Skip to content

Commit 61fbb84

Browse files
Food Delivery
1 parent c7aa5f4 commit 61fbb84

File tree

308 files changed

+11672
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

308 files changed

+11672
-0
lines changed

Admin/Add_Product.php

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
<?php
2+
require_once 'admin_header.php';
3+
require_once 'Controllers/ProductController.php';
4+
require_once 'Controllers/CategoryController.php';
5+
$categories = getAllCategories();
6+
7+
session_start();
8+
if($_SESSION["loggeduser"]==null)
9+
{
10+
header("Location: login.php");
11+
}
12+
?>
13+
14+
<script src="js/Add_Product.js"></script>
15+
<script src="js/delete_message.js"></script>
16+
<div class="form">
17+
18+
<h1 align="center">Add product</h1>
19+
<hr>
20+
<br>
21+
22+
<form action="" onsubmit="return validate()" method="post" enctype="multipart/form-data">
23+
<h5><?php echo $err_db; ?></h5>
24+
<table align="center">
25+
<tr>
26+
<td>Product name</td>
27+
<td>: <input id="product_name" type="text" name="product_name" value="<?php echo $name;?>" ><br>
28+
<span id="pdctnameErr" style="color:red;"><?php echo $pdctnameErr;?></span></td>
29+
</tr>
30+
31+
<tr>
32+
<td> Category </td>
33+
<td>: <input id="c_id" type="text" name="c_id" value="<?php echo $c_id;?>" ><br>
34+
<span id="catnameErr" style="color:red;"><?php echo $catnameErr;?></span></td>
35+
</tr>
36+
37+
38+
<tr>
39+
<td> Price </td>
40+
<td>: <input id="product_price" type="text" name="product_price" value="<?php echo $price;?>" ><br>
41+
<span id="pdctpriceErr" style="color:red;"><?php echo $pdctpriceErr;?></span></td>
42+
</tr>
43+
44+
45+
<tr>
46+
47+
48+
49+
<td >Code</td>
50+
<td>: <textarea id="product_code" name="product_code"><?php echo $code;?></textarea>
51+
<br><span id="pdctcodeErr" style="color:red;"><?php echo $pdctcodeErr;?></span>
52+
</td>
53+
</tr>
54+
55+
56+
57+
<tr>
58+
<td>Image</td>
59+
<td>: <input id="img" type="file" name="img" value="<?php echo $p_image;?>" ><br>
60+
<span id="err_p_image" style="color:red;"><?php echo $err_p_image;?></span></td>
61+
</tr>
62+
63+
64+
<tr>
65+
<td></td>
66+
<td align="center"><input type="submit" name="add_product" value="Add Product" ></td>
67+
</tr>
68+
69+
70+
</table>
71+
72+
73+
</form>
74+
75+
</div>
76+

Admin/All_Product.php

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<?php include 'admin_header.php';
2+
require_once 'controllers/ProductController.php';
3+
$products = getProducts();
4+
?>
5+
<!--All Products starts -->
6+
7+
<div class="center">
8+
<h3 class="text">All Products</h3>
9+
<input type="text" class="form-control" onkeyup="searchProduct(this)" placeholder="Search...">
10+
<div id="suggesstion"></div>
11+
<table class="table table-striped">
12+
<thead>
13+
<th>Sl#</th>
14+
15+
<th> Name</th>
16+
<th>Category </th>
17+
<th> Price</th>
18+
19+
20+
<th>Code</th>
21+
<th>Image</th>
22+
</thead>
23+
<tbody>
24+
<?php
25+
$i=1;
26+
foreach($products as $p){
27+
echo "<tr>";
28+
echo "<td>$i</td>";
29+
30+
echo "<td>".$p["product_name"]."</td>";
31+
echo "<td>".$p["c_name"]."</td>";
32+
echo "<td>".$p["product_price"]."</td>";
33+
echo "<td>".$p["product_code"]."</td>";
34+
echo "<td><img width='80px' height='100px' src='".$p["img"]."'></td>";
35+
36+
37+
echo '<td><a href="edit_product.php?id='.$p["id"].'" class="btn btn-success">Edit</a></td>';
38+
echo '<td><a href="Delete_Product.php?id='.$p["id"].'" class="btn btn-danger">Delete</a></td>';
39+
echo "</tr>";
40+
$i++;
41+
}
42+
?>
43+
44+
</tbody>
45+
</table>
46+
</div>
47+
<script src="js/products.js"></script>
48+
<!--Products ends -->
49+
<?php include 'admin_footer.php';?>

