-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcetak.php
More file actions
139 lines (101 loc) · 3.29 KB
/
cetak.php
File metadata and controls
139 lines (101 loc) · 3.29 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
<?php
// ganti ke lokasi dimana anda install mpdf dari composer
//require "/Users/dendybsulistyo/vendor/autoload.php";
require "vendor/autoload.php";
//$mpdf = new \Mpdf\Mpdf();
$mpdf = new \Mpdf\Mpdf(['orientation' => 'L']);
// awal html
$html ="
<head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8' />
<title>Editable Invoice</title>
<link rel='stylesheet' type='text/css' href='css/style.css' />
<link rel='stylesheet' type='text/css' href='css/print.css' media=print />
<script type='text/javascript' src='js/jquery-1.3.2.min.js'></script>
<script type='text/javascript' src='js/example.js'></script>
</head>
<body>
<div id=page-wrap>
<textarea id=header>INVOICE</textarea>
<div id=identity>
<div id=logo>
<div id=logohelp>
<input id=imageloc type=text size=50 value= /><br />
(max width: 540px, max height: 100px)
</div>
<h1>Codeigniter Indonesia</h1>
</div>
</div>
<div style='clear:both'></div>
<div id=customer>
<textarea id=customer-title>Faktur</textarea>
<table id=meta>
<tr>
<td class=meta-head>Nomer #</td>
<td><textarea>000123</textarea></td>
</tr>
<tr>
<td class=meta-head>Tanggal</td>
<td><textarea id=date>December 15, 2009</textarea></td>
</tr>
<tr>
<td class=meta-head>Total </td>
<td><div class=due>Rp.875.00</div></td>
</tr>
</table>
</div>
<table id=items>
<tr>
<th>Item</th>
<th>Description</th>
<th>Unit Cost</th>
<th>Quantity</th>
<th>Price</th>
</tr>
<tr class=item-row>
<td class=item-name><div class=delete-wpr>Web Updates<a class=delete href=javascript:; title='Remove row'>X</a></div></td>
<td class=description>Monthly web updates for http://widgetcorp.com (Nov. 1 - Nov. 30, 2009)</td>
<td>Rp.650.00</td>
<td>1</td>
<td><span class=price>Rp.650.00</span></td>
</tr>
<tr class=item-row>
<td class=item-name><div class=delete-wpr>SSL Renewals<a class=delete href=javascript:; title='Remove row'>X</a></div></td>
<td class=description>Yearly renewals of SSL certificates on main domain and several subdomains</td>
<td>Rp.75.00</td>
<td>3</td>
<td><span class=price>Rp.225.00</span></td>
</tr>
<tr>
<td colspan=2 class=blank> </td>
<td colspan=2 class=total-line>Subtotal</td>
<td class=total-value><div id=subtotal>Rp.875.00</div></td>
</tr>
<tr>
<td colspan=2 class=blank> </td>
<td colspan=2 class=total-line>Total</td>
<td class=total-value><div id=total>Rp.875.00</div></td>
</tr>
<tr>
<td colspan=2 class=blank> </td>
<td colspan=2 class=total-line>Amount Paid</td>
<td class=total-value><textarea id=paid>Rp.0.00</textarea></td>
</tr>
<tr>
<td colspan=2 class=blank> </td>
<td colspan=2 class='total-line balance'>Balance Due</td>
<td class='total-value balance'><div class=due>Rp.875.00</div></td>
</tr>
</table>
<div id=terms>
<h5>http://agmsoftware.id</h5>
</div>
</div>
</body>
</html>
";
// akhir html
$mpdf->WriteHTML($html);
//kalau mau pake password, tinggal diaktifkan
//$mpdf->SetProtection(array(), 'UserPassword', 'ContohPassword');
$mpdf->Output();