Your IP : 216.73.217.79


Current Path : /var/www/cesa.co.za/php/
Upload File :
Current File : /var/www/cesa.co.za/php/awardsentry.php

<?php
//die();

require_once $_SERVER['DOCUMENT_ROOT'] . '/phpmailer/PHPMailer.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/phpmailer/SMTP.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/phpmailer/Exception.php';

use PHPMailer\PHPMailer\PHPMailer;

$sErrors = "";
$bDisplayForm = true;

function XMail($to, $subject, $msg, $from, $CC, $type)
{

	$mail = new PHPMailer;
	$mail->Mailer   = "mail";
	//$mail->Host			= "smtp-relay.za24.co.za";
	if ($type == "html") $mail->IsHTML(true);

	$mail->From     = $from;
	$mail->FromName     = $from;
	$arrto = explode(",", $to);
	for ($i = 0; $i < count($arrto); $i++) {
		$mail->AddAddress($arrto[$i]);
	}
	$mail->Subject = $subject;
	$mail->Body = $msg;

	if (!$mail->Send()) echo $mail->ErrorInfo;
}

if (isset($_POST["go"]) && ($_POST["go"] == 1)) {
	include('inc_db.php');
	if (!reCaptcha($_POST["g-recaptcha-response"])) {
		$sErrors .= "You could not be verified as not being a robot, please tick the reCaptcha verification option at the bottom of the form.";
	} else {

		if (empty($_POST["Contact_Email"])) {
			$sErrors .= "<li>Please enter your email address</li>";
		}
		if ($_POST["Agree_To_Rules"] != "Yes") {
			$sErrors .= "<li>Please accept the rules</li>";
		}
	}
	if (empty($sErrors)) {

		$sql = "INSERT INTO AwardsEntries (Firm_Name, Award_Category, Project_Name, Start_Date, Completion_Date, Lead_Consultant_Name,
				Lead_Consultant_Tel, Lead_Consultant_Mobile, Lead_Consultant_Email, Role_In_Project, JV_Partners, JV_Consent, 
				Nominee_Name, Nominee_Consent, Description_Sent, Contact_Name, Contact_Job_Title, Contact_Tel, Contact_Mobile, Contact_Email, 
				A1_Poster_Required, Quantity, AwardYear) 
			VALUES ('" . addslashes($_POST["Firm_Name"]) . "', '" . addslashes($_POST["Award_Category"]) . "', 
				'" . addslashes($_POST["Project_Name"]) . "', '" . addslashes($_POST["Start_Date"]) . "', '" . addslashes($_POST["Completion_Date"]) . "', 
				'" . addslashes($_POST["Lead_Consultant_Name"]) . "', '" . addslashes($_POST["Lead_Consultant_Tel"]) . "', 
				'" . addslashes($_POST["Lead_Consultant_Mobile"]) . "', '" . addslashes($_POST["Lead_Consultant_Email"]) . "', 
				'" . addslashes($_POST["Role_In_Project"]) . "', '" . addslashes($_POST["JV_Partners"]) . "', '" . addslashes($_POST["JV_Consent"]) . "', 
				'" . addslashes($_POST["Nominee_Name"]) . "', '" . addslashes($_POST["Nominee_Consent"]) . "', '" . addslashes($_POST["Description_Sent"]) . "', 
				'" . addslashes($_POST["Contact_Name"]) . "', '" . addslashes($_POST["Contact_Job_Title"]) . "', '" . addslashes($_POST["Contact_Tel"]) . "', 
				'" . addslashes($_POST["Contact_Mobile"]) . "', '" . addslashes($_POST["Contact_Email"]) . "', 
				'" . addslashes($_POST["A1_Poster_Required"]) . "', '" . addslashes($_POST["Quantity"]) . "', YEAR(CURDATE()))";

		mysql_query($sql);

		$sMsg = '<table width="700" border="1" cellpadding="2">
	  <tbody>
		<tr>
		  <td width="329" valign="top">Name of CESA Member Firm submitting the entry</td>
		  <td colspan="2" valign="top">' . $_POST["Firm_Name"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Name of Award Category (e.g. Projects &gt; R100M)</td>
		  <td colspan="2" valign="top">' . $_POST["Award_Category"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Name of Project Entered</td>
		  <td colspan="2" valign="top">' . $_POST["Project_Name"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Start Date of Project</td>
		  <td colspan="2" valign="top">' . $_POST["Start_Date"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Completion Date of Project i.e. hand-over to client<br>
			(Client must confirm completion date on consent letter)</td>
		  <td colspan="2" valign="top">' . $_POST["Completion_Date"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Name and Contact Details for Lead Consultant</td>
		  <td width="99">Name:<br>
			Tel. Office:<br>
			Mobile:<br>
			Email:</td>
		  <td width="252">' . $_POST["Lead_Consultant_Name"] . '
			<br>
			' . $_POST["Lead_Consultant_Tel"] . '
			<br>
			' . $_POST["Lead_Consultant_Mobile"] . '
			<br>
			' . $_POST["Lead_Consultant_Email"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Your Role in the Project</td>
		  <td colspan="2">' . $_POST["Role_In_Project"] . '</td>
		</tr>
		<tr>
		  <td valign="top">List of JV Partners (CESA Members Only)</td>
		  <td colspan="2">' . $_POST["JV_Partners"] . '
		  </p></td>
		</tr>
		<tr>
		  <td valign="top">Letter of Consent from JV partners sent?</td>
		  <td colspan="2">' . $_POST["JV_Consent"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Name of Client / Company / Mentor / Young Engineer being Nominated</td>
		  <td colspan="2" valign="top">' . $_POST["Nominee_Name"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Letter of Consent from nominee / client sent?</td>
		  <td colspan="2" valign="top">' . $_POST["Nominee_Consent"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Description of Project or Motivation for Nominee sent<br>
		  Minimum 1 x A4, Arial 10</td>
		  <td colspan="2" valign="top">' . $_POST["Description_Sent"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Contact Details for person submitting this entry</td>
		  <td>Name:<br>
			Job Title:<br>
			Tel. Office:<br>
			Mobile:<br>
			Email:</td>
		  <td>' . $_POST["Contact_Name"] . '
			<br>
			' . $_POST["Contact_Job_Title"] . '
	<br>
	' . $_POST["Contact_Tel"] . '
	<br>
	' . $_POST["Contact_Mobile"] . '
	<br>
	' . $_POST["Contact_Email"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Would you like an A1 poster at a cost of R3 000.00 excl VAT?</td>
		  <td>' . $_POST["A1_Poster_Required"] . '</td>
		  <td>Quantity:
			' . $_POST["Quantity"] . '</td>
		</tr>
	  </tbody>
	</table>
	';
		XMail("bonolo@cesa.co.za,athromethm@cesa.co.za,julia@xe.co.za", "Online Awards Entry", $sMsg, $_POST["Contact_Email"], "", "html");
		$bDisplayForm = false;

		echo "<p><b>Thank you for submitting your pre-entry.</b></p>";
	}
}
?>
<p>Please send the following <strong>required</strong> documents by email to <a href="mailto:bonolo@cesa.co.za">bonolo@cesa.co.za</a>:</p>
<ul>
	<li>Letters of consent from nominee / client, and JV partners</li>
	<li>Description of project or motivation for nominee (minimum 1 x A4, Arial 10)</li>