Admin/Delete_Product.php

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<?php include 'admin_header.php';
2+
include 'controllers/ProductController.php';
3+
include 'controllers/CategoryController.php';
4+
$categories = getAllCategories();
5+
$id = $_GET["id"]; //get hyperlink
6+
$c = getProduct($id);
7+
?>
8+
<!--edit category starts -->
9+
10+
11+
12+
<div class="center">
13+
<h5 class="text-danger"><?php echo $err_db;?></h5>
14+
<form action="" method="post" enctype="multipart/form-data" class="form-horizontal form-material">
15+
<div class="form-group">
16+
<h4 style="color: red;" >Are you sure to Delete?</h4>
17+
<input type="hidden" name="id" value="<?php echo $c["id"];?>">
18+
<input type="text" name="product_name" value="<?php echo $c["product_name"];?>" class="form-control" disabled>
19+
<input type="text" name="c_id" value="<?php echo $c["c_id"];?>" class="form-control" disabled>
20+
<input type="text" name="product_price" value="<?php echo $c["product_price"];?>" class="form-control" disabled>
21+
<input type="text" name="product_code" value="<?php echo $c["product_code"];?>" class="form-control" disabled>
22+
</div>
23+
24+
<div class="form-group text-center">
25+
26+
<input type="submit" name="delete_product" class="btn btn-danger" value="Delete Food" &tab;>
27+
28+
<a href="all_food.php"> Cancel</a>
29+
</div>
30+
</form>
31+
</div>
32+
33+
<?php require_once 'admin_footer.php';?>

Admin/add_employee.php

Lines changed: 137 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,137 @@
1+
2+
<?php
3+
require_once 'admin_header.php';
4+
require_once 'controllers/employeeController.php';
5+
// require_once 'controllers/LoginController.php';
6+
session_start();
7+
if($_SESSION["loggeduser"]==null)
8+
{
9+
header("Location: login.php");
10+
}
11+
12+
?>
13+
14+
<!DOCTYPE html>
15+
<html>
16+
<head>
17+
<title>Product form</title>
18+
<!-- <link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.4.1/css/all.css" integrity="sha384-5sAR7xN1Nv6T6+dT2mhtzEpVJvfS3NScPQTrOxhwjIuvcA67KV2R5Jz6kr4abQsz" crossorigin="anonymous">-->
19+
<!--<link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700" rel="stylesheet">-->
20+
<style>
21+
html, body {
22+
min-height: 100%;
23+
padding: 0;
24+
margin: 0;
25+
font-family: Roboto, Arial, sans-serif;
26+
font-size: 14px;
27+
color: #666;
28+
}
29+
h1 {
30+
margin: 0 0 20px;
31+
font-weight: 400;
32+
color: #1c87c9;
33+
}
34+
p {
35+
margin: 0 0 5px;
36+
}
37+
.main-block {
38+
display: flex;
39+
flex-direction: column;
40+
justify-content: center;
41+
align-items: center;
42+
min-height: 100vh;
43+
background: #1c87c9;
44+
}
45+
form {
46+
padding: 25px;
47+
margin: 25px;
48+
box-shadow: 0 2px 5px #f5f5f5;
49+
background: #f5f5f5;
50+
}
51+
.fas {
52+
margin: 25px 10px 0;
53+
font-size: 72px;
54+
color: #fff;
55+
}
56+
.fa-envelope {
57+
transform: rotate(-20deg);
58+
}
59+
.fa-at , .fa-mail-bulk{
60+
transform: rotate(10deg);
61+
}
62+
input, textarea {
63+
width: calc(100% - 18px);
64+
padding: 8px;
65+
margin-bottom: 20px;
66+
border: 1px solid #1c87c9;
67+
outline: none;
68+
}
69+
input::placeholder {
70+
color: #666;
71+
}
72+
button {
73+
width: 100%;
74+
padding: 10px;
75+
border: none;
76+
background: #1c87c9;
77+
font-size: 16px;
78+
font-weight: 400;
79+
color: #fff;
80+
}
81+
button:hover {
82+
background: #2371a0;
83+
}
84+
@media (min-width: 568px) {
85+
.main-block {
86+
flex-direction: row;
87+
}
88+
.left-part, form {
89+
width: 50%;
90+
}
91+
.fa-envelope {
92+
margin-top: 0;
93+
margin-left: 20%;
94+
}
95+
.fa-at {
96+
margin-top: -10%;
97+
margin-left: 65%;
98+
}
99+
.fa-mail-bulk {
100+
margin-top: 2%;
101+
margin-left: 28%;
102+
}
103+
}
104+
</style>
105+
</head>
106+
<body>
107+
<div class="main-block">
108+
<div class="left-part">
109+
<i class="fas fa-envelope"></i>
110+
<i class="fas fa-at"></i>
111+
<i class="fas fa-mail-bulk"></i>
112+
</div>
113+
<form action="" method="post" enctype="multipart/form-data" class="form-horizontal form-material">
114+
<h1>Contact Us</h1>
115+
<div class="info">
116+
117+
<input type="text" name="f_name" placeholder="first name">
118+
<input type="text" name="l_name" placeholder="last Name">
119+
<input type="text" name="username" placeholder="username">
120+
<input type="password" name="password" placeholder="password">
121+
<input type="email" name="email" placeholder="email">
122+
<input type="text" name="phone" placeholder="phone">
123+
<input type="radio" value="Male" name="gender" >Male<input type="radio" value="Female" name="gender">Female
124+
<input type="radio" value="Employee" name="role" >Employee<input type="radio" value="Delivery Man" name="role">Delivery Man
125+
<input type="text" name="salary" placeholder="salary">
126+
<input type="file" name="u_image">
127+
128+
</div>
129+
130+
<button type="submit"name="add_employee" value="Add Employee" class="btn btn-success">Submit</button>
131+
</form>
132+
</div>
133+
</body>
134+
</html>
135+
136+
137+
<?php require_once 'admin_footer.php';?>

