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

//read variabel on sky
$kd = "";  
extract($_GET);
$kd_peminjam = $kd;  // read kode

//Including PHP
include(ASANOER_FOLDER_PELENGKAP.'koneksi-nya.php');

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

//Ambil data peminjam
    $qry = "SELECT * FROM $tb_peminjam WHERE kd_peminjam = '$kd_peminjam' AND td_peminjam = '0'";
    $hasil = $xdatabase->query($qry);        
        $crud_asanoer = $hasil->fetch_array(MYSQL_ASSOC); //memecah hasil ke dalam array
        $nm_peminjam = $crud_asanoer['nm_peminjam'];
    $hasil->close();
?>
<div class="modal fade" id="asanoer-modal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog"><div class="modal-content">
<form id="this_form" action="<?php echo ASANOER_MAIN_URL.'index-delete-aksi.proses?kd='.$kd_peminjam;?>" method="post" role="form">
<div class="panel panel-danger">
           <div class="panel-heading">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true" title="TUTUP">X</button>
                    <h4 class="modal-title">Hapus Peminjam</h4>
            </div>
         <div class="panel-body">
               Apakah Anda benar-benar akan menghapus peminjam bernama "<?php echo $nm_peminjam; ?>" dengan kode pelanggan "<?php echo $kd_peminjam; ?>"?
          </div>
          <!-- /.modal-body -->
         <div class="panel-footer">
                        <p class="text-right">
                            <button type="submit" class="btn btn-danger"><i class="fa fa-trash-o"></i> Hapus</button>&nbsp;&nbsp;
                            <button type="button" class="btn btn-primary" data-dismiss="modal"><i class="fa fa-repeat"></i> BATAL</button>
                        </p>    
        </div>
</div>
</form>

<script type="text/javascript">
    $(document).ready(function(){
	///Show Modal
	$("#asanoer-modal").modal({backdrop: 'static'});
    //////////// AJAX JS HANDLING
    $('#this_form').submit(function() {
		//$("#x-pesan").html('<img src="<?php echo ASANOER_MAIN_URL.ASANOER_FOLDER_GBR."load.gif"; ?>" />');
        $.ajax({
            type: 'POST',
            url: $(this).attr('action'),
            data: $(this).serialize(),
            success: function(data) {
				//alert(data);
					if (data == "DELETE OKE") // Tersimpan
					{
						$("#x-respon").html('<div class=\"alert alert-danger alert-dismissable\"><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">TUTUP [x]</button><B>Data Berhasil Didelete</B></div>');
						$("#asanoerload").load('<?php echo ASANOER_MAIN_URL.'index-read.html'; ?>'); // Load ulang modul Read
						$('#asanoer-modal').modal("hide"); // Hide formulir ini.
					}
                }
            })
        return false;
        });
    });
</script>
</div></div>
</div>
<?php $xdatabase->close(); ?>