Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
8abd475
login input types created
Parmkaur006 Nov 13, 2023
925634d
styling for login inputs
Parmkaur006 Nov 13, 2023
530d2f5
created the login username input and container
Parmkaur006 Nov 13, 2023
fc54425
logout branch has been created
Parmkaur006 Nov 13, 2023
87e1d2d
css added for the login
Parmkaur006 Nov 13, 2023
b07e1f4
logout file updated with calling functions
Parmkaur006 Nov 13, 2023
9b3d4af
register UI has been created
Parmkaur006 Nov 13, 2023
438186c
updated login
Parmkaur006 Nov 13, 2023
272f417
updated
Parmkaur006 Nov 13, 2023
5763d74
created the css for registration form
Parmkaur006 Nov 13, 2023
b2908e0
adding database queries
Parmkaur006 Nov 13, 2023
07ee1eb
Merge pull request #4 from Parmk06:registration
Parmkaur006 Nov 14, 2023
56db894
css added
Parmkaur006 Nov 14, 2023
cfc75e7
registration form has been created
Parmkaur006 Nov 14, 2023
c373da5
database query has been created
Parmkaur006 Nov 14, 2023
cd5f7df
added css styling for registration form
Parmkaur006 Nov 14, 2023
e824ae5
updated registration
Parmkaur006 Nov 14, 2023
a8d3256
updated css-styling for register page
Parmkaur006 Nov 14, 2023
9d299b3
Merge branch 'registration'
Parmkaur006 Nov 14, 2023
59edfcd
Merge branch 'login'
Parmkaur006 Nov 14, 2023
1bad25e
updated index with database query
Parmkaur006 Nov 14, 2023
6aabbc1
styles.css updated
Parmkaur006 Nov 14, 2023
da09046
database query has been created for the index.php
Parmkaur006 Nov 14, 2023
8c4f9b2
password input has been created
Parmkaur006 Nov 14, 2023
c185df3
updated css for logo in index.php
Parmkaur006 Nov 14, 2023
46f1fee
updated style.css
Parmkaur006 Nov 14, 2023
355c2d1
UI created for admin registration
Parmkaur006 Nov 14, 2023
a9d42f7
db query for admin registration
Parmkaur006 Nov 14, 2023
30306f3
updated db query in admin registration
Parmkaur006 Nov 14, 2023
6f1d632
updated admin_registration
Parmkaur006 Nov 14, 2023
bb126df
css styling for admin_registration
Parmkaur006 Nov 14, 2023
3ae8ebe
updated admin_registration page css
Parmkaur006 Nov 14, 2023
43c9a2a
updated registration css styling
Parmkaur006 Nov 14, 2023
c5142aa
registration container width updated
Parmkaur006 Nov 14, 2023
9cb41fa
registration container width updated
Parmkaur006 Nov 14, 2023
c029c42
css added in registration and login
Parmkaur006 Nov 14, 2023
8ddcb42
admin index file created
Parmkaur006 Nov 14, 2023
659fc73
css added for the index admin file
Parmkaur006 Nov 14, 2023
96fca17
third row created for index admin with all buttons
Parmkaur006 Nov 14, 2023
da9592e
footer created for index.php admin page
Parmkaur006 Nov 14, 2023
6764187
session_start method for connecting file
Parmkaur006 Nov 14, 2023
1aa98f0
updated the css of index page-admin side
Parmkaur006 Nov 14, 2023
52786ab
updated index.php with buttons, image and css
Parmkaur006 Nov 14, 2023
56d73bc
db query added in insert categories
Parmkaur006 Nov 14, 2023
d9e16bf
updated db queries
Parmkaur006 Nov 14, 2023
e8c8bdd
Merge pull request #8 from Parmk06:insert-categories
Parmkaur006 Nov 14, 2023
da7e535
insert devices page updated
Parmkaur006 Nov 14, 2023
6422223
Merge branch 'insert-categories'
Parmkaur006 Nov 14, 2023
57b37eb
Merge branch 'logout'
Parmkaur006 Nov 14, 2023
645c676
updated categories insert - admin side
Parmkaur006 Nov 14, 2023
cdfdf7a
updated connection db in connect.php
Parmkaur006 Nov 14, 2023
7c4a537
updated functions folder and file
Parmkaur006 Nov 14, 2023
71e6fb9
updated registration
Parmkaur006 Nov 14, 2023
9deac27
login added to index home page
Parmkaur006 Nov 14, 2023
e931cc6
added the link of cart and contact classes
Parmkaur006 Nov 14, 2023
c6f07f7
updated index,php
Parmkaur006 Nov 14, 2023
3c699ff
calling get_device funtion from functions folder
Parmkaur006 Nov 14, 2023
503c16a
updated insert-category file
Parmkaur006 Nov 14, 2023
38fc300
updated index.php user-side
Parmkaur006 Nov 14, 2023
2ac0e91
function get_products created on the index.php
Parmkaur006 Nov 16, 2023
00fa8b2
updated index.php user-side
Parmkaur006 Nov 16, 2023
758719b
fix errors in function.php
Parmkaur006 Nov 16, 2023
d14ee29
insert products file, db query created
Parmkaur006 Nov 16, 2023
34d4819
fixed getproducts function
Parmkaur006 Nov 16, 2023
3feb977
get_unique_products function updated
Parmkaur006 Nov 16, 2023
f8ecc01
updated insert_product file
Parmkaur006 Nov 16, 2023
11fa33e
updated getcategories fucntion
Parmkaur006 Nov 16, 2023
7800ea8
debug functions file to fix the errors
Parmkaur006 Nov 16, 2023
2e419a8
added image iphone14
Parmkaur006 Nov 16, 2023
3fba6d1
admin login file created and updated with db query
Parmkaur006 Nov 16, 2023
c543a11
error with start session redundancy has fixed
Parmkaur006 Nov 16, 2023
0885117
logoutAdmin file has been initialized
Parmkaur006 Nov 16, 2023
a7d82f4
removed insertdevices file to fix the bugs
Parmkaur006 Nov 17, 2023
6e44fc5
created view categories file
Parmkaur006 Nov 17, 2023
67572e9
include db connection file
Parmkaur006 Nov 17, 2023
d40bf35
added db query to select the categories
Parmkaur006 Nov 17, 2023
cf6ada6
Merge branch 'index'
Parmkaur006 Nov 17, 2023
64a24c2
including search function in functions file
Parmkaur006 Nov 17, 2023
04f68e3
search product method updated
Parmkaur006 Nov 17, 2023
6b87261
styles updated for css
Parmkaur006 Nov 17, 2023
2a874f4
search function called in the searchProduct file
Parmkaur006 Nov 17, 2023
180d292
updated searchproducts file
Parmkaur006 Nov 17, 2023
a91ec4f
added product_images
Parmkaur006 Nov 17, 2023
4591eec
contact.php file updated with db query
Parmkaur006 Nov 17, 2023
1a408da
css updated for contact file
Parmkaur006 Nov 17, 2023
6a0770e
list_users-admin side
Parmkaur006 Nov 17, 2023
6fded84
css added for list_users
Parmkaur006 Nov 17, 2023
e3d807a
debugged contact.php
Parmkaur006 Nov 17, 2023
cd8a81d
fixed getproducts method
Parmkaur006 Nov 17, 2023
675d3c6
viewcontactedusers
Parmkaur006 Nov 20, 2023
9d795b4
css has been added to viewcontactedusers
Parmkaur006 Nov 20, 2023
a9cdc6c
chaanged file name to debug the viewcontactedusers
Parmkaur006 Nov 20, 2023
2dbd23a
cart file has been created
Parmkaur006 Nov 20, 2023
7eb765c
updated cart functions
Parmkaur006 Nov 20, 2023
138e535
added getItAddress fucntion
Parmkaur006 Nov 20, 2023
5ba9578
updated fucntions for cart
Parmkaur006 Nov 20, 2023
e0e3a9b
added db queries and cart function
Parmkaur006 Nov 20, 2023
a0a7916
added cart link to home page
Parmkaur006 Nov 20, 2023
bb0eb71
called cart function toi home page user-side
Parmkaur006 Nov 20, 2023
4169ab1
changed path of cart-file
Parmkaur006 Nov 20, 2023
528ab43
debugged cart file
Parmkaur006 Nov 20, 2023
494a99e
debug the cart issues
Parmkaur006 Nov 20, 2023
3516ed5
removed checkout part for now
Parmkaur006 Nov 20, 2023
810606e
updated cart
Parmkaur006 Nov 20, 2023
e853f18
added quatity in cart total
Parmkaur006 Nov 20, 2023
c83ce72
confirm password added
Parmkaur006 Nov 21, 2023
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
129 changes: 129 additions & 0 deletions administration/admin_registration.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
<?php
include('../includes/connect.php');

