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
<?php

//Menentukan lokasi database
include(ASANOER_FOLDER_PELENGKAP.'koneksi-nya.php');

//Tabel Peminjam
$tb_peminjam = ASANOER_DB_TABEL_PREFIX."peminjam";
?>


            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12">
                        <h1 class="page-header">Daftar Spare Part</h1>
                    </div>
                    <!-- /.col-lg-12 -->
                </div>
                <!-- /.row -->
           <div class="row">
				<div class="col-lg-12">
				<p>Inilah nama-nama dan alamat peminjam / kreditur.</p>
                    <div class="panel panel-primary">
                        <div class="panel-heading">
                            <asanoertambah class="btn btn-success">Peminjam&nbsp;&nbsp;<i class="fa fa-plus"></i></asanoertambah>
                        </div>
                        <!-- /.panel-heading -->
                        <div class="panel-body">
                            <div class="table-responsive">
                                <table class="table">
                                    <thead>
                                        <tr>
                                            <th>Kode</th>
                                            <th>Nama</th>
                                            <th>Alamat</th>
											<th>Telpon</th>
											<th>Aksi</th>
                                        </tr>
                                    </thead>
                                    <tbody>
						<?php			
						$query = "SELECT * FROM $tb_peminjam WHERE td_peminjam='0' order by kd_peminjam ASC";
						if ($result = $xdatabase->query($query)) 
							{
								/* fetch object array */
								while ($crud_asanoer = $result->fetch_array(MYSQLI_ASSOC)) 
									{
										?>
										<tr>
                                            <td><?php echo $crud_asanoer['kd_peminjam']; ?></td>
                                            <td id="<?php echo $crud_asanoer['kd_peminjam']; ?>"><?php echo $crud_asanoer['nm_peminjam']; ?></td>
                                            <td><?php echo $crud_asanoer['amt_peminjam']; ?></td>
											<td><?php echo $crud_asanoer['tlp_peminjam']; ?></td>
											<td>
												<asanoeredit title="Ubah" id="<?php echo addslashes($crud_asanoer['kd_peminjam']); ?>" class="btn btn-primary btn-xs"><i class="fa fa-pencil"></i></asanoeredit>
												<asanoerhapus title="Hapus" id="<?php echo addslashes($crud_asanoer['kd_peminjam']); ?>" class="btn btn-danger btn-xs"><i class="fa fa-trash-o"></i></asanoerhapus>
											</td>
                                        </tr>
										<?php
									}
									/* free result set */
									$result->close();
							}
						?>
									</tbody>
								</table>
                            </div>
                            <!-- /.table-responsive -->
                        </div>
                        <!-- /.panel-body -->
						<div class="panel-footer">
                            <asanoertambah class="btn btn-success">Peminjam&nbsp;&nbsp;<i class="fa fa-plus"></i></asanoertambah>
                        </div>
                    </div>
                    <!-- /.panel -->
                </div>
			</div>	
		</div>

<?php $xdatabase->close(); ?>
<script type="text/javascript">
    $(document).ready(function(){
    	//////////// MODAL JS HANDLING
		$("asanoeredit").click(function(){	
			$("#load-modal").load('<?php echo ASANOER_MAIN_URL.'index-update.html?kd='; ?>'+this.id);
			disabled_all();
		});
		$("asanoerhapus").click(function(){	
			$("#load-modal").load('<?php echo ASANOER_MAIN_URL.'index-delete.html?kd='; ?>'+this.id);
			disabled_all();
		});
		$("asanoertambah").click(function(){	
			$("#load-modal").load('<?php echo ASANOER_MAIN_URL.'index-create.html'; ?>');
			disabled_all();
		});
		$("#asanoertolong").click(function(){	
			$("#load-modal").load('<?php echo ASANOER_MAIN_URL.'help-me.html'; ?>');
			disabled_all();
		});
    });

function disabled_all()
{
	$("asanoeredit").attr('disabled','disabled');
	$("asanoerhapus").attr('disabled','disabled');
	$("asanoertambah").attr('disabled','disabled');
}
</script>