<?php echo $javascript->link('jquery.js');?>
<?php echo $javascript->link('hint.js'); ?> 
<script language="JavaScript" type="text/JavaScript">
function clickSearch()
{
	document.frmHelp.submit();
}
</script>
<div align="center" class="subheading">
 <div align="left">HELP CONTENTS</div>
</div>
<br />
<div>
<!--search area start -->					
					<form action="<?php echo $sitebase.$sitefolder.'/'.$this->params["controller"];?>" method="get" name="frmHelp">
    				<div>
					<div style="float:left">	
  		 			 <select name="cmbSearchType" class="box2_admin">
					<option value="title"  <?php if($cmbSearchType == "title" || $cmbSearchType == ""){ echo("selected"); } ?>>Title</option>
					<option value="content"  <?php if($cmbSearchType == "content"){ echo("selected"); } ?>>Content</option>
					</select> &nbsp;
					<input type="text" name="txtSearch" maxlength="50" value="<?php echo(htmlentities($txtSearch)); ?>" class="box2_admin" >
					</div>
					<div>
					<a style="cursor:pointer" onClick="javascript:clickSearch();"><?php echo $html->image('/img/search_bttn.gif');?></a>
					</div>
					 </div>		
					 <br />							
				   </form>						
<!--search area end -->					
</div>
<div style="padding-left:10px;"><strong class="btn_style-org"><?php echo $html->link('Add New Help File','/helps/add')?> >></strong></div>

 <br /><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">
				<!--items display area start -->
				 <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="items_display_area_admin_table" class="tablebr_bottom" >
				  <tr>
					<td align="left" valign="top">
					<table width="100%"  border="0" cellspacing="1" cellpadding="6" class="tablebr_bottom"  style="background-color:#cfcfcf;">
					  <tr align="left" valign="middle" id="list_admin_top">
						<td width="9%">#</td>
						<td width="29%"><?php echo $paginator->sort('Title', 'title'); ?></td>
						<td width="47%"><?php echo $paginator->sort('Content', 'content'); ?></td>
						<td width="47%"><?php echo $paginator->sort('Type', 'type'); ?></td>
						<td width="15%">Options</td>
					  </tr>
					 <?php
						if(!empty($passedarg) && !isset($passedarg["page"]))								
									$cnt=1;
									else if(!empty($passedarg) && $passedarg["page"]==1)
									$cnt=1;
									else
									$cnt=((($passedarg["page"]-1)*($passedarg["limit"]))+1);
					   if(!empty($help))
					   {
					    foreach ($help as $cat){ ?> 
							  <tr align="left" valign="middle" id="list_admin">
								<td valign="top"><?php echo $cnt++;?></td>
								<td valign="top">
								<?php echo Sanitize::html($cat['Help']['title']); ?></td>
								<td>
								<?php echo htmlspecialchars_decode($cat["Help"]["content"]); ?>															
								</td>
								<td valign="top">
								<?php 
								$utype=$cat["Help"]["type"]; 
								if(isset($utype)) {
								if($utype=='A')
								echo "Admin";
								else if($utype=='U')
								echo "User"; }
								?>
								</td>
								<td valign="top"><?php echo $html->link('Edit', "/helps/edit/".$cat['Help']['id']); ?> / <?php echo $html->link('Delete', "/helps/delete/".$cat['Help']['id']); ?></td>							
							  </tr>  
					   <?php  }  ?>					  
						</table>					 
						  <table width="100%"  border="0" cellspacing="0" cellpadding="0" id="admin_bottom">
						    <tr>
						       <td align="center">
							   <?php 
									  if($cmbSearchType <> '' &&  $txtSearch <> ''){
									   $paginator->options(array('url'=>array_merge(array('cmbSearchType'=>$cmbSearchType,
									   'txtSearch'=>$txtSearch),$this->passedArgs))); }  ?>
														 <?php echo $paginator->numbers(); ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $paginator->counter(); ?></td>
						    </tr>
					      </table>
						  <?php }  else { ?>					     
							<table width="100%"  border="0" cellspacing="0" cellpadding="0" id="admin_bottom">
						     <tr id="list_admin">
						       <td align="center">No Records Found</td>
						     </tr>
					        </table>			  
						  <?php } ?>
					  </td>
				  </tr>
				</table>
				
 <div align="left" class="float_clear1"></div>
</div>
 <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div> 