-
Notifications
You must be signed in to change notification settings - Fork 0
/
adminhome.php
103 lines (100 loc) · 3.42 KB
/
adminhome.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
<?php
session_start();
include("includes/header.php");
include("includes/conn.php");
if(isset($_GET[prodid]))
{
$dt= date("Y-m-d");
mysqli_query($con,"UPDATE orders SET dispatch_date=$dt,payment=$_GET[balamt], status=Delivered where order_id=$_GET[prodid]");
$resrec = "Order status updated successfully...<br>";
$resrec =$resrec. " <a href=billingreport.php?prodid=$_GET[prodid]&balamt=$_GET[balamt]&advpaid=$_GET[advpaid] target=_blank>Print billing report</a>";
}
?>
<div id="templatemo_main">
<div id="sidebar" class="float_l">
<div class="sidebar_box"><span class="bottom"></span>
<?php
include("sidebar.php");
adminhome();
?>
</div>
</div>
<div id="content" class="float_r">
<h2>Product Orders:</h2>
<p><?php echo $resrec; ?></p>
<table width="682" border="1">
<tr>
<th width="80" scope="col">Order No.</th>
<th width="189" scope="col">Product detail</th>
<th width="100" scope="col">Order date</th>
<th width="228" scope="col">Payment details</th>
<th width="51" scope="col">Status</th>
</tr>
<?php
$dt= date("Y-m-d");
$resorders = mysqli_query($con,"SELECT * FROM orders WHERE dispatch_date = $dt AND status=Pending AND payment >=1");
while($recrows = mysqli_fetch_array($resorders))
{
$resorders1 = mysqli_query($con,"SELECT * FROM products WHERE prod_id = $recrows[prod_id]");
$recrows1 = mysqli_fetch_array($resorders1);
echo " <tr>
<td> $recrows[order_id]</td>
<td>";
$restorders2 = mysqli_query($con,"SELECT * FROM orders where test_id =$recrows[test_id]");
while($recrows2 = mysqli_fetch_array($restorders2))
{
$restorders3 = mysqli_query($con,"SELECT * FROM products where prod_id =$recrows2[prod_id]");
while($recrows3 = mysqli_fetch_array($restorders3))
{
echo " ".$recrows3[name] . "<br>";
}
}
/* Product ID: $recrows1[prod_id]<br>
Name: $recrows1[name]<br>
Product type: $recrows1[product_type]<br>
Sub type: $recrows1[sub_type]<br>
*/
echo "</td>
<td> $recrows[order_date]</td>
<td> Total: Rs. $recrows[total]<br>
Advance paid : Rs. $recrows[payment]<br>";
echo " Balance amount : Rs.". $balamt = $recrows[total]-$recrows[payment];
echo "</td> <td align=center>
$recrows[status]
<a href=adminhome.php?prodid=$recrows[order_id]&balamt=$recrows[total]&advpaid=$recrows[payment]>Delivered</a>
</td></tr>";
}
?>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
</div>
<div class="cleaner"></div>
</div>
<?php
include("includes/footer.php");
?>