<?php
require_once (PATH_TABLES . "activity/template/JobCentreTemplateTable.php") ;
require_once (PATH_TABLES . "activity/template/JobCentreTaskTemplateTable.php") ;
require_once (PATH_MODELS . "base/MasterBase.php") ;

class JobCentreTemplateClass extends MasterBase {
	function __construct($db) {
		$this->db 		= $db ;
		$this->tbl 		= JobCentreTemplateTable::C_TABLE ;
		$this->fldid 	= JobCentreTemplateTable::C_ID ;
	}

	function __destruct() {
	}
	function getAllTemplate()
	{
		$sql = "SELECT * FROM ".JobCentreTemplateTable::C_TABLE." ORDER BY ".JobCentreTemplateTable::C_JOB_NAME;

		return $rows=$this->db->getTable($sql);
	}

	function checkName($name)
	{
		$sql = "SELECT * FROM ".JobCentreTemplateTable::C_TABLE." WHERE ".JobCentreTemplateTable::C_JOB_NAME." = '".$name."'";

		$rows=$this->db->getTable($sql);

		if(!is_null($rows) && count($rows)>0){
			return true;
		}else{
			return false;
		}
	}

}
?>