Membangun Web Service PDDIKTI Sederhana (Lanjutan), Insert Mahasiswa Lulus DO

Pada kesempatan ini akan kita bahas bagian paling akhir dari masa studi mahasiswa setelah semua transaksi dilakukan, yaitu transaksi Mahasiswa Lulus Do.
Hal ini adalah langkah terakhir agar status mahasiswa yang tercantum pada laman forlap.ristekditi.go.id  mahasiswa tersebut terstatus lulus atau DO.
Tidak panjang lebar lagi, langsung aja kita menuju TKP.

Unduh template excel untuk Mahasiswa Lulus DO disini

Dan buka file depan.php rubah menjadi seperti kode dibawah ini :


depan.php


<html>
<head>
<title>WS Excel2Feeeder</title>
</head>
<body bgcolor="#005984" leftmargin="150px">
<?php
include "session.php";
//echo "Id Perguruan Tinggi : <strong>".$id_sp."</strong>";
echo "<font color='#FB7D00'> Nama Perguruan Tinggi : <font size='+1.5'><strong>".$nm_lemb."</strong></font></font>";

?>
<table>
<tr>
<td>
<form method="post" enctype="multipart/form-data" action="dictionary.php">
<input name="dictiopnary" type="submit" value="Dictionary" class="styled-tombol-2">
</form>
</td>
<td>
<form method="post" enctype="multipart/form-data" action="logout.php" title="Logout">
<input name="kembali" type="submit" value="Logout" class="styled-tombol-4"/>
</form>
</td>
</tr>
<table>

<table width="98%">
<thead>
<tr>
 <th bgcolor="#FFA6D2" width="50%">Master Data</th>
    <th bgcolor="#FFA6D2" width="50%">Aktifitas Perkuliahan</th>
<tr>
<thead>
<tbody>
<tr>
<td bgcolor="#0097DF">
  <p><strong><font color="#170ED1">Kode Prodi dan kode lain-lain </font></strong> bisa download <a href="temp_excell/kode_prodi.xlsx">disini</a></p>
<fieldset>
  <legend>Form MySql2Feeder</legend>
<p> <strong><font color="#990000">insert mahasiswa</font></strong> dari database : <font color="#000066" size="+2">MySql to Feeder</font></p>
<form method="post" enctype="multipart/form-data" action="mhs_mysql2feeder.php">
<input name="mhs" type="submit" value="MySql2Feeder" class="styled-tombol-1">
</form>
</fieldset>


<fieldset>
  <legend>Form excel</legend>
  <p><strong><font color="#990000">insert Mahasiswa</font></strong>:template excel <a href="temp_excell/inst_mhs.xls">disini</a>
<form method="post" enctype="multipart/form-data" action="insert_mhs.php" >
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-1">
</form></p>

<p> <strong><font color="#990000">insert Matakuliah</font></strong> : template excel <a href="temp_excell/matkul_sample.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="insert_matakuliah.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-1">
</form>

  <!--<legend>Form excell</legend>-->
<p> <strong><font color="#990000">insert Kurikulum</font></strong> : template excel <a href="temp_excell/kurikulum.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="ins_kurikulum.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-1">
</form>

<p> <strong><font color="#990000">insert MK Kurikulum</font></strong> : template excel <a href="temp_excell/mk_kurikulum.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="insert_mk_kurikulum.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-1">
</form>
</fieldset>
<font color="#0000A0"><p> NB : Agar Transaksi import data dari excel to feeder lancar, ada baiknya unduh dahulu tabel kode yang dibutuhkan, dan penuhi data yang akan diimport sesuai contoh isian pada template excel yang di unduh.<br> 
Trimakasih.</p></font>

</td>
<td bgcolor="#FFAD5B">

<fieldset>
<legend>Form excel</legend>
<p> <strong><font color="#990000">insert Kelas Kuliah</font></strong> : template excel <a href="temp_excell/kelas_kuliah.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="insert_kelas_kuliah.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-5"  >
</form>

<p> <strong><font color="#990000">insert Ajar Dosen</font></strong> : template excel <a href="temp_excell/ajar_dosen.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="insert_ajar_dosen.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-5">
</form>

  <p> <strong><font color="#990000">insert KRS MHS</font></strong> : template excel <a href="temp_excell/krs_mhs.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="insert_krs_mhs.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-5">
