Esempio n. 1
0
 public function contact_submit($params = array())
 {
     $mail = new \helpers\phpmailer\mail();
     $mail->setFrom(EMAIL_ADDR, SITETITLE);
     $mail->addAddress(EMAIL_ADDR);
     $mail->subject('[' . SITETITLE . '] A New Contact Form Has Been Submitted.');
     $message = '<table style="border:none"><tr><td style="width:200px"><b>Name</b></td><td>' . $params['name'] . '</td></tr>' . '<tr><td><b>Email</b></td><td>' . $params['email'] . '</td></tr>' . '<tr><td><b>Phone</b></td><td>' . $params['phone'] . '</td></tr>' . '<tr><td><b>Best time to call</b></td><td>' . $params['best_time_to_call'] . '</td></tr>' . '<tr><td><b>Year of last conviction</b></td><td>' . $params['last_conviction'] . '</td></tr>' . '<tr><td><b>Fines/Probation Status</b></td><td>' . $params['fines_status'] . '</td></tr>' . '<tr><td><b>Criminal Record</b></td><td>' . $params['criminal_record'] . '</td></tr>' . '</table>';
     $mail->body($message);
     $email_sent = $mail->send();
     $db_params = array("name" => $params['name'], "email" => $params['email'], "phone" => $params['phone'], "best_time_to_call" => $params['best_time_to_call'], "last_conviction" => $params['last_conviction'], "fines_status" => $params['fines_status'], "criminal_record" => $params['criminal_record'], "email_sent" => $email_sent);
     $this->_db->insert('contact', $db_params);
     return $this->_db->lastInsertId('id');
 }
