<?
  class CHOLIDAY{
  
    var $id;
	var $holDateFm;
	var $holDateTo;
	var $holDesc;
  
    function CHOLIDAY($id){
        
      global $conn;
        
	  $query = "SELECT * FROM punchsys_holiday WHERE id='$id'";
	  $result = mysqli_query($conn,$query);
	  
      while($myrow = mysqli_fetch_array($result)){
          $this->id = $myrow["id"];
          $this->holDateFm = $myrow["holDateFm"];
          $this->holDateTo = $myrow["holDateTo"];
          $this->holDesc = $myrow["holDesc"];
      }
	  
	}
  
  }
?>
<?
  function getHoliday($pdate){
      
      global $conn;
      
    $query = "SELECT * FROM punchsys_holiday WHERE holDateFm<='$pdate' AND holDateTo>='$pdate'";
    $result = mysqli_query($conn,$query);
	$num = mysqli_num_rows($result);

	$i=0;
	if($num>0){
	
	  while($myrow = mysqli_fetch_array($result)){
	    $arrOutput[$i] = $myrow["holDesc"];
	    $i++;
	  }
	  
	}
	
	return $arrOutput;
  }
?>