<?php
session_start();
//include "inc/config.php";


include "../../../inc/config.php";

		$requestData= $_REQUEST;

		$client = new nusoap_client($db->get_service_url('soap'), true);
		$proxy = $client->getProxy();
		$token = $db->get_token();
		$url = $db->get_service_url('rest');

		$requestData= $_REQUEST;

		$sSearch = $requestData['search']['value'];


		$iStart = $requestData['start'];
		$iLength = $requestData['length'];

		$temp_limit = $iLength;
		$temp_offset = $iStart?$iStart : 0;

		$filter = '';

		$data_result = array();

		
		$order_by = "";



		$totalData = count($data_result);
		$totalFiltered = $totalData;

		$nipd = $_POST['nipd'];
		$filter_mhs = "trim(nipd)='$nipd'";

			$temp_data = array();
			$i=0;
/*			$temp_total = $proxy->GetCountDeletedRecordset($token,"nilai",$filter_mhs);
			$totalData = $temp_total['result'];
			$totalFiltered = $totalData;*/
			$temp_rec = $proxy->GetDeletedRecordset($token,"nilai_transfer", $filter_mhs,$order_by, '','');

			if ($temp_rec['result']) {
			
			$total = 0;
			foreach ($temp_rec['result'] as $key) {
				$temps = array();
    			$temps[] = "<label class='mt-checkbox mt-checkbox-single mt-checkbox-outline'> <input type='checkbox' class='group-checkable check-selected' data-id='transfer' value='".$key['id_ekuivalensi']."'> <span></span></label>";
				$temps[] = $key['nm_mk_asal'];
				$temps[] = $key['sks_asal'];
				$temps[] = $key['nilai_huruf_asal'];
				$temps[] = $key['fk__nm_mk'];
				$temps[] = $key['sks_diakui'];
				$temps[] = $key['nilai_huruf_diakui']; 
				$temps[] = $key['nilai_angka_diakui'];
				$temp_data[] = $temps;
				$total++;
			}
			$totalData = $total;
			$totalFiltered = $total;

		}
		$temp_output = array(
			'draw' => intval($requestData['draw']),
			'recordsTotal' => intval( $totalData ),
			'recordsFiltered' => intval( $totalFiltered ),
			'data' => $temp_data
		);
	 	echo json_encode($temp_output);
