Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

making the changes in registration page #18

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .idea/ecommerce-1.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions admin/admin_logout.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php
session_start();
session_destroy();
if(isset($_POST['logout'])) {
header('location: index.php');
}
?>
<html>
<head>

</head>
<body style="background:gray">
<div style="color:skyblue margin: auto; text-align: center;" >
<p style="color:skyblue">for logout the admin panal</p>
<tr style="font_color:white"> <input type="submit" name="logout" value="logout"></tr>
</div>
</body>

</html>
6 changes: 5 additions & 1 deletion admin/view_products.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
header('location: login.php?not_admin=You are not Admin!');
}
?>
<head>

<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.min.css">
</head>
<div class="row">
<div class="col-sm-12">
<h1>Products</h1>
Expand Down Expand Up @@ -37,7 +41,7 @@
<tr>
<th scope="row"><?php echo ++$i; ?></th>
<td><?php echo $pro_title; ?></td>
<td><img class="img-thumbnail" src='product_images/<?php echo $pro_image;?>' width='80' height='80'></td>
<td><img class="img-thumbnail zoom" src='product_images/<?php echo $pro_image;?>' width='80' height='80'></td>
<td><?php echo $pro_price; ?>/-</td>
<td><a href="index.php?edit_pro=<?php echo $pro_id?>" class="btn btn-primary">
<i class="fa fa-edit"></i> Edit
Expand Down
3 changes: 2 additions & 1 deletion all_products.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
<meta charset="UTF-8">
<title>My Online Shop</title>
<link rel="stylesheet" type="text/css" href="css/mystyle.css">
<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.min.css">
</head>
<body>
<div class="main_wrapper">
Expand Down Expand Up @@ -42,7 +43,7 @@
<?php getBrands(); ?>
</ul>
</div>
<div id="content_area">
<div id="content_area" style="background-color: #9E9E9E;">
<div class="shopping_cart">
<?php cart(); ?>
<span style="float: right;
Expand Down
2 changes: 1 addition & 1 deletion cart.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
<?php getBrands(); ?>
</ul>
</div>
<div id="content_area">
<div id="content_area" style = "background-color: #9E9E9E;">
<?php
global $con;
$ip = getIp();
Expand Down
41 changes: 40 additions & 1 deletion css/mystyle.css
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,44 @@ body {
padding-top: 40px;
color: black;
}

ul.gallery{
margin-left: 3vw;
margin-right:3vw;
}

.zoom {
-webkit-transition: all 0.35s ease-in-out;
-moz-transition: all 0.35s ease-in-out;
transition: all 0.35s ease-in-out;
cursor: -webkit-zoom-in;
cursor: -moz-zoom-in;
cursor: zoom-in;
}

.zoom:hover,
.zoom:active,
.zoom:focus {
/**adjust scale to desired size,
add browser prefixes**/
-ms-transform: scale(2.5);
-moz-transform: scale(2.5);
-webkit-transform: scale(2.5);
-o-transform: scale(2.5);
transform: scale(2.5);
position:relative;
z-index:100;
}

/**To keep upscaled images visible on mobile,
increase left & right margins a bit**/
@media only screen and (max-width: 768px) {
ul.gallery {
margin-left: 15vw;
margin-right: 15vw;
}

/**TIP: Easy escape for touch screens,
give gallery's parent container a cursor: pointer.**/
.DivName {cursor: pointer}
}

4 changes: 2 additions & 2 deletions customer_login.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
</tr>
<tr>
<td align="right"><b>Email: </b></td>
<td><input type="text" name="email" placeholder="Enter email" required></td>
<td><input class="form-control" type="text" name="email" placeholder="Enter email" required></td>
</tr>
<tr>
<td align="right"><b>Password:</b></td>
<td><input type="password" name="pass" placeholder="Enter password" required></td>
<td><input class="form-control" type="password" name="pass" placeholder="Enter password" required></td>
</tr>
<tr align="center">
<td colspan="2"><a href="checkout.php?forgot_pass">Forgot Password? </a></td>
Expand Down
25 changes: 13 additions & 12 deletions customer_register.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
<meta charset="UTF-8">
<title>My Online Shop</title>
<link rel="stylesheet" type="text/css" href="css/mystyle.css">
<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.min.css">
</head>
<body>
<div class="main_wrapper">
Expand Down Expand Up @@ -88,31 +89,31 @@
</span>
</div>

<form action="customer_register.php" method="post" enctype="multipart/form-data">
<form action="customer_register.php" method="post" style="background: gray;" enctype="multipart/form-data">
<table align="center" width="750">
<tr align="center">
<td colspan="3"><h2>create an Account </h2></td>
<td colspan="3"><h2 class="h6">create an Account </h2></td>
</tr>
<tr>
<td align="right">Name: </td>
<td><input name="c_name" required></td>
<td><input class="form-control" name="c_name" required></td>
</tr>
<tr>
<td align="right">Email: </td>
<td><input name="c_email" required></td>
<td><input class="form-control" name="c_email" required></td>
</tr>
<tr>
<td align="right">Password: </td>
<td><input type="password" name="c_pass" required></td>
<td><input class="form-control" type="password" name="c_pass" required></td>
</tr>
<tr>
<td align="right">Image: </td>
<td><input type="file" name="c_image" required></td>
<td><input class="btn btn-primary" type="file" name="c_image" required></td>
</tr>
<tr>
<td align="right">Country: </td>
<td align="right">Country: </td>
<td>
<select name="c_country">
<select class="btn btn-primary" name="c_country">
<option>Select a Country </option>
<option>Afghanistan </option>
<option>Pakistan</option>
Expand All @@ -123,18 +124,18 @@
</tr>
<tr>
<td align="right">City: </td>
<td><input name="c_city" required></td>
<td><input class="form-control" name="c_city" required></td>
</tr>
<tr>
<td align="right">Contact: </td>
<td><input name="c_contact" required pattern=".*"></td>
<td><input class="form-control" name="c_contact" required pattern=".*"></td>
</tr>
<tr>
<td align="right">Address: </td>
<td><input name="c_address" required></td>
<td><input class="form-control" name="c_address" required></td>
</tr>
<tr align="center">
<td colspan="3"><input type="submit" name="register" value="Create Account"></td>
<td colspan="3"><input style="float:right" class="btn btn-primary" type="submit" name="register" value="Create Account"></td>
</tr>
</table>

