<?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 clickSearch()
{
	document.frmUsers.submit();
}
</script>

<div align="center" class="subheading">
 <div align="left">WEBSITE CONTENTS</div>
</div>
  <br />
			<?php if($session->check('Message.flash')) { ?><div id="okbox"><font color="#446423"><?php $session->flash(); ?></font></div><?php } ?>			
<div>
<!--search area start -->					
					<form action="<?php echo $sitebase.$sitefolder.'/'.$this->params["controller"];?>" method="get" name="frmUsers">
    				<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>	
					 <br />		
<!--search area end -->					
</div>
<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="8%">#</td>
						<td width="28%"><?php echo $paginator->sort('Title', 'title'); ?></td>
						<td width="46%"><?php echo $paginator->sort('Content', 'content'); ?></td>
						<td width="9%"><?php echo $paginator->sort('Status', 'status'); ?></td>
						<td width="9%">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($pages))
					   {
					    foreach ($pages as $pages){ ?> 
							  <tr align="left" valign="middle" id="list_admin">
								<td valign="top"><?php echo $cnt++;?></td>
								<td valign="top"><?php echo Sanitize::html($pages['Cmspage']['title']); ?></td>
								<td valign="top">
								<?php echo htmlspecialchars_decode($pages["Cmspage"]["content"]); ?>
								</td>
								<td valign="top">
								<?php 
								$status=Sanitize::html($pages["Cmspage"]["status"]); 
								if($status=='Y') {														
								echo $html->link('Active',"/cmspages/setStatus/".$pages['Cmspage']['id']."/N",null,'Are you sure to Inactivate this Website content.'); 
								 } else { 
								echo $html->link('Inactive',"/cmspages/setStatus/".$pages['Cmspage']['id']."/Y",null,'Are you sure to Activate this Website content.'); 
								 } ?>	
								</td>
								<td valign="top"> <?php echo $html->link('Edit', "/cmspages/edit/".$pages['Cmspage']['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 $this->renderElement('pagination'); // Render the pagination element ?></td>
						    </tr>
					      </table>
						  <?php }  else { ?>					     
							<table width="100%"  border="0" cellspacing="0" cellpadding="0" id="admin_bottom">
						     <tr id="list_admin">
						       <td align="center"><strong>No Contents found!</strong></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> 