<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2008 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts EasyCart                      |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
// +----------------------------------------------------------------------+
?>
<script language="javascript" type="text/javascript">
function chk(){
	var errorstr = '';
	var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
	with(document.Page)
	{ 	
		
		if (CmspageTitle.value == "") { errorstr += "- Please Enter Page Title.\n"; CmspageTitle.focus();}
		if (CmspageContent.value == "") { errorstr += "- Please Enter Page Content.\n"; CmspageContent.focus();}
	}	
	
	if (errorstr != '')
	{
		msgstr = msgstr + errorstr;
		alert(msgstr);
		return false;
	}
	else
	{
		return true;
	}
} 
</script>
<?php echo $fck->load(); ?> 
<?php
echo $form->create('Cmspage', array('name' =>'Page')); 
?>
<table width="90%" border="0" cellpadding="0" cellspacing="0" class="manage_top" align="center">
			  <tr><td><font color="#FF0000"><?php $session->flash(); ?></font></td></tr>
</table>
<br>
<table align="center" width="90%" cellpadding="2" cellspacing="2" class="form_table">
<tr>
<th colspan="2" align="center">Edit Website content</th>
</tr>
<tr>
<td></td>
<td>Page Title</td>
</tr>
<tr>
<td></td>
<td><?php echo $form->input('title', array('label' => '', 'value' => $pagedet["Cmspage"]["title"], 'readonly' => 1)); ?></td>
</tr>
<tr>
<td></td>
<td>Page Content</td>
</tr>
<tr>
<td></td>
<td>
	<?php echo $form->input('content', array('rows' => '3','label' => '', 'value' => $pagedet["Cmspage"]["content"])); ?>
	<?php	echo $fck->editor('Cmspage/content');?> 
</td>
</tr>
<?php if($pagedet["Cmspage"]["type"]=='email') { ?>
<tr>
<td></td>
<td>Replaceable Variables  are &nbsp;&nbsp;[User_Name], [SITE_NAME], [ORDER_DETAILS], [PASSWORD].<br>
 
		[ORDER_DETAILS] will be replaced by <b>Order details</b><br>
		[User_Name] will be replaced by <b>User Name</b><br>
		[PASSWORD] will be replaced by <b>Password</b><br>
		[SITE_NAME] will be replaced by <b>Site Name</b><br>
 		<span class="required_field">*</span> The replaceable variables are <b>System Variables </b>which will be replaced with real values,<br>
   So please donot delete or rename the <b>System Variables</b>.
   </td></tr>
<tr>
<?php } ?>
<td colspan="2" align="center"><input type="submit" value="Edit Website content" onClick="return chk();">&nbsp;&nbsp;<input type="button" value="Cancel" onClick="javascript:history.go(-1);"><?php echo $form->end(); ?></td>
</tr>
</table>