<?php
require_once (PATH_TABLES . "activity/salesquotation/SalesQuotationMaintenanceTemplateTable.php") ;
require_once (PATH_TABLES . "activity/salesquotation/SalesQuotationMaintenanceHeaderTemplateTable.php") ;
require_once (PATH_TABLES . "activity/salesquotation/SalesQuotationMaintenanceDetailTemplateTable.php") ;
require_once (PATH_MODELS . "base/MasterBase.php") ;

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

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

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

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

}
?>