</form>

  <p> <strong><font color="#990000">insert Nilai MHS</font></strong> : template excel <a href="temp_excell/nilai_mhs.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="insert_nilai_mhs.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-5">
</form>

  <p> <strong><font color="#990000">insert Nilai Transfer</font></strong> : template excel <a href="temp_excell/nilai_transfer_mhs.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="insert_nilai_transfer_mhs.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-5">
</form>

  <p> <strong><font color="#990000">insert Aktifitas Kuliah Mahasiswa</font></strong> : template excel <a href="temp_excell/aktifitas_kuliah_mhs.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="insert_aktifitas_kuliah_mhs.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-5">
</form>

  <p> <strong><font color="#990000">Insert Mahasiswa Lulus DO</font></strong> : template excel <a href="temp_excell/mhs_lulus_do.xls">disini</a></p>
<form method="post" enctype="multipart/form-data" action="mhs_lulus_do.php">
Pilih File Excel :
<input name="fileexcel" type="file" class="styled-tombol-3"> <input name="upload" type="submit" value="Import" class="styled-tombol-5">
</form>
</fieldset>
</td>
</tr>
</tbody>
</table>
</body>
<style type="text/css">
.styled-tombol-1 {
 -webkit-box-shadow:rgba(0,0,0,0.2) 0 1px 0 0;
 -moz-box-shadow:rgba(0,0,0,0.2) 0 1px 0 0;
 box-shadow:rgba(0,0,0,0.2) 0 1px 0 0;
 color:#333;
 background-color:#FA2;
 border-radius:5px;
 -moz-border-radius:5px;
 -webkit-border-radius:5px;
 border:none;
 font-family:'Helvetica Neue',Arial,sans-serif;
 font-size:14px;
 font-weight:700;
 height:30px;
 padding:4px 14px;
 text-shadow:#FE6 0 1px 0
}
.styled-tombol-2 {
 -webkit-box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 -moz-box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 background-color:#005E00;
 border:1px solid #29447E;
 font-family:'Lucida Grande',Tahoma,Verdana,Arial,sans-serif;
 font-size:12px;
 font-weight:700;
 padding:2px 6px;
 height:28px;
 color:#fff;
 border-radius:5px;
 -moz-border-radius:5px;
 -webkit-border-radius:5px
}
 .styled-tombol-3 {
 -webkit-box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 -moz-box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 background-color:#5B74A8;
 border:1px solid #29447E;
 font-family:'Lucida Grande',Tahoma,Verdana,Arial,sans-serif;
 font-size:12px;
 font-weight:700;
 padding:2px 6px;
 height:28px;
 color:#fff;
 border-radius:5px;
 -moz-border-radius:5px;
 -webkit-border-radius:5px
}
 .styled-tombol-4 {
 -webkit-box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 -moz-box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 box-shadow:rgba(0,0,0,0.0.1) 0 1px 0 0;
 background-color:#D20000;
 border:1px solid #29447E;
 font-family:'Lucida Grande',Tahoma,Verdana,Arial,sans-serif;
 font-size:12px;
 font-weight:700;
 padding:2px 6px;
 height:28px;
 color:#fff;
 border-radius:5px;
 -moz-border-radius:5px;
 -webkit-border-radius:5px
}
 .styled-tombol-5 {
-webkit-box-shadow:rgba(0,0,0,0.2) 0 1px 0 0;
 -moz-box-shadow:rgba(0,0,0,0.2) 0 1px 0 0;
 box-shadow:rgba(0,0,0,0.2) 0 1px 0 0;
 color:#fff;
 background-color:#008080;
 border-radius:5px;
 -moz-border-radius:5px;
 -webkit-border-radius:5px;
 border:none;
 font-family:'Helvetica Neue',Arial,sans-serif;
 font-size:14px;
 font-weight:700;
 height:30px;
 padding:4px 14px;
 text-shadow:#000 0 1px 0;
}
body {
 font-family:Arial, Helvetica, sans-serif;
 font-size:12px;
}
p {
 font-family:Tahoma, Geneva, sans-serif;
 font-size:14px;
}
</style>


