-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathviewservicebillingreport.php
More file actions
164 lines (149 loc) · 5.15 KB
/
viewservicebillingreport.php
File metadata and controls
164 lines (149 loc) · 5.15 KB
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
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
<?php
session_start();
include("header.php");
include("sidebar.php");
include("dbconnection.php");
$result= mysql_query("select * from service where serviecid='$_POST[serviceid]'");
$row1 = mysql_fetch_array($result);
$result1= mysql_query("select * from customer where custid='$_POST[customerid]'");
$arrrec2= mysql_fetch_array($result1);
$dt = date("Y-m-d");
if($_POST["vehstatus"] == "Completed")
{
$sql ="insert into billing(serviceid,particulars,scost,date,paidstatus) values('$_POST[serviceid]','$_POST[particulars]','$_POST[vehcost]','$dt','$_POST[vehstatus2]')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$insid = mysql_insert_id();
mysql_query("UPDATE service SET status='$_POST[vehstatus]' where serviecid='$_POST[serviceid]'");
}
if($_POST["vehstatus"] == "Cancelled")
{
$sql ="insert into billing(serviceid,particulars,scost,date,paidstatus) values('$_POST[serviceid]','Calncelled','0.00','$dt','Cancelled')";
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
$insid = mysql_insert_id();
mysql_query("UPDATE service SET status='$_POST[vehstatus]' where serviecid='$_POST[serviceid]'");
}
?>
<div id="main">
<a name="TemplateInfo"></a>
<?php
if($ctins == 1)
{
echo "<center><b>Employees account created successfully...</b></center><br>";
echo "<center><b><a href='emplogin.php'>Click here to Login.</a></b></center>";
}
else
{
?>
<form id="form1" name="form1" method="post" action="">
<table width="494" border="1">
<tr>
<th colspan="2" scope="col"><h1>E-Workshop</h1></th>
</tr>
<tr>
<th height="40" scope="col">Bill No. : <?php echo $insid; ?></th>
<th scope="col">Date: <?php echo $dt; ?></th>
</tr>
<tr>
<th width="237" height="45" scope="col">Sevice ID: </th>
<th width="241" scope="col"> <?php echo $_POST[serviceid]; ?></th>
</tr>
<?php
$result1= mysql_query("select * from customer where custid='$row1[custid]'");
$arrrec1= mysql_fetch_array($result1);
?>
<tr>
<th height="44" scope="col">Customer ID : <?php echo $arrrec2[custid]; ?></th>
<th scope="col">Customer name : <?php echo $arrrec2[fname]. " ". $arrrec2[lname]; ?></th>
</tr>
<tr>
<th height="35" scope="col">Vehicle name : <?php echo $row1[vehiclename]; ?></th>
<th scope="col">Vehicle No. : <?php echo $row1[vehicleno]; ?></th>
</tr>
<tr>
<th scope="col">Address</th>
<th scope="col">Address : <?php echo $row1[address]; ?> <br />
City : <?php echo $row1[city]; ?><br />
ZIP code: <?php echo $row1[zipcode]; ?></th>
</tr>
<?php
while($arrrec= mysql_fetch_array($result))
{
$result1= mysql_query("select * from customer where custid='$arrrec[custid]'");
$arrrec1= mysql_fetch_array($result1);
echo" <tr>
<td> $arrrec[serviecid]</td>";
echo "<td> $arrrec1[fname] $arrrec1[lname]</td>
<td> $arrrec[vehiclename]</td>
<td> $arrrec[date]</td>
<td> $arrrec[address]
<br> City: $arrrec[city]
<br> landmark: $arrrec[landmark]
<br> PIN: $arrrec[zipcode]</td>
<td> More | Billing</td>
</tr>";
}
?>
<tr>
<th width="237" height="36" scope="col">Particulars</th>
<th width="241" scope="col"><label for="particulars"></label>
<?php echo
$_POST[particulars]; ?> </th>
</tr>
<?php
$result1= mysql_query("select * from customer where custid='$row1[custid]'");
$arrrec1= mysql_fetch_array($result1);
?>
<tr>
<th height="30" scope="col">Service Cost</th>
<th scope="col"><?php echo
$_POST[vehcost]; ?></th>
</tr>
<tr>
<th height="37" scope="col">Paid status</th>
<th scope="col"> <?php echo
$_POST[vehstatus2]; ?></th>
</tr>
<tr>
<th height="23" scope="col"> </th>
<th scope="col"> </th>
</tr>
<tr>
<th height="37" colspan="2" scope="col">
<input type="button" name="btnpay" id="btnpay" value="Print" onClick="window.print()"> </th>
</tr>
<?php
while($arrrec= mysql_fetch_array($result))
{
$result1= mysql_query("select * from customer where custid='$arrrec[custid]'");
$arrrec1= mysql_fetch_array($result1);
echo" <tr>
<td> $arrrec[serviecid]</td>";
echo "<td> $arrrec1[fname] $arrrec1[lname]</td>
<td> $arrrec[vehiclename]</td>
<td> $arrrec[date]</td>
<td> $arrrec[address]
<br> City: $arrrec[city]
<br> landmark: $arrrec[landmark]
<br> PIN: $arrrec[zipcode]</td>
<td> More | Billing</td>
</tr>";
}
?>
</table>
</form>
<?php
}
?>
<br />
</div>
<!-- wrap ends here -->
</div>
<?php
include("footer.php");
?>