db_connect(); global $db_host, $db_user, $db_pass, $db_name; $dcon=mysqli_connect($db_host, $db_user, $db_pass, $db_name) or die(mysqli_error()); $Query=$dbCon->slctQuery('contacts','*','where ID=1'); $row=mysqli_fetch_array($Query); extract($row); // Adding BotDetect Captcha to the page $ExampleCaptcha = new Captcha("ExampleCaptcha"); $ExampleCaptcha->UserInputID = "CaptchaCode"; $ExampleCaptcha->CodeLength = 5; $ExampleCaptcha->ImageWidth = 250; $ExampleCaptcha->CustomLightColor = "Black"; $ExampleCaptcha->CustomDarkColor = "White"; $ExampleCaptcha->ImageStyle = ImageStyle::BlackOverlap; $bErr = false; $cErr = false; $time=$_POST['time']; $cotime=explode(" ",$time); $datepas = $_POST['date2']; $datecon = date('D', strtotime($datepas)); $sql = "SELECT * FROM office WHERE Oid = '1'"; $result2 = mysqli_query($dcon, $sql); while($row = mysqli_fetch_array($result2)) { $mon=$row[Monday]; $tue=$row[Tuesday]; $wed=$row[Wednesday]; $thr=$row[Thursday]; $fri=$row[Friday]; $sat=$row[Saturday]; $sun=$row[Sunday]; } $mond=explode('-', $mon); $tued=explode('-', $tue); $wedn=explode('-', $wed); $thrd=explode('-', $thr); $frid=explode('-', $fri); $satd=explode('-', $sat); $sund=explode('-', $sun); if($datecon == 'Mon' && $time != ''){ //from db $monday = $mond[0]; $startmondaylight = explode(' ',$monday); $emonday = $mond[1]; $endmondaylight = explode(' ',$emonday); $time_end = date("g:i",strtotime("- 30 minutes",strtotime($emonday))); //end from db if(strtotime($cotime[0])>=strtotime($startmondaylight[0]) && $startmondaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'AM')){ $con = 'true'; }else if(strtotime($cotime[0]) < strtotime($startmondaylight[0]) && $startmondaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'AM')){ $msg = 'Please choose time during office hours.'; } else if(strtotime($cotime[0]) <= strtotime($time_end) && $endmondaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'PM') ){ $con = 'true'; }else if(strtotime($cotime[0]) > strtotime($time_end) && $endmondaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'PM')) { $msg = 'You have exceeded last appointments time
'; } else if($mon == 'BY APPOINTMENT'){ $con = 'true'; } else{ $msg = "Monday ".$mon; } }else if($datecon == 'Tue' && $time != ''){ //from db $tuesday = $tued[0]; $starttuesdaylight = explode(' ',$tuesday); $etuesday = $tued[1]; $endtuesdaylight = explode(' ',$etuesday); $time_end = date("g:i",strtotime("- 30 minutes",strtotime($etuesday))); //end from db if(strtotime($cotime[0])>=strtotime($starttuesdaylight[0]) && $starttuesdaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'AM')){ $con = 'true'; }else if(strtotime($cotime[0]) < strtotime($starttuesdaylight[0]) && $starttuesdaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'AM')){ $msg = 'Please choose time during office hours.'; } else if(strtotime($cotime[0]) <= strtotime($time_end) && $endtuesdaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'PM') ){ $con = 'true'; }else if(strtotime($cotime[0]) > strtotime($time_end) && $endtuesdaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'PM')) { $msg = 'You have exceeded last appointments time
'; } else if($tue == 'BY APPOINTMENT'){ $con = 'true'; } else{ $msg = "Tuesday ".$tue; } }else if($datecon == 'Wed' && $time != ''){ //from db $wednesday = $wedn[0]; $startwednesdaylight = explode(' ',$wednesday); $ewednesday = $wedn[1]; $endwednesdaylight = explode(' ',$ewednesday); $time_end = date("g:i",strtotime("- 30 minutes",strtotime($ewednesday))); //end from db if(strtotime($cotime[0])>=strtotime($startwednesdaylight[0]) && $startwednesdaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'AM')){ $con = 'true'; }else if(strtotime($cotime[0]) < strtotime($startwednesdaylight[0]) && $startwednesdaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'AM')){ $msg = 'Please choose time during office hours.'; } else if(strtotime($cotime[0]) <= strtotime($time_end) && $endwednesdaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'PM') ){ $con = 'true'; }else if(strtotime($cotime[0]) > strtotime($time_end) && $endwednesdaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'PM')) { $msg = 'You have exceeded last appointments time
'; } else if($wed == 'BY APPOINTMENT'){ $con = 'true'; } else{ $msg = "Wednesday ".$wed; } }else if($datecon == 'Thu' && $time != ''){ //from db $thursday = $thrd[0]; $startthursdaylight = explode(' ',$thursday); $ethursday = $thrd[1]; $endthursdaylight = explode(' ',$ethursday); $time_end = date("g:i",strtotime("- 30 minutes",strtotime($ethursday))); //end from db if(strtotime($cotime[0])>=strtotime($startthursdaylight[0]) && $startthursdaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'AM')){ $con = 'true'; }else if(strtotime($cotime[0]) < strtotime($startthursdaylight[0]) && $startthursdaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'AM')){ $msg = 'Please choose time during office hours.'; } else if(strtotime($cotime[0]) <= strtotime($time_end) && $endthursdaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'PM') ){ $con = 'true'; }else if(strtotime($cotime[0]) > strtotime($time_end) && $endthursdaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'PM')) { $msg = 'You have exceeded last appointments time
'; } else if($thr == 'BY APPOINTMENT'){ $con = 'true'; } else { $msg = "Thursday ".$thr; } }else if($datecon == 'Fri' && $time != ''){ //from db $friday = $frid[0]; $startfridaylight = explode(' ',$friday); $efriday = $frid[1]; $endfridaylight = explode(' ',$efriday); $time_end = date("g:i",strtotime("- 30 minutes",strtotime($efriday))); //end from db if(strtotime($cotime[0])>=strtotime($startfridaylight[0]) && $startfridaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'AM')){ $con = 'true'; }else if(strtotime($cotime[0]) < strtotime($startfridaylight[0]) && $startfridaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'AM')){ $msg = 'Please choose time during office hours.'; } else if(strtotime($cotime[0]) <= strtotime($time_end) && $endfridaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'PM') ){ $con = 'true'; }else if(strtotime($cotime[0]) > strtotime($time_end) && $endfridaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'PM')) { $msg = 'You have exceeded last appointments time
'; } else if($fri == 'BY APPOINTMENT'){ $con = 'true'; } else{ $msg = "Friday ".$fri; } }else if($datecon == 'Sat' && $time != ''){ //from db $saturday = $satd[0]; $startsaturdaylight = explode(' ',$saturday); $esaturday = $satd[1]; $endsaturdaylight = explode(' ',$esaturday); $time_end = date("g:i",strtotime("- 30 minutes",strtotime($esaturday))); //end from db if(strtotime($cotime[0])>=strtotime($startsaturdaylight[0]) && $startsaturdaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'AM')){ $con = 'true'; }else if(strtotime($cotime[0]) < strtotime($startsaturdaylight[0]) && $startsaturdaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'AM')){ $msg = 'Please choose time during office hours.'; } else if(strtotime($cotime[0]) <= strtotime($time_end) && $endsaturdaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'PM') ){ $con = 'true'; }else if(strtotime($cotime[0]) > strtotime($time_end) && $endsaturdaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'PM')) { $msg = 'You have exceeded last appointments time
'; } else if($sat == 'BY APPOINTMENT'){ $con = 'true'; } else{ $msg = "Saturday ".$sat; } }else if($datecon == 'Sun' && $time != ''){ //from db $sunday = $sund[0]; $startsaturdaylight = explode(' ',$sunday); $esunday = $sund[1]; $endsundaylight = explode(' ',$esunday); $time_end = date("g:i",strtotime("- 30 minutes",strtotime($esunday))); //end from db if(strtotime($cotime[0])>=strtotime($startsundaylight[0]) && $startsundaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'AM')){ $con = 'true'; }else if(strtotime($cotime[0]) < strtotime($startsundaylight[0]) && $startsundaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'AM')){ $msg = 'Please choose time during office hours.'; } else if(strtotime($cotime[0]) <= strtotime($time_end) && $endsundaylight[1] == $cotime[1] || (strtotime($cotime[0]) >= strtotime('12:00') && $cotime[1] == 'PM') ){ $con = 'true'; }else if(strtotime($cotime[0]) > strtotime($time_end) && $endsundaylight[1] == $cotime[1] && (strtotime($cotime[0]) <= strtotime('11:59') && $cotime[1] == 'PM')) { $msg = 'You have exceeded last appointments time
'; } else if($sun == 'BY APPOINTMENT'){ $con = 'true'; } else{ $msg = "Sunday ".$sun; } }else{ } // when the form is submitted if($_POST){ // validate the Captcha to check we're not dealing with a bot $isHuman = $ExampleCaptcha->Validate(); if (!$isHuman) { // Captcha validation failed, show error message $msgcaptcha = "You have entered the wrong code!"; $bErr = true; } else { // Captcha validation passed, perform protected action if($con != ''){ $cname = $_POST['name']; $cemail = $_POST['email']; $cdate2 = $_POST['date2']; $ctime = $_POST['time']; $cphone = $_POST['phone']; $cdcondition = $_POST['dcondition']; $cmessage = $_POST['request']; require 'phpmailer/PHPMailerAutoload.php'; //$mail->SMTPDebug = 3; // Enable verbose debug output $mail = new PHPMailer(true); $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'secure.emailsrvr.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'leasing@rentaptsonline.com'; // SMTP username $mail->Password = '%56yMyO7Wbpg'; // SMTP password $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 465; // TCP port to connect to $mail->CharSet = 'UTF-8'; $mail->setFrom('leasing@rentaptsonline.com', ''.$cname.' | RentAptsOnline.Com | TheMultifamilyNetwork'); $mail->addAddress('villaknolls@ctmapartmentservices.com'); $mail->addReplyTo($cemail); $mail->addBCC('internal@rentaptsonline.com'); $mail->addBCC('rentaptsonline@gmail.com'); $mail->isHTML(true); // Set email format to HTML $mail->Subject = '🏠 New RAO Lead | www.RentVillaKnolls.Com'; $mail->Body = '

Villa Knolls Apartments 
By The CTM Company
Email Subject: '.$cdcondition.'
Name: '.$cname.'
Email: '.$cemail.'
Schedule of Appointment: '.$cdate2.' '.$ctime.'
Phone: '.$cphone.'
Customer message or request: '.htmlentities($cmessage).'
'; //Auto-Reply Email Codes $mail2 = new PHPMailer(true); $mail2->isSMTP(); // Set mailer to use SMTP $mail2->Host = 'secure.emailsrvr.com'; // Specify main and backup SMTP servers $mail2->SMTPAuth = true; // Enable SMTP authentication $mail2->Username = 'leasing@rentaptsonline.com'; // SMTP username $mail2->Password = '%56yMyO7Wbpg'; // SMTP password $mail2->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted $mail2->Port = 465; // TCP port to connect to $mail2->CharSet = 'UTF-8'; $mail2->setFrom('leasing@rentaptsonline.com', 'RentVillaKnolls.Com | Contact Us'); $mail2->addAddress($cemail); $mail2->addReplyTo($cemail); $mail2->isHTML(true); // Set email format to HTML $autoconvert = htmlspecialchars_decode($CONTACT, ENT_COMPAT); $autodecode = html_entity_decode($autoconvert); $autoclean = strip_tags($autodecode); $mail2->Subject = '🏠 Auto Reply Email From Contact Us | www.RentVillaKnolls.Com'; $mail2->Body = '

Villa Knolls Apartments 
By The CTM Company
'.$autoclean.'
Email Subject: '.$cdcondition.'
Name: '.$cname.'
Email: '.$cemail.'
Schedule of Appointment: '.$cdate2.' '.$ctime.'
Phone: '.$cphone.'
Customer message or request: '.htmlentities($cmessage).'
This is a system-generated e-mail. This email was sent from a notification-only address that cannot accept incoming email. Please do not reply.
'; if(substr_count($cmessage,'a href=')==0 && substr_count($cmessage,'www.')==0 && substr_count($cmessage,'http://')==0 && substr_count($cmessage,'src=')==0 && substr_count($cmessage,'.exe')==0 && substr_count($cmessage,'.php')==0 && substr_count($cmessage,'.net')==0 && substr_count($cmessage,'.com')==0) { if(!$mail->send()) { echo 'Message could not be sent. '; } else { $mail2->send(); header ('location: 91942-request-done.html#index-content'); } } else { $cErr = true; $msgcaptcha = "Sending Error. There was an error in the information that you have presented.
Your request is not successful."; } } } } $Query=mysqli_query($dcon, "Select * from contact_info where ID=1")or die(mysqli_error()); $information=mysqli_fetch_array($Query); extract($information); ?>

Villa Knolls Apartment Contact Us, For Rent Apts - La Mesa 91942 | RentVillaKnolls.Com

Html(); ?>
'.$msgcaptcha.'
'; } else{} ?>