<?php
/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: 			*/
// +----------------------------------------------------------------------+
// | PHP version 4/5                                                      |
// +----------------------------------------------------------------------+
// | Copyright (c) 2004-2010 ARMIA INC                                    |
// +----------------------------------------------------------------------+
// | This source file is a part of iScripts VistaCart                     |
// +----------------------------------------------------------------------+
// | Authors: Jipson<jipson.thomas@armiasystems.com>             		  |
// +----------------------------------------------------------------------+
?>
<?php echo $javascript->link('jquery.js'); ?>
<?php echo $javascript->link('hint.js'); ?>
<script language="JavaScript" type="text/JavaScript">
function clickSearch()
{
	document.frmUsers.submit();
}
</script>
<div align="center" class="subheading">
              <div align="left">Feedback On Products</div>
            </div>
            <br />	
			<div align="left" id="item_details_admin">
				<!--items display 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="pname"  <?php if($cmbSearchType == "pname"){ echo("selected"); } ?>>Product Name</option>
					<option value="type"  <?php if($cmbSearchType == "type"){ echo("selected"); } ?>>Type</option>
					<option value="comment"  <?php if($cmbSearchType == "comment"){ echo("selected"); } ?>>Comment</option>
					<option value="uname"  <?php if($cmbSearchType == "uname" || $cmbSearchType == ""){ echo("selected"); } ?>>User Name</option>
					<option value="date"  <?php if($cmbSearchType == "date"){ echo("selected"); } ?>>Date (mm-dd-yyyy)</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 />		
              <div align="left" id="item_details_admin">
				<!--items display area start -->
				
				
<form name="customlist" method="post" action="/vistacart/customfieldvalues/edit">
				  <div align="center" id="items_display_area_admin">
						
									
									
                       <div id="list_admin_top">
					   					<div class="listf1"><strong>#</strong></div>
										<div class="listf2"><strong><?php echo $paginator->sort('Product Name', 'Product.pname'); ?></strong></div>
										<div class="listf2"><strong><?php echo $paginator->sort('Type', 'type'); ?></strong></div>
										<div class="listf2"><strong><?php echo $paginator->sort('Comment', 'comment'); ?></strong></div>	
										<div class="listf2"><strong><?php echo $paginator->sort('User Name', 'User.uname'); ?></strong></div>	
										<div class="listf2"><strong><?php echo $paginator->sort('Date', 'date'); ?></strong></div>	
										<div class="listf3"><strong>Options</strong></div>										
										<div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						</div>




				<?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($feeds)){
	foreach ($feeds as $feed){?>   
						<div id="list_admin">
										<div class="listf1"><?php echo $cnt++;?></div>
										<div class="listf2">
										<?php 
										$fpname=$feed['Product']['pname'];
										if(strlen($fpname)>10)
										$fpname=substr($fpname, 0, 10)."...";
										else
										$fpname=$fpname; ?>			
										<a href="#" class="tooltip" title="<?php echo $feed['Product']['pname']; ?>" style="text-decoration:none;" onclick="return false;">
										<?php echo $fpname; ?>
										</a>										
										</div>										
										<div class="listf2">
										<?php echo $feed['Feedback']['type']; ?>
                                        </div> 
										<div class="listf2">
										<?php 
										$fcmnt=$feed['Feedback']['comment'];
										if(strlen($fcmnt)>20)
										$fcmnt=substr($fcmnt, 0, 20)."...";
										else
										$fcmnt=$fcmnt; ?>			
										<a href="#" class="tooltip" title="<?php echo $feed['Feedback']['comment']; ?>" style="text-decoration:none;" onclick="return false;">
										<?php echo $fcmnt; ?>
										</a>
										</div>
										<div class="listf2">
										<?php echo $feed['User']['uname']; ?>
										</div>
										<div class="listf2">
										<?php $dt	= strtotime($feed["Feedback"]["date"]);
			echo date("m-d-Y",$dt ); ?>
										</div>
										<div class="listf3">
										<?php echo $html->link('Edit',"/feedbacks/edit/".$feed['Feedback']['id'])." / ".$html->link('Delete', 
"/feedbacks/delete/".$feed['Feedback']['id'],null,'Are you sure you want to delete this Feedback'); ?>
                                        </div>                                        
										
										<div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						</div>
			 <?php 		
			 } ?>
			   <div id="admin_bottom">		
										<div>&nbsp;</div>
										<div>
										<?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(); ?>
										</div>
										<div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						                </div>			
			 <?php } else { ?>
			          <div id="admin_bottom">				
										<div>&nbsp;</div>
										<div><strong>Sorry no feedback found !</strong></div>																			
										<div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						</div>			     
			 <?php } ?>
						           
				  </div>
				
				
				</div>							
 <div align="left" class="float_clear1"></div>
</div>
 <div align="left" class="float_clear1"><?php echo $html->image('/img/clear.gif');?></div> 