Skip to content
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.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.

404 changes: 404 additions & 0 deletions .idea/workspace.xml

Large diffs are not rendered by default.

42 changes: 42 additions & 0 deletions admin/add_admin.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<div class="row">
<div class="offset-md-2 col-md-8">
<form action="" method="post" enctype="multipart/form-data">
<div class="form-group row">
<h2 class="offset-lg-3 offset-md-2 offset-1 "> Add Admin </h2>
</div>
<div class="form-group row">
<label class="col-form-label col-sm-4 col-lg-3 d-none d-sm-block" for="pro_title">New Admin Email</label>
<div class="col-12 col-sm-8 col-lg-9">
<input class="form-control" type="email" id="email" name="email" placeholder="Enter Email..."
pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$" required>
</div>
</div>
<div class="form-group row">
<label class="col-form-label col-sm-4 col-lg-3 d-none d-sm-block" for="pro_title">New Admin Password</label>
<div class="col-12 col-sm-8 col-lg-9">
<input class="form-control" type="password" id="password" name="password" placeholder="Enter Password..."
required>
</div>
</div>

<div class="form-group row">
<div class="offset-sm-3 col-12 col-sm-6">
<input class="btn btn-block btn-primary btn-lg" type="submit" id="add" name="add"
value="Add">
</div>
</div>
</form>
</div>
</div>
<?php
if(isset($_POST['add'])){
//getting text data from the fields
$email = $_POST['email'];
$user_pass = $_POST['password'];

$add_admin = "insert into admins (user_email, user_pass)
VALUES ('$email','$user_pass');";
$insert_admin = mysqli_query($con, $add_admin);
}

?>
8 changes: 8 additions & 0 deletions admin/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,11 @@
<a href="logout.php">
<i class="fa fa-sign-out-alt"></i> Admin logout</a>
</li>
<li>
<a href="index.php?add_admin">
<i class="fas fa-plus"></i> Add Admin
</a>
</li>
</ul>
</nav>
<div id="content">
Expand Down Expand Up @@ -126,6 +131,9 @@
else if(isset($_GET['del_customer'])){
include ('del_customer.php');
}
else if(isset($_GET['add_admin'])){
include ('add_admin.php');
}


?>
Expand Down
8 changes: 6 additions & 2 deletions admin/login.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
$pass = $_POST['user_pass'];
$sel_user = "select * from admins where user_email='$email' AND user_pass='$pass'";
$run_user = mysqli_query($con, $sel_user);
$check_user = mysqli_num_rows($run_user);
if($check_user==0){
if(mysqli_num_rows($run_user)==0){
$error_msg = 'Password or Email is wrong, try again';
}
else{
Expand Down Expand Up @@ -55,7 +54,12 @@
<script src="assets/js/jquery-3.3.1.min.js"></script>
<script src="assets/js/bootstrap.bundle.min.js"></script>
</body>
<<<<<<< HEAD

</html>
=======
</html>



>>>>>>> upstream/master
15 changes: 8 additions & 7 deletions check_email.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
<?php
require "functions/functions.php";
$e = $_REQUEST["e"];
$sel_email = "select * from customers where cust_email= '$e'";
$run_email = mysqli_query($con,$sel_email);
$count = mysqli_num_rows($run_email);
if($count>0){
echo "Email already registered";
require "./includes/db_connetion.php";

$e = $_REQUEST["e"];
$sel_email = "select * from customers where cust_email= '$e'";
$run_email = mysqli_query($con,$sel_email);
$count = mysqli_num_rows($run_email);
if($count>0){
echo "Email already registered";
}
2 changes: 1 addition & 1 deletion customer_register.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
<tr>
<td align="right">Email: </td>
<td>
<input name="c_email" onkeyup="checkEmail(this.value)" required>
<input name="c_email" onkeyup="checkEmail(this.value);" required>
<span id="hint"></span>
</td>
</tr>
Expand Down