<?php

class SalarySetup {

	/*************************************************
	/ This function add new Salary Setup
	*************************************************/
	
	public static function AddSalarySetup($data) {
		global $db;
				
		$id = $db->query_insert(TABLE_SALARYSETUP, $data);
		if($db->affected_rows > 0){
			//$db->query_insert("vrs_logs", $data);
			return $id;
		}else{
			return false;
		}
	
	} // AddSalary

	/*************************************************
	/ This function update Salary
	*************************************************/
	
	public static function UpdateSalarySetup($pid,$data) {
		global $db;
				
		$id = $db->query_update(TABLE_SALARYSETUP,$data,"id='$pid'");
		
		if($db->affected_rows > 0){
			//$db->query_insert("vrs_logs", $data);
			
			return $id;
		}else{
			return $id;
		}
	
	} // UpdateSalary


	public static function GetSalarySetupById($id) {
	
		global $db;
		$query = "SELECT * from ".TABLE_SALARYSETUP." WHERE id ='$id'";
		//print($query);exit;
		$rows = $db->query_first($query);
	
                if($db->affected_rows > 0){
			
                        return $rows;
                }else{
			
                        return false;
                }
	}//Salary

	/**********************************************************
	/ This function will return SalarySetup
	**********************************************************/
		
	public static function GetSalarySetupList($filter="",$pageno="null",$pagesize="null") {
	
		global $db;
		$query = "SELECT * from ".TABLE_SALARYSETUP." ". $filter;
		//print($query);exit;
		$rows = $db->fetch_all_array($query,$pageno,$pagesize);
	
			if($db->affected_rows > 0){
			
                        return $rows;
                }else{
			
                        return false;
                }
	}//SalarySetup

	public static function GetNumRows() { global $db; return $db->GetNumRows(); }
	public static function GetNumberOfPages() { global $db; return $db->GetNumberOfPages(); }
		
	
}

?>