Expand Down
17 changes: 11 additions & 6 deletions functions/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function getBrands(){
}
}

function getPro($flag = ''){
function getPro($flag = '',$search_pro=''){
global $con;
$get_pro = "";
if(!isset($_GET['cat']) && !isset($_GET['brand']) && !isset($_GET['search'])) {
Expand All @@ -39,9 +39,14 @@ function getPro($flag = ''){
} else if(isset($_GET['brand'])){
$pro_brand_id = $_GET['brand'];
$get_pro = "select * from products where pro_brand = '$pro_brand_id'";
} else if(isset($_GET['search'])){
$search_query = $_GET['user_query'];
$get_pro = "select * from products where pro_keywords like '%$search_query%'";
} else if(isset($_GET['search']) || $search_pro != ''){
$search_query = '';
if($search_pro == '')
$search_query = $_GET['user_query'];
else {
$search_query = $search_pro;
$get_pro = "select * from products where pro_keywords like '%$search_query%'";
}
}
$run_pro = mysqli_query($con,$get_pro);
$count_pro = mysqli_num_rows($run_pro);
Expand All @@ -57,8 +62,8 @@ function getPro($flag = ''){
$pro_image = $row_pro['pro_image'];
echo "
<div class='single_product'>
<h3>$pro_title</h3>
<img src='admin/product_images/$pro_image' width='180' height='180'>
<h3 class='h6'>$pro_title</h3>
<img src='admin/product_images/$pro_image' class='img-thumbnail zoom' width='180' height='180'>
<p> <b> Rs $pro_price/- </b> </p>
<a href='details.php?pro_id=$pro_id' style='float: left'>Details</a>
<a href='index.php?add_cart=$pro_id'><button style='float: right;'>Add to Cart</button></a>
Expand Down
51 changes: 39 additions & 12 deletions index.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,32 +6,59 @@
<html lang="en">
<head>
<meta charset="UTF-8">
<meta class="viewport" content="width=device-width, initial-scale=1.0">
<title>My Online Shop</title>
<link rel="stylesheet" type="text/css" href="admin/assets/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="css/mystyle.css">
<script>
function check_input(q){
console.log(q);
if(q == ''){
document.getElementById('products_box').innerHTML = '';
}
else {
var http = new XMLHttpRequest();
http.onreadystatechange = function () {
if (http.readyState == 4 && http.status == 200){
document.getElementById('products_box').innerHTML = http.responseText;
}
}
http.open('get','search_products.php?pro=' + q);
http.send();
}
}


</script>
</head>
<body>
<div class="main_wrapper">
<div class="main_wrapper" >
<div class="header_wrapper">
<a href="index.php"><img id="logo" src="images/logo.jpg"></a>
<img id="banner" src="images/banner.gif">
<a href="index.php"><img class="col-sm-9" id="logo" src="images/logo.jpg"></a>
<img class="row-md-9" id="banner" src="images/banner.gif">

</div>
<div class="menubar">
<ul id="menu">
<div class="menubar" class="container">
<ul id="menu" class="col-sm-12">
<li><a href="index.php">Home</a></li>
<li><a href="all_products.php">All Products</a></li>
<li><a href="my_account.php">My Account</a></li>
<li><a href="#">Sign Up</a></li>
<li><a href="cart.php">Cart</a></li>
<li><a href="#">Contact Us</a></li>

</ul>
<div id="form">
<form method="get" action="results.php">
<input type="text" name="user_query" placeholder="Search products">
<input type="submit" name="search" value="Search">
<div class="row">
<input type="text" name="user_query" onkeyup="check_input(this.value)" placeholder="Search products">
<input type="submit" name="search" value="Search">

</div>
</form>
</div>
</div>
<div class="content_wrapper">
<div class="content_wrapper" class="col-md-9">
<div id="sidebar">
<div class="sidebar_title">Categories </div>
<ul class="cats">
Expand All @@ -42,8 +69,8 @@
<?php getBrands(); ?>
</ul>
</div>
<div id="content_area">
<div class="shopping_cart">
<div id="content_area" style="background-color: #9E9E9E;">
<div class="shopping_cart" class="col-sm-9">
<?php cart(); ?>
<span style="float: right;
font-size: 18px; padding: 5px;line-height: 40px;">
Expand All @@ -69,14 +96,14 @@
?>
</span>
</div>
<div class="products_box">
<div id="products_box" class="col-sm-12" class="products_box" class="img-thumbnail zoom">
<?php getPro(); ?>
</div>

</div>
</div>
<div id="footer">
<h2> &copy; 2018 by Muhammad Ali Makhdoom</h2>
<h2> &copy; 2018 by Muhammad ali Makhdoom</h2>
</div>
</div>
</body>
Expand Down
15 changes: 13 additions & 2 deletions logout.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
<?php
session_start();
session_destroy();
header('location: index.php');
?>

//header('location: index.php');
?>
<html>
<head>
</head>
<body>
<div style="color:skyblue">
<input type="submit" name="logout">for logout the admin panal</input>
</div>
</body>

</html>
Loading