<?php
class AppFakultasToAdmisi extends Database {

   protected $mSqlFile= 'module/fakultas/business/appfakultastoadmisi.sql.php';
   
   function __construct($connectionNumber=0) {
      parent::__construct($connectionNumber);
      
   }
   
   
   //------------------ Get Data-------------------
   
   function GetDataFakultas($kodeFak, $namaResmiFak, $namaSingkatFak, $offset, $limit ){
      $result=$this->Open($this->mSqlQueries['get_data_fakultas'],array('%'.$kodeFak.'%',
                                                                        '%'.$namaResmiFak.'%',
                                                                        '%'.$namaSingkatFak.'%',
                                                                        $offset,
                                                                        $limit));
      return $result;
   }   
   

   function GetCountDataFakultas($kodeFak, $namaResmiFak, $namaSingkatFak){
      $result=$this->Open($this->mSqlQueries['get_count_data_fakultas'],array('%'.$kodeFak.'%',
                                                                        '%'.$namaResmiFak.'%',
                                                                        '%'.$namaSingkatFak.'%',
                                                                        $offset,
                                                                        $limit));
                     
      if (!$result) {
         return 0;
      } else {
         return $result[0]['total'];
      }
   }
   
   function GetDataFakultasById($kodeFak){
      $result=$this->Open($this->mSqlQueries['get_data_fakultas_by_id'],array($kodeFak));
      return $result;
   }
   
   function GetMaxIdFakultas(){
      $result=$this->Open($this->mSqlQueries['get_max_id_fakultas'],array());
      return $result;
   }
   
//------------------------do---------------------------------------------------------------   
   function DoAddFakultas($kodeFak,$namaResmiFak,$namaSingkatFak){
      $result=$this->Execute($this->mSqlQueries['do_add_fakultas'],array($kodeFak,
                                                                        $namaResmiFak,
                                                                        $namaSingkatFak));
    //  print('From Admisi<br>'.$this->GetLastError().'<br><br>');exit;
      return $result;
   }
   
   function DoUpdateFakultas($namaResmiFak,$namaSingkatFak,$dataId){
      $result=$this->Execute($this->mSqlQueries['do_update_fakultas'],array($namaResmiFak,$namaSingkatFak,$dataId));
      //print('From Admisi<br>'.$this->GetLastError().'<br><br>');
      return $result;
   }
   
   function DoDeleteFakultasById($kodeFak){
      $result=$this->Execute($this->mSqlQueries['do_delete_fakultas_by_id'],array($kodeFak));
      return $result;
   }
   
   function DoDeleteFakultasByArrayId($arrKodeFak){
      $kodeFak = implode("', '", $arrKodeFak);
      $result=$this->Execute($this->mSqlQueries['do_delete_fakultas_by_array_id'],array($kodeFak));
      //print('From Admisi<br>'.$this->GetLastError().'<br><br>');
      return $result;
   }
   
   
}
?>