<?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 body
$html = "<tr>";
$html.= "<td id=\"<!--emailtype-->tender_approve<!--/emailtype--><!--id-->".$this->tender['id']."<!--/id--><!--user-->".$admin['id']."<!--/user-->\">";
$html.= $this->lang['dear']." ".$admin['name'].",";
$html.= "<br/><br/>";
$redirect = "approve&tenderid=".$this->tender['id'];
$link = $cfg['url']."index.php?next_module=tender&next_function=".rawurlencode($redirect)."&next_call_id=".time();
$html.= $this->lang['tenderneedapproval'].". <a href=\"".$link."\">".$this->lang['clicktoaprrove']."</a>.";
$html.= "<br/><br/>";
// Information Table
$html.= "<table width=\"100%\" border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
$html.= "<tr>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['rfq'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= $this->tender['rfq_number'];
$html.= "</td>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['subscriber'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= "<a href=\"mailto:".$this->user['email']."?subject=".$this->lang['queryon']." ".$this->tender['rfq_number']."\">";
$html.= $this->subscriber['name']." ".$this->subscriber['surname'];
$html.= "</a>";
$html.= "</td>";
$html.= "<tr>";
$html.= "<tr>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['contact'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= $this->subscriber['phone_work'];
$html.= "</td>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['company'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= $this->subscriber['organisationname']." (".$this->subscriber['branchname'].")";
$html.= "</td>";
$html.= "<tr>";
$html.= "<tr>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['location'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= $this->tender['statename'].": ".$this->tender['areaname'];
$html.= "</td>";
$html.= "<td class=\"t1\">";
$html.= $this->lang['closing'];
$html.= "</td>";
$html.= "<td class=\"t2\">";
$html.= $this->response['closing']." ".$cfg['local']['display'];
$html.= "</td>";
$html.= "<tr>";
$html.= "</table>";
$html.= "<br/>";
// Tender tables
$html.= "<table width=\"100%\"  border=\"0\" cellpadding=\"2\" cellspacing=\"0\">";
$html.= "<tr>";
$html.= "<td class=\"h t1\">";
$html.= $this->lang['item'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.= $this->lang['category'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.= $this->lang['brand'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.= $this->lang['model'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.= $this->lang['description'];
$html.= "</td>";
$html.= "<td class=\"ha t1\">";
$html.= $this->lang['quote'];
$html.= "</td>";
// budget
if ($cfg['tender']['budget']) {
	$html.= "<td class=\"ha t1\">";
	$html.= $this->lang['budget'];
	$html.= "</td>";
}
$html.= "<td>";
$html.= "</td>";
$html.= "</tr>";
// Populate rows
foreach($items as $row_item) {
	$html.= "<tr>\n";
	// item id
	$html.= "<td class=\"h2b t2\" id=\"<!--item-->".$row_item['id']."<!--/item--><!--type-->".$row_item['classification']."<!--/type-->\">";
	$html.= $row_item['id'];
	$html.= "</td>\n";
	// Category
	$html.= "<td class=\"h2c t2\" id=\"<!--category-->\">";
	$html.= $row_item['category']."/<br/>".$row_item['category_sub'];
	$html.= "</td>\n";
	// Brand
	$html.= "<td class=\"h2c t2\" id=\"<!--/category--><!--brand-->\">";
	$html.= $row_item['brand'];
	$html.= "</td>\n";
	// Model
	$html.= "<td class=\"h2c t2\" id=\"<!--/brand--><!--model-->\">";
	$html.= $row_item['model'];
	$html.= "</td>\n";
	// description
	$html.= "<td class=\"h2c t2\" id=\"<!--/model--><!--des-->\">";
	$html.= "<pre class=\"t2\">".wordwrap($row_item['description'],25)."</pre>";
	$html.= "</td>\n";
	// quote
	$html.= "<td class=\"h2c t2\" id=\"<!--/des--><!--quote-->\">";
	$html.= $row_item['quote'];
	$html.= "</td>\n";
	if ($cfg['tender']['budget']) {
		// budget
		$html.= "<td class=\"h2c t2\" id=\"<!--/quote--><!--budget-->\">";
		$html.= $row_item['budget'];
		$html.= "</td>\n";
		$html.= "<td id=\"<!--/budget-->\">";
	} else {
		$html.= "<td id=\"<!--/quote-->\">";	
	}
	// clsoing column - must be present as outlook removes last tag in certain circumstances
	$html.= "</td>\n";
	$html.= "</tr>\n";
}
// Close the table
$html.= "</table>";
$html.= "<br/>";
// help
$html.= " <a href=\"".$cfg['url']."manuals/".$this->user['language']."/admin_manual.pdf\">".$this->lang['downloadmanual']."</a>.";
?>
