Canteen Management System
Canteen Management System
7
Fig. 8
Fig. 9
Fig. 10
Fig. 11
Fig. 12
Fig. 13
Fig. 14
Fig. 15
Fig. 16
Fig. 17
Fig. 18
Code of the Project
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>The Perfect Food at Your Door!</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Bree+Serif&display=swap"
rel="stylesheet">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
</head>
<body>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="js/loaders.js"></script>
<script src="js/ajax.js"></script>
</body>
</html>
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>About!</title>
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Bree+Serif&display=swap"
rel="stylesheet">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
</head>
<body>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<!-- Compiled and minified JavaScript -->
<script
src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.min.js"></sc
ript>
<script src="js/loaders.js"></script>
<script src="js/ajax.js"></script>
</body>
</html>
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>RestroGirls - Categories!</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Bree+Serif&display=swap"
rel="stylesheet">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
</head>
<body>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="js/loaders.js"></script>
<script src="js/ajax.js"></script>
</body>
</html>
<?php
session_start();
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Categories!</title>
<link href="https://fonts.googleapis.com/icon?family=Material+Icons"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Pacifico&display=swap"
rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Bree+Serif&display=swap"
rel="stylesheet">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.min.css">
</head>
<body>
<script
src="https://code.jquery.com/jquery-3.4.1.min.js"
integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo="
crossorigin="anonymous"></script>
<script src="js/loaders.js"></script>
<script src="js/ajax.js"></script>
</body>
</html>
-- phpMyAdmin SQL Dump
-- version 4.8.0
-- https://www.phpmyadmin.net/
--
-- Host: 127.0.0.1
-- Generation Time: Sep 03, 2019 at 09:15 PM
-- Server version: 10.1.31-MariaDB
-- PHP Version: 7.2.4
--
-- Database: `mishtidb`
--
-- --------------------------------------------------------
--
-- Table structure for table `admin`
--
--
-- Dumping data for table `admin`
--
-- --------------------------------------------------------
--
-- Table structure for table `categories`
--
--
-- Dumping data for table `categories`
--
-- --------------------------------------------------------
--
-- Table structure for table `food`
--
--
-- Dumping data for table `food`
--
-- --------------------------------------------------------
--
-- Table structure for table `orders`
--
--
-- Dumping data for table `orders`
--
--
-- Table structure for table `users`
--
--
-- Dumping data for table `users`
--
--
-- Indexes for dumped tables
--
--
-- Indexes for table `admin`
--
ALTER TABLE `admin`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `categories`
--
ALTER TABLE `categories`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `food`
--
ALTER TABLE `food`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `orders`
--
ALTER TABLE `orders`
ADD PRIMARY KEY (`id`);
--
-- Indexes for table `users`
--
ALTER TABLE `users`
ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT for dumped tables
--
--
-- AUTO_INCREMENT for table `admin`
--
ALTER TABLE `admin`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
--
-- AUTO_INCREMENT for table `categories`
--
ALTER TABLE `categories`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `food`
--
ALTER TABLE `food`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=12;
--
-- AUTO_INCREMENT for table `orders`
--
ALTER TABLE `orders`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;
COMMIT;
<div class="section">
<h3>Add Categories</h3>
</div>
<?php
if (isset($_SESSION['msg'])) {
echo '<div class="row" style="background: red; color: white;">
<div class="col s12">
<h6>'.$_SESSION['msg'].'</h6>
</div>
</div>';
unset($_SESSION['msg']);
}
?>
<div class="row">
<div class="col s6" style="">
<div class="input-field">
<input id="name" name="name" type="text" class="validate"
style="color: white; width: 70%">
<label for="name" style="color: white;"><b>Category Name
:</b></label>
</div>
</div>
<div class="col s6" style="">
<div class="input-field">
<input id="short_desc" name="short_desc" type="text"
class="validate" style="color: white; width: 70%">
<label for="short_desc" style="color: white;"><b>Short
Description :</b></label>
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<div class="input-field">
<input id="long_desc" name="long_desc" type="text" class="validate"
style="color: white; width: 70%">
<label for="long_desc" style="color: white;"><b>Long Description
:</b></label>
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<div class="section right" style="padding: 15px 10px;">
<a href="category-list.php" class="waves-effect waves-light
btn">Dismiss</a>
</div>
<div class="section right" style="padding: 15px 20px;">
<button type="submit" class="waves-effect waves-light btn">Add
New</button>
</div>
</div>
</div>
</form>
</div>
</div>
<?php
require('../backends/connection-pdo.php');
$query = $pdoconn->prepare($sql);
$query->execute();
$arr_all = $query->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="section white-text" style="background: #B35458;">
<div class="section">
<h3>Categories</h3>
</div>
<?php
if (isset($_SESSION['msg'])) {
echo '<div class="section center" style="margin: 5px 35px;"><div class="row"
style="background: red; color: white;">
<div class="col s12">
<h6>'.$_SESSION['msg'].'</h6>
</div>
</div></div>';
unset($_SESSION['msg']);
}
?>
<tbody>
<?php
?>
<tr>
<td><?php echo $key['name']; ?></td>
<td><?php echo $key['short_desc']; ?></td>
<td><?php echo $key['long_desc']; ?></td>
<td><a href="../backends/admin/cat-delete.php?id=<?php echo $key['id'];
?>"><span class="new badge" data-badge-caption="">Delete</span></a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
<?php
if (isset($_SESSION['msg'])) {
echo '<div class="section white-text" style="background:
#B35458;">'.$_SESSION['msg'].'</div>';
unset($_SESSION['msg']);
}
?>
<h4>Dashboard</h4>
</div>
</div>
</div>
<?php
require('../backends/connection-pdo.php');
$query = $pdoconn->prepare($sql);
$query->execute();
$arr_all = $query->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="section">
<h3>Add Food Item</h3>
</div>
<?php
if (isset($_SESSION['msg'])) {
echo '<div class="row" style="background: red; color: white;">
<div class="col s12">
<h6>'.$_SESSION['msg'].'</h6>
</div>
</div>';
unset($_SESSION['msg']);
}
?>
<div class="row">
<div class="col s6" style="">
<div class="input-field">
<input id="name" name="name" type="text" class="validate"
style="color: white; width: 70%">
<label for="name" style="color: white;"><b>Food Name
:</b></label>
</div>
</div>
<div class="col s6" style="">
<div class="input-field" style="color: white !important;
width: 90%">
<select name='category'>
<?php
<div class="row">
<div class="col s12">
<div class="input-field">
<input id="desc" name="desc" type="text" class="validate" style="color:
white; width: 70%">
<label for="desc" style="color: white;"><b>Description :</b></label>
</div>
</div>
</div>
<div class="row">
<div class="col s12">
<div class="section right" style="padding: 15px 10px;">
<a href="food-list.php" class="waves-effect waves-light
btn">Dismiss</a>
</div>
<div class="section right" style="padding: 15px 20px;">
<button type="submit" class="waves-effect waves-light btn">Add
New</button>
</div>
</div>
</div>
</form>
</div>
</div>
<?php
require('../backends/connection-pdo.php');
$query = $pdoconn->prepare($sql);
$query->execute();
$arr_all = $query->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="section">
<h3>Foods</h3>
</div>
<?php
if (isset($_SESSION['msg'])) {
echo '<div class="section center" style="margin: 5px 35px;"><div class="row"
style="background: red; color: white;">
<div class="col s12">
<h6>'.$_SESSION['msg'].'</h6>
</div>
</div></div>';
unset($_SESSION['msg']);
}
?>
<tbody>
<?php
?>
<tr>
<td><?php echo $key['fname']; ?></td>
<td><?php echo $key['description']; ?></td>
<td><?php echo $key['name']; ?></td>
<td><a href="../backends/admin/food-delete.php?id=<?php echo $key['id'];
?>"><span class="new badge" data-badge-caption="">Delete</span></a></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link rel="stylesheet" href="../css/form-style.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/css/materialize.css">
<title>Document</title>
</head>
<body>
<div class="container">
<div class="container">
<div class="container">
<div class="card horizontal hoverable">
<div class="card-stacked">
<form class="card-content" action="login-admin.php"
method="post">
<h4 class="header">Admin Login</h4>
<?php
if(!empty($msg_error)){
echo '<div class="row error-msg">
<div class="col">
<b>'.$msg_error.'</b>
</div>
</div>';
}
?>
<div class="row">
<div class="input-field col s12">
<span for="email"><b>Email</b></span>
<input name="email" id="email"
type="email" class="validate">
</div>
</div>
<div class="row">
<div class="input-field col s12">
<span for="email"><b>Password</b></span>
<input id="password" name="password"
type="password" class="validate">
</div>
</div>
<div class="row">
<div class="col s12">
<button type="submit" class="waves-
effect waves-light btn"><b>Log In</b></button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0/js/materialize.js">
</script>
</body>
</html>
<?php
include_once("../backends/connection-pdo.php");
if (!isset($_POST['email']) || !isset($_POST['password'])) {
header('location: index.php');
exit();
}
$email=$_POST['email'];
$password=$_POST['password'];
$query = $pdoconn->prepare($sql);
$query->execute();
$arr_login=$query->fetchAll(PDO::FETCH_ASSOC);
if (count($arr_login) > 0) {
foreach($arr_login as $val)
{
$tmp_name= $val['name'];
session_start();
$_SESSION['username']=$tmp_name;
$_SESSION['msg']="You have successfully Logged In!";
header('location: dashboard.php');
} else {
session_start();
$_SESSION['msg']="Invalid Credentials!";
header('location: index.php');
}
?>
<?php require('layout/header.php'); ?>
<?php require('layout/left-sidebar-long.php'); ?>
<?php require('layout/topnav.php'); ?>
<?php require('layout/left-sidebar-short.php'); ?>
<?php
require('../backends/connection-pdo.php');
$query = $pdoconn->prepare($sql);
$query->execute();
$arr_all = $query->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="section">
<h3>Orders</h3>
</div>
<?php
if (isset($_SESSION['msg'])) {
echo '<div class="section center" style="margin: 5px 35px;"><div class="row"
style="background: red; color: white;">
<div class="col s12">
<h6>'.$_SESSION['msg'].'</h6>
</div>
</div></div>';
unset($_SESSION['msg']);
}
?>
<tbody>
<?php
?>
<tr>
<td><?php echo $key['order_id']; ?></td>
<td><?php echo $key['user_name']; ?></td>
<td><?php echo $key['fname']; ?></td>
<td><?php echo $key['timestamp']; ?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>