Admin/add_food.php

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?php
2+
require_once 'admin_header.php';
3+
require_once 'Controllers/allProductController.php';
4+
require_once 'Controllers/CategoryController.php';
5+
$categories = getAllCategories();
6+
7+
?>
8+
9+
<script src="js/product_validation.js"></script>
10+
<div class="form">
11+
12+
<h1 align="center">Add product</h1>
13+
<hr>
14+
<br>
15+
<form action="" onsubmit="return validate()" method="post" enctype="multipart/form-data">
16+
<h5><?php echo $err_db; ?></h5>
17+
<table align="center">
18+
<tr>
19+
<td>Product name</td>
20+
<td>: <input id="product_name" type="text" name="product_name" value="<?php echo $name;?>" ><br>
21+
<span id="pdctnameErr" style="color:red;"><?php echo $pdctnameErr;?></span></td>
22+
</tr>
23+
24+
<tr>
25+
<td> Category </td>
26+
<td>: <input id="c_id" type="text" name="c_id" value="<?php echo $c_id;?>" ><br>
27+
<span id="catnameErr" style="color:red;"><?php echo $catnameErr;?></span></td>
28+
</tr>
29+
30+
31+
<tr>
32+
<td> Price </td>
33+
<td>: <input id="product_price" type="text" name="product_price" value="<?php echo $price;?>" ><br>
34+
<span id="pdctpriceErr" style="color:red;"><?php echo $pdctpriceErr;?></span></td>
35+
</tr>
36+
37+
38+
<tr>
39+
40+
41+
42+
<td >Code</td>
43+
<td>: <textarea id="product_code" name="product_code"><?php echo $code;?></textarea>
44+
<br><span id="pdctcodeErr" style="color:red;"><?php echo $pdctcodeErr;?></span>
45+
</td>
46+
</tr>
47+
48+
49+
50+
<tr>
51+
<td>Image</td>
52+
<td>: <input id="img" type="file" name="img" value="<?php echo $p_image;?>" ><br>
53+
<span id="err_p_image" style="color:red;"><?php echo $err_p_image;?></span></td>
54+
</tr>
55+
56+
57+
<tr>
58+
<td></td>
59+
<td align="center"><input type="submit" name="add_product" value="Add Product" ></td>
60+
</tr>
61+
62+
63+
</table>
64+
65+
66+
</form>
67+
68+
</div>
69+

0 commit comments

Comments
 (0)