<?php
require_once (PATH_TABLES . "activity/salesquotation/SalesQuotationCoverTemplateTable.php") ;
require_once (PATH_TABLES . "activity/salesquotation/SalesQuotationCoverDetailTemplateTable.php") ;
require_once (PATH_MODELS . "base/MasterBase.php") ;

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

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

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

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

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

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

}
?>