<?php

session_start();
if(isset($_SESSION['loginuser-id'])) {
	
	$s_id1 =$_SESSION['loginuser-id'];
	}
	else {
       $s_id1 =session_id();
	   
	   
	}



include("connect.php");




$sql3="select c_id, c_name,c_price,c_img,SUM(c_quantity) from  mycart where c_s_id='$s_id1'  group by c_p_id";

echo $sql3;

$result1=mysql_query($sql3) or die(mysql_error());

while($row1=mysql_fetch_array($result1))
{

$sum=0;
$x=$row1['SUM(c_quantity)'];
echo '<br>';
$sub=$x*$row1['c_price'];
echo '<br>';

$sum=$sum+$sub;



echo '<table border=1>
<tr><td align=center>PRODUCT-NAME</td>
<td align=center>PRODUCT-PRICE</td>
<td align=center>PRODUCT</td>
<td align=center>PRODUCT-QUANTITY</td>
<td align=center>TOTAL-PRICE</td>
<td></td>
<td></td>
</tr>';




echo '<tr>';

echo '<td align=center>';
echo $row1['c_name'];
echo '<td align=center>';
echo $row1['c_price'];
echo '</td>';

echo '<td align=center>';

echo "<img  src=upload/".$row1['c_img']."   height=200 width=200   border=10 >";
echo '</td>';


echo '<td align=center>';
echo $x;

echo '</td>';
echo '<td align=center>';


echo $sub;
echo '</td>';


echo '<td  align=center>';


echo '<form action=delcart.php  method=post>
<input type=hidden name=hidden  value="'.$row1['c_id'].'">
<input type=submit  name=delcart  value="delete-cart"></form>';

echo '</td>';
echo '<td align=center>';
echo '<a href="product.php"><button>continue shopping</button></a>';
echo '</td></tr>';
echo '</table>';




}



?>