-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathreporting.php
111 lines (85 loc) · 5.5 KB
/
reporting.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>SidEx - Courier Management System</title>
</head>
<body>
<?php
$con=mysql_connect("localhost","root","");
if(!$con)
{
die('could not connect'.mysql_error());
}
mysql_select_db("courier",$con);
$sql1="select * from courier_table where `status`='Loaded'";
$sql2="select * from courier_table where `status`='In Transit'";
$sql3="select * from courier_table where `status`='Delivered'";
$sql4="select * from courier_table";
$result1=mysql_query($sql1,$con);
$result2=mysql_query($sql2,$con);
$result3=mysql_query($sql3,$con);
$result4=mysql_query($sql4,$con);
include("report1.php");
if(!$result1)
{
echo "Error!" . "</br>";
include 'report.php';
}
else {
echo "Couriers in 'Loaded' state-->>";echo "</br>";echo "</br>";
echo "<table>";
echo"cid orig dest sname rname radd date rate mode status";
while( $row=mysql_fetch_row($result1))
{
echo "<tr><td>$row[0]</td><td> </td><td>$row[1]</td><td> </td><td>$row[2]</td><td> </td><td>$row[3]</td><td> </td><td>$row[4]</td><td> </td><td>$row[5]</td><td> </td><td>$row[6]</td><td> </td><td>$row[7]</td><td> </td><td>$row[8]</td><td> </td><td>$row[9]</td></tr>";
}
echo "</table>";echo "</br>";echo "</br>";}
//////////////////////
if(!$result2)
{
echo "Error!" . "</br>";
include 'report.php';
}
else {
echo "Couriers in 'In Transit' state-->>";echo "</br>";echo "</br>";
echo "<table>";
echo"cid orig dest sname rname radd date rate mode status";
while( $row=mysql_fetch_row($result2))
{
echo "<tr><td>$row[0]</td><td> </td><td>$row[1]</td><td> </td><td>$row[2]</td><td> </td><td>$row[3]</td><td> </td><td>$row[4]</td><td> </td><td>$row[5]</td><td> </td><td>$row[6]</td><td> </td><td>$row[7]</td><td> </td><td>$row[8]</td><td> </td><td>$row[9]</td></tr>";
}
echo "</table>";echo "</br>";echo "</br>"; }
//////////////////////////////
if(!$result3)
{
echo "Error!" . "</br>";
include 'report.php';
}
else {
echo "Couriers in 'Delivered' state-->>";echo "</br>";echo "</br>";
echo "<table>";
echo"cid orig dest sname rname radd date rate mode status";
while( $row=mysql_fetch_row($result3))
{
echo "<tr><td>$row[0]</td><td> </td><td>$row[1]</td><td> </td><td>$row[2]</td><td> </td><td>$row[3]</td><td> </td><td>$row[4]</td><td> </td><td>$row[5]</td><td> </td><td>$row[6]</td><td> </td><td>$row[7]</td><td> </td><td>$row[8]</td><td> </td><td>$row[9]</td></tr>";
}
echo "</table>";}
/////////////////////
if(!$result4)
{
echo "Error!" . "</br>";
include 'report.php';
}
else {
echo "</br>";echo "</br>";echo "Total Revenue-->> ₹ ";
$sum = 0;
while ($row = mysql_fetch_assoc($result4))
{
$sum += $row['rate'];
}
echo $sum;
echo "</br>";echo "</br>"; }
?>
</body>
</html>