-
Notifications
You must be signed in to change notification settings - Fork 1
/
print.php
184 lines (148 loc) · 10 KB
/
print.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
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
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
<?php include('./constant/layout/head.php');?>
<?php
include('./constant/connect.php');?>
<div class="">
<div class="container-fluid" style="background-color: #ffffff;">
<?php
$productSql = "SELECT * FROM orders WHERE order_id = '".$_GET['id']."'";
$productData = $connect->query($productSql);
$row = $productData->fetch_array();
$productSql1 = "SELECT * FROM users WHERE user_id= '".$row['user_id']."'";
$productData1 = $connect->query($productSql1);
$row1 = $productData1->fetch_array();
$sql1 = "SELECT * FROM tbl_client
WHERE id = '".$row['client_name']."'";
$result1 = $connect->query($sql1);
$data1 = $result1->fetch_assoc();
?>
<div class="row">
<div class="col-lg-12" >
<div class="card">
<div class="card-title">
<div class="float-left">
<h2 class="mb-0" style="color: black;">Invoice #<?php echo$row['order_id']; ?></h2>
</div>
<div class="float-right">
Date: <?php echo$row['order_date']; ?></div>
</div>
<hr>
<div class="card-body">
<div class="row mb-4">
<div class="col-sm-4 mt-4">
<?php
$que="select * from manage_website";
$query=$connect->query($que);
$web=mysqli_fetch_array($query);
?>
<br>
<image class="profile-img" src="./assets/uploadImage/Logo/<?=$web['invoice_logo']?>" style="height:120px;width:auto;">
</div>
<div class="col-sm-4">
<br>
<h5 class="mb-3" style="color: black;">From:</h5>
<h3 class="text-dark mb-1"><?=$row1['username'];?></h3>
<div><?php echo $web['currency_code']; ?></div>
<!-- <div><?=$result['address']?></div>
--> <div>Email: <?=$row1['email']?></div>
<div>Contact: <?php echo $web['short_title']; ?></div>
</div>
<div class="col-sm-4">
<br>
<h5 class="mb-3" style="color: black;">To:</h5>
<h3 class="text-dark mb-1"><?= $data1['name']; ?></h3>
<div><?= $data1['address']; ?></div>
<!-- <div>Canal Winchester, OH 43110</div>
-->
<div>Phone: <?= $data1['mob_no']; ?></div>
</div>
</div>
<div class="table-responsive-sm">
<table class="table table-striped">
<thead>
<tr>
<th class="center">#</th>
<th>Cyilnder</th>
<th class="right">Unit Cost</th>
<th class="center">Qty</th>
<th class="right">Total</th>
</tr>
</thead>
<tbody>
<?php
$productSql11 = "SELECT * FROM order_item WHERE order_id = '".$_GET['id']."'";
$productData11 = $connect->query($productSql11);
while($row11 = $productData11->fetch_array()){
$productSql2 = "SELECT * FROM product WHERE product_id='".$row11['product_id']."'";
$productData2 = $connect->query($productSql2);
$row2 = $productData2->fetch_array();
$no +=1;
?>
<tr>
<td class="center"><?=$no?></td>
<td class="left strong"><?=$row2['product_name']?></td>
<td class="right"><?=$row11['rate']?></td>
<td class="center"><?=$row11['quantity']?></td>
<td class="right"><?=$row11['total']?></td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
<div class="row">
<div class="col-lg-4 col-sm-5">
</div>
<div class="col-lg-4 col-sm-5 ml-auto">
<table class="table table-clear">
<tbody>
<tr>
<td class="left">
<strong class="text-dark">Subtotal</strong>
</td>
<td class="right"><?=$row['sub_total']?></td>
</tr>
<tr>
<td class="left">
<strong class="text-dark">Discount (<?=$row['discount']?>%)</strong>
</td>
<td class="right"><?php
echo $discount=$row['sub_total']*($row['discount']/100);
?></td>
</tr>
<tr>
<td class="left">
<strong class="text-dark">GST (<?=$row['gst_rate']?>%)</strong>
</td>
<td class="right"><?php
$gst_rate=($row['sub_total']-$discount)*($row['gstn']/100);
echo number_format($gst_rate,2);
?></td>
</tr>
<tr>
<td class="left">
<strong class="text-dark">Total</strong>
</td>
<td class="right">
<strong class="text-dark"><?=$row['grand_total']?></strong>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="card-footer bg-white">
<p class="mb-0">Thank you for your business !</p>
</div>
</div>
<input id ="printbtn" type="button" class="btn btn-success btn-flat m-b-30 m-t-30" value="Print Invoice" onclick="window.print();" >
<input id ="printbtn" type="button" value="Go Back" class="btn btn-danger btn-flat m-b-30 m-t-30" onclick="goBack()" >
</div>
</div>
</div>
</div>
<?php include('./constant/layout/footer.php');?>
<script>
function goBack() {
window.history.back();
}
</script>