<?php 



class category {


	

	function slugExist($type,$slug,$id=0){

		if($type=='pages' && $slug!=''){

			$sql ="select * FROM tbl_pages WHERE page_slug = '".$slug."'  AND page_id != $id"; 

			return connection::execute($sql,'select');

		}		

		if($type=='news' && $slug!=''){

			$sql ="select * FROM tbl_news WHERE news_slug = '".$slug."'  AND news_id != $id"; 

			return connection::execute($sql,'select');

		}
		
		if($type=='package' && $slug!=''){

			$sql ="select * FROM tbl_package WHERE package_slug = '".$slug."'  AND package_id != $id"; 

			return connection::execute($sql,'select');

		}


	}

	

}



?>