require '../members/check.php'; ?>
TigerRoar.com - Total LSU Fan interaction
include '../headers/header2007.php';
require 'config.php';
include 'mysql_connect.php';
$link = mysql_connect ($db_hostname, $db_username, $db_password) or die ("Unable to connect to database.");
$PHP_SELF = $_SERVER['PHP_SELF'];
if (isset($_GET['tid'])) { $tid = $_GET['tid']; }
if (isset($_POST['tid'])) { $tid = $_POST['tid']; }
if (isset($_POST['sending'])) { $sending = $_POST['sending']; } else { $sending = ""; }
if (isset($_POST['sendername'])) { $sendername = $_POST['sendername']; }
if (isset($_POST['replyemail'])) { $replyemail = $_POST['replyemail']; }
if (isset($_POST['comments'])) { $comments = $_POST['comments']; }
//---FUNCTIONS ---------------------------------//
$query = "SELECT * FROM $exchange_table where ticket_id='$tid'";
$result = mysql_db_query ($db_name, $query, $link);
$Row = mysql_fetch_array ($result) ;
$buy = $Row['buy'];
$type = $Row['type'];
$member = $Row['member'];
$sport = $Row['sport'];
$gamedate = $Row['gamedate'];
$date_of_post = $Row['date_posted'];
$section = $Row['section'];
$row = $Row['row'];
$seats = $Row['seats'];
$price_total = $Row['price'];
if ($sending !="" ) {
// SEND MESSAGE TO MEMBER //////////////////////////////////////////////
$to = "$Row[email]";
$member = "$Row[member]";
$subject = "Response to $Row[number_items] $Row[game]";
if($Row['type'] == 1) {
$subject .= " Tickets";
} elseif ($Row['type'] == 2) {
$subject .= " Parking Passes";
}
if ($Row['buy'] =="0") {
$subject .= " For sale";
} elseif($Row['buy']=="1") {
$subject .= " Needed";
}
$fromName = "$sendername";
$fromAddress = "$replyemail";
$MailBody ="Dear Tiger Roar Member $member,\n\n";
# $MailBody ="Dear Tiger Roar Member ($Row[member]),\n\n";
$MailBody = "In response to your post $Row[number_items] $Row[game]";
if($type == '1') {
$MailBody .= " Tickets";
} elseif ($type == 2) {
$MailBody .= " Parking Passes";
}
if ($buy =="0") {
$MailBody .= " For Sale ";
} elseif($buy=="1") {
$MailBody .= " Needed ";
}
$MailBody .= "$fromName has responded with the following:\n\n";
$MailBody .= "Comments: $comments \n\n";
$MailBody .= "$fromName\'s email address is: $fromAddress (you may reply directly to this email) \n";
$MailBody .= "\n\n------------------------------------------------------\n";
$MailBody .= "To protect you from spam and help maintain your privacy, your email address has been masked to the general public and this message has been sent to you from Tiger Roar. Please be aware that once you respond to this person, your email address will no longer be hidden. Thank you for being a member of Tiger Roar!\n\n";
$MailBody = stripslashes($MailBody);
// SEND MESSAGE TO RESPONDER /////////////////////////////////////////////
$to3 = "$replyemail";
$subject3 = "Ticket Exchange Response.";
$fromName3 = "Tiger Roar Ticket Exchange";
$fromAddress3 = "info@tigerroar.com";
$MailBodyb = "Your response to $Row[number_items] $Row[game]";
if($type == 1) {
$MailBodyb .= " Tickets";
} elseif ($type == 2) {
$MailBodyb .= " Parking Passes";
}
if ($buy == "0") {
$MailBodyb .= " For Sale ";
} elseif($buy== "1") {
$MailBodyb .= " Needed ";
}
$MailBodyb .= "has been sent to $Row[member].\n\n";
$MailBodyb .= "If the member wishes to contact you they will do so directly from this point. \n\nThank you for using the Tiger Roar ticket exchange!\n\n";
#$MailBodyb .= "\n\n------------------------------------------------------\n";
#$MailBodyb .= "Sign up for Tiger Roar Membership and be able to post your tickets or requests on the exchange! Members also have access to non-public posts. Be part of the largest and longest running LSU community on the internet!\n\n http://www.tigerroar.com/signup";
$MailBodyb = stripslashes($MailBodyb);
$headers = "From: $fromAddress";
// send out the first email to the member
$temp = mail($to,$subject,$MailBody,"From: ".$fromName." <".$fromAddress.">") or print "Mail to Member failed.
";
#$temp = mail($to, $subject, $MailBody, $headers, "-f info@tigerroar.com") or print "Mail to Member failed.
";
if ($temp = true) {
echo "
Your message has been sent.
Return to the Ticket Exchange";
// send out the second email to the outsider
$temp3= mail($to3, $subject3, $MailBodyb, "From: ".$fromName3." <".$fromAddress3.">") or print "Confirmation Failed.
";
if ($temp3 = true) {
$success1=TRUE;
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// Scott, if you want a copy of each request (to monitor people contacting members for another reason, add them to a table here
$remote_addr = $_SERVER['REMOTE_ADDR'];
$query = "INSERT INTO ticket_responses (remote_addr,from_name,from_addr,to_name,to_addr,subject,message)
values ('$remote_addr','$fromName','$fromAddress','$member','$to','$subject','$comments')";
$result = mysql_db_query ($db_name, $query, $link);
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/* (Old way) Scott, if you want a copy of each request (to monitor people contacting members for another reason, put your email address in here and unescape the code -----------------
// Send a copy to you to monitor spam attempts /////////////////////////////
$to2 = "hailreagan@tigerroar.com";
$subject2 = "Copy of message";
$fromName2 = "TICKET EXCHANGE";
$fromAddress2 = "hailreagan@tigerroar.com";
$MailBody2 = "Post: ($Row[number_items] $Row[game]";
if($type1 == 1) {
$MailBody2 .= " Tickets";
} elseif ($type1 == 2) {
$MailBody2 .= " Parking Passes";
}
if ($type2 == "p") {
$MailBody2 .= " for sale) \n";
} elseif($type2 == "r") {
$MailBody2 .= " needed) \n";
}
$MailBody2 .= "$fromName ( $replyemail ) has responded with the following:\n\n";
$MailBody2 .= "Comments: \" $comments \" \n\n";
$MailBody2 = stripslashes($MailBody2);
$temp2 = mail($to2, $subject2, $MailBody2, "From: ".$fromName2." <".$fromAddress2.">") or print "Could not send mail.
";
if ($temp2 = true) {
*/
$SUCCESS2=true;
//--- dont forget this one too---> }
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
} else {
echo "Message was not sent due to error. Please try again.";
}
} else {
echo "
";
}
echo "   ";
mysql_close ($link);
include '/home/tigerroa/headers/footer2007.php';
?>