</ul>
<?php
if ($bDisplayForm) {
	if (!empty($sErrors)) {
?>
		<p style='color:red'>Please correct the following errors:</p>
		<ul style='color:red'>
			<?php
			echo $sErrors;
			?>
		</ul>
	<?php
	}
	?>
	<form method="post" action="/awards/entryform.php">
		<input type="hidden" name="go" value="1">
		<table width="700" border="1" cellpadding="2">
			<tbody>
				<tr>
					<td width="329" valign="top">Name of CESA Member Firm submitting the entry</td>
					<td colspan="2" valign="top"><input type="text" name="Firm_Name" id="Firm_Name" size="50" value="<?php echo $_POST["Firm_Name"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top" colspan="3">Award Category: <select name="Award_Category" id="Award_Category">
							<?php
							$arrCats = array(
								'Project with a value less than R50 million',
								'Project with a value between R50 million and R250 million',
								'Project with a value between R250 million and R1 billion',
								'Project with a value equal to or greater than R1 billion',
								'Best International Project',
								'Engineering Technology and Innovation - Water, Sanitation, and Hygiene (Wash) Design Excellence Award',
								'Engineering Technology and Innovation - Renewable Energy Systems Design Excellence Award',
								'Engineering Technology and Innovation - HVAC Building Systems Design Excellence',
								'Business Excellence Award',
								'Small Company of the Year',
								'Mentoring Company of the Year',
								'Young Engineer of the Year',
								'Mentor of the Year',
								'Lifetime Industry Achievement Award',
								'Visionary Client of the Year'
							);
							foreach ($arrCats as $value) {
								echo '<option value="' . $value . '"';
								if ($value == $_POST["Award_Category"]) echo ' selected';
								echo '>' . $value . '</option>';
							}
							?></select></td>
				</tr>
				<tr>
					<td valign="top">Name of Project Entered</td>
					<td colspan="2" valign="top"><input type="text" name="Project_Name" id="Project_Name" size="50" value="<?php echo $_POST["Project_Name"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Start Date of Project</td>
					<td colspan="2" valign="top"><input type="text" name="Start_Date" id="Start_Date" size="50" value="<?php echo $_POST["Start_Date"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Completion Date of Project i.e. hand-over to client<br>
						(Client must confirm completion date on consent letter)</td>
					<td colspan="2" valign="top"><input type="text" name="Completion_Date" id="Completion_Date" size="50" value="<?php echo $_POST["Completion_Date"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Name and Contact Details for Lead Consultant</td>
					<td width="99">Name:<br>
						Tel. Office:<br>
						Mobile:<br>
						Email:</td>
					<td width="252"><input type="text" name="Lead_Consultant_Name" id="Lead_Consultant_Name" size="40" value="<?php echo $_POST["Lead_Consultant_Name"]; ?>">
						<br>
						<input type="text" name="Lead_Consultant_Tel" id="Lead_Consultant_Tel" size="40" value="<?php echo $_POST["Lead_Consultant_Tel"]; ?>">
						<br>
						<input type="text" name="Lead_Consultant_Mobile" id="Lead_Consultant_Mobile" size="40" value="<?php echo $_POST["Lead_Consultant_Mobile"]; ?>">
						<br>
						<input type="text" name="Lead_Consultant_Email" id="Lead_Consultant_Email" size="40" value="<?php echo $_POST["Lead_Consultant_Email"]; ?>">
					</td>
				</tr>
				<tr>
					<td valign="top">Your Role in the Project</td>
					<td colspan="2"><input type="text" name="Role_In_Project" id="Role_In_Project" size="50" value="<?php echo $_POST["Role_In_Project"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">List of JV Partners (CESA Members Only)</td>
					<td colspan="2">
						<p>
							<textarea name="JV_Partners" id="JV_Partners" cols="45" rows="5"><?php echo $_POST["JV_Partners"]; ?></textarea>
						</p>
					</td>
				</tr>
				<tr>
					<td valign="top">Letter of Consent from JV partners sent?</td>
					<td colspan="2"><input name="JV_Consent" type="checkbox" id="JV_Consent" value="Yes" <?php if ($_POST["JV_Consent"] == "Yes") echo " checked"; ?>> Yes</td>
				</tr>
				<tr>
					<td valign="top">Name of Client / Company / Mentor / Young Engineer being Nominated</td>
					<td colspan="2" valign="top"><input type="text" name="Nominee_Name" id="Nominee_Name" size="50" value="<?php echo $_POST["Nominee_Name"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Letter of Consent from nominee / client sent? (<em>Not required for Visionary Client of the Year category)</em></td>
					<td colspan="2" valign="top"><input name="Nominee_Consent" type="checkbox" id="Nominee_Consent" value="Yes" <?php if ($_POST["Nominee_Consent"] == "Yes") echo " checked"; ?>>
						Yes</td>
				</tr>
				<tr>
					<td valign="top">Description of Project or Motivation for Nominee sent<br>
						Minimum 1 x A4, Arial 10</td>
					<td colspan="2" valign="top"><input name="Description_Sent" type="checkbox" id="Description_Sent" value="Yes" <?php if ($_POST["Description_Sent"] == "Yes") echo " checked"; ?>>
						Yes</td>
				</tr>
				<tr>
					<td valign="top">Contact Details for person submitting this entry</td>
					<td>Name:<br>
						Job Title:<br>
						Tel. Office:<br>
						Mobile:<br>
						Email:</td>
					<td><input type="text" name="Contact_Name" id="Contact_Name" size="40" value="<?php echo $_POST["Contact_Name"]; ?>">
						<br>
						<input type="text" name="Contact_Job_Title" id="Contact_Job_Title" size="40" value="<?php echo $_POST["Contact_Job_Title"]; ?>">
						<br>
						<input type="text" name="Contact_Tel" id="Contact_Tel" size="40" value="<?php echo $_POST["Contact_Tel"]; ?>">
						<br>
						<input type="text" name="Contact_Mobile" id="Contact_Mobile" size="40" value="<?php echo $_POST["Contact_Mobile"]; ?>">
						<br>
						<input type="text" name="Contact_Email" id="Contact_Email" size="40" value="<?php echo $_POST["Contact_Email"]; ?>">
					</td>
				</tr>
				<tr>
					<td valign="top">Would you like an A1 poster at a cost of R3 000.00 excl VAT?</td>
					<td><input name="A1_Poster_Required" type="checkbox" id="A1_Poster_Required" value="Yes" <?php if ($_POST["A1_Poster_Required"] == "Yes") echo " checked"; ?>>
						Yes</td>
					<td>Quantity:
						<input type="text" name="Quantity" id="Quantity" size="40" value="<?php echo $_POST["Quantity"]; ?>">
					</td>
				</tr>
				<tr>
					<td valign="top">&nbsp;</td>
					<td>&nbsp;</td>
					<td>&nbsp;</td>
				</tr>
				<tr valign="top">
					<td colspan="3">
						<p>
							<input name="Agree_To_Rules" type="checkbox" id="Agree_To_Rules" value="Yes" <?php if ($_POST["Agree_To_Rules"] == "Yes") echo " checked"; ?>>
							I agree to abide by the rules and regulations of the CESA Aon Engineering Excellence Awards and also pay a non-refundable fee of R4 617.00 (excluding VAT) on submission of this Pre-entry form.
							<!--
        I agree to abide by the rules and regulations of the CESA Aon Engineering Excellence Awards and also pay a non refundable deposit of R4 
		617.00 (excluding VAT) on submission of this Pre-entry form. This amounts to 30% of the total entry fee.<br>
      The balance of R10 773.00 (excluding VAT), I agree to pay on invitation to submit a full entry if all criteria for full entry are met.
-->
						</p>
					</td>
				</tr>
				<tr valign="top">
					<td colspan="3" align="center">
						<div class="g-recaptcha" data-sitekey="6LcoIWUrAAAAAKBLHpjS7GyroBey9G6yhilbpyNa"></div>
						<input type="submit" name="submit" id="submit" value="Submit">
					</td>
				</tr>
				<tr valign="top">
					<td colspan="3">
						<p>Please take note of the following:</p>
						<ul>
							<li>This is a preliminary entry only and indicates your intention to submit a full entry at a later stage in accordance with the rules of the competition.</li>
							<!--          <li>Once the Awards Committee has reviewed your pre-entry form/s, an email of confirmation will be sent to you, should your entry/entries be successful by no later than Wednesday, 13th April 2016.</li>
          <li>Incomplete or late entries will not be considered.</li>
          <li>If your pre-entry is successful, the full entry will be required by Wednesday, 25th May 2016.</li>-->
						</ul>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
<?php
}
?>