<?php include "../../inc/inc.koneksi.php"; include "../../inc/fungsi_koperasi.php"; $noanggota = $_POST['cari']; $sisaangsuran = sisaAngsuran($noanggota); $data['sisa'] = $sisaangsuran; echo json_encode($data); /* if ($sisaangsuran>0){ $data['no'] = $no; echo json_encode($data); }else{ $data['no'] = 'P0001'; echo json_encode($data); } */
$data = mysql_query($query); function myheader($profil, $judul_H) { echo "<div class='profil'>" . $profil . "\n\t\t</div>\n\t\t<br>\n\t\t<div class='header'>\n\t\t <h2>" . $judul_H . "</h2>\n\t\t </div>\n\t\t<table class='grid' >\n\t\t<tr>\n\t\t\t<th width='5%'>No</th>\n\t\t\t<th >Nomor Anggota</th>\n\t\t\t<th >No Identitas</th>\n\t\t\t<th >Nama Anggota</th>\n\t\t\t<th >L/P</th>\n\t\t\t<th >Tempat, Tanggal Lahir</th>\n\t\t\t<th >Alamat</th>\n\t\t\t<th >HP</th>\n\t\t\t<th >Simpanan</th>\n\t\t\t<th >Pinjaman</th>\n\t\t</tr>"; } //echo $query; function myfooter() { echo "</table>"; } $no = 1; $page = 1; while ($r_data = mysql_fetch_array($data)) { $tgllhr = jin_date_str($r_data['tgl_lahir']); $simpanan = simpanan($r_data['noanggota']); $pinjaman = sisaAngsuran($r_data['noanggota']); if ($no % 40 == 1) { if ($no > 1) { myfooter(); echo "<div class=\"pagebreak\" align='right'>\n\t\t<div class='page' align='center'>Hal - {$page}</div>\n\t\t</div>"; $page++; } myheader($profil, $judul_H); } echo "<tr>\n\t\t\t<td align='center'>{$no}</td>\n\t\t\t<td align='center'>{$r_data['noanggota']}</td>\n\t\t\t<td align='center'>{$r_data['noidentitas']}</td>\n\t\t\t<td align='left'>{$r_data['namaanggota']}</td>\n\t\t\t<td align='center'>{$r_data['jk']}</td>\n\t\t\t<td align='left'>{$r_data['tempat_lahir']}, {$tgllhr}</td>\n\t\t\t<td align='left'>{$r_data['alamat']}</td>\n\t\t\t<td align='left'>{$r_data['hp']}</td>\n\t\t\t<td align='right'>" . number_format($simpanan) . "</td>\n\t\t\t<td align='right'>" . number_format($pinjaman) . "</td>\n\t\t\t</tr>"; $no++; } myfooter(); echo "</table>"; //echo "<div class='akhir' align='right'> // Total <b>".number_format($gtotal)."</b>
<?php //cari_anggota include '../../inc/inc_koneksi.php'; include '../../inc/fungsi_tanggal.php'; include '../../inc/fungsi_koperasi.php'; $table = 'anggota'; $id = $_POST['cari']; $q = "SELECT * FROM {$table} WHERE noanggota='{$id}'"; $sql = mysql_query($q); $row = mysql_num_rows($sql); if ($row > 0) { $r = mysql_fetch_array($sql); if ($r['jk'] == 'L') { $sex = 'Laki-laki'; } else { $sex = 'Perempuan'; } $sisaangsuran = sisaAngsuran($r['noanggota']); echo "<table>\n\t\t<tr>\n\t\t\t<td>No Identitas</td>\n\t\t\t<td>: {$r['noidentitas']}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Nama</td>\n\t\t\t<td>: {$r['namaanggota']}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Jenis Kelamin</td>\n\t\t\t<td>: {$sex}</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Tempat, Tgl Lahir</td>\n\t\t\t<td>: " . $r['tempat_lahir'] . ", " . jin_date_sql($r['tgl_lahir']) . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Alamat</td>\n\t\t\t<td>: " . $r['alamat'] . "</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>Sisa Angsuran</td>\n\t\t\t<td>: " . number_format($sisaangsuran) . "</td>\n\t\t</tr>\n\t</table>"; }