Dari file depan.php diatas dirubah tampilannya menjadi sedikit indah, dengan menyertakan sentuhan CSS yang sudah dipaljari sebelum-sebelumnnya sehingga tampilan halaman depan.php menjadi seperti gambar berikut :


sedangkan skrip import mahasiswa Lulus DO seperti kode dibawah ini :


mhs_lulus_do.php


<?php
include 'session.php';
include "excel_reader2.php";
@$data = new Spreadsheet_Excel_Reader($_FILES['fileexcel']['tmp_name']);
@$hasildata = $data->rowcount($sheet_index=0);
$sukses = 0;
$gagal = 0;

for ($i=3; $i<=$hasildata; $i++)
 {
   $status='1';
   $tglls=$data->val($i,3);
   $ket='LULUS';
   //$sk_yud=$row['sk_yudisiu'];
   $jdl_skripsi=$data->val($i,11);
   $no_ijazah=$data->val($i,8);
   $bln_awal_bim=$data->val($i,9);
   $bln_akhir_bim=$data->val($i,10);
   $ipk=$data->val($i,7);
   $nim=$data->val($i,1);
   $nipd="nipd LIKE '%$nim%'";
   //echo "nipd = $nipd";
   $result=$proxy->GetRecord($gettoken,'mahasiswa_pt',$nipd);
   $coba=$result['result'];
   $id_reg_pd=$coba['id_reg_pd'];
   //echo "id reg pd = $id_reg_pd";
   
   $record['id_reg_pd'] = $id_reg_pd;
   $record['id_jns_keluar'] = $status;
   $record['tgl_keluar'] = $tglls;
   $record['ket'] = $ket;
   $record['tgl_sk_yudisium'] = $tglls;
   $record['judul_skripsi'] = $jdl_skripsi;
   $record['ipk'] = $ipk;
   $record['no_seri_ijazah'] = $no_ijazah;
   $record['bulan_awal_bimbingan'] = $bln_awal_bim;
   $record['bulan_akhir_bimbingan'] = $bln_akhir_bim;
   
   $records[]=$record;
 }

   for($i=0;$i<1;$i++){
    foreach($records as $baris){
    //echo $baris['id_reg_pd']."-".$baris['nipd']."-".$tglls."-".$jdl_skripsi."<br>";
    $key=array('id_reg_pd'=>$baris['id_reg_pd']);
    $data=array('id_jns_keluar'=>$baris['id_jns_keluar'],
       'tgl_keluar'=>$baris['tgl_keluar'],
        'ket'=>$baris['ket'],
     'tgl_sk_yudisium'=>$baris['tgl_sk_yudisium'],
       'jalur_skripsi'=>1,    
       'judul_skripsi'=>$baris['judul_skripsi'],
        'ipk'=>$baris['ipk'],
      'no_seri_ijazah'=>$baris['no_seri_ijazah'],
         'bulan_awal_bimbingan'=>$baris['bulan_awal_bimbingan'],
        'bulan_akhir_bimbingan'=>$baris['bulan_akhir_bimbingan']);
     
    $rubahs[]=array('key'=>$key,'data'=>$data);
    //echo "update =$rubahs";
    if ($hasildata) $sukses++;
     else $gagal++;

    } // end foreach
    $je_updt=json_encode($rubahs);
    
    //print_r($je_updt);
    $result=$proxy->UpdateRecordset($gettoken,'mahasiswa_pt',$je_updt);
    //var_dump($result);
    
   } // end for
    
  echo "<b>Update data selesai.</b> <br>";
  echo "Data yang berhasil diupdate : " . $sukses .  "<br>";
  echo "Data yang gagal diupdate : ".$gagal .  "<br>";
  echo "kembali ke <a href='depan.php'>depan</a>";
?>

Demikian pembahasan untuk modul mahasiswa lulus do, semoga ada dari temen-temen yang bermaksud mengembangkan skrip yang sudah di bahas, dan semoga bisa berguna bagi kita semuanya.
Salam koding, selamat belajar dan salam smangat...
Chayoooo....
Thx.
Previous
Next Post »