Advertisement
Guest User

hapus_mahasiswa_view_detail.php

a guest
Mar 21st, 2016
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 8.64 KB | None | 0 0
  1. <?php
  2. include "lib/nusoap/nusoap.php";
  3. ?>
  4.                 <!-- Content Header (Page header) -->
  5.                 <section class="content-header">
  6.                     <h1>
  7.                         Manage Mahasiswa <?php echo $db->fetch_single_row('jurusan','kode_jurusan',$id_jur)->nama_jurusan;?>
  8.                     </h1>
  9.                         <ol class="breadcrumb">
  10.                         <li><a href="<?=base_index();?>"><i class="fa fa-dashboard"></i> Home</a></li>
  11.                         <li><a href="<?=base_index();?>hapus-mahasiswa">Hapus Mahasiswa</a></li>
  12.                         <li class="active">Hapus Mahasiswa List</li>
  13.                     </ol>
  14.                 </section>
  15.  
  16.                 <!-- Main content -->
  17.                 <section class="content">
  18.                     <div class="row">
  19.                         <div class="col-xs-12">
  20.                             <div class="box">
  21.                              
  22.                                 <div class="box-body table-responsive">
  23. <?php
  24.  
  25. $config = $db->fetch_single_row('config_user','id',1);
  26.  
  27. if ($config->live=='Y') {
  28.   $url = 'http://'.$config->url.':'.$config->port.'/ws/live.php?wsdl'; // gunakan live
  29. } else {
  30.   $url = 'http://'.$config->url.':'.$config->port.'/ws/sandbox.php?wsdl'; // gunakan sandbox
  31. }
  32.   $client = new nusoap_client($url, true);
  33.   $proxy = $client->getProxy();
  34.  
  35.  
  36.  
  37.   # MENDAPATKAN TOKEN
  38.  $username = $config->username;
  39.   $password = $config->password;
  40.   $result = $proxy->GetToken($username, $password);
  41.   $token = $result;
  42.  
  43.   $semester = $proxy->GetRecordset($token,"semester", '',"id_smt DESC", '','');
  44.  
  45. ?>
  46.  
  47.  
  48.                                     <table id="dtb_hapus_kelas" class="table table-bordered table-striped">
  49.                                    <thead>
  50.                                      <tr>    
  51.                              <th>Nama</th>              
  52.                           <th>NIM</th>
  53.                           <th>Tanggal Lahir </th>
  54.                           <th>Angkatan</th>
  55.                           <th>Action</th>
  56.                          
  57.                         </tr>
  58.                                       </thead>
  59.                                         <tbody>
  60.                                         </tbody>
  61.                                     </table>
  62.                                                        <div class="row">
  63.         <div class="col-lg-12">
  64.             <div class="pull-right">
  65.                 <button type="button" data-id="<?=$id_jur;?>" data-uri="<?=base_admin();?>modul/hapus_kelas/hapus.php" class="btn btn-danger" id="hapus_massal"><i class="fa fa-recycle"></i> Hapus Data Massal</button>
  66.             </div>
  67.         </div>
  68.         <!-- /.col-lg-12 -->
  69.     </div>
  70.                                 </div><!-- /.box-body -->
  71.                             </div><!-- /.box -->
  72.                         </div>
  73.                     </div>
  74. <div class="modal modal-danger" id="mass_info" data-backdrop="static" data-keyboard="false" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog"> <div class="modal-content"><div class="modal-header"> <h4 class="modal-title">Hapus Data Massal</h4> </div> <div class="modal-body">
  75. <div class="form-group" style="margin-bottom:32px">
  76.                         <label style="padding-top:6px" for="Jurusan" class="control-label col-lg-2">Semester</label>
  77.                         <div class="col-lg-10">
  78.                           <select  name="sem_delete" id="sem_delete"  class="form-control " tabindex="2" required>
  79.                            <?php
  80.                     foreach ($semester['result'] as $isi) {
  81.                   echo "<option value='".$isi['id_smt']."'>".$isi['nm_smt']."</option>";
  82.                } ?>
  83.  
  84.               </select>
  85.                         </div>
  86. <input type="hidden" id="semester_selected">
  87.                       </div><!-- /.form-group -->
  88.  </div> <div class="modal-footer"> <button type="button" id="delete" class="btn btn-danger">Delete</button> <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> </div> </div><!-- /.modal-content --> </div><!-- /.modal-dialog --> </div><!-- /.modal -->
  89.         <?php
  90.        foreach ($db->fetch_all("sys_menu") as $isi) {
  91.                       if ($path_url==$isi->url) {
  92.                           if ($role_act["insert_act"]=="Y") {
  93.                     ?>
  94.           <a href="<?=base_index();?>hapus-kelas/tambah/<?=$id_jur;?>" class="btn btn-primary btn-flat"><i class="fa fa-plus"></i> Tambah</a>
  95.                           <?php
  96.                           }
  97.                        }
  98. }
  99.      
  100.   foreach ($db->fetch_all("sys_menu") as $isi) {
  101.  
  102.   //jika url = url dari table menu
  103.   if ($path_url==$isi->url) {
  104.    if ($role_act["up_act"]=="Y") {
  105.   $edit = '<a href="'.base_index()."hapus-mahasiswa/edit/'+aData[indek]+'".'" class="btn btn-primary btn-flat"><i class="fa fa-pencil"></i></a>';
  106.   } else {
  107.     $edit ="";
  108.   }
  109.   if ($role_act['del_act']=='Y') {
  110.    $del = "<span data-id='+aData[indek]+' data-uri=".base_admin()."modul/hapus_mahasiswa/hapus.php".' class="btn btn-danger hapus_feeder_kelas btn-flat"><i class="fa fa-trash"></i></span>';
  111.   } else {
  112.     $del="";
  113.   }
  114.                    }
  115.   }
  116.  
  117. ?>  
  118.                 </section><!-- /.content -->
  119.         <script type="text/javascript">
  120. $(document).ready(function() {
  121.  
  122.  
  123.  
  124.  
  125.  
  126. var dataTable = $("#dtb_hapus_kelas").dataTable({
  127.            "fnCreatedRow": function( nRow, aData, iDataIndex ) {
  128.             var indek = aData.length-1;          
  129.      $('td:eq('+indek+')', nRow).html('<?=$edit.'&nbsp'.$del;?>');
  130.        $(nRow).attr('id', 'line_'+aData[indek]);
  131.    },
  132.            'bProcessing': true,
  133.             'bServerSide': true,
  134.               "searching": true,
  135.                "ordering": false,
  136.                  "columnDefs": [ {
  137.               "targets": [0,4],
  138.               "orderable": false,
  139.               "searchable": true
  140.  
  141.             } ],
  142.             "ajax":{
  143.               url :"<?=base_admin();?>modul/hapus_mahasiswa/hapus_mahasiswa_data.php",
  144.             type: "post",  // method  , by default get
  145.             data: function ( d ) {
  146.              
  147.                       d.jurusan = "<?=$id_jur;?>";
  148.                   },
  149.           error: function (xhr, error, thrown) {
  150.             console.log(xhr);
  151.               $(".dtb_akm-error").html("");
  152.               $("#dtb_akm").append('<tbody class="dtb_akm-error"><tr><th colspan="9">No data found in the server</th></tr></tbody>');
  153.               $("#dtb_akm_processing").css("display","none");
  154.  
  155.             }
  156.           },
  157.           "language": {
  158.              searchPlaceholder: "Pencarian dengan NIM atau Nama",
  159.           "processing": "<i class=\"fa fa-spinner fa-spin\"></i> Loading data, please wait..." //add a loading image,simply putting <img src="loader.gif" /> tag.
  160.    },
  161.  
  162.         });
  163.  
  164.  
  165.  
  166.  
  167. $("#bulkDelete").on('click',function() { // bulk checked
  168.           var status = this.checked;
  169.           $(".deleteRow").each( function() {
  170.             $(this).prop("checked",status);
  171.           });
  172.         });
  173.  
  174. $('#deleteTriger').on("click", function(event){
  175.           if( $('.deleteRow:checked').length > 0 ){
  176.             event.preventDefault();
  177.  
  178.  
  179.             var ids = [];
  180.             $('.deleteRow').each(function(){
  181.               if($(this).is(':checked')) {
  182.                 ids.push($(this).val());
  183.               }
  184.             });
  185.             var ids_string = ids.toString();
  186.  
  187.  
  188.             $('#ucing')
  189.         .modal({ keyboard: false })
  190.         .one('click', '#delete', function (e) {
  191.  
  192.           $("#loadnya").show();
  193.           $.ajax({
  194.               type: "POST",
  195.               url: "<?=base_admin();?>modul/hapus_mahasiswa/hapus.php?act=del_massal",
  196.               data: {data_ids:ids_string},
  197.                async: true,
  198.               success: function(result) {
  199.                 $("#loadnya").hide();
  200.                 window.location.reload();
  201.               },
  202.               async:true
  203.             });
  204.           $('#ucing').modal('hide');
  205.  
  206.  
  207.  
  208.         });
  209.  
  210.  
  211.           }
  212.         });
  213.  
  214.   $("#sem_filter").change(function(){
  215.     $("#matkul").html('');
  216.     $("#matkul").chosen();
  217.     $("#loadnya").show();
  218.     $("#img_loader").show();
  219.    
  220.       $.ajax({
  221.           url : "<?=base_admin();?>modul/hapus_kelas/matakuliah.php",
  222.           type : "post",
  223.           data : {jurusan : "<?=$id_jur;?>",semester : $(this).val() },
  224.           success : function(data) {
  225.             $("#loadnya").hide();
  226.             $("#img_loader").hide();
  227.               $("#matkul").html(data);
  228.               $("#matkul").trigger('chosen:updated');
  229.  
  230.           }
  231.  
  232.       });
  233.      
  234.   });
  235.  
  236.  
  237. });
  238.  
  239.  
  240.  
  241. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement