-
Notifications
You must be signed in to change notification settings - Fork 0
/
billingreport.php
93 lines (79 loc) · 2.34 KB
/
billingreport.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
<?php
error_reporting(0);
include("includes/conn.php");
$restest=mysqli_query($con,"SELECT * from orders where order_id=$_GET[prodid]");
$retest= mysqli_fetch_array($restest);
$restest=mysqli_query($con,"SELECT * from test where test_id=$retest[2]");
$retest= mysqli_fetch_array($restest);
//echo mysqli_num_rows($restest);
$resapp=mysqli_query($con,"SELECT * from appointment where app_id=$retest[1]");
$retapp= mysqli_fetch_array($resapp);
$respat=mysqli_query($con,"SELECT * from patient where pat_id=$retapp[2]");
$retpat= mysqli_fetch_array($respat);
?>
<html>
<head>
<script>
function printpage()
{
window.print()
}
</script>
</head>
<body onLoad="printpage()">
<table width="639" border="1">
<tr>
<th colspan="3" scope="row"><p>OPTOMATE</p>
<p> </p>
<p> </p></th>
</tr>
<tr>
<th width="191" scope="row">Order No. <?php echo $_GET[prodid]; ?> </th>
<td width="240"> </td>
<td width="186">Date: <?php echo date("Y-m-d"); ?></td>
</tr>
<tr>
<th scope="row"> </th>
<td> </td>
<td> </td>
</tr>
<tr>
<th scope="row">To</th>
<td colspan="2"> <?php echo $retpat[pat_name]; ?></td>
</tr>
<tr>
<th colspan="2" scope="row">Particulars</th>
<td><strong>AMOUNT</strong></td>
</tr>
<?php
$restest=mysqli_query($con,"SELECT * from orders where order_id=$_GET[prodid]");
while($retest= mysqli_fetch_array($restest))
{
//$respr=mysqli_query($con,"SELECT * from products where prod_id=$retest[3]");
//$retpr= mysqli_fetch_array($respr);
$restorders2 = mysqli_query($con,"SELECT * FROM orders where test_id =$retest[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))
{
?>
<tr>
<th colspan="2" scope="row"> <?php echo $recrows3[name];?></th>
<td> <?php echo $recrows3[cost];?></td>
</tr>
<?php
//echo " ".$recrows3[name] . "<br>";
}
}
?>
<?php
}
?>
<tr>
<th colspan="2" scope="row">Total</th>
<td><strong><?php echo $_GET[balamt]; ?></strong></td>
</tr>
</table>
</body>
</html>