-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathcetak_disposisi.php
278 lines (267 loc) · 10.3 KB
/
cetak_disposisi.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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
<?php
//cek session
if(empty($_SESSION['admin'])){
$_SESSION['err'] = '<strong>ERROR!</strong> Anda harus login terlebih dahulu.';
header("Location: ./");
die();
} else {
echo '
<style type="text/css">
table {
background: #fff;
padding: 5px;
}
tr, td {
border: table-cell;
border: 1px solid #444;
}
tr,td {
vertical-align: top!important;
}
#right {
border-right: none !important;
}
#left {
border-left: none !important;
}
.isi {
height: 300px!important;
}
.disp {
text-align: center;
padding: 1.5rem 0;
margin-bottom: .5rem;
}
.logodisp {
float: left;
position: relative;
width: 110px;
height: 110px;
margin: 0 0 0 1rem;
}
#lead {
width: auto;
position: relative;
margin: 25px 0 0 75%;
}
.lead {
font-weight: bold;
text-decoration: underline;
margin-bottom: -10px;
}
.tgh {
text-align: center;
}
#nama {
font-size: 2.1rem;
margin-bottom: -1rem;
}
#alamat {
font-size: 16px;
}
.up {
text-transform: uppercase;
margin: 0;
line-height: 2.2rem;
font-size: 1.5rem;
}
.status {
margin: 0;
font-size: 1.3rem;
margin-bottom: .5rem;
}
#lbr {
font-size: 20px;
font-weight: bold;
}
.separator {
border-bottom: 2px solid #616161;
margin: -1.3rem 0 1.5rem;
}
@media print{
body {
font-size: 12px;
color: #212121;
}
nav {
display: none;
}
table {
width: 100%;
font-size: 12px;
color: #212121;
}
tr, td {
border: table-cell;
border: 1px solid #444;
padding: 8px!important;
}
tr,td {
vertical-align: top!important;
}
#lbr {
font-size: 20px;
}
.isi {
height: 200px!important;
}
.tgh {
text-align: center;
}
.disp {
text-align: center;
margin: -.5rem 0;
}
.logodisp {
float: left;
position: relative;
width: 80px;
height: 80px;
margin: .5rem 0 0 .5rem;
}
#lead {
width: auto;
position: relative;
margin: 15px 0 0 75%;
}
.lead {
font-weight: bold;
text-decoration: underline;
margin-bottom: -10px;
}
#nama {
font-size: 20px!important;
font-weight: bold;
text-transform: uppercase;
margin: -10px 0 -20px 0;
}
.up {
font-size: 17px!important;
font-weight: normal;
}
.status {
font-size: 17px!important;
font-weight: normal;
margin-bottom: -.1rem;
}
#alamat {
margin-top: -15px;
font-size: 13px;
}
#lbr {
font-size: 17px;
font-weight: bold;
}
.separator {
border-bottom: 2px solid #616161;
margin: -1rem 0 1rem;
}
}
</style>
<body onload="window.print()">
<!-- Container START -->
<div id="colres">
<div class="disp">';
$query2 = mysqli_query($config, "SELECT institusi, nama, status, alamat, logo FROM tbl_instansi");
list($institusi, $nama, $status, $alamat, $logo) = mysqli_fetch_array($query2);
echo '<img class="logodisp" src="./upload/'.$logo.'"/>';
echo '<h6 class="up">'.$institusi.'</h6>';
echo '<h5 class="up" id="nama">'.$nama.'</h5><br/>';
echo '<h6 class="status">'.$status.'</h6>';
echo '<span id="alamat">'.$alamat.'</span>';
echo '
</div>
<div class="separator"></div>';
$id_surat = mysqli_real_escape_string($config, $_REQUEST['id_surat']);
$query = mysqli_query($config, "SELECT * FROM tbl_surat_masuk WHERE id_surat='$id_surat'");
if(mysqli_num_rows($query) > 0){
$no = 0;
while($row = mysqli_fetch_array($query)){
echo '
<table class="bordered" id="tbl">
<tbody>
<tr>
<td class="tgh" id="lbr" colspan="5">LEMBAR DISPOSISI</td>
</tr>
<tr>
<td id="right" width="18%"><strong>Indeks Berkas</strong></td>
<td id="left" style="border-right: none;" width="57%">: '.$row['indeks'].'</td>
<td id="left" width="25"><strong>Kode</strong> : '.$row['kode'].'</td>
</tr>
<tr><td id="right"><strong>Tanggal Surat</strong></td>
<td id="left" colspan="2">: '.indoDate($row['tgl_surat']).'</td>
</tr>
<tr>
<td id="right"><strong>Nomor Surat</strong></td>
<td id="left" colspan="2">: '.$row['no_surat'].'</td>
</tr>
<tr>
<td id="right"><strong>Asal Surat</strong></td>
<td id="left" colspan="2">: '.$row['asal_surat'].'</td>
</tr>
<tr>
<td id="right"><strong>Isi Ringkas</strong></td>
<td id="left" colspan="2">: '.$row['isi'].'</td>
</tr>
<tr>
<td id="right"><strong>Diterima Tanggal</strong></td>
<td id="left" style="border-right: none;">: '.indoDate($row['tgl_diterima']).'</td>
<td id="left"><strong>No. Agenda</strong> : '.$row['no_agenda'].'</td>
</tr>
<tr>
<td id="right"><strong>Tanggal Penyelesaian</strong></td>
<td id="left" colspan="2">: </td>
</tr>
<tr>';
$query3 = mysqli_query($config, "SELECT * FROM tbl_disposisi JOIN tbl_surat_masuk ON tbl_disposisi.id_surat = tbl_surat_masuk.id_surat WHERE tbl_disposisi.id_surat='$id_surat'");
if(mysqli_num_rows($query3) > 0){
$no = 0;
$row = mysqli_fetch_array($query3);{
echo '
<tr class="isi">
<td colspan="2">
<strong>Isi Disposisi :</strong><br/>'.$row['isi_disposisi'].'
<div style="height: 50px;"></div>
<strong>Batas Waktu</strong> : '.indoDate($row['batas_waktu']).'<br/>
<strong>Sifat</strong> : '.$row['sifat'].'<br/>
<strong>Catatan</strong> :<br/> '.$row['catatan'].'
<div style="height: 25px;"></div>
</td>
<td><strong>Diteruskan Kepada</strong> : <br/>'.$row['tujuan'].'</td>
</tr>';
}
} else {
echo '
<tr class="isi">
<td colspan="2"><strong>Isi Disposisi :</strong>
</td>
<td><strong>Diteruskan Kepada</strong> : </td>
</tr>';
}
} echo '
</tbody>
</table>
<div id="lead">
<p>Kepala Sekolah</p>
<div style="height: 50px;"></div>';
$query = mysqli_query($config, "SELECT kepsek, nip FROM tbl_instansi");
list($kepsek,$nip) = mysqli_fetch_array($query);
if(!empty($kepsek)){
echo '<p class="lead">'.$kepsek.'</p>';
} else {
echo '<p class="lead">H. Riza Fachri, S.Kom.</p>';
}
if(!empty($nip)){
echo '<p>NIP. '.$nip.'</p>';
} else {
echo '<p>NIP. -</p>';
}
echo '
</div>
</div>
<div class="jarak2"></div>
<!-- Container END -->
</body>';
}
}
?>