<?php 

class setting {
	
	function getAllRecords($all='*',$where='',$orderby='',$limit=''){
		
		$sql ="select $all FROM tbl_setting WHERE 1=1 "; 
		if($where!=''){
			$sql .= " AND $where ";
		}
		
		if($orderby!=''){
			$sql .= " $orderby ";
		}
		
		if($limit!=''){
			$sql .= " $limit ";
		}
		
		return connection::execute($sql,'select-all');
	}
	
	function updateRecords($setting_name,$setting_value){
		
		$sql ="UPDATE tbl_setting SET setting_value = '".$setting_value."' WHERE setting_name = ".stripslashes($setting_name)." ";
		return connection::execute($sql,'update');
	}
	
	function getAllCountry($all='*',$where='',$orderby='',$limit=''){
		
		$sql ="select $all FROM tbl_country WHERE 1=1 "; 
		if($where!=''){
			$sql .= " AND $where ";
		}
		
		if($orderby!=''){
			$sql .= " $orderby ";
		}
		
		if($limit!=''){
			$sql .= " $limit ";
		}
		
		return connection::execute($sql,'select-all');
	}
	function getAllSubCast($all='*',$where='',$orderby='',$limit=''){
		
		$sql ="select $all FROM tbl_subcast WHERE 1=1 "; 
		if($where!=''){
			$sql .= " AND $where ";
		}
		
		if($orderby!=''){
			$sql .= " $orderby ";
		}
		
		if($limit!=''){
			$sql .= " $limit ";
		}
		
		return connection::execute($sql,'select-all');
	}
	function addSubCast($cast){
	$sql ="INSERT INTO tbl_subcast(name,status)  VALUES ('".$cast."','Active')";
			return connection::execute($sql,'insert');
	}
	function addEducation($degree){
	$sql ="INSERT INTO tbl_degree(name,status)  VALUES ('".$degree."','Active')";
			return connection::execute($sql,'insert');
	}
	function getAllLanguages($all='*',$where='',$orderby='',$limit=''){
		
		$sql ="select $all FROM tbl_lang WHERE 1=1 "; 
		if($where!=''){
			$sql .= " AND $where ";
		}
		
		if($orderby!=''){
			$sql .= " $orderby ";
		}
		
		if($limit!=''){
			$sql .= " $limit ";
		}
		
		return connection::execute($sql,'select-all');
	}
	function getAllDegree($all='*',$where='',$orderby='',$limit=''){
		
		$sql ="select $all FROM tbl_degree WHERE 1=1 "; 
		if($where!=''){
			$sql .= " AND $where ";
		}
		
		if($orderby!=''){
			$sql .= " $orderby ";
		}
		
		if($limit!=''){
			$sql .= " $limit ";
		}
		
		return connection::execute($sql,'select-all');
	}
}

?>