<?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>             		  |
// +----------------------------------------------------------------------+
?>
<br>
<table width="90%" border="0" cellpadding="0" cellspacing="0" class="header" align="center">
			  <tr><td>Products Re-Order List</td></tr>
			    <tr><td>&nbsp;</td></tr>
</table>
<table width="90%" border="0" cellpadding="0" cellspacing="0" class="manage_table" align="center">
	<?php 
	//$pagination->setPaging($paging); // Initialize the pagination variables
	$th = array ('Image1','Image2','Name','Price','Description','Category','Stock','Weight','Options'); // Generate the pagination sort links
	echo $html->tableHeaders($th); // Create the table headers with sort links if desired
	if(!empty($product)){
	foreach ($product as $product): ?>
	<tr><?php
		$img	= explode(".",$product['Product']['image1']);
		$img2	= explode(".",$product['Product']['image2']);?>
		<td><?php echo $html->image('/img/products/'.$img[0].'_thumb.jpg?'.time(),array('border' => '0'));?></td>
		<td><?php echo $html->image('/img/products/'.$img2[0].'_thumb.jpg?'.time(),array('border' => '0'));?></td>
		<td>
			<?php echo $html->link($product['Product']['pname'], 
"/products/edit/".$product['Product']['id']); ?>
		</td>
		<td><?php echo $product['Product']['price']; ?></td>
		<td><?php echo substr($product["Product"]["descr"],0,50); ?></td>
		<td><?php echo $product['Category']['cname']; ?></td>
		<td align="right"><?php echo $product['Product']['stock']; ?></td>
		<td align="right"><?php echo $product['Product']['weight']; ?></td>
		<td><?php echo $html->link('Edit', 
"/products/edit/".$product['Product']['id'])." / ".$html->link('Delete', 
"/products/delete/".$product['Product']['id']); ?>
		</td>
	</tr>
	<?php endforeach; ?>
	<tr>
	<td colspan="9" width="100%" align="center">
<?php echo $this->renderElement('pagination'); // Render the pagination element ?>
</td></tr>
<?php }else { ?>
<tr>
	<td colspan="9" width="100%" align="center">
Sorry, There is no products found to re order! 
</td></tr>
<?php } ?>
</table>

