Your IP : 216.73.217.79


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

<?php
error_reporting(E_ALL);
ini_set('display_errors', 1);

include_once($_SERVER['DOCUMENT_ROOT'] . '/cfg/config.php');
include_once($_SERVER['DOCUMENT_ROOT'] . '/cesanet/inc_shared.php');

use PHPMailer\PHPMailer\PHPMailer;


$sErrors = "";
$bDisplayForm = true;

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

	maill($to, $subject, $msg, null, array('from-address' => $from, 'from-name' => 'CESA SCE', 'cc' => array($CC), 'isHTML' => $type));
	return;

	$mail = new PHPMailer;
	$mail->Mailer   = "mail";
	/*	
	$mail->Mailer="smtp";
	$mail->Host="relay.aitonline.co.za";
	$mail->Port=587;
	$mail->Username="mail@cesa.co.za";
	$mail->Password="c3SAmail!@!";
	$mail->SMTPDebug=false;
	$mail->SMTPAuth=true;
	*/
	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 .= "<li>You could not be verified as not being a robot, please tick the reCaptcha verification option at the bottom of the form.</li>";
	} else {

		if (empty($_POST["Email_Address"])) {
			$sErrors .= "<li>Please enter your email address</li>";
		}
	}
	if (empty($sErrors)) {

		$sMsg = '<table width="700" border="1" cellpadding="2">
	  <tbody>
		<tr>
		  <td valign="top">Nature of the Request</td>
		  <td valign="top">' . $_POST["Nature_of_the_Request"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Requested Course</td>
		  <td valign="top">' . $_POST["Requested_Course"] . '</td>
		</tr>
		<tr>
		  <td valign="top">First Name</td>
		  <td valign="top">' . $_POST["First_Name"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Surname</td>
		  <td valign="top">' . $_POST["Surname"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Company Name</td>
		  <td valign="top">' . $_POST["Company_Name"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Contact Number</td>
		  <td valign="top">' . $_POST["Contact_Number"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Email Address</td>
		  <td valign="top">' . $_POST["Email_Address"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Province</td>
		  <td valign="top">' . $_POST["Province"] . '</td>
		</tr>
		<tr>
		  <td valign="top">Message</td>
		  <td valign="top">' . $_POST["Your_Message"] . '</td>
		</tr>
	  </tbody>
	</table>
	';

		XMail("sce@cesa.co.za,blessings@cesa.co.za", "Website Enquiry RE Venue Hire or In-house Training", $sMsg, $_POST["Email_Address"], "", "html");
		$bDisplayForm = false;

		echo "<p><b>Thank you for submitting your enquiry, it has been sent to us and we will get back to you shortly.</b></p>";
	}
}
?>
<?php
if ($bDisplayForm) {
?>
	<script src='https://www.google.com/recaptcha/api.js' async defer></script>
	<?php
	if (!empty($sErrors)) {
	?>
		<p style='color:red'>Please correct the following errors:</p>
		<ul style='color:red'>
			<?php
			echo $sErrors;
			?>
		</ul>
	<?php
	}
	?>
	CESA offers In-house training courses and venue hire options at a reasonable rate. Should you be interested in any in-house courses or use of our Johannesburg venue hire facility, please complete the required fields below to send us an enquiry and we will get back to you as soon as possible.
	<form method="post" action="">
		<input type="hidden" name="go" value="1">
		<table width="700" border="1" cellpadding="2">
			<tbody>
				<tr>
					<td width="203" valign="top">Nature of the Request</td>
					<td width="477" valign="top"><select name="Nature_of_the_Request" id="Nature_of_the_Request">
							<option value="In-house training" <?php if ($_POST["Nature_of_the_Request"] == "In-house training") echo " selected"; ?>>In-house training</option>
							<option value="Venue hire" <?php if ($_POST["Nature_of_the_Request"] == "Venue hire") echo " selected"; ?>>Venue hire</option>
						</select>
					</td>
				</tr>
				<tr>
					<td valign="top">Requested Course</td>
					<td valign="top"><input type="text" name="Requested_Course" id="Requested_Course" size="50" value="<?php echo $_POST["Requested_Course"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">First Name</td>
					<td valign="top"><input type="text" name="First_Name" id="First_Name" size="50" value="<?php echo $_POST["First_Name"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Surname</td>
					<td valign="top"><input type="text" name="Surname" id="Surname" size="50" value="<?php echo $_POST["Surname"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Company Name</td>
					<td valign="top"><input type="text" name="Company_Name" id="Company_Name" size="50" value="<?php echo $_POST["Company_Name"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Contact Number</td>
					<td><input type="text" name="Contact_Number" id="Contact_Number" size="50" value="<?php echo $_POST["Contact_Number"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Email Address (* required)</td>
					<td><input type="text" name="Email_Address" id="Email_Address" size="50" value="<?php echo $_POST["Email_Address"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Province where training will take place</td>
					<td><input type="text" name="Province" id="Province" size="50" value="<?php echo $_POST["Province"]; ?>"></td>
				</tr>
				<tr>
					<td valign="top">Your Message</td>
					<td>
						<p>
							<textarea name="Your_Message" id="Your_Message" cols="45" rows="5"><?php echo $_POST["Your_Message"]; ?></textarea>
						</p>
					</td>
				</tr>
				<tr valign="top">
					<td colspan="2" 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="2">
						<p>Note: A minimum number of 10 delegates is required for all in-house courses</p>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
<?php
}
?>