-
Notifications
You must be signed in to change notification settings - Fork 0
/
view_invoice.php
118 lines (74 loc) · 1.84 KB
/
view_invoice.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
<div class="col-md-10" style="margin-left: 2%;" >
<?php
include "koneksi.php";
//getnik reserved
$getnik = $_GET['nik'];
$getinvoice = $_GET['invoice'];
$query = "SELECT * FROM pesan WHERE nik='$getnik' AND invoice = $getinvoice";
$sql = mysqli_query($connect,$query);
?>
<div class="box">
<h2 align="center">INVOICE</h2>
<div class="panel panel-default">
<div class="panel-body text-left" style="background-color: #E5E4E2">
</div>
</div>
<?php
$sqlNama = "SELECT * FROM pesan WHERE nik = '$getnik'";
$query = mysqli_query($connect,$sqlNama);
$tmp = mysqli_fetch_array($query);
?>
<br>
<table>
<tr>
<td align="left">NIK : <?php echo $tmp['nik']; ?></td>
</tr>
<tr>
<td align="left">Nama Pemesan : <?php echo $tmp['nama_klien']; ?></td>
</tr>
</table>
<br>
<table class='table table-bordered'>
<thead>
<tr>
<th>No</th>
<th>Tanggal</th>
<th>Kategori</th>
<th>Tarif</th>
</tr>
</thead>
<?php
$no = 1;
$count = mysqli_num_rows($sql);
if($count<1){
echo "<tr><td colspan='9'><center>Data Tidak Ditemukan!</center></td></tr>";
}else{
while($data=mysqli_fetch_array($sql,MYSQLI_BOTH)){
?>
<tr>
<td><?php echo $no++; ?></td>
<td><?php echo $data['tgl']; ?></td>
<td><?php echo $data['kategori']; ?></td>
<td>Rp. <?php echo number_format($data['harga']); ?></td>
</tr>
<?php
}
}
?>
<?php
//sum harga
$sqlSum = "SELECT * FROM pembayaran
WHERE nik = '$getnik'";
$query = mysqli_query($connect,$sqlSum);
$total = mysqli_fetch_array($query);
?>
<tr>
<td>Total Pembayaran (Rp. )</td><td>:</td><td colspan="3">Rp.<?php echo number_format($total['total']); ?></td>
</tr>
</table>
<div class="col-md-8 pul-right">
<a href="cetak.php?&&nik=<?php echo $getnik;?>&&invoice=<?php echo $getinvoice; ?>" target="_blank" class="btn btn-warning">Cetak Invoice</a>
</div>
</div>
</div>
</div>