load->library('session'); $this->load->library('rhlib'); require_once(APPPATH.'libraries/nusoap/nusoap.php'); //includes nusoap require_once(APPPATH.'libraries/nusoap/class.wsdlcache.php'); //includes nusoap $this->client = new nusoap_client($this->url, true); $this->proxy = $this->client->getProxy(); set_time_limit(0); } function _get_token(){ $token = $this->proxy->GetToken($this->username, $this->password); return $token; } //get mahasiswa pindahan yang tidak memiliki nilai_transfer function get_mahasiswa_pindahan(){ $token = $this->_get_token(); $GetRecordset = $this->proxy->GetRecordset($token, 'mahasiswa_pt', "p.id_jns_daftar = 2 AND (sks_diakui = 0 OR sks_diakui is null)", '',1500, 0); $data_mahasiswa = array(); foreach($GetRecordset['result'] as $idx => $result){ $nim = trim($result['nipd']); $query_nilai = "SELECT konversi.idkn , konversi.nim , konversi.idstkonversi , (select sum(konversidet.sksasal) from konversidet where konversidet.idkn = konversi.idkn) as sksdiakui FROM konversi WHERE konversi.idstkonversi = 1 AND konversi.nim = '".$nim."'"; $get_sks_diakui = $this->db->query($query_nilai)->row_array(); if(isset($get_sks_diakui['sksdiakui']) && !empty($get_sks_diakui['sksdiakui'])) $result['sksdiakui_siak'] = $get_sks_diakui['sksdiakui']; else $result['sksdiakui_siak'] = 0; $data_mahasiswa[] = $result; } $return = array('success' => true, 'data' => $data_mahasiswa); echo json_encode($return); die; } function export_to_feeder() { $data = $this->input->post('json_sksdiakui'); if(empty($data)){ $return = array( 'success' => false, 'message' => 'data yang dimasukkan kosong', ); echo json_encode($return); die; } $data = json_decode($data); $success_all = true; $message = ""; if(!empty($data)) { $token = $this->_get_token(); foreach($data as $idx => $dt){ $update = array( 'key' => array('id_reg_pd' => $dt->id_reg_pd), 'data' => array('sks_diakui' => $dt->sksdiakui_siak), ); $updated_mahasiswa_pt = $this->proxy->UpdateRecord($token, 'mahasiswa_pt', json_encode($update)); if(!empty($updated_mahasiswa_pt['result']['error_desc']) || !empty($updated_mahasiswa_pt['error_desc'])){ $message .= "gagal mengupdate mahasiswa ".$dt->nm_pd."
"; $success_all = false; } } } $return = array( 'success' => $success_all, 'message' => $message, ); echo json_encode($return); die; } } ?>