<?php
class AppLaporanMahasiswa extends Database {

   protected $mSqlFile= 'module/laporan_mahasiswa/business/applaporanmahasiswa.sql.php';

   function __construct($connectionNumber=0) {
      parent::__construct($connectionNumber);
      #$this->SetDebugOn();
   }
   
   function GetCountDataMahasiswa($periode,$jenjang,$jalur,$prodi,$status_reg){       
      $result =$this->Open($this->mSqlQueries['get_count_data_mahasiswa'], array('%'.$periode.'%','%'.$jenjang.'%','%'.$jalur.'%',$prodi,$prodi,$status_reg,$status_reg));
      #print($this->GetLastError());
      if (!$result) {
         return 0;
      } else {
         return $result[0]['total'];
      }
   }
   
   function GetDataMahasiswa($periode,$jenjang,$jalur,$prodi,$status_reg,$offset,$limit){      
      $result =$this->Open($this->mSqlQueries['get_data_mahasiswa'], array('%'.$periode.'%','%'.$jenjang.'%','%'.$jalur.'%',$prodi,$prodi,$status_reg,$status_reg,$offset,$limit));
      #print($this->GetLastError());
      return $result;
   }
   
   function GetDataPrintLaporanMahasiswa($periode,$jenjang,$jalur,$prodi,$status_reg){
   //var_dump($periode);
      $result =$this->Open($this->mSqlQueries['get_data_print_laporan_mahasiswa'], array('%'.$periode.'%','%'.$jenjang.'%','%'.$jalur.'%',$prodi,$prodi,$status_reg,$status_reg));
      return $result;
      #print($this->GetLastError());
   }
   
   function GetExcelDataMahasiswa($periode,$jenjang,$jalur,$prodi,$status_reg){      
      $result =$this->Open($this->mSqlQueries['get_excel_data_mahasiswa'], array('%'.$periode.'%','%'.$jenjang.'%','%'.$jalur.'%',$prodi,$prodi,$status_reg,$status_reg));
      #print($this->GetLastError());
      return $result;
   }
   
   function GetStatusRegistrasi(){
      $dataStatusReg[0]['id']="S";
      $dataStatusReg[0]['name']="Sudah";
      $dataStatusReg[1]['id']="B";
      $dataStatusReg[1]['name']="Belum";      
      return $dataStatusReg;
   }
   
   function GetJenjangAkademik(){
      $result=$this->Open($this->mSqlQueries['get_jenjang_akademik'],array());
      return $result;
   }
   
   function GetNamaJenjang($id){
      $result=$this->Open($this->mSqlQueries['get_nama_jenjang'],array($id));
      return $result;
   }
   
   function GetJalurMasuk(){
      $result=$this->Open($this->mSqlQueries['get_jalur_masuk'],array());
      return $result;
   }
   
   function GetNamaJalur($id){
      $result=$this->Open($this->mSqlQueries['get_nama_jalur'],array($id));
      return $result;
   }
   
   function GetDataTahun(){
      $result=$this->Open($this->mSqlQueries['get_data_tahun'],array());
      return $result;
   }
   
   function GetPeriodeAktif(){
      $result=$this->Open($this->mSqlQueries['get_periode_aktif'],array());
      return $result;
   }
   
   function GetNamaPeriode($id){
      $result=$this->Open($this->mSqlQueries['get_nama_periode'], array($id));
      return $result;
   }
   
   function GetDataPeriode(){
      $result=$this->Open($this->mSqlQueries['get_data_periode'], array());
      return $result;
   }
   
   function GetDataProdi(){
      $result=$this->Open($this->mSqlQueries['get_data_prodi'], array());
      return $result;
   }
   
   function GetDataProdiById($idProdi){
      $result=$this->Open($this->mSqlQueries['get_data_prodi_by_id'], array($idProdi));
      return $result;
   }
   
   function GetNamaProdi($id){
      $result=$this->Open($this->mSqlQueries['get_nama_prodi'], array($id));
      return $result;
   }

//===DO===

}
?>