  

  <?php  $lg=$this->fun->get_lang();

         foreach($lg->result() as $r):

         $language=$r->lang;

         endforeach;

?>


  <head>
  <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>

  <div id="mws-container" class="clearfix">
            <div class="container">
            
       
       
   
  <div class="mws-panel grid_8">
                	<div class="mws-panel-header">
                    	<span class="mws-i-24 i-table-1">Orders</span>
                    </div>
                    <div class="mws-panel-body">
                        <table class="mws-datatable-fn mws-table">
                            <thead>
                                <tr>
                                    <th width="75" align="center">ID</th>
                                    <th>Client</th>
                                    <th>Client Phone</th>
                                    <th>Client Email</th>
                                    <th>Client address</th>
                                    <th>Order Date</th>
                                    <th>Status</th>
                                    <th>View</th>
                                    <th>Delete</th>
                               
                                </tr>
                            </thead>
                          <?php  if($records !=FALSE){ $c=0;
                          foreach($records as $rs):?>
                            <tbody>
                                <tr class="gradeA">
                                     <td><?php echo $rs->id;?></td>
                                     <td><?php 	$this->load->model('orders_model');   
 $q=$this->orders_model->get_client($rs->uid); foreach($q->result() as $r): endforeach; echo $r->name?></td>
                                     <td><?php echo $r->phone;?></td>
                                      <td><?php echo $r->email;?></td>
                                       <td><?php echo $r->address;?></td>
                                    <td><?php echo $rs->add_date;?></td>
                                    <td><?php if($rs->open=='yes'){?><a href="<?php echo base_url();?>index.php/orders/change_status/no/<?php echo $rs->session_id;?>">Open</a><?php }else{?><a href="<?php echo base_url();?>index.php/orders/change_status/yes/<?php echo $rs->session_id;?>">Closed</a><?php }?></td>
                                     <td><a href="<?php echo base_url();?>index.php/orders/view_order/<?php echo $rs->session_id;?>"><img src="<?php echo base_url();?>template/images/user_edit.png" alt="" title="" border="0" /></a></td>
                                    <td class="center"><a href="<?php echo base_url();?>index.php/orders/delete_order/<?php echo $rs->session_id;?>" class="ask"><img src="<?php echo base_url();?>template/images/trash.png" alt="" title="" border="0" /></a></td>
                                     
                                </tr>
                       <?php endforeach;
                       }
                       ?>

                                
                             

                        </table>
                                 <?php echo $this->pagination->create_links();?>

                        

                    </div>
                    
                    <br>
                    <div class="mws-button-row">   
                                        </div>              		
                    					                    		
                </div>

  </div>
    



    
    
    



  
 






















