<?php
// +---------------------------------------------------------------------------------------+
// | TenderSystem                                                                          |
// +---------------------------------------------------------------------------------------+
// | The contents of this file are subject to the TenderSystem Public License Version 1.1  |
// | ("License"); you may not use this file except in compliance with the License. You may |
// | obtain a copy of the License at http://www.tendersystem.com/tpl/                      |
// |                                                                                       |
// | Software distributed under the License is distributed on an "AS IS" basis, WITHOUT    |
// | WARRANTY OF ANY KIND, either express or implied. See the License for the specific     |
// | language governing rights and limitations under the License.                          |
// |                                                                                       |
// | All copies of the Covered Code must include the "Powered by TenderSystem" logo and    |
// | ValueCard copyright notice on every user interface screen and in every outgoing       |
// | email in the same form as they appear in the distribution.                            |
// |                                                                                       |
// | The Original Code is: TenderSystem                                                    |
// | The Initial Developer of the Original Code is ValueCard (Pty) Limited.                |
// | Portions created by ValueCard are Copyright (C) 2002 ValueCard (Pty) Limited.         |
// | All Rights Reserved.                                                                  |
// | Contributor(s): __________________.                                                   |
// +---------------------------------------------------------------------------------------+

///////////////////////////////////////////////////////////////////////////////////////////
// Purpose of file: Email Template
///////////////////////////////////////////////////////////////////////////////////////////
// set the subject
$subject = $this->lang['suppliersubject']." ".$this->tender['rfq_number']." (".$this->tender['rfq_reference'].")";
// supplier header
$html_supplier = "<table width=\"100%\"  border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
$html_supplier.= "<tr>\n";
$html_supplier.= "<td class=\"h t1\">";
$html_supplier.= $this->lang['supplier'];
$html_supplier.= "</td>\n";
$html_supplier.= "<td class=\"ha t2\" colspan=\"2\">";
$html_supplier.= $this->tender['submitter'][$key]['organisationname'];
$html_supplier.= "</td>\n";
$html_supplier.= "<td class=\"ha t1\">";
$html_supplier.= $this->lang['agent'];
$html_supplier.= "</td>\n";
$html_supplier.= "<td class=\"ha t2\" colspan=\"2\">";
$html_supplier.= $this->tender['submitter'][$key]['name']." ".$this->tender['submitter'][$key]['surname'];
$html_supplier.= "</td>\n";
$html_supplier.= "<td class=\"ha t1\">";
$html_supplier.= $this->lang['phonework'];
$html_supplier.= "</td>\n";
$html_supplier.= "<td class=\"ha t2\">";
$html_supplier.= $this->tender['submitter'][$key]['phone_work'];
$html_supplier.= "</td>\n";
$html_supplier.= "</tr>\n";
// additional information on submitter
$this->tender['submitter'][$key]['language'] = $this->user['language'];
$new_file = new file;
$new_file->link_api_find("tender","response_submitter",$html_supplier,$this->tender['submitter'][$key],$cfg,$conn);
$html_supplier.= "<td class=\"hc t1\">";
$html_supplier.= $this->lang['email'];
$html_supplier.= "</td>\n";
$html_supplier.= "<td class=\"hc t2\">";
$html_supplier.= "<a href=\"mailto:".$this->tender['submitter'][$key]['email']."?subject=".$subject."\">".$this->tender['submitter'][$key]['email']."</a>";
$html_supplier.= "</td>\n";
$html_supplier.= "</tr>\n";

// item header
$html_header = "<table width=\"100%\"  border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
$html_header.= "<tr>\n";

$class1 = "h1 t1";
$class2 = "h1a t1";

$html_header.= "<td class=\"$class1\">".$this->lang['item']."</td>\n";
$html_header.= "<td class=\"$class2\">".$this->lang['brand']."</td>\n";
$html_header.= "<td class=\"$class2\">".$this->lang['model']."</td>\n";
$html_header.= "<td class=\"$class2\">".$this->lang['description']."</td>\n";
$html_header.= "<td class=\"$class2\">".$this->lang['valid']."</td>\n";
$html_header.= "<td class=\"$class2\">".$this->lang['stock']."</td>\n";
$html_header.= "<td class=\"$class2\">".$this->lang['position']."</td>\n";
$html_header.= "<td class=\"$class2\">".$this->lang['price']."</td>\n";
// attachment
$html_header.= "<td></td>\n";
$html_header.= "</tr>\n";

// close table
$html_close = "<tr>\n";
$html_close.= "<td class=\"h1b t1\" colspan=\"7\" align=\"right\">".$this->lang['price']."</td>\n";
$html_close.= "<td class=\"h1c t1\">".$cfg['local']['precurrency'].sprintf("%.2f",$this->tender['submitter'][$key]['total']).$cfg['local']['postcurrency']."</td>\n";
$html_close.= "</tr>\n";
$html_close.= "</table>\n";
?>