<?
  class CUSER{
  
    var $id,$eName,$cName,$userId,$password,$administrator,$section;
  
    function CUSER($pid){
	  $query = "SELECT * FROM xoops_adm_teacher WHERE id='$pid'";
	  $result = mysql_query($query);
	  
	  $this->id = mysql_result($result,0,"id");
	  $this->eName = mysql_result($result,0,"eName");
	  $this->cName = mysql_result($result,0,"cName");
	  $this->userId = mysql_result($result,0,"userID");
	  $this->password = mysql_result($result,0,"password");
	  $this->administrator = mysql_result($result,0,"administrator");
	  $this->section = mysql_result($result,0,"section");
	}
	
	//----- start time of punchin ----------
	function getStartT($wk){
	
	  $query = "SELECT * FROM xoops_pc_timetable WHERE secid='" . $this->section . "' AND wkDay=$wk";
	  $result = mysql_query($query);
	  $num = mysql_num_rows($result);
	  
	  if($num>0){
	    return mysql_result($result,0,"pcInTime");
	  }else{
	    return "";
	  }
	
	}
	
	//------- end time of punchin ---------
	function getEndT($wk){
	
	  $query = "SELECT * FROM xoops_pc_timetable WHERE secid='" . $this->section . "' AND wkDay=$wk";
	  $result = mysql_query($query);
	  $num = mysql_num_rows($result);
	  
	  if($num>0){
	    return mysql_result($result,0,"pcOutTime");
	  }else{
	    return "";
	  }
	
	}
  
  }
?>