computerproject
computerproject
INDEX.PHP 2.
.top{ }
text-align: left; }
.heading{ }
align-items: center; } }
.right{ .icons {
margin-top: 10px;
3. 4.
<body>
<div class="top">
</div>
<div class="heading">
<div class="left">
<p>Hey!</p>
<span>
5.
ADDUSER.PHP 6.
<html>
<head>
$sql = "INSERT INTO customers (username,
</head> password, email) VALUES ('$uname', '$password',
'$email')";
<body>
if (mysqli_query($conn,$sql) === TRUE) {
header("Location: http://localhost/project/login.php");
<?php
//record added
$servername = "localhost";
}
$username = "root";
$password = "";
else {
$database = "foodie";
echo "Error: " . $sql . "<br>" . $conn->error;
}
$conn = new mysqli($servername, $username, $password,
$database);
if ($conn->connect_error) { else {
} }
$conn->close();
$uname = $_POST['cusName'];
$password = $_POST['Password'];
$email = $_POST['email'];
</body>
.back-link {
display: inline-block;
9. 10.
.character.hit {
</style>
left: 0;
</head>
animation: hitAnimation 2s infinite;
<body style=" background-color: #1e1e2f;">
}
<div class="error-container">
right: 0;
50% {
transform: translateX(150px);
@keyframes targetReaction {
0%, 100% {
transform: translateX(0);
50% {
}
11.
LOGIN.PHP 12.
<html>
border-radius: 10px;
<head>
box-shadow: 0 0 18px rgba(13, 210, 232, 0.86);
<title> Login</title>
width: 400px;
</head>
}
<style>
.login-form h1 {
*{
margin-bottom: 1.5rem;
margin: 0;
text-align: center;
padding: 0;
color: #fff;
box-sizing: border-box;
}
}
.input-group {
body {
margin-bottom: 1.2rem;
font-family: 'Roboto', sans-serif;
color: #fff;
background-image: url('img/bg1.jpg');
}
background-size: cover;
.input-group label {
background-repeat: no-repeat;
display: block;
display: flex;
margin-bottom: 0.5rem;
flex-direction: column;
font-weight: bold;
justify-content: center;
}
align-items: center;
.input-group input {
height: 100vh;
width: 100%;
}
padding: 0.8rem;
#rname {
border: 1px solid #ddd;
color: #fff;
border-radius: 5px;
text-align: left;
font-size: 1rem;
margin-bottom: 2rem;
}
font-size:50px;
.input-group input:focus {
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.73);
border-color: #4facfe;
}
outline: none;
.login-container {
box-shadow: 0 0 5px rgba(79, 172, 254, 0.5);
background-color:rgba(0, 0, 0, 0.46);
}
padding: 2rem
13. 14.
.login-button {
<body>
width: 100%;
padding: 0.8rem;
<h1 id="rname">FOODIE’S DELIGHT</h1>
background-color: #4facfe;
border: none;
<div class="login-container">
border-radius: 5px;
<form class="login-form" action="menu.php"
color: #fff; method="POST">
</div>
.login-button:hover {
<div class="input-group">
background-color: #008cba;
<label for="password">Password</label>
}
<input type="password" id="password"
.register-text { name="password" placeholder="Enter your password"
text-align: center; required>
font-weight: bold;
} </body>
</html>
.register-text a:hover {
text-decoration: underline;
</style>
15.
SIGNUP.PHP 16.
<html>
border-radius: 5px;
<head> <title>Sign UP</title>
border: 1px solid #ccc;
<style>
font-size: 16px;
body {
}
font-family: Arial, sans-serif;
.form-group textarea {
background-image: URL('img/bg1.jpg');
resize: vertical;
padding: 20px;
height: 100px;
}
}
.form-container {
.form-group input[type="submit"] {
color: #fff; max-width: 400px;
background-color: #4CAF50;
margin: 0 auto; padding: 20px;
color: #fff;
background-color: rgba(0, 0, 0, 0.14);
border: none;
border-radius: 5px;
padding: 10px 20px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
font-size: 16px;
}
border-radius: 5px;
.form-group {
cursor: pointer;
margin-bottom: 20px;
}
margin-right:20px; color: #fff;
#password{
}
width: 100%;
.form-group label {
padding: 10px;
display: block;
border-radius: 5px;
font-weight: bold;
border: 1px solid #ccc;
margin-bottom: 5px;
font-size: 16px;
}
}
.form-group input[type="text"],
#repassword{
.form-group input[type="email"],
width: 100%;
.form-group textarea {
padding: 10px;
width: 100%;
border-radius: 5px;
padding: 10px;
border: 1px solid #ccc;
font-size: 16px;}
18.
17.
border-radius: 10px;
.form-group input[type="submit"]:hover {
box-shadow: 0 0 18px rgba(13, 210, 232, 0.86);
background-color: #45a049;
width: 400px;
}
}
span{
.login-form h1 {
margin-left: 5px;
margin-bottom: 1.5rem;
font-size: 12px;
text-align: center;
color: red;
color: #fff;
}
}
#rname{
.input-group {
color: #fff;
margin-bottom: 1.2rem;
margin-left:500px;
color: #fff;
font-size:50px;
}
font-style:italic;
.input-group label {
text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.73);
display: block;
}
margin-bottom: 0.5rem;
</style>
font-weight: bold;
</head>
}
<body>
.input-group input {
<centre><h1 id="rname">FOODIE’S DELIGHT</h1></centre>
width: 100%;
<div class="form-container">
padding: 0.8rem;
<h2>Create Account</h2>
border: 1px solid #ddd;
border-radius: 5px;
<form action="adduser.php" method="POST">
font-size: 1rem;
<div class="form-group">
}
<label for="cusName" >Username</label>
.input-group input:focus {
<input type="text" id="cusName" name="cusName"
placeholder="Enter Your Username" onkeyup="NameMsg()"> border-color: #4facfe;
<div class="form-group"> }
else{
<input type="email" id="email" name="email"
placeholder="Enter Your Email Address" document.querySelector('#namemsg').innerHTML=""
onkeyup="EmailMsg()" >
}}
<span id="emailmsg"></span>
function EmailMsg(){
</div>
let Email = document.querySelector('#email') .value
<div class="form-group">
if(Email==""){
<label for="password">Password</label>
document.querySelector('#emailmsg').innerHTML="Ple
<input type="password" id="password" name="Password" ase enter Your email address"
placeholder="Enter Your Password"
else if(Email.endsWith(".com")){
onkeyup="PasswordMsg()">
document.querySelector('#emailmsg').innerHTML="" }
<span id="passmsg"></span>
else{
</div>
document.querySelector('#emailmsg').innerHTML="inval
<div class="form-group"> id Email Adress" } }
if(CusName==""){ if(RePassword!==Password){
document.querySelector('#namemsg').innerHTML="Enter document.querySelector('#repassmsg').innerHTML="p
Your Name"} assword didn't match"
else{ document.querySelector('#repassmsg').innerHTM
L="" } }
else if(CusName.length<6){
document.querySelector('#namemsg').innerHTML="Minim
um 6 characters long" }
</script>
21. MENU.PHP 22.
<html>
.menu-item {
<head>
width: 250px;
<title>
background: white;
FOODIE'S DELIGHT – Menu
margin: 15px;
</title>
padding: 15px;
<style>
border-radius: 10px;
body {
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
font-family: Arial, sans-serif;
transition: transform 0.3s, box-shadow 0.3s;
text-align: center;
box-shadow:2px 2px 18px rgba(0, 0, 0, 0.77);
background-image: URL('img/menubg.jpg');
}
background-size: cover;
.menu-item:hover {
background-repeat: no-repeat;
transform: scale(1.05);
}
box-shadow: 4px 4px 15px rgba(0, 0, 0, 0.3);
}
h1 {
.menu-item img {
font-size:45px;
width: 200px;
font-style:bold;
height: 200px;
color: rgb(255, 255, 255);
border-radius: 10px;
text-shadow: 2px 2px 10px rgb(0, 0, 0);
}
padding: 15px;
.stars {
margin: 0;
color: gold;
}
font-size:20px; }
.menu-container {
.quantity-controls {
display: flex;
display: flex;
flex-wrap: wrap;
align-items: center;
justify-content: center;}
justify-content: center;
padding: 20px;
margin-top: 10px;
}
23. 24.
display:flex;
.quantity-controls button {
flex-direction: column;
background: #ff6600;
float: right;
color: white;
}
border: none;
#profilpic{
padding: 5px 10px;
border:1px solid yellow;
cursor: pointer;
background-color:yellow;
font-size: 18px;
height:50px;
border-radius: 5px;
width:50px;
}
border-radius: 50%;
#container{
26.
25.
#productlst{
#clsdtl {
width:400px;
margin: 0;
background-color:rgba(0, 0, 0, 0.77);
float: right;
color:#fff;
border: none;
position:fixed;
background: none;
top:0;
color: red;
right:0;
font-size: 30px;
bottom:0;
cursor: pointer;
z-index: 1000;
padding: 0;
max-height: 46em;
font-weight: bold;
overflow-y: auto;
}
}
.php-style {
#cbtn{
font-family: 'Arial', sans-serif;
height:50px;
font-size: 16px;
width:40%;
margin-bottom: 10px;
color:white;
line-height: 1.5;
font-size:15px;
word-wrap: break-word; }
background:green;
.crt{
border:none;
margin:0 0 0 0;
cursor:pointer;
background:yellow;
}
height:50px;
#purchase{
width:50px;
width:40%;
border-radius:50%;
height:50px;
box-shadow:2px 2px 10px black;
color:white;
}
font-size:15px;
svg{
background:green;
margin-top:5px;
border:none;
cursor:pointer;
cursor:pointer; }
color:black;}
28.
27.
.quantity {
#total{
flex: 1;
color:red;
font-size: 16px;
font-size:18px;
text-align: center;
font-weight:bold;
.cc, .cd, .pa, .cp {
text-shadow:2px 2px 10px black;
background-color: rgb(46, 45, 45);
}
}
#tc{
.vc, .vd, .ff, .br {
color:red;
background-color: rgb(63, 63, 63);
font-size:18px;
}
font-weight:bold;
#logout{
text-shadow:2px 2px 10px black;
font-size:15px !important;
}
font-weight:bold;
.foods div{
height:20px;
margin-left:5px;
width:80px;
margin-right:5px;
color:red;
display: flex;
text-shadow:2px 2px 10px black;
align-items: center;
margin: 0 auto;
padding-bottom: 8px;
cursor:pointer;
padding-top:8px;
}
border-radius: 5px;
</style>
}
</head>
.fname {
<body>
flex: 2;
font-size: 16px;
font-weight: bold;
<?php
}
$servername = "localhost";
.price {
$username = "root";
flex: 1;
$password = "";
font-size: 16px;
$database = "foodie";
text-align: center; }
30.
29.
die("Connection failed:".$conn->connect_error); }
$username = $_POST['username'];
exit; </div>
} <br>
<br> </div>
<br>
31. 32.
</div> </div>
<div class="php-style">
<div class="menu-container">
<p><strong>Price:</strong> Rs.199</p>
<div class="menu-item">
<p class="stars">★★★★★</p>
<img src="img/cc.png" >
<div class="quantity-controls">
<h3>Chicken Chawmin</h3>
<button onclick="updateQuantity('q3', -1)">-
<p><strong>Price:</strong> Rs.149</p> </button>
<div class="quantity-controls">
<div class="menu-item">
<button onclick="updateQuantity('q4', -1)">-
<img src="img/vc.png">
</button>
<h3>Veg Chawmin</h3>
<input type="text" id="q4" value="1" readonly>
<p><strong>Price:</strong> Rs.99</p>
<button onclick="updateQuantity('q4', 1)">
<p class="stars">★★★★☆</p> +</button> </div>
<div class="menu-item">
<h3>Chicken Dumplings</h3>
35. 36.
document.getElementById("dtls").style.display = "none";}
<p class="stars">★★★★☆</p>
//quantity change
<div class="quantity-controls">
function updateQuantity(id, change) {
<button onclick="updateQuantity('q7', -1)">-
</button> let qtyInput = document.getElementById(id);
<input type="text" id="q7" value="1" readonly> let currentValue = parseInt(qtyInput.value);
<button onclick="updateQuantity('q7', 1)">+</button> let newValue = Math.max(1, currentValue +
change);
</div>
qtyInput.value = newValue; }
<button class="cartbtn" onclick="addToCartcp()">
Add to Cart</button>
37. 38.
//ADD TO CART
cp = 599*qnt7; }
var cc = 0, vc = 0, cd = 0, vd = 0, pa = 0, ff = 0, cp = 0, br = 0;
function addToCartbr(){
function addToCartcc(){
var qnt8=
var qnt1= Number(document.getElementById('q1').value); Number(document.getElementById('q8').value);
document.getElementById('cc').innerHTML=qnt1+'x'; document.getElementById('br').innerHTML=qnt8+'x';
cc = 149*qnt1; } br = 499*qnt8; }
document.getElementById('vc').innerHTML=qnt2+'x'; document.getElementById('tc').innerHTML='Rs.'+total+'/-
'; }
vc = 99*qnt2; }
function ShowHide() {
function addToCartcd(){
const productList =
var qnt3= Number(document.getElementById('q3').value); document.querySelector("#productlst");
document.getElementById('cd').innerHTML=qnt3+'x'; if (productList.style.display === "none" ||
cd = 199*qnt3; } productList.style.display === "") {
resetTimer();