<?php
class AppJenisSemesterToSia extends Database {

	protected $mSqlFile= 'module/jenis_semester/business/appjenissemestertosia.sql.php';
   
   function __construct($connectionNumber=1) {
		parent::__construct($connectionNumber);
		
	}
   
   function GetCountJenisSemester(){
      $result=$this->Open($this->mSqlQueries['get_count_jenis_semester'],array());
		if (!$result) {
			return 0;
		} else {
			return $result[0]['total'];
		}
   }
   
   function GetDataJenisSemeter($startRec, $itemViewed){
      $result=$this->Open($this->mSqlQueries['get_jenis_semester'],array($startRec, $itemViewed));
      return $result;
   }
   
   function GetJenisSemesterById($id){
      $result=$this->Open($this->mSqlQueries['get_jenis_semester_by_id'],array($id));
      return $result;
   }
   
   function GetMaxIdJenisSemeter(){
      $result=$this->Open($this->mSqlQueries['get_max_id_jenis_semester'],array());
      return $result;
   }
   
   function DoAddJenisSemester($namaSemId,$namaSemJenis,$namaSemPeriode,$namaSemNama,$namaSemNamaSingkat){
      $result=$this->Execute($this->mSqlQueries['do_add_jenis_semester'],array($namaSemId,
                                                                               $namaSemJenis,
                                                                               $namaSemPeriode,
                                                                               $namaSemNama,
                                                                               $namaSemNamaSingkat)); 
      return $result;
   }
   
   function DoUpdateJenisSemester($namaSemJenis,$namaSemPeriode,$namaSemNama,$namaSemNamaSingkat,$idData){
      $result=$this->Execute($this->mSqlQueries['do_update_jenis_semester'],array($namaSemNama,
                                                                                  $namaSemNamaSingkat,
                                                                                  $namaSemJenis,
                                                                                  $namaSemPeriode,
                                                                                  $idData));
      return $result;
   }
   
   function DoDeleteJenisSemesterById($idData){
      $result=$this->Execute($this->mSqlQueries['do_delete_semester_by_id'],array($idData));
      return $result;
   }
   
   function DoDeleteJenisSemesterByArrayId($arrIdData){
      $idData = implode("', '", $arrIdData);
      $result=$this->Execute($this->mSqlQueries['do_delete_semester_by_array_id'],array($idData));
      return $result;
   }
}
?>