-
Notifications
You must be signed in to change notification settings - Fork 0
/
info-umkm.php
327 lines (307 loc) · 17.4 KB
/
info-umkm.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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
<?php session_start(); ?>
<script src="pages/inc/slideshow/jquery.resize.js"></script>
<script src="pages/inc/slideshow/jquery.waitforimages.min.js"></script>
<script src="pages/inc/slideshow/modernizr.js"></script>
<script src="pages/inc/slideshow/jquery.carousel-3d.js"></script>
<link rel="stylesheet" href="pages/inc/slideshow/jquery.carousel-3d.default.css">
<?php
include ("inc/koneksi.php");
$id=$_GET['id'];
$querysearch = "SELECT M.msme_building_id, M.name_of_msme_building, J.name_of_type AS type, M.owner_name,
M.contact_person, M.number_of_employee, M.monthly_income, M.building_area, M.land_area,
M.parking_area, M.standing_year, T.name_of_type AS constr, M.electricity_capacity, M.address,
B.name_of_model FROM msme_building AS M
LEFT JOIN type_of_construction AS T ON M.type_of_construction=T.type_id
LEFT JOIN type_of_msme AS J ON M.type_of_msme=J.type_id
LEFT JOIN building_model AS B ON M.model_id=B.model_id
WHERE M.msme_building_id='$id'
";
$hasil = pg_query($querysearch);
while ($row = pg_fetch_array($hasil)) {
$nama = $row['name_of_msme_building'];
$bang = $row['building_area'];
$lahan = $row['land_area'];
$parkir = $row['parking_area'];
$tahun = $row['standing_year'];
$listrik = $row['electricity_capacity'];
$alamat = $row['address'];
$konstruksi = $row['constr'];
$jenis = $row['type'];
$id_k = $row['type_of_construction'];
$id_m = $row['type_of_msme'];
$pemilik = $row['owner_name'];
$pegawai = $row['number_of_employee'];
$penghasilan = $row['monthly_income'];
$kontak = $row['contact_person'];
$model = $row['name_of_model'];
}
function tampilfoto(){
$id=$_GET['id'];
$sql = pg_query("SELECT photo_url, upload_date FROM msme_building_gallery WHERE msme_building_id='$id'
");
$cek = pg_num_rows($sql);
$n=0;$foto;$tglfoto;
while ($row = pg_fetch_assoc($sql)) {
$foto[$n]=$row['photo_url'];
$tglfoto[$n]=$row['upload_date'];
$n++;
}
$server='foto/umkm/';
echo '<div id="foto1"><div data-carousel-3d>';
if ($cek<1) {
echo '
<div style="min-width: 320px; min-height: 213px; max-height: 700px; max-height: 500px; text-align-last: center; vertical-align: middle; display: table-cell;">
<img src="foto/umkm.png" />
<a class="icon-container" style="background-color: #d8dbff" href="#">
<span class="ti-na"></span><span class="icon-name">No Image Available</span>
</a>
</div>
<div style="min-width: 320px; min-height: 213px; max-height: 700px; max-height: 500px; text-align-last: center; vertical-align: middle; display: table-cell;">
<img src="foto/umkm.png" />
<a class="icon-container" style="background-color: #d8dbff" href="#">
<span class="ti-na"></span><span class="icon-name">No Image Available</span>
</a>
</div>
';
}
else{
$i=0;
while($i<$n){
echo'
<div style="min-width: 320px; min-height: 213px; max-height: 700px; max-height: 500px; text-align-last: center; vertical-align: middle; display: table-cell;">
<img src="'.$server.$foto[$i].'" />
<label>Uploaded: '.$tglfoto[$i].'</label>
<a class="icon-container" style="background-color: #d8dbff" href="'.$server.$foto[$i].'" target="_blank">
<span class="ti-zoom-in"></span><span class="icon-name">Fullscreen</span>
</a>
</div>';
$i++;
}
}
if ($n==1) {
echo '
<div style="min-width: 320px; min-height: 213px; max-height: 700px; max-height: 500px; text-align-last: center; vertical-align: middle; display: table-cell;">
<img src="'.$server.$foto[$i-1].'" />
<label>Uploaded: '.$tglfoto[$i-1].'</label>
<a class="icon-container" style="background-color: #d8dbff" href="'.$server.$foto[$i-1].'" target="_blank">
<span class="ti-zoom-in"></span><span class="icon-name">Fullscreen</span>
</a>
</div>';
}
echo '</div></div>';
echo "Total Photo: ".$cek;
}
?>
<div class="main-content-inner">
<div class="row">
<div class="col-lg-4">
<div class="card">
<div class="card-body">
<div class="media">
<div class="media-body">
<h6>ID:
<?php echo $id ?>
</h6>
<br />
<table style="width: 100%;">
<tr>
<td>Nama </td>
<td>:</td>
<td>
<?php echo $nama ?>
</td>
</tr>
<tr>
<td>Type of MSME</td>
<td>:</td>
<td>
<?php echo $jenis; ?>
</td>
</tr>
<tr>
<td>Owner Name</td>
<td>:</td>
<td>
<?php echo $pemilik; ?>
</td>
</tr>
<tr>
<td>Contact Person</td>
<td>:</td>
<td>
<?php echo $kontak; ?>
</td>
</tr>
<tr>
<td>Number of Employee</td>
<td>:</td>
<td>
<?php echo $pegawai; ?>
</td>
</tr>
<?php
if(isset($_SESSION['username'])) {
echo '
<tr>
<td>Monthly Income</td>
<td>:</td>
<td>Rp.
'.number_format($penghasilan).'
</td>
</tr>';
}
?>
<tr>
<td>Building Size </td>
<td>:</td>
<td>
<?php echo $bang; ?> m<sup>2</sup>
</td>
</tr>
<tr>
<td>Land Area </td>
<td>:</td>
<td>
<?php echo $lahan; ?> m<sup>2</sup>
</td>
</tr>
<tr>
<td>Parking Area </td>
<td>:</td>
<td>
<?php echo $parkir; ?> m<sup>2</sup>
</td>
</tr>
<tr>
<td>Standing Year </td>
<td>:</td>
<td>
<?php echo $tahun ?>
</td>
</tr>
<tr>
<td>Construction Type </td>
<td>:</td>
<td>
<?php echo $konstruksi; ?>
</td>
</tr>
<tr>
<td>Electricity Capacity </td>
<td>:</td>
<td>
<?php echo $listrik; ?> kWh
</td>
</tr>
<tr>
<td>Address </td>
<td>:</td>
<td>
<?php echo $alamat; ?>
</td>
</tr>
<tr>
<td>Building Model: </td>
<td>:</td>
<td>
<?php echo $model; ?>
</td>
</tr>
</table>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-5">
<div class="card">
<div class="card-body">
<div class="media">
<div class="media-body">
<h5 class="mb-3">Photo
<!-- <button id="ukuranpenuh" class="btn btn-warning btn-sm" title="show all images in full screen">
<i class="ti-fullscreen"></i>
</button> -->
</h5>
<?php tampilfoto() ?>
</div>
</div>
</div>
</div>
</div>
<div class="col-lg-3">
<div class="card">
<div class="card-body">
<div class="media">
<div class="media-body">
<h5 class="mb-3">Facility</h5>
<table width="100%" class="table-striped table-bordered table-hover">
<thead style="text-align: center;">
<th>Name of Facility</th>
<th>Qty</th>
</thead>
<tbody>
<?php
$sql=pg_query("SELECT D.msme_building_id, D.facility_id, D.quantity_of_facilities, F.name_of_facility
FROM detail_msme_building_facilities AS D
LEFT JOIN msme_building_facilities AS F ON F.facility_id=D.facility_id
WHERE D.msme_building_id = '$id'
");
if (pg_num_rows($sql)>0) {
while ($data=pg_fetch_assoc($sql)) {
$id_fas=$data['facility_id'];
$namafas =$data['name_of_facility'];
$qty = $data['quantity_of_facilities'];
echo "<tr>";
echo "<td>".$namafas."</td>";
echo "<td>".$qty."</td>";
echo "</tr>";
}
}
else {
echo '</tbody><td colspan="2"><center>No facility data</center></td>';
}
?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div> <!-- SAMPAI DISINI BATAS ROW-->
<div class="modal fade bd-example-modal-lg modal-xl" id="ukuranpenuhhhh">
<div class="modal-dialog modal-lg modal-xl">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Foto</h5>
<button type="button" class="close" data-dismiss="modal"><span>×</span></button>
</div>
<div class="modal-body">
<?php tampilfoto() ?>
</div>
</div>
</div>
</div>
<!-- main content area end -->
<!-- footer area start-->
<script type="text/javascript">
function reset () {
$("#toggleCSS").attr("href", "assets/alertify/themes/alertify.default.css");
alertify.set({
labels : {
ok : "OK",
cancel : "Cancel"
},
delay : 5000,
buttonReverse : false,
buttonFocus : "ok"
});
}
// $("#ukuranpenuh").on( 'click', function () {
// reset();
// alertify.alert('<div id="foto2" style="width: 700px"></div>');
// $("#foto1").clone().prependTo("#foto2");
// return false;
// });
</script>