-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlist_data.php
More file actions
227 lines (210 loc) · 13.1 KB
/
Copy pathlist_data.php
File metadata and controls
227 lines (210 loc) · 13.1 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
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
<?php
if (isset($_GET['terapkan'])) {
$base_url = 'http://localhost/simkbs/';
include 'app/koneksi.php';
$sql_profil = "SELECT * FROM tabel_control WHERE id=1";
$result_profil = $mysqli->query($sql_profil);
$row_profil = $result_profil->fetch_object();
include 'views/layout/user/header.php';
include 'views/layout/user/navbar.php';
function tgl_indo($tanggal)
{
$bulan = array(
1 => 'Januari',
'Februari',
'Maret',
'April',
'Mei',
'Juni',
'Juli',
'Agustus',
'September',
'Oktober',
'November',
'Desember'
);
$pecahkan = explode('-', $tanggal);
// variabel pecahkan 0 = tanggal
// variabel pecahkan 1 = bulan
// variabel pecahkan 2 = tahun
return $pecahkan[2] . ' ' . $bulan[(int)$pecahkan[1]] . ' ' . $pecahkan[0];
}
if (!empty($_GET['pencarian']) && $_GET['pencarian'] == "rekomendasi" && !empty($_GET['dusun'])) {
?>
<main id="main">
<div class="pt-3" style="min-height: 629px;">
<div class="container">
<div class="row justify-content-center">
<div class="text-center">
<img src="<?= $base_url; ?>asset_user/img/logo-campur.png" alt="logo" width="5%">
<h4>Informasi Rekomendasi Penerima Bantuan</h4>
<?php
$sql_dusun1 = $mysqli->query("SELECT * FROM tabel_dusun WHERE id='{$_GET['dusun']}'");
$row_dusun1 = $sql_dusun1->fetch_assoc();
?>
<small>Dusun <?= $row_dusun1['dusun']; ?></small>
<!-- pencarian -->
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3>
<a href="beranda" class="btn text-light" style="background-color: #042165;">
<span class="fas fa-arrow-alt-circle-left"></span> Kembali</a>
</h3>
<div class="card">
<div class="card-header">
<small class="card-title">Daftar Data Kependudukan</small>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="example1" style="font-size: 14px;">
<thead>
<tr>
<th>No</th>
<th>No. KK</th>
<th>NIK</th>
<th>Nama Kepala Keluarga</th>
<th>Tgl Lahir</th>
<th>Jenis Kelamin</th>
<th>Penghasilan</th>
<th>Dusun</th>
</tr>
</thead>
<tbody>
<?php
$nomor = 1;
$query = $mysqli->query("SELECT * FROM tabel_kependudukan JOIN tabel_konsumsi ON tabel_kependudukan.NIK = tabel_konsumsi.NIK JOIN tabel_pekerjaan ON tabel_pekerjaan.NIK = tabel_kependudukan.NIK JOIN tabel_pendidikan ON tabel_pendidikan.NIK = tabel_kependudukan.NIK JOIN tabel_rumah ON tabel_rumah.NIK = tabel_kependudukan.NIK JOIN tabel_tabungan ON tabel_tabungan.NIK = tabel_kependudukan.NIK WHERE tabel_kependudukan.HBKEL = '1' AND bantuan='0' AND LUAS_LANTAI = '1' AND (JENIS_LANTAI ='Bambu' OR JENIS_LANTAI ='Kayu/Papan') AND (JENIS_DINDING ='Bambu' OR JENIS_DINDING ='Rumbia' OR JENIS_DINDING ='Tembok Tanpa Di Plester') AND FASILITAS_BAB = '0' AND SUMBER_PENERANGAN ='0' AND (SUMBER_AIR_MINUM = 'Sungai' OR SUMBER_AIR_MINUM = 'Mata Air Tidak Terlindung' OR SUMBER_AIR_MINUM = 'Air Hujan') AND (BAHAN_BAKAR_MEMASAK = 'Kayu Bakar' OR BAHAN_BAKAR_MEMASAK = 'Minyak Tanah') AND FREKUENSI_PER_MINGGU <= 1 AND PAKAIAN_PER_TAHUN <= 1 AND MAKAN_PER_HARI <= 2 AND BIAYA_PENGOBATAN = '0' AND PENGHASILAN_PER_BULAN < 600000 AND (PENDIDIKAN_TERAKHIR ='Tidak Tamat SD' OR PENDIDIKAN_TERAKHIR ='Tidak Sekolah' OR PENDIDIKAN_TERAKHIR ='SD dan Sederajat') AND KEPEMILIKAN_TABUNGAN = '0' AND DSN='{$_GET['dusun']}'");
while ($row = $query->fetch_assoc()) {
$sql_dusun = $mysqli->query("SELECT * FROM tabel_dusun WHERE id='$row[DSN]'");
$row_dusun = $sql_dusun->fetch_assoc();
?>
<tr>
<td><?= $nomor++ ?></td>
<td><?= $row['NO_KK'] ?></td>
<td><?= $row['NIK'] ?></td>
<td><?= $row['NAMA_LGKP'] ?></td>
<td><?= tgl_indo($row['TGL_LHR']) ?></td>
<td><?= $row['JK'] == '1' ? 'Laki Laki' : 'Perempuan'; ?></td>
<td>Rp. <?= number_format($row['PENGHASILAN_PER_BULAN']); ?></td>
<td><?= $row_dusun['dusun'] ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<?php
include 'views/layout/user/footer.php';
} else if (!empty($_GET['pencarian']) && $_GET['pencarian'] == "penerima" && !empty($_GET['dusun']) && !empty($_GET['jenis_bantuan'])) {
?>
<main id="main" style="min-height: 629px;">
<div class="pt-3">
<div class="container">
<div class="row justify-content-center">
<div class="text-center">
<img src="<?= $base_url; ?>asset_user/img/logo-campur.png" alt="logo" width="5%">
<h4>Informasi Rekomendasi Penerima Bantuan</h4>
<small>Jenis Bantuan : <?= $_GET['jenis_bantuan']; ?></small><br>
<?php
$sql_dusun1 = $mysqli->query("SELECT * FROM tabel_dusun WHERE id='{$_GET['dusun']}'");
$row_dusun1 = $sql_dusun1->fetch_assoc();
?>
<small>Dusun <?= $row_dusun1['dusun']; ?></small>
<!-- pencarian -->
</div>
</div>
<div class="row">
<div class="col-md-12">
<h3>
<a href="beranda" class="btn text-light" style="background-color: #042165;">
<span class="fas fa-arrow-alt-circle-left"></span> Kembali</a>
</h3>
<div class="card">
<div class="card-header">
<small class="card-title">Daftar Data Kependudukan</small>
</div>
<!-- /.card-header -->
<div class="card-body">
<div class="table-responsive">
<table class="table table-bordered table-striped" id="example1" style="font-size: 14px;">
<thead>
<tr>
<th>No</th>
<th>No. KK</th>
<th>NIK</th>
<th>Nama Kepala Keluarga</th>
<th>Tgl Lahir</th>
<th>Jenis Kelamin</th>
<th>Penghasilan</th>
<th>Jenis Bantuan</th>
<th>Dusun</th>
</tr>
</thead>
<tbody>
<?php
$nomor = 1;
$query = $mysqli->query("SELECT * FROM tabel_kependudukan
JOIN tabel_konsumsi ON tabel_kependudukan.NIK = tabel_konsumsi.NIK
JOIN tabel_pekerjaan ON tabel_pekerjaan.NIK = tabel_kependudukan.NIK
JOIN tabel_pendidikan ON tabel_pendidikan.NIK = tabel_kependudukan.NIK
JOIN tabel_rumah ON tabel_rumah.NIK = tabel_kependudukan.NIK
JOIN tabel_tabungan ON tabel_tabungan.NIK = tabel_kependudukan.NIK
WHERE tabel_kependudukan.HBKEL = '1' AND bantuan='1'
AND DSN='{$_GET['dusun']}' AND jenis_bantuan='{$_GET['jenis_bantuan']}'");
while ($row = $query->fetch_assoc()) {
$sql_dusun = $mysqli->query("SELECT * FROM tabel_dusun WHERE id='$row[DSN]'");
$row_dusun = $sql_dusun->fetch_assoc();
?>
<tr>
<td><?= $nomor++ ?></td>
<td><?= $row['NO_KK'] ?></td>
<td><?= $row['NIK'] ?></td>
<td><?= $row['NAMA_LGKP'] ?></td>
<td><?= tgl_indo($row['TGL_LHR']) ?></td>
<td><?= $row['JK'] == '1' ? 'Laki Laki' : 'Perempuan'; ?></td>
<td>Rp. <?= number_format($row['PENGHASILAN_PER_BULAN']); ?></td>
<td><?= $row['jenis_bantuan']; ?></td>
<td><?= $row_dusun['dusun'] ?></td>
</tr>
<?php
}
?>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</main>
<?php
include 'views/layout/user/footer.php';
} else {
?>
<script>
alert("Masukkan data secara lengkap !'");
document.location.href = 'beranda';
</script>
<?php
}
} else {
?>
<script>
alert("Pilih data terlebih dahulu pada form 'Lihat Daftar Penerima Bantuan'");
document.location.href = 'beranda';
</script>
<?php
}
?>