Commit 43a6d68e authored by eshanjayakody's avatar eshanjayakody

Initial commit

parents
<!DOCTYPE html>
<html lang="en">
<head>
<style type="text/css">
h5{
color: blue;
}
.p1{
text-align: justify;
}
</style>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>About us | Life Style Store</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php
include 'includes/header.php';
?>
<div class="container" id="content">
<img src="img/team1.jpg" style="float: left;">
<div class="row">
<div class="col-lg-4" align="justify">
<h3><mark>WHO WE ARE</mark></h3><br>
<p id="p1">At Brandistic, we are more than just an online shopping destination; we are your go-to source for the latest in fashion, style, and trendsetting products. Founded with a passion for style and a commitment to customer satisfaction, Brandistic has quickly evolved into a trusted and beloved brand in the world of e-commerce. <br><br>The company was founded in 2023 by Jayakody to ease the process of ordering various items. From those early days with just few employees, Brandistic Store now has more than 100 employees, serving thousands of customers. Brandistic Store is guided by four principles: customer obsession rather than competitor focus, passion for invention, commitment to operational excellence, and long-term thinking.<br><br>Thank you for choosing Brandistic as your fashion destination. We look forward to being a part of your style journey and helping you express your unique identity through the power of fashion. <br><br><h4><mark>Vision</mark></h4>We envision a world where fashion is a means of self-expression, where everyone can find the perfect outfit that reflects their personality and style. We aim to continue evolving and expanding, bringing you the best in fashion and lifestyle products while remaining committed to our values of quality, affordability, and customer satisfaction.<br><br><h4><mark>Mission</mark></h4>Our mission is to provide you with an unmatched shopping experience that combines quality, innovation, and affordability.
</p>
</div>
<div class="col-lg-4" align="justify">
<h3><mark>BUILDING THE FUTURE</mark></h3><br>
<p id="p1">We endeavor to create a positive influence on customers, employees, small enterprises, the economy, and local communities.<br><br> We are a group of intelligent, enthusiastic creators with diverse backgrounds and aspirations, yet we all share a common drive to continuously learn and innovate in the best interest of our customers.<br><br>To stay competitive, we employ the following robust growth strategies:<br>
<ul>
<li>Market Expansion:<br>Our primary focus is on entering and expanding into new markets.</li><br>
<li>Market Deepening:<br>We aim to increase revenue from the markets where our company currently operates.</li><br>
<li>Product Advancement:<br>Our objective is to innovate and introduce new products to enhance revenue. </li><br>
<li>Diversification:<br>We aim to achieve growth by exploring new business opportunities.</li><br>
</ul>
</p>
</div>
</div>
</div>
</div>
<?php
include 'includes/footer.php';
?>
</body>
</html>
\ No newline at end of file
<?php
require("includes/common.php");
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
$item_id = $_GET['id'];
$user_id = $_SESSION['user_id'];
$query = "INSERT INTO `user_item`(`user_id`, `item_id`, `status`) VALUES($user_id, $item_id, 1)";
mysqli_query($con, $query) or die(mysqli_error($con));
header('location: products.php');
}
?>
\ No newline at end of file
<?php
require("includes/common.php");
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
$item_id = $_GET["id"];
$user_id = $_SESSION['user_id'];
// Delete the rows from user_items table where item_id and user_id equal to the item_id and user_id we got from the cart page and session
$query = "DELETE FROM user_item WHERE item_id='$item_id' AND user_id='$user_id' AND status= 1";
$res = mysqli_query($con, $query) or die($mysqli_error($con));
header("location:cart.php");
}
?>
\ No newline at end of file
<?php
require("includes/common.php");
if (!isset($_SESSION['email'])) {
header('location: index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Cart | Brandistic Store</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid" id="content">
<?php include 'includes/header.php'; ?>
<div class="col-lg-4 col-md-6 ">
<img src="img/confirmorder.png" style="float: left;">
</div>
<div class="row decor_bg">
<div class="col-md-6">
<table class="table table-striped">
<!--show table only if there are items added in the cart-->
<?php
$sum = 0;$id='';
$user_id = $_SESSION['user_id'];
$query = "SELECT items.price AS Price, items.id As id, items.name AS Name FROM user_item JOIN items ON user_item.item_id = items.id WHERE user_item.user_id='$user_id' and `status`=1";
$result = mysqli_query($con, $query)or die($mysqli_error($con));
if (mysqli_num_rows($result) >= 1) {
?>
<thead>
<tr>
<th>Item Number</th>
<th>Item Name</th>
<th>Price</th>
<th></th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($result)) {
$sum+= $row["Price"];
$id .= $row["id"] . ", ";
echo "<tr><td>" . "#" . $row["id"] . "</td><td>" . $row["Name"] . "</td><td>Rs " . $row["Price"] . "</td><td><a href='cart-remove.php?id={$row['id']}' class='remove_item_link'> Remove</a></td></tr>";
}
$id = rtrim($id, ", ");
echo "<tr><td></td><td>Total</td><td>Rs " . $sum . "</td><td><a href='success.php?itemsid=" . $id . "' class='btn btn-primary'>Confirm Order</a></td></tr>";
?>
</tbody>
<?php
} else {
echo "Heyy!! Your Cart is Empty. Please add items to the cart first!";
}
?>
<?php
?>
</table>
</div>
</div>
</div>
<?php include("includes/footer.php"); ?>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Contact | Life Style Store</title>
<style type="text/css">
.p1{
text-align: justify;
}
</style>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php
include 'includes/header.php';
?>
<div class="container" id="content">
<div class="row">
<div class="col-lg">
<img src="img/contact.png" style="float: right;">
<h1>Get in Touch</h1>
<p id="p1">Greetings! We're here to provide you with assistance.<br> Feel free to get in touch if you have any questions about our products, payment methods, or order deliveries.<br>Regarding payments, please be aware that we will only accept prepaid orders to minimize cash transactions. <br> Regarding potential delays in order deliveries, please understand that while we're doing our utmost to ensure timely delivery, unforeseen circumstances or the current situation may lead to delays. NeveIf you have any other inquiries, please complete the form below, and our team will reach out to you within 24 hours.<br>Alternatively, you can contact the number provided below to speak directly with our customer care representative.</p>
</div><br><br>
<div class="col-lg">
<div style="float: right;">
<h1>COMPANY INFORMATION</h1><br>
<p id="p1">Address: Dehiwala-Mount Lavinia, Sri Lanka 10350</p><br>
<p id="p1">Phone : +94 719181881</p><br>
<p id="p1">Email : support@brandisticstore.com</p>
</div>
<h1>CONTACT US</h1>
<div style="float: left;">
<form>
<div class="form-group">
<input type="text" name="name" placeholder="Name" autofocus="on" class="form-control" required = "true" pattern="^[A-Za-z\s]{1,}[\.]{0,1}[A-Za-z\s]{0,}$">
</div>
<div class="form-group">
<input type="email" name="email" placeholder="Email" class="form-control"
pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" required = "true">
</div>
<div class="form-group">
<textarea rows="5" cols="60" placeholder="Address"></textarea>
</div>
<div class="form-group">
<button type="submit" class="btn btn-primary">Submit</button>
</div>
</form>
</div>
</div>
</div>
</div>
<?php
include 'includes/footer.php';
?>
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
/* Reset some default styles and set a modern font */
body {
margin: 0;
font-family: Arial, sans-serif;
background-color: #f5f5f5;
}
/* Make links stand out and remove underlines */
a {
text-decoration: none;
color: #3498db;
}
/* Modernize the header with a dark background and better spacing */
.header {
background-color: #333;
color: #fff;
border: 1px solid #080808;
padding: 15px 0;
text-align: center;
}
/* Center the content within the header */
.innerheader {
width: 80%;
margin: 0 auto;
display: flex;
justify-content: space-between;
align-items: center;
}
/* Improve the logo and signup button styles */
.logo {
height: 50px;
font-size: 24px;
font-weight: bold;
}
.signup {
font-size: 18px;
font-weight: bold;
background-color: #3498db;
color: #fff;
padding: 10px 20px;
border-radius: 5px;
}
/* Modernize the main content area */
.content {
min-height: 600px;
padding: 20px;
background-color: #fff;
border-radius: 5px;
box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}
/* Update the banner section for a more appealing look */
.banner {
padding: 50px 0;
text-align: center;
color: #fff;
background: url(../intro-bg_1.jpg) no-repeat center;
background-size: cover;
}
.innerbanner {
width: 80%;
margin: 0 auto;
}
.bannercontent {
padding: 30px;
background-color: rgba(0, 0, 0, 0.7);
max-width: 600px;
border-radius: 5px;
}
.button {
color: #fff;
background-color: #3498db;
padding: 12px 20px;
font-size: 18px;
border: none;
border-radius: 5px;
cursor: pointer;
}
/* Modernize the thumbnail styles */
.thumbnail {
width: 100%;
display: block;
margin-bottom: 20px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 5px;
}
.caption {
padding: 10px;
text-align: center;
font-weight: bold;
}
/* Update the footer with a dark background and better spacing */
footer {
background-color: #333;
color: #fff;
font-size: 16px;
padding: 20px 0;
text-align: center;
}
/* Modernize the banner image styles */
.banner_image {
padding: 100px 0 50px;
text-align: center;
color: #fff;
background: url(../img/intro-bg_1.jpg) no-repeat center center;
background-size: cover;
border-bottom: 1px solid #ccc;
border-top: 1px solid #ccc;
}
header {
text-align: center;
}
/* Styles for sections */
.container section {
background-color: #fff;
padding: 20px;
margin-bottom: 20px;
}
.container section h1 {
font-size: 24px;
margin-top: 20px;
}
.container section p {
font-size: 16px;
margin-bottom: 10px;
}
.container section ul {
list-style: disc;
margin-left: 20px;
}
/* Reset some default styles and set a modern font */
body,
html {
width: 100%;
height: 100%;
margin: 0;
font-family: "Arial", sans-serif;
}
/* Add padding to the top of the body to accommodate the header */
body {
padding-top: 100px;
}
/* Set a more modern and readable font for headings */
h1, h2, h3, h4, h5, h6 {
font-family: "Roboto", Arial, sans-serif;
font-weight: 700;
}
/* Add a background color to the content area */
#content {
min-height: 600px;
background-color: #f5f5f5;
}
/* Update the banner image section for a more modern look */
#banner_image {
padding: 50px 0;
text-align: center;
color: #fff;
background: url(../img/intro-bg_1.jpg) no-repeat center;
background-size: cover;
}
/* Modernize the banner content styles */
#banner_content {
padding: 6% 0;
background-color: rgba(0, 0, 0, 0.7);
max-width: 660px;
border-radius: 5px;
margin: 12% auto;
}
/* Update the item list section */
#item_list {
padding: 50px 0;
}
/* Remove hidden pseudo-elements for section navigation */
#cameras:before, #watches:before, #shirts:before {
content: none;
}
/* Update the footer for a cleaner and modern look */
footer {
padding: 20px 0;
background-color: #333;
color: #fff;
text-align: center;
}
/* Modernize the red color class */
.red {
color: #ff0000;
}
/* Add margin to the settings container */
#settings-container {
margin: 10px 0;
}
/* Increase the font size of the navbar brand for better visibility */
.navbar-brand {
font-size: 24px;
}
/* Add responsive styles for smaller screens */
@media (max-width: 768px) {
#banner_content {
padding-bottom: 15%;
}
footer {
text-align: center;
}
}
/* Update the link color for item removal */
.remove_item_link {
color: #007bff;
}
This source diff could not be displayed because it is too large. You can view the blob instead.
<?php
//This code checks if the product is added to cart.
function check_if_added_to_cart($item_id) {
$user_id = $_SESSION['user_id']; //We'll get the user_id from the session
require("common.php"); // connecting to the database
// We will select all the entries from the user_items table where the item_id is equal to the item_id we passed to this function, user_id is equal to the user_id in the session and status is 'Added to cart'
$query = "SELECT * FROM user_item WHERE item_id='$item_id' AND user_id ='$user_id' and `status`=1";
$result = mysqli_query($con, $query) or die(mysqli_error($con));
// We'll check if the no.of rows in the result and no.of rows returned by the mysqli_num_rows($result) is true. If yes then it return 0 else it returns 0
if (mysqli_num_rows($result) >= 1) {
return 1;
} else {
return 0;
}
}
?>
\ No newline at end of file
<!--establish the connection to database, and start the session-->
<?php
$con = mysqli_connect("localhost", "root", "", "store")or die($mysqli_error($con));
if(session_status() == PHP_SESSION_NONE){
session_start();
}
?>
\ No newline at end of file
<!-- this code is footer navigation bar in website -->
<footer>
<div class="container">
<center>
<p>Copyright &copy; Brandistic. All Rights Reserved | Contact Us: +94 719181881</p>
</center>
</footer>
\ No newline at end of file
<!-- this code is header navigation bar in website -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<!--To add menu option when screen width is reduced-->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#myNavbar">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">Brandistic Store</a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
<ul class="nav navbar-nav navbar-right">
<!--If user is logged in, then header will contain these-->
<?php
if (isset($_SESSION['email'])) {
?>
<li><a href = "cart.php"><span class = "glyphicon glyphicon-shopping-cart"></span> Cart </a></li>
<li><a href = "settings.php"><span class = "glyphicon glyphicon-user"></span> Settings</a></li>
<li><a href = "orderhistory.php"><span class = "glyphicon glyphicon-file"></span> Order History</a></li>
<li><a href = "logout_script.php"><span class = "glyphicon glyphicon-log-in"></span> Logout</a></li>
?>
<?php
} else {
?>
<li><a href="signup.php"><span class="glyphicon glyphicon-user"></span> Sign Up</a></li>
<li><a href="login.php"><span class="glyphicon glyphicon-log-in"></span> Login</a></li>
<li><a href="aboutus.php"><span class="glyphicon glyphicon-tasks"></span> About us</a></li>
<li><a href="contact.php"><span class="glyphicon glyphicon-phone"></span> Contact</a></li>
<li><a href="privacy.php"><span class="glyphicon glyphicon-info-sign"></span> Privacy Policy</a></li>
<?php
}
?>
</ul>
</div>
</div>
</div>
\ No newline at end of file
<?php
//establish the connection to database, and start the session
require("includes/common.php");
// Redirects the user to products page if he/she is logged in.
if (isset($_SESSION['email'])) {
header('location: products.php');
}
?>
<!--Specifies document type is html-->
<!DOCTYPE html>
<!--Specifies the language as English-->
<html lang="en">
<head>
<!--instructs browser on how to control the page's dimensions and scaling-->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!--Title of index page-->
<title>Welcome | Brandistic Store</title>
<!-- Bootstrap Core CSS -->
<link href="css/bootstrap.css" rel="stylesheet">
<!-- Custom CSS -->
<link href="css/style.css" rel="stylesheet">
<!-- jQuery -->
<script src="js/jquery.js"></script>
<!-- Bootstrap Core JavaScript -->
<script src="js/bootstrap.min.js"></script>
</head>
<body style="padding-top: 50px;">
<!-- Header -->
<?php
include 'includes/header.php';
?>
<!--Header end-->
<div id="content">
<!--Main banner image-->
<div id = "banner_image">
<div class="container">
<center>
<div id="banner_content">
<h1>Selling only the best things online</h1>
<p>20% OFF on premium brands for new users</p>
<br/>
<a href="products.php" class="btn btn-danger btn-lg active">Shop Now</a>
</div>
</center>
</div>
</div>
<!--Main banner image end-->
<!--Item categories listing-->
<div class="container">
<div class="row text-center" id="item_list">
<div class="col-sm-4">
<a href="products.php#cameras" >
<div class="thumbnail">
<img src="img/1.jpg" alt="">
<div class="caption">
<h3>Cameras</h3>
<p>Choose among the best available in the world.</p>
</div>
</div>
</a>
</div>
<div class="col-sm-4">
<a href="products.php#watches" >
<div class="thumbnail">
<img src="img/10.jpg" alt="">
<div class="caption">
<h3>Watches</h3>
<p>Original watches from the best brands.</p>
</div>
</div>
</a>
</div>
<div class="col-sm-4">
<a href="products.php#shirts" >
<div class="thumbnail">
<img src="img/13.jpg" alt="">
<div class="caption">
<h3>Shirts</h3>
<p>Our exquisite collection of shirts.</p>
</div>
</div>
</a>
</div>
</div>
</div>
<!--Item categories listing end-->
</div>
<!--Footer-->
<?php
include 'includes/footer.php';
?>
<!--Footer end-->
</body>
</html>
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
<?php
require("includes/common.php");
// Redirects the user to products page if logged in.
if (isset($_SESSION['email'])) {
header('location: products.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Login | Life Style Store</title>
<link href="css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php include 'includes/header.php'; ?>
<div id="content">
<div class="container-fluid decor_bg" id="login-panel">
<div class="col-lg-4 col-md-6">
<img src="img/yess.jpg">
</div>
<div class="row">
<div class="col-lg-4 col-lg-offset-3 col-md-4">
<div class="panel panel-primary" >
<div class="panel-heading">
<h4>LOGIN</h4>
</div>
<div class="panel-body">
<p class="text-warning"><i>Login to make a purchase</i><p>
<form action="login_submit.php" method="POST">
<div class="form-group">
<input type="email" class="form-control" placeholder="Email" autofocus="on" name="e-mail" required = "true">
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" name="password" required = "true">
</div>
<button type="submit" name="submit" class="btn btn-primary">Login</button><br><br>
<?php if(isset($_GET['error'])) echo $_GET['error']; ?>
</form><br/>
</div>
<div class="panel-footer"><p>Don't have an account? <a href="signup.php">Register</a></p></div>
</div>
</div>
</div>
</div>
</div>
<?php include 'includes/footer.php'; ?>
</body>
</html>
\ No newline at end of file
<?php
require("includes/common.php");
//Get the email and password from the user through login page
$email = $_POST['e-mail'];
$email = mysqli_real_escape_string($con, $email);
$password = $_POST['password'];
$password = mysqli_real_escape_string($con, $password);
$password = MD5($password);
// Query checks if the email and password are present in the database.
$query = "SELECT id, email FROM users WHERE email='" . $email . "' AND password='" . $password . "'";
$result = mysqli_query($con, $query)or die($mysqli_error($con));
$num = mysqli_num_rows($result);
// If the email and password are not present in the database, the mysqli_num_rows returns 0, it is assigned to $num.
if ($num == 0) {
$error = "<span class='red'>Please enter correct E-mail id and Password</span>";
header('location: login.php?error=' . $error);
} else {
$row = mysqli_fetch_array($result);
$_SESSION['email'] = $row['email'];
$_SESSION['user_id'] = $row['id'];
header('location: products.php');
}
\ No newline at end of file
<?php
session_start();
if (!isset($_SESSION['email'])) {
header('location: login.php');
}
session_destroy();
header('location: index.php');
?>
\ No newline at end of file
<?php
require("includes/common.php");
if (!isset($_SESSION['email'])) {
header('location: index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Confirmation | Life Style Store</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php include 'includes/header.php'; ?>
<div class="container-fluid" id="content">
<div class="col-md-12">
<div class="jumbotron">
<h3 align="center">Your order has been placed successfully. Thank you for shopping with us.</h3><hr>
<p align="center">Your order will be delivered in 2 days</p><hr>
<p align="center">Click <a href="products.php">here</a> to purchase any other item.</p>
</div>
</div>
</div>
<?php include("includes/footer.php");
?>
</body>
</html>
</html>
\ No newline at end of file
<?php
require("includes/common.php");
if (isset($_GET['id']) && is_numeric($_GET['id'])) {
$item_id = $_GET['id'];
$user_id = $_SESSION['user_id'];
$query = "INSERT INTO `user_item`(`user_id`, `item_id`, `status`) VALUES($user_id, $item_id, 2)";
mysqli_query($con, $query) or die(mysqli_error($con));
header('location: success.php');
}
?>
<?php
require("includes/common.php");
if (!isset($_SESSION['email'])) {
header('location: index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Order History | Life Style Store</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid" id="content">
<?php include 'includes/header.php'; ?>
<div class="col-lg-4 col-md-6 ">
<img src="img/cart.jpg" style="float: left;">
</div>
<div class="row decor_bg">
<div class="col-md-6">
<table class="table table-striped">
<!--show table only if there are items added in the cart-->
<?php
$sum = 0;$id='';
$user_id = $_SESSION['user_id'];
$query = "SELECT items.price AS Price, items.id As id, items.name AS Name FROM user_item JOIN items ON user_item.item_id = items.id WHERE user_item.user_id='$user_id' and `status`=2";
$query1="SELECT user_item.date_time AS Timedate from user_item WHERE user_id='$user_id' and `status`=2";
$result = mysqli_query($con, $query)or die($mysqli_error($con));
$result1 = mysqli_query($con, $query1)or die($mysqli_error($con));
if (mysqli_num_rows($result) >= 1) {
?>
<h1 style="margin-bottom: 20px; font-weight: 20;"><center>Order History</center></h1>
<thead>
<tr>
<th>Item name</th>
<th>Price</th>
<th>Order & time</th>
</tr>
</thead>
<tbody>
<?php
$total = 0;
while ($row = mysqli_fetch_array($result)) {
$id .= $row["id"] . ", ";
echo '<tr><td><a href="order.php">'. $row["Name"] . "</a></td><td>Rs. " . $row["Price"] . "</td>";
$total= $total + $row["Price"];
while ($row1 = mysqli_fetch_array($result1) ) {
echo"<td>" . $row1["Timedate"] . "</td></tr>";
break;
}
}
echo "<tr><td>Total</td>"."<td>Rs. ".$total."</td></tr>";
?>
</tbody>
<?php
} else {
echo "Sorry! No orders placed yet";
}
?>
<?php
?>
</table>
</div>
</div>
</div>
<?php include("includes/footer.php"); ?>
</body>
</html>
\ No newline at end of file
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="css/privacy.css">
<link rel="stylesheet" type="text/css" href="css/index.css">
<link href="css/style.css" rel="stylesheet">
<link href="css/bootstrap.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
<title>Privacy Policy | Brandistic Store</title>
</head>
<body>
<?php
include 'includes/header.php';
?>
<header>
<h1>Privacy Policy</h1>
</header>
<div class="container">
<section>
<h1>1. Information We Collect</h1>
<p>
When you use our website to place orders, we may collect the following types of personal information:
</p>
<ul>
<li>Contact Information: We collect your name, email address, and shipping address to process your orders and communicate with you regarding your purchases.</li>
<li>Order Information: We collect details related to the products you order, including the product names, quantities, and any special instructions you provide.</li>
<li>Account Information: If you create an account on our website, we will collect your chosen username and password to facilitate future orders and provide a more personalized experience.</li>
</ul>
</section>
<section>
<h1>2. How We Use Your Information</h1>
<p>
We use the information we collect for the following purposes:
</p>
<ul>
<li>Processing Orders: We use your contact and order information to fulfill and deliver the products you order from our website.</li>
<li>Communicating with You: We may use your contact information to provide order updates, answer your inquiries, and address any issues related to your purchases.</li>
<li>Account Management: If you create an account, we use your account information to manage and secure your account and provide you with a more tailored experience on our website.</li>
<li>Improving Our Services: We may analyze your order data to improve our product offerings, website functionality, and customer experience.</li>
</ul>
</section>
<section>
<h1>3. Changes to this Privacy Policy</h1>
<p>
We may update this Privacy Policy from time to time to reflect changes in our practices or for legal and regulatory reasons. When we make changes, we will update the "Last updated" date at the bottom of this policy.
<br>
<br>
Last Updated: 02/11/2023
</p>
</section>
</div>
<?php
include 'includes/footer.php';
?>
</body>
</html>
This diff is collapsed.
<?php
require_once("includes/common.php");
if (!isset($_SESSION['email'])) {
header('location: index.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Settings | Brandistic Store</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php include 'includes/header.php'; ?>
<div class="container-fluid" id="content">
<div class="col-lg-4 col-md-6">
<img src="img/settings.jpg">
</div>
<div class="row">
<div class="col-lg-4 col-md-6" id="settings-container">
<h4>Change Password</h4>
<form action="settings_script.php" method="POST">
<div class="form-group">
<input type="password" class="form-control" name="old-password" placeholder="Old Password" required = "true">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password" placeholder="New Password" required = "true">
</div>
<div class="form-group">
<input type="password" class="form-control" name="password1" placeholder="Re-type New Password" required = "true">
</div>
<button type="submit" class="btn btn-primary">Change</button>
<?php if(isset($_GET['error'])) echo $_GET['error']; ?>
</form>
</div>
</div>
</div>
<?php include("includes/footer.php"); ?>
</body>
</html>
\ No newline at end of file
<?php
// This page updates the user password
require("common.php");
if (!isset($_SESSION['email'])) {
header('location: index.php');
}
$old_pass = $_POST['old-password'];
$old_pass = mysqli_real_escape_string($con, $old_pass);
$old_pass = MD5($old_pass);
$new_pass = $_POST['password'];
$new_pass = mysqli_real_escape_string($con, $new_pass);
$new_pass = MD5($new_pass);
$new_pass1 = $_POST['password1'];
$new_pass1 = mysqli_real_escape_string($con, $new_pass1);
$new_pass1 = MD5($new_pass1);
$query = "SELECT email, password FROM users WHERE email ='" . $_SESSION['email'] . "'";
$result = mysqli_query($con, $query)or die($mysqli_error($con));
$row = mysqli_fetch_array($result);
$orig_pass = $row['password'];
if ($new_pass != $new_pass1) {
$error = "<span class='red'>The two passwords don't match</span>";
header('location: settings.php?error= ' . $error);
} else {
if ($old_pass == $orig_pass) {
$query = "UPDATE users SET password = '" . $new_pass . "' WHERE email = '" . $_SESSION['email'] . "'";
mysqli_query($con, $query) or die($mysqli_error($con));
$error = "<span class='red'>Password Updated</span>";
header('location: settings.php?error= ' . $error);
} else{
$error = "<span class='red'>Wrong Old Password</span>";
header('location: settings.php?error= ' . $error);
}
}
?>
\ No newline at end of file
<?php
require("includes/common.php");
if (isset($_SESSION['email'])) {
header('location: products.php');
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Signup | Life Style Store</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<script src="js/jquery.js"></script>
<script src="js/bootstrap.min.js"></script>
</head>
<body>
<?php include 'includes/header.php'; ?>
<div class="container-fluid decor_bg" id="content">
<div class="col-lg-4 col-md-6">
<img src="img/signup1.jpg">
</div>
<div class="row">
<div class="container">
<div class="col-lg-4 col-lg-offset-3 col-md-6">
<h2>SIGN UP</h2>
<form action="signup_script.php" method="POST">
<div class="form-group">
<input class="form-control" placeholder="Name" autofocus="on" name="name" required = "true" pattern="^[A-Za-z\s]{1,}[\.]{0,1}[A-Za-z\s]{0,}$">
</div>
<div class="form-group">
<input type="email" class="form-control" placeholder=" Enter a valid Email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" name="e-mail" required = "true"><?php if(isset($_GET['m1'])) echo $_GET['m1']; ?>
</div>
<div class="form-group">
<input type="password" class="form-control" placeholder="Password" title="Password must be 8 characters including 1 uppercase letter, 1 lowercase letter and numeric characters"pattern="(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,}" name="password" required = "true">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Contact (ex. 8444844863)" maxlength="10" size="10" name="contact" required = "true"><?php if(isset($_GET['m2'])) echo $_GET['m2']; ?>
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="City" name="city" required = "true">
</div>
<div class="form-group">
<input type="text" class="form-control" placeholder="Address" name="address" required = "true">
</div>
<button type="submit" name="submit" class="btn btn-primary">Submit</button>
</form>
</div>
</div>
</div>
</div>
<?php include "includes/footer.php"; ?>
</body>
</html>
\ No newline at end of file
<?php
require("includes/common.php");
// Getting the values from the signup page using $_POST[] and cleaning the data submitted by the user.
$name = $_POST['name'];
$name = mysqli_real_escape_string($con, $name);
$email = $_POST['e-mail'];
$email = mysqli_real_escape_string($con, $email);
$password = $_POST['password'];
$password = mysqli_real_escape_string($con, $password);
$password = MD5($password);
$contact = $_POST['contact'];
$contact = mysqli_real_escape_string($con, $contact);
$city = $_POST['city'];
$city = mysqli_real_escape_string($con, $city);
$address = $_POST['address'];
$address = mysqli_real_escape_string($con, $address);
$regex_email = "/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/";
$regex_num = "/^[789][0-9]{9}$/";
//Checking whether email id already used for registration
$query = "SELECT * FROM users WHERE email='$email'";
$result = mysqli_query($con, $query)or die($mysqli_error($con));
$num = mysqli_num_rows($result);
if ($num != 0) {
$m = "<span class='red'>Email Already Exists</span>";
header('location: signup.php?m1=' . $m);
} else if (!preg_match($regex_email, $email)) {
$m = "<span class='red'>Not a valid Email Id</span>";
header('location: signup.php?m1=' . $m);
} else if (!preg_match($regex_num, $contact)) {
$m = "<span class='red'>Not a valid phone number</span>";
header('location: signup.php?m2=' . $m);
} else {
$query = "INSERT INTO users(name, email, password, contact, city, address)VALUES('" . $name . "','" . $email . "','" . $password . "','" . $contact . "','" . $city . "','" . $address . "')";
mysqli_query($con, $query) or die(mysqli_error($con));
$user_id = mysqli_insert_id($con);
$_SESSION['email'] = $email;
$_SESSION['user_id'] = $user_id;
header('location: login.php');
}
?>
\ No newline at end of file
-- phpMyAdmin SQL Dump
-- version 4.9.0.1
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Jun 07, 2020 at 05:52 PM
-- Server version: 10.4.6-MariaDB
-- PHP Version: 7.3.9
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;
--
-- Database: `store`
--
-- --------------------------------------------------------
--
-- Table structure for table `items`
--
CREATE TABLE `items` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`price` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `items`
--
INSERT INTO `items` (`id`, `name`, `price`) VALUES
(1, 'Canon EOS', 36000),
(2, 'Nikon DSLR', 40000),
(3, 'Sony DSLR', 45000),
(4, 'Olympus DSLR', 50000),
(5, 'Titan Model #301', 13000),
(6, 'Titan Model #201', 3000),
(7, 'HMT Milan', 8000),
(8, 'Faber Luba #111', 18000),
(9, 'H&W', 800),
(10, 'Luis Phil', 1000),
(11, 'John Zok', 1500),
(12, 'Jhalsani', 1300);
-- --------------------------------------------------------
--
-- Table structure for table `users`
--
CREATE TABLE `users` (
`id` int(11) NOT NULL,
`name` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
`password` varchar(255) NOT NULL,
`contact` varchar(255) NOT NULL,
`city` varchar(255) NOT NULL,
`address` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `users`
--
INSERT INTO `users` (`id`, `name`, `email`, `password`, `contact`, `city`, `address`) VALUES
(1, 'Vishwa', 'vish@gmail.com', '708175b3fdb269c4ebe8e7751bb3fccd', '9283746352', 'Bengaluru', 'JP Nagar 2nd Phase'),
(2, 'Vishal', 'vishal@gmail.com', '72eea11febe23ae3dcab2bf59794c54c', '9120394750', 'Chennai', 'T Nagar'),
(3, 'Ram', 'ram@gmail.com', '1b7b4c38f626766bbdcfc895e2c514f6', '9718273679', 'Delhi', 'PMO'),
(4, 'Raj', 'raj@gmail.com', '1537c1dea8479ff52bc68336e323385f', '9281736475', 'Bengaluru', 'Basavangudi'),
(5, 'Ravi', 'ravi@gmail.com', 'f4690de2554616f5b853d35f5a7970d4', '9182712098', 'Chennai', 'abc'),
(6, 'Vishwadutt', 'vishwadutt99@gmail.com', '8231ac09972b51e692a5f515f8349a29', '9741301718', 'Bengaluru', 'Jayanagar 3rd Block');
-- --------------------------------------------------------
--
-- Table structure for table `user_item`
--
CREATE TABLE `user_item` (
`id` int(11) NOT NULL,
`user_id` int(11) NOT NULL,
`item_id` int(11) NOT NULL,
`status` enum('Added to cart','Confirmed','','') NOT NULL,
`date_time` datetime NOT NULL DEFAULT current_timestamp()
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
--
-- Dumping data for table `user_item`
--
INSERT INTO `user_item` (`id`, `user_id`, `item_id`, `status`, `date_time`) VALUES
(1, 1, 2, 'Confirmed', '2020-06-07 21:08:35'),
(2, 1, 10, 'Confirmed', '2020-06-07 21:08:38'),
(3, 3, 7, 'Confirmed', '2020-06-07 21:09:06'),
(4, 3, 12, 'Confirmed', '2020-06-07 21:09:10'),
(5, 5, 5, 'Confirmed', '2020-06-07 21:22:01'),
(6, 5, 1, 'Confirmed', '2020-06-07 21:22:03');
--
-- Indexes for dumped tables
--
--
-- Indexes for table `items`
--
ALTER TABLE `items`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `user_item`
--
ALTER TABLE `user_item`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `items`
--
ALTER TABLE `items`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=13;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
--
-- AUTO_INCREMENT for table `user_item`
--
ALTER TABLE `user_item`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
<?php
require("includes/common.php");
if (!isset($_SESSION['email'])) {
header('location: index.php');
}
$user_id = $_SESSION['user_id'];
$item_ids_string = $_GET['itemsid'];
//We will change the status of the items purchased by the user to 'Confirmed'
$query = "UPDATE user_item SET status=2 WHERE user_id=" . $user_id . " AND item_id IN (" . $item_ids_string . ") and status= 1 ";
mysqli_query($con, $query) or die($mysqli_error($con));
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta name="viewport" content="width = device-width, initial-scale = 1">
<title>Success | Brandistic Store</title>
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<?php include 'includes/header.php'; ?>
<div class="container-fluid" id="content">
<div class="col-md-12">
<div class="col-lg-4 col-md-6 ">
<img src="img/thanks.png" style="float: left;">
</div>
<div class="jumbotron">
<h3 align="center">Your order is confirmed. Thank you for shopping with us.</h3><hr>
<p align="center">Click <a href="products.php">here</a> to purchase any other item.</p>
</div>
</div>
</div>
<?php include("includes/footer.php");
?>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment