<?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 >
<div align="center">
			<h2 class="title text-center mainhd">Orders</h2>
            </div>
            <br />			
			<div align="left" id="item_details_admin">
				<!--items display area start -->
					
					<form action="<?php echo $sitebase.$sitefolder.'/'.$this->params["controller"];?>/myorder" method="post" name="frmUsers">
					<div class="srch-bx">
						<select name="cmbSearchType" class="box2_admin margbot5px">
						<option value="oid"  <?php if($cmbSearchType == "oid" || $cmbSearchType == ""){ echo("selected"); } ?>>Order Number</option>
						<option value="orderstatus"  <?php if($cmbSearchType == "orderstatus"){ echo("selected"); } ?>>Order Status</option>
						<option value="dateoforder"  <?php if($cmbSearchType == "dateoforder"){ echo("selected"); } ?>>Date of Order (mm-dd-yyyy)</option>
						</select> &nbsp;
						<input type="text" name="txtSearch" maxlength="50" value="<?php echo(htmlentities($txtSearch)); ?>" class="box2_admin margbot5px" >
						<a style="cursor:pointer" class="margbot5px" onClick="javascript:clickSearch();"><?php echo $html->image('/img/search_bttn.gif');?></a>
						<div class="clear"></div>
					</div>		
	             <br />							
               </form>	
                 <br />		
              <div 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" class="table-responsive">
						
						<table class="table" width="832px">
							<tr><td>			
									
                       <div id="list_admin_top" style="width:832px;">
					   					<div class="list9"><strong>#</strong></div>
										<div class="listp6"><strong><?php echo $paginator->sort('Order Number', 'Order.id'); ?></strong></div>
										<div class="list16"><strong><?php echo $paginator->sort('Order Date', 'Order.date'); ?></strong></div>	
										<div class="list16"><strong><?php echo $paginator->sort('Total', 'Order.total_price'); ?></strong></div>	
										<div class="list17"><strong><?php echo $paginator->sort('Order Status', 'OrderStatus.name'); ?></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($odr)){
	foreach ($odr as $oder){?>   
						<div id="list_admin">
										<div class="list9"><?php echo $cnt++;?></div>
										<div class="listp6">
										<?php echo $html->link($oder['Order']['id'], "/orders/userorderdetails/".$oder['Order']['id']); ?>
										</div>										
										
										
										<div class="list16">
										<?php $dt	= strtotime($oder['Order']['date']); echo date("m-d-Y",$dt ); ?>
                                        </div>                                        
										<div class="list16">
										<?php echo $curlogo;?><?php echo $oder['Order']['total_price']; ?>
                                        </div> 
										<div class="list17">
										<?php echo $oder['ORS']['name']; ?>
                                        </div> 										
										
										<div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						</div>
			 <?php 		
			 } ?>
			   <div id="list_admin">									
										
										<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>&nbsp;</div>	
																	
										<div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						          </div>			
								   <div id="list_admin">									
										
										<div>&nbsp;</div>
										<div><input type="button" value="Back" onClick="window.location.href='<?php echo $sitebase.$sitefolder;?>/users/myaccount/'"  class="btn-gry01"></div>
										<div>&nbsp;</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="list_admin">									
										
										<div>&nbsp;</div>
										<div><strong>Sorry no orders found !</strong></div>
										<div>&nbsp;</div>	
										<div>&nbsp;</div>										
										<div align="left" class="float_clear"><?php echo $html->image('/img/clear.gif', array('width' => 1, 'height' => 1));?></div>
						</div>			     
			 <?php } ?>
					</td>
				  </tr>
				  </table>	           
				  </div>
				  </form>
				  
				  </div>  </div>
				   <br /></div>
<div align="left" class="float_clear1"></div>