<?php
require_once (PATH_TABLES . "activity/salesquotation/SalesQuotationProjectPlanTemplateTable.php") ;
require_once (PATH_TABLES . "activity/salesquotation/SalesQuotationProjectPlanHeaderTemplateTable.php") ;
require_once (PATH_TABLES . "activity/salesquotation/SalesQuotationProjectPlanDetailTemplateTable.php") ;
require_once (PATH_MODELS . "base/MasterBase.php") ;

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

	function __destruct() {
	}
	function getAllTemplate()
	{
		$sql = "SELECT * FROM ".SalesQuotationProjectPlanTemplateTable::C_TABLE." ORDER BY ".SalesQuotationProjectPlanTemplateTable::C_TEMP_NAME;
		return $rows=$this->db->getTable($sql);
	}

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

		$rows=$this->db->getTable($sql);
		if(!is_null($rows) && count($rows)>0){
			return true;
		}else{
			return false;
		}
	}

}
?>