<?php
include "../../inc/config.php";
  $token = get_token();




switch ($_GET["act"]) {
  case 'delete_all':

  $filter_nim = "id_smt='".$_POST['sem']."'";

  $data_kuliah = $proxy->GetRecordset($token,'kuliah_mahasiswa', $filter_nim,$order,$limit,$offset);

    foreach ($data_kuliah['result'] as $dt) {
       $hapus[] = array(
          'id_smt' => $dt['id_smt'],
          'id_reg_pd'=>$dt['id_reg_pd']
          );
    
     }

        $temp_res = $proxy->DeleteRecordset($token, 'kuliah_mahasiswa', json_encode($hapus));

    break;
  case "delete":
  $id_transfer = $_GET["id"];
          $data_param = array(
                    'act' => 'DeleteNilaiTransferPendidikanMahasiswa',
                    'token' => $token,
                    'key' => array('id_transfer' => $id_transfer)
                );
          $hapus_nilai_trf = service_request($data_param);
          dump($hapus_nilai_trf);
  break;

  case 'del_massal':
     $data_ids = $_REQUEST['data_ids'];
    $data_id_array = explode(",", $data_ids);
    if(!empty($data_id_array)) {

      foreach($data_id_array as $id_transfer) {
          $data_param = array(
                    'act' => 'DeleteNilaiTransferPendidikanMahasiswa',
                    'token' => $token,
                    'key' => array('id_transfer' => $id_transfer)
                );
          $hapus_nilai_trf = service_request($data_param);
          dump($hapus_nilai_trf);
      }

    }
    break;

}