<?php
class AppIntegrasiDataAdmisi extends Database{
	protected $mSqlFile= 'module/integrasi_data/business/appintegrasidataadmisi.sql.php';
	
	function __construct($connectionNumber=0) {
		parent::__construct($connectionNumber);
		#$this->setDebugOn();
	}
#Function Get List data Begin
	function GetListData($mhsProdi,$mhsNama,$mhsStatusReg,$mhsStatus,$mhsNim,$mhsNoTes,$startRec,$offset){
      $result=$this->Open($this->mSqlQueries['get_list_data'],array('%'.$mhsProdi.'%',
                                                                   '%'.$mhsNama.'%',
                                                                   '%'.$mhsStatusReg.'%', 
                                                                   '%'.$mhsStatus.'%',
                                                                   '%'.$mhsNim.'%',
                                                                   '%'.$mhsNim.'%',
                                                                   $startRec,
                                                                   $offset));
      #print($this->GetLastError());
      return $result;
   }
   
   function GetCountListData($mhsProdi,$mhsNama,$mhsStatusReg,$mhsStatus,$mhsNim,$mhsNoTes){
      $result=$this->Open($this->mSqlQueries['get_count_list_data'],array('%'.$mhsProdi.'%',
                                                                   '%'.$mhsNama.'%',
                                                                   '%'.$mhsStatusReg.'%',
                                                                   '%'.$mhsStatus.'%',
                                                                   '%'.$mhsNim.'%',
                                                                   '%'.$mhsNim.'%',));
		if (!$result) {
			return 0;
		} else {
			return $result[0]['total'];
		}
   }
#Function Get List data End

#Function Get Data Mahasiswa Begin
   function GetDataMahasiswaById($idMhs){
      $result=$this->Open($this->mSqlQueries['get_data_mahasiswa_by_id'], array($idMhs));
      #print($this->GetLastError());
      return $result;
   }
   
   function GetDataOrtuMahasiswaById($idMhs){
      $result=$this->Open($this->mSqlQueries['get_data_ortu_by_id'], array($idMhs));
      return $result;
   }
   
   function GetDataMhsRegById($idMhs){
      $result=$this->Open($this->mSqlQueries['get_data_mahasiswa_registrasi_by_id'],array($idMhs));
      #print($this->GetLastError());
      return $result;
   }
   
   function GetDataMahasiswaByArrayId(){
      $result=$this->Open($this->mSqlQueries['get_data_mahasiswa_by_array_id'], array());
      return $result;
   }
   
   function GetDataOrtuMahasiswaByArrayId(){
      $result=$this->Open($this->mSqlQueries['get_data_ortu_by_array_id'], array());
      return $result;
   }
   
   //-- get mhs status bayar dr admisi --//
   function GetDataStatusBayarById($idMhs){
      $result=$this->Open($this->mSqlQueries['get_data_status_bayar_by_id'],array($idMhs));
      //print($this->GetLastError());
      return $result;
   }
   
#Function Get Data Mahasiswa END

#Function Get Data Filter Begin
   function GetDataProdi(){
      $result=$this->Open($this->mSqlQueries['get_data_prodi'], array());
      return $result;
   }
   
   function GetPeriodeAktif(){
      $result=$this->Open($this->mSqlQueries['get_periode_aktif'],array());
      return $result;
   }
   
   function GetStatusReg(){
      $status[0]['id']='B';
      $status[0]['name']='Belum';
      $status[1]['id']='S';
      $status[1]['name']='Sudah';
      return $status;
   }
   
   function GetStatusMhs(){
      $status[0]['id']='CM';
      $status[0]['name']='Calon Mahasiswa';
      $status[1]['id']='M';
      $status[1]['name']='Mahasiswa';
      return $status;
   }
   
#Function Get Data Filter END

   function DoUpdateIsSent($mhs_id) {
      $result=$this->Execute($this->mSqlQueries['do_update_is_sent'], array($mhs_id));
      #print($this->GetLastError());
      return $result;
   }
}
?>
