<?php
include("db.php");
error_reporting(0);
session_start();
ob_start();
$sid=session_id();
$pro_id=$_GET['disid'];
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Trendy Fashion </title>
<?php include('includes/links.php'); ?>
</head>
<body>
<?php include('includes/navbar.php'); ?>
<div class="container pt-5 pb-5" id="pro-show">
<div class="row">
<?php
$select="select * from addproduct where pro_id='$pro_id'";
$query=mysqli_query($conn,$select);
$i=0;
while($row=mysqli_fetch_array($query))
{
$pro_id=$row['pro_id'];
$producttitle=$row['producttitle'];
$productbrand=$row['productbrand'];
$productprice=$row['productprice'];
$photo=$row['img'];
$adddesc=$row['adddesc'];
?>
<h3><?php echo $protitle; ?></h3>
<hr />
<div class="col-md-5">
<center><img class="zoom pb-5" src="admin/upload/<?php echo $photo;?>" alt="" height="310" width="300" ></center>
</div>
<div class="col-md-7">
<form method="post" class="showpro" >
<table width="500" height="300">
<tr>
<td colspan="2"><h3><b><?php echo $producttitle;?></b></h2><hr></td>
</tr>
<tr>
<td style="color: grey; font-size: 16px;"><i><b>Brand: <?php echo $productbrand;?></b><i></td>
</tr>
<tr>
<td style="font-size: 22px; font-weight:650;">Rs. <?php echo $productprice;?>
<span style="font-size: 12px; color:#03a685;" > (inclusive of all taxes)</span>
</td>
</tr>
<tr>
<td>Quantity</td>
<td colspan="2"> <input type="number" name="quantity" value="1" style="width: 50px;text-align: center;"></td>
</tr>
<tr>
<td>Size</td>
<td><select name="size">
<option value="small">Small</option>
<option value="medium">Medium</option>
<option value="large">Large</option>
<option value="XL">Extra Large</option>
</select></td>
<tr>
<td colspan="2"><br>
<b>Delivery Options</b>
<ul>
<li>100% Original Products</li>
<li>Free Delivery on order above Rs. 799</li>
<li>Pay on delivery</li>
<li>Easy 30 days returns and exchanges</li>
</ul>
</td>
</tr>
</tr>
<tr>
<td><input type="submit" name="buynow" value="Add to cart" class="btn" style="background-color:#ff3e6c; color:white; font-weight: 700; padding: 10px;"></td>
<td><a href="registration.php?regid=<?php echo $pro_id; ?>" class="btn" style="border: 1px solid #ff3e6c;"> Buy Now <i class="fa fa-angle-double-right" aria-hidden="true"></i></a></td>
</tr>
</table>
</form>
<?php
if(isset($_REQUEST['buynow']))
{
$quantity=$_REQUEST['quantity'];
$size=$_REQUEST['size'];
$totalprice=$quantity*$productprice;
$insert="insert into displaycart(`session_id`,`pro_id`,`product_title`,`product_brand`,`product_price`,`quantity`,`size`,`img`,`total_price`) Values('$sid','$pro_id','$producttitle','$productbrand','$productprice','$quantity','$size','$photo','$totalprice')";
$result=$result = mysqli_query($conn, $insert);
if($result)
{
header("location:shop-cart.php");
}
}
?>
</div>
<br><br>
<ul class="nav nav-tabs border-0 bg-light" id="myTab" role="tablist">
<li class="nav-item"><a class="nav-link active" id="description-tab" data-toggle="tab" href="#description" role="tab" aria-controls="description" aria-selected="true">Description</a></li>
</ul>
<div class="tab-content mb-5" id="myTabContent">
<div class="tab-pane fade show active" id="description" role="tabpanel" aria-labelledby="description-tab">
<div class="p-4 p-lg-5 bg-white">
<h6 class="text-uppercase">Product description </h6>
<p class="text-muted text-small mb-0"><?php echo $adddesc;?></p>
</div>
</div>
</div>
<?php $i++; }?>
</div>
</div>
<br><br>
<?php include('includes/footer.php'); ?>
</body>
</html>
0 Comments