<?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 SalesQuotationCoverDetailTemplateClass extends MasterBase {
	function __construct($db) {
		$this->db 		= $db ;
		$this->tbl 		= SalesQuotationCoverDetailTemplateTable::C_TABLE ;
		$this->fldid 	= SalesQuotationCoverDetailTemplateTable::C_ID ;
	}

	function __destruct() {
	}

	function getSalesQuotationCoverTemplate($id){

        $sql = "SELECT * FROM " ;
        $sql .= SalesQuotationCoverDetailTemplateTable::C_TABLE . " WHERE " . SalesQuotationCoverDetailTemplateTable::C_ID . " = " . $id;
        $sql .= "ORDER BY " . SalesQuotationCoverDetailTemplateTable::C_ID ." ASC";
        
        $rows = $this->db->getTable($sql);

        if(!is_null($rows) && count($rows) > 0){
            return $rows;
        }
        
        return null;
    }

    function deleteTask($id)
    {
        $sql = "DELETE FROM " . SalesQuotationCoverDetailTemplateTable::C_TABLE . 
                " WHERE " . SalesQuotationCoverDetailTemplateTable::C_ID . " = " . $id. "";
        
        try{
            $this->db->executeSql($sql);
        } catch (Exception $e){
            Log::write("[ChecklistDetailClass]" . $e->getMessage());
        }
    }
}
?>