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

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

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

		$temp_limit = $iLength;
		$temp_offset = $iStart?$iStart : 0;
$search_filter = "";
		if ($sSearch!='') {
	$search_filter = "nm_bidang_minat like '%".strtolower($sSearch)."%'";
}

		$data_dics = [
			'act' => 'GetListBidangMinat',
		    'token' => $token,
		    'filter' => "$search_filter",
		    'order' => '',
		    'limit' => $temp_limit,
		    'offset' => $temp_offset

		];

$totalData = 0;
	$totalFiltered =  0;
$temp_data = service_request($data_dics);
if (!empty($temp_data)) {
	$totalData = count($temp_data->data);
	$totalFiltered = count($temp_data->data);
}


		$temp_datas = array();
		$i=0;
		
		if (!empty($temp_data->data)) {
		
		foreach ($temp_data->data as $dt) {
						$temps = array();
					
					 $temps[] = '<div class="input-group">
                <b><input type="text" name="total_tagihan" class="form-control id_dosen" readonly="" value="'.$dt->id_bidang_minat.'">
                </b>
                 <span class="input-group-addon salin copy-btn" title="Klik untuk Copy" data-placement="left">Salin</span>
              </div>';
					$temps[] = $dt->nm_bidang_minat;
					$temps[] = $dt->nama_program_studi;
					$temps[] = $dt->smt_dimulai;
					$temps[] = $dt->sk_bidang_minat;
					$temps[] = $dt->tamat_sk_bidang_minat;
	               
					
				$temp_datas[] = $temps;
			}
		}
			$temp_output = array(
									'draw' => intval($requestData['draw']),
									'recordsTotal' => intval( $totalData ),
									'recordsFiltered' => intval( $totalFiltered ),
									'data' => $temp_datas
				);

			echo json_encode($temp_output);