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

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

	function __destruct() {
	}

	function getSalesQuotationAppendixTemplate($id){

        $sql = "SELECT * FROM " ;
        $sql .= SalesQuotationAppendixTemplateTable::C_TABLE . " WHERE " . SalesQuotationAppendixTemplateTable::C_ID . " = " . $id;
        $sql .= "ORDER BY " . SalesQuotationAppendixTemplateTable::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 " . SalesQuotationAppendixTemplateTable::C_TABLE . 
                " WHERE " . SalesQuotationAppendixTemplateTable::C_ID . " = " . $id. "";
        
        try{
            $this->db->executeSql($sql);
        } catch (Exception $e){
            Log::write("[ChecklistDetailClass]" . $e->getMessage());
        }
    }
}
?>