<?php

class SalarySetupMart {

	/*************************************************
	/ This function add new Salary Setup
	*************************************************/
	
	public static function AddSalarySetup($data) {
		global $db;
				
		$id = $db->query_insert(TABLE_SALARYSETUP_MART, $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_MART,$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_MART." 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_MART." ". $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(); }
		
	
}

?>
