<?
$rez=include("setup.php");
if (! $rez) //if can't find setup.php or not chmod'ed 
 {
  echo "<font color=red>Check setup.php file !</font>";
	exit;
 }

 echo "<center><b>My cart</b></center>";

if (isset($delfrombin)) //if delete product from cart was clicked
{
       unset($cadd_ses[$delfrombin]);
}

require "menuindex.php";
       $i=120;
if (isset($cadd_ses))
{
        echo "<table width=100% cellpadding=4 cellspacing=2 border=0 bgcolor=#fffcd0>";
        echo "<tr>
                     <td><b>Name</b></td>
                     <td width=30%><b>Description</b></td>
                     <td><b>Price</b></td>
                     <td><b>Price without VAT</b></td>
                     <td><b>Count</b></td>
                     <td align=center><b>Delete</b></td>
                     <td align=center><b>Print</b></td>
    
              </tr>";
}
else
{
       echo "You have no products";
       exit;
}
$j=1;
while ($element=each($cadd_ses))
{
        $col="#808".$i;
        $i=$i+20;
       $id=$element["key"];
       $result=mysql_query("select * from product where ID=$id") or die (mysql_error(). " : ".mysql_errno());
       $row=mysql_fetch_object($result);

               echo "<tr><td bgcolor=$col>";
               echo "                 
                     <b><a href=\"javascript:showuserdata('one_index_product.php','$row->ID')\" title=\"Show about $row->Name\">$row->Name</a></b></td>
                     <td bgcolor=$col>$row->Description</td>
                     <td bgcolor=$col>$row->Price</td>
                     <td bgcolor=$col>$row->PriceWithoutVat</td>
                     <td bgcolor=$col>$row->Count</td>
                     <td bgcolor=$col align=center><a href='$PHP_SELF?delfrombin=$row->ID'><img src=rbin.gif border=0></a></td>
                     <td bgcolor=$col align=center>
                     <a href=# onClick=\"printIt('one_index_product.php','$row->ID');return false\"><img src=print.gif border=0></a>
                     </tr>";


$j++;
}
               echo "</table>";

?>
<br>
<table  cellpadding=0 cellspacing=4  width=120 align=right bgcolor=white>
<tr>
<td>
<?
echo "<a href='$PHP_SELF?exitme1=exitme&to_go=$search_index' ><img src=rbinall.gif border=0 alt='Empty my cart'></a>";
?>
</td>

<td>
<a href="all_print.php" target=_blank><img src=printall.gif border=0 alt='Print all products'></a>
</td>
</tr>
</table>