<h3 align="center">Orders</h3>



<?php

$p_order_id='';

$total_amt = 0;





if($result):



$atts = array(

      'width'      => '800',

      'height'     => '600',

      'scrollbars' => 'yes',

      'status'     => 'yes',

      'resizable'  => 'yes',

      'screenx'    => '20',

      'screeny'    => '20',

      'class'	   => 'lnk'

    );





?>





<table width="80%" border="0" align="center" cellpadding="5" cellspacing="2" style="text-align:center; margin-bottom:30px;">



 <tr><td colspan="3" style="font-size:9px; font-family:Tahoma, Geneva, sans-serif; text-align:left; color:#2D2D2D;">Click on the order id, customer name to view details</td></tr> 



  <tr class="tdcolor">

    <td width="2%;">No.</td>

    <td width="10%">Order ID</td>

    <td width="25%">Customer Name</td>

    <td width="18%">Date</td>

    <td width="18%">Status</td>

    <td width="17%">Track Details</td>

    <td width="5%">Edit</td>

    <td width="5%">Delete</td>

  </tr>

  <?php $i=1; foreach($result as $row): ?>

 <tr class="tdcolor2">

    <td><?=$i?></td>

    <td>

	<?php 

	$atts['height']=600; 

	echo anchor_popup(site_url('order_admin/order_details/'.$row['order_id']), $row['order_id'], $atts) ; 

	?>

    </td>

    <td>

	<?php 

	$atts['height']=400; 

	echo anchor_popup(site_url('user_details/view/'.$row['user_id']), get_customer_by_id($row['user_id']), $atts) ; 

	?>

	</td>

    <td><?=get_datetime($row['order_date'])?></td>

    <td>

    <form name="form<?=$i?>" method="post" action="order_admin/change_del_status/">

    <input type="hidden" name="oid" value="<?=$row['order_id']?>" />

    <select name="status" onchange="form<?=$i?>.submit()" style="width:auto;">

    <option value="P" <?php if($row['status']=='P')echo 'selected'; ?> >Pending</option>

    <option value="1" <?php if($row['status']=='1')echo 'selected'; ?> >Confirmed</option>

    <option value="D" <?php if($row['status']=='D')echo 'selected'; ?> >Delivered</option>

    <option value="C" <?php if($row['status']=='C')echo 'selected'; ?> >Cancelled</option>

    </select>

    </form>

    </td>

    <td><?php echo $row['track_det']=='' ? '' : substr($row['track_det'],0,100).'...' ; ?> </td>

    <td align="center">

    <a href="<?php echo site_url('order_admin/edit/'.$row['order_id']) ; ?>">

    <img src="<?php echo base_url('assets/web_images/edit.png'); ?>" width="20" height="20" />

    </a>

    </td>

    <td align="center">

    <a href="<?php echo site_url('order_admin/delete/'.$row['order_id'].'/1/') ; ?>" onClick="return confirm('Delete content ?')">

    <img src="<?php echo base_url('assets/web_images/delete.gif'); ?>" width="20" height="20" />

    </a> 

    </td>

  </tr>

  <?php $i++; endforeach; ?>

</table>





<?php endif; ?>





