client = new nusoap_client($this->url, true); $this->proxy = $this->client->getProxy(); } function _get_token(){ $token = $this->proxy->GetToken($this->username, $this->password); return $token; } function get_all_tables(){ $token = $this->_get_token(); $listtable = $this->proxy->ListTable($token); echo json_encode($listtable); } function get_list_table(){ $token = $this->_get_token(); $listtable = $this->proxy->ListTable($token); //print_r($listtable); foreach($listtable['result'] as $table) { echo "Table ".$table['table']."\n"; //get dictionary $dictionary = $this->proxy->GetDictionary($token, $table['table']); print_r($dictionary); } } function get_dictionary() { $tablename = $this->input->post('tablename'); $token = $this->_get_token(); $dictionary = $this->proxy->GetDictionary($token, $tablename); echo json_encode($dictionary); } function GetRecord() { $token = $this->_get_token(); $tablename = $this->input->post('tablename'); $filter = $this->input->post('filter'); $GetRecord = $this->proxy->GetRecord($token, $tablename, $filter); echo json_encode($GetRecord); } function GetRecordset() { $token = $this->_get_token(); $tablename = $this->input->post('tablename'); $limit = $this->input->post('limit'); $offset = $this->input->post('offset'); $filter = $this->input->post('filter'); $GetRecordset = $this->proxy->GetRecordset($token, $tablename, $filter, '',$limit, $offset); print_r($GetRecordset);die; echo json_encode($GetRecordset); die; } function GetCountRecordset() { $token = $this->_get_token(); $tablename = $this->input->post('tablename'); $filter = $this->input->post('filter'); $CountRecordset = $this->proxy->GetCountRecordset($token, $tablename, $filter); print_r($CountRecordset);die; echo json_encode($CountRecordset); die; } function DeleteRecord(){ $token = $this->_get_token(); $tablename = $this->input->post('tablename'); $record = $this->input->post('record'); if(!empty($tablename) && !empty($record)){ $DeleteRecord = $this->proxy->DeleteRecord($token, $tablename, json_encode($record)); print_r($DeleteRecord); } } function update_wrong_akuntansi() { $token = $this->_get_token(); $kode_prodi = '62201'; $id_sp = 'db9b5dff-3837-41bd-adf1-6caa04e21029'; $wrong_id_sms = 'bcb5ab78-d2b4-4bc1-a763-696ef7268d6c'; $filter_mahasiswa_pt = "p.id_sms = '".$wrong_id_sms."' AND p.id_sp = '".$id_sp."'"; $GetRecordset = $this->proxy->GetRecordset($token, 'mahasiswa_pt', $filter_mahasiswa_pt, '',1000, 0); if(!empty($GetRecordset['result'])){ //get real id sms $filter_prodi = "p.id_sp = '".$id_sp."' and kode_prodi = '".$kode_prodi."'"; $Getprodi = $this->proxy->GetRecord($token, 'sms', $filter_prodi); if(!empty($Getprodi['result'])) { foreach($GetRecordset['result'] as $idx => $mhs_pt) { $update = array( 'key' => array('id_reg_pd' => $mhs_pt['id_reg_pd']), 'data' => array('id_sms' => $Getprodi['result']['id_sms']), ); $updated_mahasiswa = $this->proxy->UpdateRecord($token, 'mahasiswa_pt', json_encode($update)); } } } } function update_wrong_manajemen() { $token = $this->_get_token(); $kode_prodi = '61201'; $id_sp = 'db9b5dff-3837-41bd-adf1-6caa04e21029'; $wrong_id_sms = '3e344d03-9751-477c-aa5f-66eaae13f718'; $filter_mahasiswa_pt = "p.id_sms = '".$wrong_id_sms."' AND p.id_sp = '".$id_sp."'"; $GetRecordset = $this->proxy->GetRecordset($token, 'mahasiswa_pt', $filter_mahasiswa_pt, '',1000, 0); if(!empty($GetRecordset['result'])){ //get real id sms $filter_prodi = "p.id_sp = '".$id_sp."' and kode_prodi = '".$kode_prodi."'"; $Getprodi = $this->proxy->GetRecord($token, 'sms', $filter_prodi); if(!empty($Getprodi['result'])) { foreach($GetRecordset['result'] as $idx => $mhs_pt) { $update = array( 'key' => array('id_reg_pd' => $mhs_pt['id_reg_pd']), 'data' => array('id_sms' => $Getprodi['result']['id_sms']), ); $updated_mahasiswa = $this->proxy->UpdateRecord($token, 'mahasiswa_pt', json_encode($update)); } } } } function update_wrong_matematika() { $token = $this->_get_token(); $kode_prodi = '84202'; $id_sp = 'db9b5dff-3837-41bd-adf1-6caa04e21029'; $wrong_id_sms = 'e80b7e3a-2985-494e-95ef-09074c433a79'; $filter_mahasiswa_pt = "p.id_sms = '".$wrong_id_sms."' AND p.id_sp = '".$id_sp."'"; $GetRecordset = $this->proxy->GetRecordset($token, 'mahasiswa_pt', $filter_mahasiswa_pt, '',1000, 0); if(!empty($GetRecordset['result'])){ //get real id sms $filter_prodi = "p.id_sp = '".$id_sp."' and kode_prodi = '".$kode_prodi."'"; $Getprodi = $this->proxy->GetRecord($token, 'sms', $filter_prodi); if(!empty($Getprodi['result'])) { foreach($GetRecordset['result'] as $idx => $mhs_pt) { $update = array( 'key' => array('id_reg_pd' => $mhs_pt['id_reg_pd']), 'data' => array('id_sms' => $Getprodi['result']['id_sms']), ); $updated_mahasiswa = $this->proxy->UpdateRecord($token, 'mahasiswa_pt', json_encode($update)); } } } } function update_wrong_elektro() { $token = $this->_get_token(); $kode_prodi = '20201'; $id_sp = 'db9b5dff-3837-41bd-adf1-6caa04e21029'; $wrong_id_sms = '0dc4f928-0faf-4298-8df3-cbb69401184c'; $filter_mahasiswa_pt = "p.id_sms = '".$wrong_id_sms."' AND p.id_sp = '".$id_sp."'"; $GetRecordset = $this->proxy->GetRecordset($token, 'mahasiswa_pt', $filter_mahasiswa_pt, '',1000, 0); if(!empty($GetRecordset['result'])){ //get real id sms $filter_prodi = "p.id_sp = '".$id_sp."' and kode_prodi = '".$kode_prodi."'"; $Getprodi = $this->proxy->GetRecord($token, 'sms', $filter_prodi); if(!empty($Getprodi['result'])) { foreach($GetRecordset['result'] as $idx => $mhs_pt) { $update = array( 'key' => array('id_reg_pd' => $mhs_pt['id_reg_pd']), 'data' => array('id_sms' => $Getprodi['result']['id_sms']), ); $updated_mahasiswa = $this->proxy->UpdateRecord($token, 'mahasiswa_pt', json_encode($update)); } } } } function delete_mahasiswa() { $nim = $this->input->post('nim'); if(empty($nim)){ echo 'ni kosong';die; } $token = $this->_get_token(); $filter_mhs_pd = "trim(nipd) = '".$nim."'"; $check = $this->proxy->GetRecord($token, 'mahasiswa_pt', $filter_mhs_pd); if(isset($check['result'])['id_reg_pd']){ $id_reg_pd = $check['result']['id_reg_pd']; $id_pd = $check['result']['reg_pd']; $delete_mhs_pt = $this->proxy->DeleteRecord($token, 'mahasiswa_pt', json_encode(array('id_reg_pd' => $id_reg_pd))); $delete_mhs = $this->proxy->DeleteRecord($token, 'mahasiswa', json_encode(array('id_pd' => $id_pd))); print_r($delete_mhs_pt); print_r($delete_mht); } } } ?>