Skip to content

Commit 21d0a97

Browse files
committed
first commit
1 parent 9285be0 commit 21d0a97

Some content is hidden

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

52 files changed

+2171
-0
lines changed

OLDFOOD.PHP

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
<?php
2+
session_start();
3+
if(!isset($_SESSION[username]))
4+
{
5+
header("Location:index.php");
6+
exit;
7+
}
8+
include("header.php");
9+
include("sql.php");
10+
?>
11+
<html>
12+
<head>
13+
<title>EXISTING FOOD ITEMS</title>
14+
<link href="stylesheets/main.css" media="all" rel="stylesheet" type="text/css" />
15+
</head>
16+
<body>
17+
18+
<h1>EXISTING FOOD ITEMS </h1>
19+
20+
<?php
21+
if(isset($_POST[type]))
22+
{
23+
echo '
24+
<div align="center">
25+
<form action="oldfood.php" method="post" >
26+
SELECT FOOD ITEM:
27+
<select name="name">';
28+
$q="SELECT food_name FROM food_items WHERE food_type='".$_POST[type]."';";
29+
$res=mysql_query($q,$con) OR die('Error in selecting: ' . mysql_error());
30+
while($arr=mysql_fetch_array($res))
31+
{
32+
echo '<option value="'.$arr[0].'">'.$arr[0].'</option>';
33+
}
34+
echo '
35+
</select>
36+
<input type="submit" value="GET INFORMATION"/>
37+
</form>
38+
</div>';
39+
}
40+
else if(isset($_POST[name]))
41+
{
42+
echo '<div align="center">';
43+
$q="SELECT * FROM food_items WHERE food_name='".$_POST[name]."';";
44+
$res=mysql_query($q,$con) OR die('Error in selecting: ' . mysql_error());
45+
while($arr=mysql_fetch_array($res))
46+
{
47+
echo "
48+
<table>
49+
<tr>
50+
<td>FOOD ID : </td>
51+
<td> $arr[0] </td>
52+
</tr>
53+
<tr>
54+
<td>FOOD NAME : </td>
55+
<td> $arr[1] </td>
56+
</tr>
57+
<tr>
58+
<td>FOOD COST : </td>
59+
<td> $arr[2] </td>
60+
</tr>
61+
<tr>
62+
<td>QTY PER SERVING: </td>
63+
<td> $arr[3] </td>
64+
</tr>
65+
<tr>
66+
<td>FOOD TYPE : </td>
67+
<td> $arr[4] </td>
68+
</tr>
69+
</table>";
70+
71+
}
72+
}
73+
else
74+
{
75+
echo '
76+
<div align="center">
77+
<form action="oldfood.php" method="post" onsubmit="return oldfoodvalidate()">
78+
SELECT FOOD TYPE:
79+
<select name="type">';
80+
$q="SELECT DISTINCT food_type FROM food_items";
81+
$res=mysql_query($q,$con) OR die("Error in selecting: " . mysql_error());
82+
while($arr=mysql_fetch_array($res))
83+
{
84+
echo '<option value="'.$arr[0].'">'.$arr[0].'</option>';
85+
}
86+
echo '
87+
</select>
88+
<input type="submit" value="GET INFORMATION"/>
89+
</form>
90+
</div>';
91+
}
92+
?>
93+
94+
95+
96+
<?php mysql_close($con);?>
97+
</body>
98+
</html>

