<div id="page">
<table>
<? if($pageRequest=='showWebPages') {  ?>
<font color="#FF0000"> <b> 
<?=$msg?> 
<br /> </b></font>

<div class="errormessage"><img class="errormessage" src="<?=base_url()?>images/adminimages/padlock-open.gif" align="absmiddle" border="0" height="16" width="16">
<h2> Web Pages</h2>

</div>


<?php /*?><font color="#FF0000"> <b> <?=$this->validation->error_string; ?> </b> </font>
<?php */?>

<table align="center" width="100%">

<tr><th align="left"> Page Name  </th> <th align="left"> Action </th></tr>
<? 
$a1 = mysql_query("select * from webpages") or die(mysql_error());
while($row5 = mysql_fetch_array($a1)) {  ?>

<tr><td>  <?=$row5['name']?>  </td> <td> <a href="<?=base_url()?>admin/edit/<?=$row5['id']?>"> [ Edit ] </a></td></tr>

<? } ?>
</table>


<? } elseif($pageRequest=='editWebPages') {  ?>
<form action="<?=base_url()?>admin/edit1" method="post">
<table align="center" width="100%">
<? foreach($data as $row)  { ?>

<tr> <td> Name  </td><td><input type="text" name="name" value="<?=$row['name']?>" /></strong> </td></tr>

<tr> <td> Details  </td><td>  <? //$spaw1 = new SpawEditor("details",$row['details']);  $spaw1->show(); ?>

<textarea name="details" rows="25" cols="100"><?=$row['details']?></textarea>
<input type="hidden" name="pageid" value="<?=$row['id']?>" />
</td></tr>
<tr><td colspan="2">

<fieldset>
<legend> SEO Keywords </legend>
<table align="center" width="100%">
<tr> <td> Title : </td><td> <input type="text" name="title" size="80" value="<?=$row['title']?>"   /> </td></tr>
<tr> <td> Description: </td><td> <input type="text" name="description"  size="80"   value="<?=$row['description']?>"    /> </td></tr>
<tr> <td> Keywords: </td><td> <input type="text" name="keywords"  size="80"  value="<?=$row['keywords']?>" /> </td></tr>
</table>
</fieldset>
</td></tr> 
<?  } ?>
<tr><td colspan="2" style="border-bottom: 3px double rgb(114, 174, 215); padding-bottom: 0px;"><h3>Action</h3></td></tr>
<tr><td colspan="2"><input type=button value="Back" onClick="history.go(-1)"> 
<input type=submit value="Save Details" > <input type="reset" name="Reset" />
</td></tr>
</table>
</form>

<? } elseif($pageRequest=='showEmailTemplate') {  ?>

<font color="#FF0000"> <b> 

<?=$msg?> 

<br /> </b></font>


<div class="errormessage"><img class="errormessage" src="<?=base_url()?>images/adminimages/padlock-open.gif" align="absmiddle" border="0" height="16" width="16">
E-mail Template

</div>


<?php /*?><font color="#FF0000"> <b> <?=$this->validation->error_string; ?> </b> </font><?php */?>


<table align="center" width="100%">

<tr><td colspan="2" align="right">  </td> </tr>

<?
$a = mysql_query("select * from emailtemplate");
while($row = mysql_fetch_array($a))
	{ ?>

<tr><td>  <?=$row['name']?> </td> <td> </td> <td> <a href="<?=base_url()?>admin/editTemplate/<?=$row['eID']?>"> [ Edit ] </a>
 </td></tr>
<? } ?>




</table>

<? } elseif($pageRequest=='addEmailTemplate') {  ?>


<div class="errormessage"><img class="errormessage" src="<?=base_url()?>images/adminimages/padlock-open.gif" align="absmiddle" border="0" height="16" width="16">
<?=$edit_email_template?>

</div>


<form action="<?=base_url()?>admin/insertEmailTempalte/" method="post" >
<table align="center" width="100%">

<tr> <td width="10%"> <?=$name?> : </td> <td width="90%"> <input type="text" name="name" /> </td> </tr>
<tr> <td width="10%"> <?=$send_email_when?> : </td> <td width="90%"> 
<select name="when"><option> Listing Added</option><option>Sucessful Payment Recived</option><option>UnSucessful Payment Recived</option></select>
</td> </tr>

<tr> <td> <?=$details?> : </td><td>  <? 

						$spaw1 = new SpawEditor("details"); 
								  $spaw1->show(); ?>

</td></tr>

<tr> <td  align="center" colspan="2" ><INPUT TYPE="button" VALUE="<?=$back_link?>" onClick="history.go(-1);return true;"><input type="submit" name="button" value="<?=$edit_template?>" > </td></tr>

</table>
</form>
<? } elseif($pageRequest=='editEmailTemplate') {  ?>



<div class="errormessage"><img class="errormessage" src="<?=base_url()?>images/adminimages/padlock-open.gif" align="absmiddle" border="0" height="16" width="16">

Edit Email Template
</div>


<form action="<?=base_url()?>admin/updateTemplate/" method="post" >
<table align="center" width="100%">
<? foreach($data as $row)  { ?>
 
<tr> <td width="10%">  Name : </td>
<td width="90%"> <?=$row['name']?> </td>
</tr>


<tr> <td> Details : </td><td>  <? 

						//$spaw1 = new SpawEditor("details",$row['details']); 		  $spaw1->show(); ?>

<textarea rows="26" cols="80" name="details"><?=$row['details']?></textarea>
<input type="hidden" name="pageid" value="<?=$row['eID']?>" />
</td></tr>

<?  } ?>

<tr><td colspan="2" style="border-bottom: 3px double rgb(114, 174, 215); padding-bottom: 0px;"><h3>Action</h3></td></tr>
<tr><td colspan="2"><input type=button value="Back" onClick="history.go(-1)"> 
<input type=submit value="Save Details" > <input type="reset" name="Reset" />
</td></tr>


</table>
</form>

<? } elseif($pageRequest=='showSMSTemplate') {  ?>

<font color="#FF0000"> <b> 

<?=$msg?> 

<br /> </b></font>


<div class="errormessage"><img class="errormessage" src="<?=base_url()?>images/adminimages/padlock-open.gif" align="absmiddle" border="0" height="16" width="16">
E-mail Template

</div>


<?php /*?><font color="#FF0000"> <b> <?=$this->validation->error_string; ?> </b> </font><?php */?>


<table align="center" width="100%">

<tr><td colspan="2" align="right">  </td> </tr>

<?
$a = mysql_query("select * from SMStemplate");
while($row = mysql_fetch_array($a))
	{ ?>

<tr><td>  <?=$row['name']?> </td> <td> </td> <td> <a href="<?=base_url()?>admin/editSMSTemplate/<?=$row['eID']?>"> [ Edit ] </a>
 </td></tr>
<? } ?>




</table>

<? } elseif($pageRequest=='addSMSTemplate') {  ?>


<div class="errormessage"><img class="errormessage" src="<?=base_url()?>images/adminimages/padlock-open.gif" align="absmiddle" border="0" height="16" width="16">
<?=$edit_email_template?>

</div>


<form action="<?=base_url()?>admin/insertSMSTempalte/" method="post" >
<table align="center" width="100%">

<tr> <td width="10%"> <?=$name?> : </td> <td width="90%"> <input type="text" name="name" /> </td> </tr>
<tr> <td width="10%"> <?=$send_email_when?> : </td> <td width="90%"> 
<select name="when"><option> Listing Added</option><option>Sucessful Payment Recived</option><option>UnSucessful Payment Recived</option></select>
</td> </tr>

<tr> <td> <?=$details?> : </td><td>  <? 

						$spaw1 = new SpawEditor("details"); 
								  $spaw1->show(); ?>

</td></tr>

<tr> <td  align="center" colspan="2" ><INPUT TYPE="button" VALUE="<?=$back_link?>" onClick="history.go(-1);return true;"><input type="submit" name="button" value="<?=$edit_template?>" > </td></tr>

</table>
</form>
<? } elseif($pageRequest=='editSMSTemplate') {  ?>



<div class="errormessage"><img class="errormessage" src="<?=base_url()?>images/adminimages/padlock-open.gif" align="absmiddle" border="0" height="16" width="16">

Edit SMS Template
</div>


<form action="<?=base_url()?>admin/updateSMSTemplate/" method="post" >
<table align="center" width="100%">
<? foreach($data as $row)  { ?>
 
<tr> <td width="10%">  Name : </td>
<td width="90%"> <?=$row['name']?> </td>
</tr>


<tr> <td> Details : </td><td>  <? 

						//$spaw1 = new SpawEditor("details",$row['details']); 		  $spaw1->show(); ?>

<textarea rows="26" cols="80" name="details"><?=$row['details']?></textarea>
<input type="hidden" name="pageid" value="<?=$row['eID']?>" />
</td></tr>

<?  } ?>

<tr><td colspan="2" style="border-bottom: 3px double rgb(114, 174, 215); padding-bottom: 0px;"><h3>Action</h3></td></tr>
<tr><td colspan="2"><input type=button value="Back" onClick="history.go(-1)"> 
<input type=submit value="Save Details" > <input type="reset" name="Reset" />
</td></tr>


</table>
</form>



<? } ?>
</table>
<br style="clear: both;" />
</div>