Code: Select all
<?php require_once('../Connections/spartanwisdom.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "bopconfirmation")) {
$insertSQL = sprintf("INSERT INTO BOPConfirmation (`Date`, AgentCode, AgentName, GuestName, GuestEmail, GuestPhone, Email) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['date'], "date"),
GetSQLValueString($_POST['agentcode'], "text"),
GetSQLValueString($_POST['agentname'], "text"),
GetSQLValueString($_POST['guestname'], "text"),
GetSQLValueString($_POST['email'], "text"),
GetSQLValueString($_POST['guestnumber'], "text"),
GetSQLValueString($_POST['email'], "text"));
mysql_select_db($database_spartanwisdom, $spartanwisdom);
$Result1 = mysql_query($insertSQL, $spartanwisdom) or die(mysql_error());
}
?>
<style type="text/css">
.label{
text-align:right;
}
#submit{
text-align:center;
}
body,td,th {
color: #000000;
}
body {
background-color: #CCCCCC;
}
a:hover {
color: #0099CC;
}
a:visited {
color: #9933CC;
}
.style1 {
color: #FF0000;
font-weight: bold;
}
</style>
<?php
$to='deniseadkins83@gmail.com';
$from='info@spartanwisdom.com';
$messageSubject='BOP Attendee Confirmation Call';
$confirmationSubject='Tuesday Night Attendance Instructions';
$confirmationBody= "www.spartanwisdom.com/bop/invitedtobop/bopinvitedvideodayof.html";
$name='';
$guestname='';
$phone='';
$bopdate='';
$email='';
$body='';
$displayForm=true;
if ($_POST){
$email=stripslashes($_POST['email']);
$body=stripslashes($_POST['body']);
$name=stripslashes($_POST['name']);
$guestname=stripslashes($_POST['guestname']);
$phone=stripslashes($_POST['phone']);
$bopdate=stripslashes($_POST['bopdate']);
// validate e-mail address
$valid=eregi('^([0-9a-z]+[-._+&])*[0-9a-z]+@([-0-9a-z]+[.])+[a-z]{2,6}$',$email);
$crack=eregi("(\r|\n)(to:|from:|cc:|bcc:)",$body);
if ($name && $guestname && $phone && $bopdate && $email && $body && $valid && !$crack){
if (mail($to,$messageSubject,$name.$guestname.$phone.$bopdate.$body,'From: '.$from."\r\n")
&& mail($email,$confirmationSubject,$confirmationBody.$body,'From: '.$from."\r\n")){
$displayForm=false;
?>
<script type="text/javascript">
<!--
function MM_popupMsg(msg) { //v1.0
alert(msg);
}
//-->
</script>
<p>
Your message was successfully sent.
In addition, a confirmation copy was sent to your e-mail address.
Your message is shown below.</p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
echo '<p>'.htmlspecialchars($body).'</p>';
}else{ // the messages could not be sent
?>
<p>
Something went wrong when the server tried to send your message.
This is usually due to a server error, and is probably not your fault.
We apologise for any inconvenience caused.</p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
}
}else if ($crack){ // cracking attempt
?>
<p><strong>
Your message contained e-mail headers within the message body.
This seems to be a cracking attempt and the message has not been sent.
</strong></p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<?php
}else{ // form not complete
?>
<p><strong>
Your message could not be sent.
You must include both a valid e-mail address and a message.
</strong></p>
<p align="center"><a href="../agent.php">Back to Home Page</a></p>
<p>
<?php
}
}
if ($displayForm){
?>
</p>
<p>Please Enter all the Information in for the Invite, this way we have a faster more streamlined sign in process and also more organized follow up and confirmation. They will receive a phone call reminder and a email reminder as well. Please make sure that you add your invites the day you invited them this way the email that goes out is a fresh reminder.</p>
<p><span class="style1">**Please make sure that these are solid invites, meaning that they have confirmed to you that they will be attending the meeting. This is not a confirmation for someone you asked to come to a meeting and they said they might make it. This is a call to say we are reminding you of the appointment you scheduled with 'inviter' to attend our company overview. Also please note that the guest email must be filled out correctly for the guest to receive the confirmation email. Also the standard pre-written letter is in the last box. Feel free to add a salutation or a personal touch to the email. The guest will recieve the email with a link that will send them to a site to fill out a rsvp form and instructions and directions.**</span></p>
<form action="<?php echo $editFormAction; ?>" method="POST" name="bopconfirmation" id="bopconfirmation">
<table>
<tr>
<td class="label">Date of BOP Guest Attending:</td>
<td><label>
<input name="date" type="text" id="date" value="<?php echo htmlspecialchars($bopdate); ?>">
</label></td>
</tr>
<tr>
<td class="label">Agent Code:</td>
<td><label>
<input type="text" name="agentcode" id="agentcode">
</label></td>
</tr>
<tr>
<td class="label"><label for="email">Agent Name:</label></td>
<td><label>
<input name="agentname" type="text" id="agentname" value="<?php echo htmlspecialchars($name); ?>">
</label></td>
</tr>
<tr>
<td class="label">Guest Name:</td>
<td><label>
<input name="guestname" type="text" id="guestname" value="<?php echo htmlspecialchars($guestname); ?>">
</label></td>
</tr>
<tr>
<td class="label">Guest Email:</td>
<td><input type="text" name="email" id="email" value="<?php echo htmlspecialchars($email); ?>" size="30" />
(a confirmation e-mail will be sent to this address) </td>
</tr>
<tr>
<td class="label">Guest Phone Number:</td>
<td><label>
<input name="guestnumber" type="text" id="guestnumber" value="<?php echo htmlspecialchars($phone); ?>">
</label></td>
</tr>
<tr>
<td class="label"><label for="body">Confirmation email that goes to guest<br>
:</label></td>
<td><textarea name="body" id="body" cols="70" rows="5">Thanks for confirming your attendance to our tuesday night open house. We look forward to meeting you. Please go to the following link for further instructions and directions to our office. Again we look forward to meeting you.
<?php echo htmlspecialchars($body); ?>
Thanks Again
Denise Adkins
Director of Operations
Global Financial Advisors
</textarea></td>
</tr>
<tr><td id="submit" colspan="2"><button type="submit" onclick="MM_popupMsg('Please make sure you are clear on instructions. Make sure guest email is filled out properly so that your guest received the rsvp email. Corey will recieve a copy of this and call your invitee accordingly.')">Send Confirmation</button></td></tr>
</table>
<input type="hidden" name="MM_insert" value="bopconfirmation">
</form>
<?php
}
?>