if (isset($_POST['register'])) {
$username = $_POST['username'];
$password = $_POST['password'];

// check if username already exist
$checkUsernameQuery = "SELECT * FROM admin_login WHERE username='$username'";
$checkResult = mysqli_query($con, $checkUsernameQuery);

if (mysqli_num_rows($checkResult) == 0) {
$hashedPassword = password_hash($password, PASSWORD_DEFAULT);
$insertAdminQuery = "INSERT INTO admin_login (username, password) VALUES ('$username', '$hashedPassword')";
$insertResult = mysqli_query($con, $insertAdminQuery);

if ($insertResult) {
echo "<script>alert('Admin registration successful. You can now log in.')</script>";
} else {
echo "<script>alert('Admin registration failed. Please try again.')</script>";
}
} else {
echo "<script>alert('Username is already in use. Please choose a different username.')</script>";
}

}
?>
<!DOCTYPE html>
<html lang="en">
<style>
body {
background-color: #ff69b4;
font-family: 'Arial', sans-serif;
background-color: #f4f4f4;
margin: 0;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}

.container {
max-width: 400px;
padding: 90px;
background-color: #fff;
border: 1px solid #ddd;
border-radius: 8px;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
text-align: center;
}

h3 {
color: #007bff;
font-size: 28px;
font-weight: bold;
text-transform: uppercase;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

h2 {
color: #333;
margin-top: 10px;
}

.input-group {
margin-bottom: 20px;
}

.input-group-label {
display: flex;
align-items: center;
background-color: #007bff;
color: #fff;
padding: 8px;
border-top-left-radius: 8px;
border-bottom-left-radius: 8px;
}

.input-group-label i {
margin-right: 10px;
}

.form-control {
width: 100%;
padding: 15px;
font-size: 18px;
border: 1px solid #ddd;
border-radius: 4px;
box-sizing: border-box;
}

.my-button {
background-color: #007bff;
color: #fff;
padding: 12px;
font-size: 18px;
border: none;
border-radius: 4px;
cursor: pointer;
}

.my-button:hover {
background-color: #0056b3;
}
</style>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Registration</title>

</head>
<body>
<div class="container">
<h3 class="text-center">Admin Registration</h3>
<h2 class="text-center">Register as Admin</h2>
<form action="" method="post" class="mb-2">
<div class="input-group">
<label for="username" class="input-group-text"><i class="fa-solid fa-user"></i> Username:</label>
<input type="text" class="form-control" name="username" id="username" placeholder="Enter a username" required>
</div>
<div class="input-group">
<label for="password" class="input-group-text"><i class="fa-solid fa-lock"></i> Password:</label>
<input type="password" class="form-control" name="password" id="password" placeholder="Enter a password" required>
</div>
<button class="my-button" style="font-size: 20px;" name="register">Register</button>
</form>
</div>
</body>
</html>
146 changes: 146 additions & 0 deletions administration/index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
<!-- Connect file -->
<?php

session_start();
if (isset($_GET['logout_admin']) && $_GET['logout_admin'] == 1) {
// Not working
echo "<script>alert('You have been successfully logged out.')</script>";

}


?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Admin Dashboard</title>
<!-- bootstrap css link -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css"
rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN"
crossorigin="anonymous">

<!--font awesome link -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.2/css/all.min.css"
integrity="sha512-z3gLpd7yknf1YoNbCzqRKc4qyor8gaKU1qmn+CShxbuBusANI9QpRohGBreCFkKxLhei6S9CQXFEbbKuqLg0DA=="
crossorigin="anonymous" referrerpolicy="no-referrer" />

<!-- CSS file -->
<link rel="stylesheet" href="../style.css">

<style>
.my-button {
background-color: palevioletred;
margin-right: 15px;
margin-bottom: 15px;
border: none;
padding: 5px;
border-radius: 5px;
display: inline-block;
text-align: center;
}

.my-button a {
text-decoration: none;
color: white;
display: block;
padding: 10px;
}

.admin_image {
width: 80px;
height: 80px;
}

/* Additional styling for navbar and header */
.navbar {
background-color: palevioletred;
padding: 10px;
}

.header {
background-color: #f7f7f7;
text-align: center;
padding: 10px;
color: black;
font-size: 36px;
font-weight: bold;
font-family: 'Arial', sans-serif;
text-transform: uppercase;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}
</style>
</head>
<body>
<!-- navbar -->
<div class="container-fluid p-0">
<!-- First child -->
<nav class="navbar navbar-expand-lg navbar-light bg-secondary">
<div class="container-fluid">

<img src="../images/admin-logo" alt="" class="logo">

<nav class="navbar navbar-expand-lg">

<ul class="navbar-nav">
<li class="nav-item">
<a href="" class="nav-link" style="color: black;">
<B><h5>Welcome!,<?php echo $_SESSION['admin_username']; ?></h5></B>
</a>
</li>
</ul>

</nav>

</div>
</nav>
</div>
<div class="bg-light">
<h3 class="text-center p-2" style="color: black; padding: 5px; font-size: 36px; font-weight: bold; font-family: 'Arial', sans-serif; text-transform: uppercase; text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);">Manage Details</h3>
</div>

<!-- Third Child -->
<div class="row">
<div class="col-md-12 bg-secondary p-1 d-flex align-items-center">
<div class="p-5">
<a href="#"><img src="../images/admin-logo.jpg" alt="" class="admin_image"></a>
<p class="text-light text-center">Admin</p>
</div>

<div class="button text-center">

<button class="my-button" ><a href="insert_product.php" class="nav-link">Insert Products</a></button>

<button class="my-button"><a href="index.php?insert_category" class="nav-link">Insert Categories</a></button>

<button class="my-button"><a href="view_categories.php" class="nav-link">View Categories</a></button>

<button class="my-button"><a href="list_users.php" class="nav-link">List Users</a></button>

<button class="my-button"><a href="view_contacted_users.php" class="nav-link">View Contacted Users</a></button>

<button class="my-button"><a href="logout_admin.php" class="nav-link">Logout</a></button>
</div>
</div>
</div>

<div class="container my-3">
<?php
if(isset($_GET['insert_category'])){
include('insert_categories.php');
}
?>
</div>
<!---footer-->
<div class="bg-secondary p-3 text-right bg-secondary">
<p>© PY-Electronics</p>
</div>

</div>
<!-- bootstrap js link -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" rel="stylesheet"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

</body>
</html>
41 changes: 41 additions & 0 deletions administration/insert_categories.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?php

include('../includes/connect.php');



if(isset($_POST['insert_cat'])){
$category_title=$_POST['cat_title'];

$select_query="Select * from `categories` where category_title='$category_title'";
$result_select=mysqli_query($con,$select_query);
$number=mysqli_num_rows($result_select);
if($number>0){
echo"<script>alert('This category is present inside the database')</script>";
}else{
$insert_query="insert into `categories` (category_title) values ('$category_title')";
$result= mysqli_query($con,$insert_query);
if($result){
echo"<script>alert('Category has been inserted successfully')</script>";
}
}
}
?>

<h2 class="text-center">Insert Categories</h2>


<form action="" method="post" class="mb-2">
<div class="input-group w-90 mb-2">
<span class="input-group-text bg-info" id="basic-addon1"><i
class= "fa-solid fa-receipt"></i></span>
<input type="text" class="form-control" name="cat_title"
placeholder="Insert categories" aria-label="Categories"
aria-describedby="basic-addon1">
</div>

<div class="input-group w-10 mb-2 m-auto">
<input type="submit" class="bg-info border-0 p-2 my-3" name="insert_cat" value="Insert Categories">

</div>
</form>
Loading