“USA”,”AL” => “Alabama”,”AK” => “Alaska”,”AZ” => “Arizona”,”AR” => “Arkansas”,”CA” => “California”,”CO” => “Colorado”,”CT” => “Connecticut”,”DE” => “Delaware”,”DC” => “District of Columbia”,”FL” => “Florida”,”GA” => “Georgia”,”HI” => “Hawaii”,”ID” => “Idaho”,”IL” => “Illinois”,”IN” => “Indiana”,”IA” => “Iowa”,”KS” => “Kansas”,”KY” => “Kentucky”,”LA” => “Louisiana”,”ME” => “Maine”,”MD” => “Maryland”,”MA” => “Massachusetts”,”MI” => “Michigan”,”MN” => “Minnesota”,”MS” => “Mississippi”,”MO” => “Missouri”,”MT” => “Montana”,”NE” => “Nebraska”,”NV” => “Nevada”,”NH” => “New Hampshire”,”NJ” => “New Jersey”,”NM” => “New Mexico”,”NY” => “New York”,”NC” => “North Carolina”,”ND” => “North Dakota”,”OH” => “Ohio”,”OK” => “Oklahoma”,”OR” => “Oregon”,”PA” => “Pennsylvania”,”RI” => “Rhode Island”,”SC” => “South Carolina”,”SD” => “South Dakota”,”TN” => “Tennessee”,”TX” => “Texas”,”UT” => “Utah”,”VT” => “Vermont”,”VA” => “Virginia”,”WA” => “Washington”,”WV” => “West Virginia”,”WI” => “Wisconsin”,”WY” => “Wyoming”,”end USA” => “end”,”start Canada” => “CANADA”,”AB” => “Alberta”,”BC” => “British Columbia”,”MB” => “Manitoba”,”NB” => “New Brunswick”,”NF” => “Newfoundland”,”NT” => “Northwest Territory”,”NS” => “Nova Scotia”,”NU” => “Nunavut”,”ON” => “Ontario”,”PE” => “Prince Edward Island”,”QC” => “Quebec”,”SK” => “Saskatchewan”,”YT” => “Yukon Territory”,”end Canada” => “end”); $user = &JFactory::getUser(); $userEmail = $user->get(“email”); if (isset($_POST[“actionSubmit”])) { $show_request_date = $_POST[“show_request_date”]; if($show_request_date) { $request_date = date(“Y-m-d”, strtotime($show_request_date)); } $show_start_date = $_POST[“show_start_date”]; if ($show_start_date) { $start_date = date(“Y-m-d”, strtotime($show_start_date)); } $show_end_date = $_POST[“show_end_date”]; if($show_end_date) { $end_date = date(“Y-m-d”, strtotime($show_end_date)); } $po_fname = $_POST[“po_fname”]; $po_lname = $_POST[“po_lname”]; $po_card = $_POST[“po_card”]; $userEmail = $_POST[“userEmail”]; $po_phone = $_POST[“po_phone”]; $po_phonetype = $_POST[“po_phonetype”]; $po_address = $_POST[“po_address”]; $g_fname= $_POST[“g_fname”]; $g_lname= $_POST[“g_lname”]; $g_license = $_POST[“g_license”]; $g_license_state = $_POST[“g_license_state”]; $g_address = $_POST[“g_address”]; $agree = $_POST[“agree”]; $passID = time(); if ($agree != “agree”) { $agree = “disagree”; } $x = $_POST[“x”]; $y = $_POST[“y”]; $sum = $_POST[“sum”]; if ($start_date == “”) { echo ““; } else if ($end_date == “”) { echo ““; } else if ($po_fname == “”) { echo ““; } else if ($po_lname == “”) { echo ““; } else if ($po_card == “”) { echo ““; } else if ($po_phone == “”) { echo ““; } else if ($po_address == “”) { echo ““; } else if ($g_fname == “”) { echo ““; } else if ($g_lname == “”) { echo ““; } else if ($g_license == “”) { echo ““; } else if ($g_license_state == “Choose”) { echo ““; } else if ($g_address == “”) { echo ““; } else if ($agree == “disagree”) { echo ““; } else if ($x + $y != $sum) { $flag = 0; echo ““; } else { /* ############### */ /* ##### SQL ##### */ /* ############### */ $conn = mysql_connect(“localhost”, “nrrecc5_3rrec”, “3Rr3c!”) or die(mysql_error()); mysql_select_db(“nrrecc5_3rrec”, $conn) or die(mysql_error()); MYSQL_QUERY (“INSERT INTO guest_pass ( request_date, start_date, end_date, po_fname, po_lname, po_card, po_email, po_phone, po_phonetype, po_address, g_fname, g_lname, g_license, g_license_state, g_address, agree, passID ) VALUES ( ‘$request_date’, ‘$start_date’, ‘$end_date’, ‘$po_fname’, ‘$po_lname’, ‘$po_card’, ‘$userEmail’, ‘$po_phone’, ‘$po_phonetype’, ‘$po_address’, ‘$g_fname’, ‘$g_lname’, ‘$g_license’, ‘$g_license_state’, ‘$g_address’, ‘$agree’, ‘$passID’ )”, $conn); /* ################# */ /* ##### EMAIL ##### */ /* ################# */ require(“phpmailer/class.phpmailer.php”); $message2 = “
“; $message2 .= “
CLICK HERE TO AUTHORIZE GUEST PASS
“; $message2 .= “
Clicking the link indicates that you authorize this guest pass for ” . $g_fname . ” ” . $g_lname . “ for the dates: ” . $show_start_date . ” – ” . $show_end_date . “ .
“; $message2 .= “
This message was sent to the email address associated with your 3R website account, and is meant to ensure that this guest pass was requested by a landowner.
“; $message2 .= “
If you have not received your Guest Pass within 24 hours, please contact the 3R Office: 541-420-0556 or info@3rrec.com
“; $message2 .= “
“; $mail2 = new PHPMailer(); $mail2->IsSMTP(); $mail2->SMTPDebug = 1; $mail2->SMTPAuth = “true”; $mail2->Host = “mail.3rrec.com”; $mail2->Port = “25”; $mail2->Username = “info@3rrec.com”; $mail2->Password = “3rr3c1nf0”; $mail2->IsHTML(true); $mail2->SetFrom(“info@3rrec.com”,”3RLOA Website”); $mail2->AddAddress($userEmail); //$mail2->AddAddress(“webmaster@3rrec.com”); $mail2->Subject = “3R Guest Pass Authorization”; $mail2->Body = $message2; if(!$mail2->Send()) { echo ‘Message 2 was not sent.’; echo ‘Mailer error: ‘ . $mail2->ErrorInfo; } $request_date = “”; $show_request_date = “”; $start_date = “”; $show_start_date = “”; $end_date = “”; $show_end_date = “”; $po_phonetype = “”; $g_fname= “”; $g_lname = “”; $g_license = “”; $g_license_state = “”; $g_address = “”; $agree = “”; $passID = “”; $flag = 1; echo ““; } } $x = rand(1,10); $y = rand(1,10); ?>