addbill.php

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<?php
2+
$i=1;
3+
include("sql.php");
4+
while($i<=10)
5+
{
6+
$item_id="itemid".$i;
7+
$qty="qty".$i;
8+
if(isset($_POST[$item_id])
9+
{
10+
$q="INSERT INTO bills(bill_id,,cust_address)
11+
VALUES('".$_POST[name]."','".$_POST[ph]."','".$_POST[add]."');";
12+
if (!mysql_query($q,$con))
13+
{
14+
die('Error in updating: ' . mysql_error());
15+
echo '<a href="newcustomer.php">TRY AGAIN</a>';
16+
}
17+
else
18+
{
19+
echo "SUCCESSFULLY ADDED";
20+
echo '<a href="newcustomer.php">ADD ANOTHER CUSTOMER</a>';
21+
}
22+
}
23+
24+
25+
26+
}
27+
mysql_close($con);
28+
29+
?>

addcustomer.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
include("sql.php");
3+
$q="INSERT INTO home_delivery_customers(cust_name,cust_ph,cust_address)
4+
VALUES('".$_POST[name]."','".$_POST[ph]."','".$_POST[add]."');";
5+
if (!mysql_query($q,$con))
6+
{
7+
die('Error in updating: ' . mysql_error());
8+
echo '<a href="newcustomer.php">TRY AGAIN</a>';
9+
}
10+
else
11+
{
12+
echo "SUCCESSFULLY ADDED";
13+
echo '<a href="newcustomer.php">ADD ANOTHER CUSTOMER</a>';
14+
}
15+
mysql_close($con);
16+
?>

addemployee.php

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
<?php
2+
$join_date = $_POST[dd]."-".$_POST[mm]."-".$_POST[yy];
3+
include("sql.php");
4+
$q="INSERT INTO employees(emp_name,emp_sex,joining_date,emp_add,emp_ph,emp_pos)
5+
VALUES('".$_POST[name]."','".$_POST[sex]."','".$join_date."','".$_POST[add]."','".$_POST[ph]."','".$_POST[pos]."');";
6+
if (!mysql_query($q,$con))
7+
{
8+
die('Error in updating: ' . mysql_error());
9+
echo '<a href="newemployee.php">TRY AGAIN</a>';
10+
}
11+
else
12+
{
13+
$q="SELECT max(emp_id) FROM employees";
14+
$res=mysql_query($q,$con) OR die("error");
15+
$arr=mysql_fetch_array($res);
16+
$empid=$arr[0];
17+
18+
if($_POST[pos]=="cook")
19+
{
20+
echo '<div align="center">
21+
<form action="empprocess.php" method="post" onsubmit="return validate()">
22+
COOK SPECIALISATION<input type="text" name="spec" id="spec">
23+
<input type="hidden" name="id" value="'.$empid.'">
24+
<input type="submit" value="SUBMIT">
25+
</form>
26+
</div>';
27+
28+
}
29+
else if($_POST[pos]=="waiter")
30+
{
31+
echo '<div align="center">
32+
<form action="empprocess.php" method="post" onsubmit="return validate()">
33+
TABLE NO<input type="text" name="table" id="table">
34+
<input type="hidden" name="id" value="'.$empid.'">
35+
<input type="submit" value="SUBMIT">
36+
</form>
37+
</div>';
38+
39+
}
40+
else if($_POST[pos]=="delivery person")
41+
{
42+
echo '<div align="center">
43+
<form action="empprocess.php" method="post" onsubmit="return validate()">
44+
<input type="hidden" name="id" value="'.$empid.'">
45+
<input type="submit" value="SUBMIT">
46+
</form>
47+
</div>';
48+
49+
}
50+
else
51+
{
52+
echo "SUCCESSFULLY ADDED";
53+
echo '<a href="newemployee.php">ADD ANOTHER EMPLOYEE</a>';
54+
}
55+
}
56+
mysql_close($con);
57+
?>

addfood.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
include("sql.php");
3+
$q="INSERT INTO food_items(food_name,food_cost,quantity_per_serving,food_type)
4+
VALUES('".$_POST[name]."','".$_POST[cost]."','".$_POST[qty]."','".$_POST[type]."');";
5+
if (!mysql_query($q,$con))
6+
{
7+
die('Error in updating: ' . mysql_error());
8+
echo '<a href="newfood.php">TRY AGAIN</a>';
9+
}
10+
else
11+
{
12+
echo "SUCCESSFULLY ADDED";
13+
echo '<a href="newfood.php">ADD ANOTHER ITEM</a>';
14+
}
15+
mysql_close($con);
16+
?>

addhomedelbill.php

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<?php
2+
session_start();
3+
if(!isset($_SESSION[username]))
4+
{
5+
header("Location:index.php");
6+
exit;
7+
}
8+
?>
9+
<html>
10+
<head>
11+
<link href="stylesheets/main.css" media="all" rel="stylesheet" type="text/css" />
12+
</head>
13+
<body>
14+
<?php
15+
include("header.php");
16+
include("javascript/validate1.php");
17+
?>
18+
<?php
19+
$i=1;
20+
include("sql.php");
21+
$q="INSERT INTO bills(order_type)
22+
VALUES('HOMEDEL')";
23+
if (!mysql_query($q,$con))
24+
{
25+
die('Error in updating: ' . mysql_error());
26+
echo '<a href="resbill.php">TRY AGAIN</a>';
27+
}
28+
$q="SELECT max(bill_id) FROM bills";
29+
$res=mysql_query($q,$con) OR die("error");
30+
$arr=mysql_fetch_array($res);
31+
$billid=$arr[0];
32+
while($i<=10)
33+
{
34+
$item_id="itemid".$i;
35+
$qty="qty".$i;
36+
if(!empty($_POST[$item_id]))
37+
{
38+
$item=(int)$_POST[$item_id];
39+
$q1="SELECT food_cost FROM food_items WHERE food_id=".$item.";";
40+
$res1=mysql_query($q1,$con) OR die('Error in updating: adfad' . mysql_error());
41+
$arr1=mysql_fetch_array($res1);
42+
$amt=$arr1[0] * $_POST[$qty];
43+
$q="INSERT INTO orders(food_id,quantity,amount,bill_id,paid)
44+
VALUES('".$_POST[$item_id]."','".$_POST[$qty]."','".$amt."',".$billid.",'N');";
45+
if(!mysql_query($q,$con))
46+
{
47+
die('Error in updating: ' . mysql_error());
48+
echo '<a href="resbill.php">TRY AGAIN</a>';
49+
}
50+
}
51+
$i++;
52+
}
53+
$q='SELECT * FROM delivery_persons WHERE status="FREE";';
54+
$res=mysql_query($q,$con);
55+
$arr=mysql_fetch_array($res);
56+
57+
echo "DELIVERY PERSON ASSIGNED : ID IS {$arr[0]}";
58+
echo '<a href="billselect.php">ADD ANOTHER BILL</a>';
59+
60+
mysql_close($con);
61+
62+
?>

addinventory.php

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
include("sql.php");
3+
$q="INSERT INTO inventories(item_name,quantity,item_type)
4+
VALUES('".$_POST[name]."','".$_POST[qty]."','".$_POST[type]."');";
5+
if (!mysql_query($q,$con))
6+
{
7+
die('Error in updating: ' . mysql_error());
8+
echo '<a href="newinventory.php">TRY AGAIN</a>';
9+
}
10+
else
11+
{
12+
echo "SUCCESSFULLY ADDED";
13+
echo '<a href="newinventory.php">ADD ANOTHER ITEM</a>';
14+
}
15+
mysql_close($con);
16+
?>

addorder.php

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
<?php
2+
session_start();
3+
if(!isset($_SESSION[username]))
4+
{
5+
header("Location:index.php");
6+
exit;
7+
}
8+
?>
9+
<html>
10+
<head>
11+
<link href="stylesheets/main.css" media="all" rel="stylesheet" type="text/css" />
12+
</head>
13+
<body>
14+
<?php
15+
include("header.php");
16+
include("javascript/validate1.php");
17+
?>
18+
<?php
19+
$i=1;
20+
echo '
21+
<div align="center">
22+
<form id="d" action="addorderprocess.php" method="post" onsubmit="return validate()" >
23+
<input type="hidden" name="billid" value='.$_POST[bid].'>
24+
<table border="1">
25+
<tr>
26+
<th>ITEM ID</th>
27+
<th>QUANTITY</th>
28+
</tr>';
29+
while($i<=10)
30+
{
31+
$item_id="itemid".$i;
32+
$qty="qty".$i;
33+
echo '<tr>
34+
<td> <input type="text" name="'.$item_id.'" value="" id="'.$item_id.'" />
35+
<td> <input type="text" name="'.$qty.'" value="" id="'.$qty.'"/>
36+
</tr>';
37+
$i++;
38+
}
39+
echo '
40+
</table>
41+
<input type="submit" value="SUBMIT"/>
42+
</form>
43+
</div>';
44+
?>
45+
46+
</body>
47+
</html>

0 commit comments

Comments
 (0)