<?php
  class CSYSTEM{

    var $format;
    var $passmark;
    var $schName;
    var $schCName;
    var $schCode;
    var $imgPath;
    var $prisub1;
    var $prisub2;
    var $thisYear;
    var $pksr1rate;
    var $pksr2rate;
    var $gender;
    var $upsrranking;
    var $reporttype;
    var $report4type;
    var $morecol;
    var $reportnote;
    var $sysver;
    var $pksrname1;
    var $pksrname2;
    var $pksrnamet;
    var $sem1;
    var $sem2;
    var $showSchlogo;
    var $schlogoHeight;
    var $showsociety;
    var $showsport;
    var $showhonor;
    var $showclub;
    var $showteeth;
    var $shownclass;
    var $showtotalj;
    var $showthisj;
    var $showrmb;
    var $gurusign;
    var $gurubesarsign;
    var $ibubapasign;
    var $avggrade;
	var $printnumstu;
	var $thranking;
	var $bonus1, $bonustxt1, $bonus2, $bonustxt2, $bonus3, $bonustxt3;

    function __construct(){
	  global $conn;
	  
      $query = "SELECT * FROM xoops_sps_system";
      $result = mysqli_query($conn,$query);
	  while($myrow = mysqli_fetch_array($result)){
	  
		  $this->format = $myrow["format"];      
		  $this->passmark = $myrow["passmark"];
		  $this->schName = $myrow["schName"];
		  $this->schCName = $myrow["schCName"];
		  $this->schCode = $myrow["schCode"];
		  $this->pksrRatio = $myrow["pksrRatio"];
		  $this->imgPath = $myrow["imgPath"];
		  $this->prisub1 = $myrow["prisub1"];
		  $this->prisub2 = $myrow["prisub2"];
		  $this->thisYear = $myrow["thisYear"];
		  $this->pksr1rate = $myrow["pksr1rate"];
		  $this->pksr2rate = $myrow["pksr2rate"];
		  $this->pksr1rate = $myrow["pksr1rate"];
		  $this->pksr2rate = $myrow["pksr2rate"];
		  $this->gender = $myrow["gender"];
		  $this->upsrranking = $myrow["upsrranking"];
		  $this->reporttype = $myrow["reporttype"];
		  $this->report4type = $myrow["report4type"];
		  $this->morecol = $myrow["morecol"];
	
		  $this->reportnote = $myrow["reportnote"];
		  $this->sysver = $myrow["sysver"];
	
		  $this->pksrname1 = $myrow["pksrname1"];
		  $this->pksrname2 = $myrow["pksrname2"];
		  $this->pksrnamet = $myrow["pksrnamet"];
	
		  $this->diffail = $myrow["diffail"];
		  $this->sem1 = $myrow["sem1"];
		  $this->sem2 = $myrow["sem2"];
		  $this->showSchlogo = $myrow["showSchlogo"];
		  $this->schlogoHeight = $myrow["schlogoHeight"];
	
		  $this->showsociety = $myrow["showsociety"];
		  $this->showsport = $myrow["showsport"];
		  $this->showhonor = $myrow["showhonor"];
		  $this->showclub = $myrow["showclub"];
		  $this->showteeth = $myrow["showteeth"];
		  $this->shownclass = $myrow["shownclass"];
		  $this->showtotalj = $myrow["showtotalj"];
		  $this->showthisj = $myrow["showthisj"];
		  $this->showrmb = $myrow["showrmb"];
	
		  $this->gurusign = $myrow["gurusign"];
		  $this->gurubesarsign = $myrow["gurubesarsign"];
		  $this->ibubapasign = $myrow["ibubapasign"];
	
		  $this->avggrade = $myrow["avggrade"];
		  $this->printnumstu = $myrow["printnumstu"];
		  $this->thranking = $myrow["thranking"];
		  
		  $this->bonus1 = $myrow["bonus1"];
		  $this->bonus2 = $myrow["bonus2"];
		  $this->bonus3 = $myrow["bonus3"];
		  $this->bonustxt1 = $myrow["bonustxt1"];
		  $this->bonustxt2 = $myrow["bonustxt2"];
		  $this->bonustxt3 = $myrow["bonustxt3"];
	  
	  }
	  
    }

    function getGenderOrder(){
      if($this->gender==0){
        $order = " gender ";
      }else if($this->gender==1){
        $order = " gender DESC ";
      }else{
        $order = " ename ";
	  }
      return $order;
    }

	  /*
    function getSysPassword(){
      $query="SELECT * FROM xoops_adm_teacher WHERE id='admin'";
      $result=mysql_query($query);
      $password = mysql_result($result,0,"password");
      return $password;
    }

    function setSysPassword($pValue){
      $query = "UPDATE xoops_adm_teacher SET password='$pValue' WHERE id='admin'";
      mysql_query($query);
    }

    function chkBonus(){
	  $rst = false;
	  if($this->bonus1==1 || $this->bonus2==1 || $this->bonus3==1){
	    $rst = true;
	  }
	  return $rst;
	}
*/
  }
?>