Skip to content

Instantly share code, notes, and snippets.

@omeshkumar65
Created June 23, 2019 13:53
Show Gist options
  • Save omeshkumar65/1af8ba62664439c66b44f48cf54050fc to your computer and use it in GitHub Desktop.
Save omeshkumar65/1af8ba62664439c66b44f48cf54050fc to your computer and use it in GitHub Desktop.
<!DOCTYPE>
<?php
session_start();
include("functions/function.php");
?>
<html>
<head>
<title>my online shop</title>
<link rel="stylesheet" href="styles/style.css" media="all"></link>
</head>
<body>
<!--main_wrapper start-->
<div class="main_wrapper">
<!--header start-->
<div class="header_wrapper">
<center><img src="images/Logo.jpeg"></center>
</div>
<!--header end-->
<!--menubar start-->
<div class="menubar">
<ul id="menu">
<li><a href="index.php">Home</a></li>
<li><a href="all_product.php">All product</a></li>
<li><a href="customer/my_account.php">My account</a></li>
<li><a href="">Signup</a></li>
<li><a href="cart.php">Shopping cart</a></li>
<li><a href="">Contact us</a></li>
</ul>
<div id="search">
<form method="get" action="result.php" enctype="multipart/form-data">
<input type="text" name="user_query" placeholder="search the product" />
<input type="submit" name="search" value="search" />
</form>
</div>
</div>
<!--menubar end-->
<!--content_wrapper start-->
<div class="content_wrapper">
<!--sidebar start-->
<div id="sidebar">
<div id="sidebar_title">Categories</div>
<ul id="cats">
<?php getcats(); ?>
</ul>
<div id="sidebar_title">Brands</div>
<ul id="cats">
<?php getbrands(); ?>
</ul>
</div>
<!--sidebar end-->
<!--content area start-->
<div id="content_area">
<div id="shopping_cart">
<span style="float:right; font-size:18px; padding:5px;line-height:20px">
<?php
if(isset($_SESSION['customer_email'])){
echo"<b>welcome:</b>" . $_SESSION['customer_email'] . "<b style='color:yellow;'>Your</b>";
}
else{
echo"<b>Welcome Guest!</b>";
}
?>
<b style="color:yellow"> Shopping cart</b> -Total item:<b style="color:yellow"><?php total_items();?></b>
Total price: <a href="cart.php" style="color:yellow"> Go to cart</a>
<?php
if(!isset($_SESSION['customer_email'])){
echo"<a href='signup_welcome.php'>Login</a>";
}
else{
echo"<a href='logout.php'>Logout</a>";
}
?>
</span> </div>
<div id='products_box'>
<?php
$get_pro="select * from products";
$run_pro=mysqli_query($con,$get_pro);
while($row_pro=mysqli_fetch_array($run_pro)){
$product_id=$row_pro['product_id'];
$product_cat=$row_pro['product_cat'];
$product_brand=$row_pro['product_brand'];
$product_title=$row_pro['product_title'];
$product_price=$row_pro['product_price'];
$product_desc=$row_pro['product_desc'];
$product_image=$row_pro['product_image'];
$product_keyword=$row_pro['product_keyword'];
echo "<div id='single_product'>
<h3>$product_title</h3>
<img src='admin_area/product_images/$product_image' width='180px'/>
<h2>Price $product_price</h2>
<a href='detail.php?product_id=$product_id'>Details</a>
<a href='index.php?product_id=$product_id'><button style='float:right'>Add to cart</button></a>
</div>
";
}
?>
</div>
</div>
<!--content area end-->
</div>
<!--content_wrapper end-->
<!--footer start-->
<div id="footer">
<h2 style="text-align:center;"> copyright &copy pingworld.com</h2>
</div>
<!--footer end-->
</div>
<!--main_wrapper end-->
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment