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

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

	function __destruct() {
	}

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

		return $rows=$this->db->getTable($sql);
	}
	function checkName($name)
	{
		$sql = "SELECT * FROM ".JobQuotationTemplateTable::C_TABLE." WHERE ".JobQuotationTemplateTable::C_JOB_NAME." = '".$name."'";

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

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

}
?>