<?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>             		  |
// +----------------------------------------------------------------------+
?>
<?php
echo $javascript->link('ckeditor/ckeditor.js');
?>
<script language="javascript" type="text/javascript">
    window.onload = function()
    {
        CKEDITOR.replace( 'HelpContent' );
    };
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>

<div align="center" class="subheading">
   <div align="left">EDIT HELP CONTENTS</div>
     </div>
<br />
<?php if($session->check('Message.flash')) { ?><div id="okbox"><font color="#446423"><?php $session->flash(); ?></font></div><?php } ?>
<div align="left" id="item_details_admin">
							 <?php //echo $fck->load(); ?> 
							<?php	echo $form->create('Help', array('name' =>'Help')); 	?>
							<table width="90%" border="0" cellpadding="0" cellspacing="0" class="manage_top" align="center">										
							</table>
							<br>
							<table align="center" width="90%" cellpadding="2" cellspacing="2" class="form_table">							
							<tr>
							<td width="18%"></td>
							<td width="82%">Help Type</td>
							</tr>
							<tr>
							<td width="18%"></td>
							<td width="82%">
							<?php 
						     $types['A']='Admin';$types['U']='User';
					         echo $form->input('type', array('options' => $types,'label' => '','class' => 'box2_admin','selected' => $pagedet["Help"]["type"])); ?>
							 </td>
							</tr>
							<tr>
							<td width="18%"></td>
							<td width="82%">Title</td>
							</tr>
							<tr>
							<td width="18%"></td>
							<td width="82%"><?php echo $form->input('title', array('label' => '','class' => 'box2_admin','size'=>250));?></td>
							</tr>
							<tr>
							<td></td>
							<td>Content</td>
							</tr>
							<tr>
							<td></td>
							<td>
								<?php echo $form->input('content', array('rows' => '3','label' => '')); ?>
								<?php	//echo $fck->editor('Help/content');?> 
							</td>
							</tr>							
							<tr>
							<td colspan="2" align="center">			
							 <input name="submit" type="submit" class="buttn_admin" value="Update" onClick="return chk();"/>
							 <input name="submit" type="button" class="buttn_admin" onClick="javascript:history.go(-1);" value="Cancel" />			
							</td>
							</tr>
							</table>
							<?php echo $form->end(); ?>
				</div>
				 <div align="left" class="float_clear1"></div>
				</div>