Esempio n. 2
0
 public function noncanadians_submit($params = array())
 {
     $mail = new \helpers\phpmailer\mail();
     $mail->setFrom(EMAIL_ADDR, SITETITLE);
     $mail->addAddress(EMAIL_ADDR);
     $mail->subject('[' . SITETITLE . '] A New Non-Canadians Form Has Been Submitted.');
     $message = '<table style="border:none">' . '<tr><td style="width:200px;height:24px;"><b>Firstname</b></td><td>' . $params['firstname'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>Lastname</b></td><td>' . $params['lastname'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>Email</b></td><td>' . $params['email'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>Phone</b></td><td>' . $params['phone'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>SIN or ITN</b></td><td>' . $params['sin'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>Birthdate</b></td><td>' . $params['birthdate'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>When did you arrive in Canada</b></td><td>' . $params['arrived_at'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>Were you working in Canada</b></td><td>' . $params['worked'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>How much money did you earn in Canada</b></td><td>' . $params['earned'] . '</td></tr>' . '<tr><td style="width:200px;height:24px;"><b>How much rent did you paid during the year</b></td><td>' . $params['rent'] . '</td></tr></table>';
     $mail->body($message);
     $email_sent = $mail->send();
     $db_params = array("firstname" => $params['firstname'], "lastname" => $params['lastname'], "email" => $params['email'], "phone" => $params['phone'], "arrived_at" => $params['arrived_at'], "worked" => $params['worked'], "earned" => $params['earned'], "rent" => $params['rent'], "email_sent" => $email_sent);
     $this->_db->insert('noncanadians', $db_params);
     return $this->_db->lastInsertId('id');
 }
Esempio n. 3
0
 public function contact_submit($params = array())
 {
     $mail = new \helpers\phpmailer\mail();
     $mail->setFrom($params['email']);
     $mail->addAddress(EMAIL_ADDR);
     $mail->subject($params['subject']);
     $message = '<table style="border:none"><tr><td style="width:80px"><b>Name</b></td><td>' . $params['name'] . '</td></tr>' . '<tr><td><b>Email</b></td><td>' . $params['email'] . '</td></tr>' . '<tr><td><b>Phone</b></td><td>' . $params['phone'] . '</td></tr>' . '<tr><td><b>Message</b></td><td>' . $params['message'] . '</td></tr></table>';
     $mail->body($message);
     $email_sent = $mail->send();
     $db_params = array("name" => $params['name'], "email" => $params['email'], "phone" => $params['phone'], "subject" => $params['subject'], "message" => $params['message'], "email_sent" => $email_sent);
     $this->_db->insert('contact', $db_params);
     return $this->_db->lastInsertId('id');
 }
Esempio n. 4
0
 public function index()
 {
     //SEO
     $data['title'] = Language::show('title', 'contact', $_SESSION['site_lang']);
     $data['meta_description'] = Language::show('meta_description', 'contact', $_SESSION['site_lang']);
     $data['meta_keywords'] = '';
     $data['sitename_before'] = "Y";
     //title for de hover in navbar
     $data['title_page'] = "contact";
     //contacts
     $data['contacts'] = $this->_model->fetchContacts($_SESSION['site_lang']);
     // Envio de correo
     if (!is_null(filter_input(INPUT_POST, 'submit'))) {
         $name = filter_input(INPUT_POST, 'name');
         $email_contact = filter_input(INPUT_POST, 'email_contact');
         $email_client = filter_input(INPUT_POST, 'email_client');
         $phone = filter_input(INPUT_POST, 'phone');
         $comment = filter_input(INPUT_POST, 'message');
         if ($name == '' || !isset($name) || $email_client == '' || !isset($email_client) || $comment == '' || !isset($comment)) {
             $error = "";
             Url::redirect($_SESSION['site_lang'] . "/contact.php?error=1");
         }
         if (!$error) {
             $mail = new \helpers\phpmailer\mail();
             $mail->CharSet = 'UTF-8';
             $mail->setFrom($email_client);
             $mail->addAddress($email_contact);
             $mail->addAddress(EMAIL_PIERRE);
             $mail->addAddress(EMAIL_INFO);
             $subject = "Govacationmaya Contact";
             $subject .= date("Y-m-d");
             $mail->subject($subject);
             $message = "Language: " . $_SESSION['site_lang'] . "<br><br>";
             $message .= "Name: " . $name . "<br>";
             $message .= "Email: " . $email_client . "<br>";
             $message .= "Phone: " . $phone . "<br>";
             $message .= "Comment: " . $comment;
             $mail->body($message);
             if (!$mail->send()) {
                 Url::redirect($_SESSION['site_lang'] . "/contact.php?error=2");
             } else {
                 Url::redirect($_SESSION['site_lang'] . "/contact.php?send=1");
             }
         }
     }
     //tender views
     View::rendertemplate('header', $data);
     View::render('contact/contact', $data, $error);
     View::rendertemplate('footer', $data);
 }
Esempio n. 5
0
 public function detailVente($url)
 {
     //send of mail
     if (!is_null(filter_input(INPUT_POST, 'submit'))) {
         $name = filter_input(INPUT_POST, 'name');
         $email = filter_input(INPUT_POST, 'email');
         $phone = filter_input(INPUT_POST, 'phone');
         $comment = filter_input(INPUT_POST, 'comment');
         if ($name == '' || !isset($name) || $email == '' || !isset($email) || $comment == '' || !isset($comment)) {
             $error = "";
             Url::redirect("?error=1", true);
         }
         if (!$error) {
             $mail = new \helpers\phpmailer\mail();
             $mail->CharSet = 'UTF-8';
             $mail->setFrom($email);
             $mail->addAddress(EMAIL_PIERRE);
             $mail->addAddress(EMAIL_INFO);
             $subject = "Govacationmaya Contact Rentals ";
             $subject .= date("Y-m-d");
             $mail->subject($subject);
             $message = "Language: " . $_SESSION['site_lang'] . "<br><br>";
             $message .= "Name: " . $name . "<br>";
             $message .= "Email: " . $email . "<br>";
             $message .= "Phone: " . $phone . "<br>";
             $message .= "Comment: " . $comment;
             $mail->body($message);
             if (!$mail->send()) {
                 Url::redirect("?error=2", true);
             } else {
                 Url::redirect("?send=1", true);
             }
         }
     }
     //URL
     $urlExplode = explode("/", $url);
     if ($urlExplode[0] == "print") {
         $item_id = $urlExplode[1];
     } else {
         $item_id = $urlExplode[0];
     }
     //detail
     $data['item_id'] = $item_id;
     $data['item_result'] = $this->_model->fetchSalesDetails($item_id, "Y", $_SESSION['site_lang']);
     //title for de hover in navbar
     $data['title_page'] = "vente";
     //type of search in form, default selected: rentals
     $data['searchtype'] = 'rentals';
     //URL change lang
     $data['lang_var'] = "detail";
     //change tipe text to capital letter
     switch ($data['item_result'][0]->type) {
         case 'condo':
             $data['item_result'][0]->type = 'Condo';
             break;
         case 'house':
             $data['item_result'][0]->type = 'House';
             break;
         case 'hotel':
             $data['item_result'][0]->type = 'Hotel';
             break;
         case 'lot':
             $data['item_result'][0]->type = 'Lot';
             break;
         case 'commercial':
             $data['item_result'][0]->type = 'Commercial business';
             break;
         case 'other':
             $data['item_result'][0]->type = 'Hotel';
             break;
     }
     switch ($data['item_result'][0]->bathrooms_details) {
         case 'private':
             $data['item_result'][0]->bathrooms_details = 'Private';
             break;
         case 'shared':
             $data['item_result'][0]->bathrooms_details = 'Shared';
             break;
         case 'both':
             $data['item_result'][0]->bathrooms_details = 'Private and Shared';
             break;
     }
     switch ($data['item_result'][0]->pool_type) {
         case 'private':
             $data['item_result'][0]->pool_type = 'Private';
             break;
         case 'shared':
             $data['item_result'][0]->pool_type = 'Shared';
             break;
     }
     //SEO
     $data['title'] = "Sales - " . $data['item_result'][0]->name . " " . $data['item_result'][0]->location;
     $data['meta_description'] = strip_tags($data['item_result'][0]->highlights);
     $data['meta_keywords'] = $data['item_result'][0]->name . ", " . $data['item_result'][0]->location . ", " . $data['item_result'][0]->type;
     $data['sitename_before'] = "Y";
     //Comments
     $data['comments'] = $this->_model_c->fetchSalesComments($item_id, 0, 0, 'Y');
     $data['replys'] = $this->_model_c->fetchSalesReply(0, 0, 'Y');
     // send of comment
     if (!is_null(filter_input(INPUT_POST, 'submitComment'))) {
         $name = filter_input(INPUT_POST, 'name');
         $email = filter_input(INPUT_POST, 'email');
         $comment = filter_input(INPUT_POST, 'comment');
         $date = date("Y-m-d H:i:s");
         if ($name == '' || !isset($name) || $email == '' || !isset($email) || $comment == '' || !isset($comment)) {
             $error = "";
             Url::redirect("?error=1", true);
         }
         if (!$error) {
             $mail = new \helpers\phpmailer\mail();
             $mail->CharSet = 'UTF-8';
             $mail->setFrom($email);
             $mail->addAddress(EMAIL_PIERRE);
             $mail->addAddress(EMAIL_INFO);
             $subject = "Govacationmaya Sale Comment " . $data['title'] . " ";
             $subject .= date("Y-m-d");
             $mail->subject($subject);
             $message = "Language: " . $_SESSION['site_lang'] . "<br><br>";
             $message .= "Name: " . $name . "<br>";
             $message .= "Email: " . $email . "<br>";
             $message .= "Comment: " . $comment;
             $mail->body($message);
             // insert table
             $dataComments = array('sales_id' => $item_id, 'name' => $name, 'email' => $email, 'comment' => $comment, 'date_submit' => $date, 'online' => 'N');
             $this->_model_c->insert_comments('sale_comment', $dataComments);
             if (!$mail->send()) {
                 Url::redirect("?error=2", true);
             } else {
                 Url::redirect("?send=1", true);
             }
         }
     }
     // send of reply
     if (!is_null(filter_input(INPUT_POST, 'submitReply'))) {
         $name = filter_input(INPUT_POST, 'name');
         $email = filter_input(INPUT_POST, 'email');
         $comment = filter_input(INPUT_POST, 'comment');
         $date = date("Y-m-d H:i:s");
         $id_reply = filter_input(INPUT_POST, 'id_reply');
         $email_reply = filter_input(INPUT_POST, 'email_reply');
         if ($name == '' || !isset($name) || $email == '' || !isset($email) || $comment == '' || !isset($comment)) {
             $error = "";
             Url::redirect("?error=1", true);
         }
         if (!$error) {
             $mail = new \helpers\phpmailer\mail();
             $mail->CharSet = 'UTF-8';
             $mail->setFrom($email);
             $mail->addAddress($email_reply);
             $mail->addAddress(EMAIL_PIERRE);
             $mail->addAddress(EMAIL_INFO);
             $subject = "Govacationmaya Sale Reply Comment " . $data['title'] . " ";
             $subject .= date("Y-m-d");
             $mail->subject($subject);
             $message = "Language: " . $_SESSION['site_lang'] . "<br><br>";
             $message .= "Name: " . $name . "<br>";
             $message .= "Email: " . $email . "<br>";
             $message .= "Reply: " . $comment;
             $mail->body($message);
             // insert table
             $dataComments = array('sale_comment_id' => $id_reply, 'name' => $name, 'email' => $email, 'comment' => $comment, 'date_submit' => $date, 'online' => 'Y');
             $this->_model_c->insert_comments('sale_reply', $dataComments);
             if (!$mail->send()) {
                 Url::redirect("?error=2", true);
             } else {
                 Url::redirect("?send=1", true);
             }
         }
     }
     //images
     if ($data['item_result']) {
         $data['images_result'] = $this->_model->fetchSalesPhotos($item_id, 0, 0);
         // Images for a property
         $array = array();
         $i = 0;
         foreach ($data['images_result'] as $images_row) {
             $array[$i] = $this->_model->fetchSalesPhotoDetails($images_row->photo_id);
             $i++;
         }
         $data['images_details_result'] = $array;
         if ($urlExplode[0] == "print") {
             View::rendertemplate('header_print', $data);
             View::render('sales/sales_print', $data);
             View::rendertemplate('footer_print', $data);
         } else {
             View::rendertemplate('header', $data);
             View::render('sales/sales', $data);
             View::rendertemplate('footer', $data);
         }
     } else {
         // not found rental
         header("HTTP/1.0 404 Not Found");
         $data['title'] = '404';
         $data['error'] = 'No routes found.';
         View::rendertemplate('header', $data);
         View::render('error/404', $data);
         View::rendertemplate('footer', $data);
     }
 }
Esempio n. 6
0
 public function detailActivities($url)
 {
     //title for de hover in navbar
     $data['title_page'] = "activity";
     //URL
     $urlExplode = explode("/", $url);
     $item_id = $urlExplode[0];
     //detail
     $data['item_result'] = $this->_model->fetchActivitiesDetails($item_id, "Y", $_SESSION['site_lang']);
     //SEO
     $data['title'] = $data['item_result'][0]->name;
     $data['meta_description'] = strip_tags($data['item_result'][0]->description);
     $data['meta_keywords'] = $data['item_result'][0]->name;
     $data['sitename_before'] = "Y";
     //Comments
     $data['comments'] = $this->_model_c->fetchActivityComments($item_id, 0, 0, 'Y');
     $data['replys'] = $this->_model_c->fetchActivityReply(0, 0, 'Y');
     // send of comment
     if (!is_null(filter_input(INPUT_POST, 'submitComment'))) {
         $name = filter_input(INPUT_POST, 'name');
         $email = filter_input(INPUT_POST, 'email');
         $comment = filter_input(INPUT_POST, 'comment');
         $date = date("Y-m-d H:i:s");
         if ($name == '' || !isset($name) || $email == '' || !isset($email) || $comment == '' || !isset($comment)) {
             $error = "";
             Url::redirect("?error=1", true);
         }
         if (!$error) {
             $mail = new \helpers\phpmailer\mail();
             $mail->CharSet = 'UTF-8';
             $mail->setFrom($email);
             $mail->addAddress(EMAIL_PIERRE);
             $mail->addAddress(EMAIL_INFO);
             $subject = "Govacationmaya Activity Comment " . $data['title'] . " ";
             $subject .= date("Y-m-d");
             $mail->subject($subject);
             $message = "Language: " . $_SESSION['site_lang'] . "<br><br>";
             $message .= "Name: " . $name . "<br>";
             $message .= "Email: " . $email . "<br>";
             $message .= "Comment: " . $comment;
             $mail->body($message);
             // insert table
             $dataComments = array('activity_id' => $item_id, 'name' => $name, 'email' => $email, 'comment' => $comment, 'date_submit' => $date, 'online' => 'N');
             $this->_model_c->insert_comments('activity_comment', $dataComments);
             if (!$mail->send()) {
                 Url::redirect("?error=2", true);
             } else {
                 Url::redirect("?send=1", true);
             }
         }
     }
     // send of reply
     if (!is_null(filter_input(INPUT_POST, 'submitReply'))) {
         $name = filter_input(INPUT_POST, 'name');
         $email = filter_input(INPUT_POST, 'email');
         $comment = filter_input(INPUT_POST, 'comment');
         $date = date("Y-m-d H:i:s");
         $id_reply = filter_input(INPUT_POST, 'id_reply');
         $email_reply = filter_input(INPUT_POST, 'email_reply');
         if ($name == '' || !isset($name) || $email == '' || !isset($email) || $comment == '' || !isset($comment)) {
             $error = "";
             Url::redirect("?error=1", true);
         }
         if (!$error) {
             $mail = new \helpers\phpmailer\mail();
             $mail->CharSet = 'UTF-8';
             $mail->setFrom($email);
             $mail->addAddress($email_reply);
             $mail->addAddress(EMAIL_PIERRE);
             $mail->addAddress(EMAIL_INFO);
             $subject = "Govacationmaya Activity Reply Comment " . $data['title'] . " ";
             $subject .= date("Y-m-d");
             $mail->subject($subject);
             $message = "Language: " . $_SESSION['site_lang'] . "<br><br>";
             $message .= "Name: " . $name . "<br>";
             $message .= "Email: " . $email . "<br>";
             $message .= "Reply: " . $comment;
             $mail->body($message);
             // insert table
             $dataComments = array('activity_comment_id' => $id_reply, 'name' => $name, 'email' => $email, 'comment' => $comment, 'date_submit' => $date, 'online' => 'Y');
             $this->_model_c->insert_comments('activity_reply', $dataComments);
             if (!$mail->send()) {
                 Url::redirect("?error=2", true);
             } else {
                 Url::redirect("?send=1", true);
             }
         }
     }
     //column lateral
     $data['search_results_detail_activities'] = $this->_model->fetchActivities($_SESSION['site_lang'], "Y", "rank", 0, 0);
     //URL change lang
     $data['lang_var'] = "detail";
     //tender views
     View::rendertemplate('header', $data);
     View::render('activity/activity', $data);
     View::rendertemplate('footer', $data);
 }