コード例 #1
0
ファイル: contact.php プロジェクト: alejandrozepeda/gvm
 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);
 }
コード例 #2
0
ファイル: cwp.php プロジェクト: seancho0420/globalink
 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');
 }
コード例 #3
0
ファイル: glt.php プロジェクト: seancho0420/globalink
 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');
 }
コード例 #4
0
ファイル: glvc.php プロジェクト: seancho0420/globalink
 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');
 }
コード例 #5
0
ファイル: Crm.php プロジェクト: Oluwafemikorede/gbedu
 public function newsletter()
 {
     $action = $_GET['action'];
     $newsletter_model = new \models\newsletter();
     $user_model = new \models\users();
     $this->data['subscribers'] = $newsletter_model->byGroup();
     $this->data['title'] = 'Newsletter';
     if (isset($_POST) && !empty($_POST)) {
         $group = $_POST['subscribers'];
         $content = $_POST['content'];
         $subject = $_POST['subject'];
         //$slug = \helpers\url::generateSafeSlug($pagename);
         $subscribers = $newsletter_model->get(array('group' => $group));
         $mail_helper = new \helpers\phpmailer\mail();
         foreach ($subscribers as $item) {
             $mail_helper->template('newsletter');
             $mail_helper->newsletter($item->email, $subject, $content);
         }
         $this->data['success'] = 'Mails Sent!';
     }
     View::rendertemplate('home_header', $this->data);
     View::rendertemplate('sidebar', $this->data);
     View::render('crm/newsletter', $this->data);
     View::rendertemplate('footer', $this->data);
 }
コード例 #6
0
ファイル: Account.php プロジェクト: Oluwafemikorede/gbedu
 public function signup($slug = null)
 {
     $this->data['title'] = 'Join Us';
     // $module_slug = $slug[0];
     $role = new \models\userrole();
     $user = new User();
     $this->data['user_role'] = $role->all();
     //PULL DATA FROM SITESETTINGS
     $document = new \Helpers\Document();
     $details = $document->siteSettings();
     //GET NEW USER STATUS ID
     $this->model->table('user_status');
     $user_status = $this->model->get_row(array("title" => "inactive"));
     $this->data['reg_form'] = $details['reg_form'];
     if (isset($_POST) && !empty($_POST)) {
         if ($_POST['password'] == $_POST['password2']) {
             $encrypted = md5($_POST['password']);
             $row_count = $user->get(array("email" => $_POST['email']));
             if (count($row_count) >= 1) {
                 $this->data['error'] = 'Email exists in our records, please use a different email';
             } else {
                 $insert_array = array('firstname' => $_POST['fname'], 'lastname' => $_POST['lname'], 'email' => $_POST['email'], 'password' => $encrypted, 'role' => $_POST['role'], 'status' => $user_status->id);
                 $hash = $user->register($insert_array);
                 if ($hash != '') {
                     //SEND ACCOUNT DETAILS TO USER
                     $fullname = $_POST['fname'] . ' ' . $_POST['lname'];
                     $subject = 'New Account';
                     $mail = new \helpers\phpmailer\mail();
                     $mail->template('welcome');
                     $mail->generalEmail($_POST['email'], $subject, $fullname, $hash);
                     $this->data['success'] = 'A link has been sent to your email, please click to activate your account';
                 } else {
                     $this->data['error'] = 'Operation Fails, Please contact admin';
                 }
             }
         } else {
             $this->data['error'] = 'Password does not match!';
         }
     }
     View::rendertemplate('header', $this->data);
     View::render('account/signup', $this->data);
     View::rendertemplate('footer', $this->data);
 }
コード例 #7
0
ファイル: Account.php プロジェクト: Oluwafemikorede/gbedu
 public function forgotpassword()
 {
     $this->data['title'] = 'Retrieve Password';
     $hash_model = new \models\hash();
     if (isset($_POST['email']) && !empty($_POST['email'])) {
         $user_details = $this->user_model->getColRow('user_email', $_POST['email']);
         if ($user_details->user_email != '') {
             $get_status = $this->status_model->getColRow('status_title', 'active');
             $uniqid = uniqid();
             $insert = $hash_model->create(array('hash_user_id' => $user_details->user_id, 'hash_value' => $uniqid, 'hash_status_id' => $get_status->status_id));
             //SEND ACCOUNT DETAILS TO USER
             $fullname = $user_details->user_firstname . ' ' . $user_details->user_lastname;
             $subject = 'Reset Password';
             $content .= "You have requested for a new password, please click the link below to reset";
             $content .= '<a href="' . DIR . 'account/resetpassword/' . $uniqid . '" target="_blank">Get Password </a>';
             $mail = new \helpers\phpmailer\mail();
             $mail->general($user_details->user_email, $subject, $fullname, $content);
             $this->data['success'] = "Congrats!, A reset link has been sent to your email";
         } else {
             $this->data['error'] = 'This email does not exist in our records!';
         }
     }
     View::rendertemplate('header', $this->data);
     View::render('account/forgotpassword', $this->data);
     View::rendertemplate('footer', $this->data);
 }
コード例 #8
0
ファイル: sales.php プロジェクト: alejandrozepeda/gvm
 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);
     }
 }
コード例 #9
0
ファイル: activity.php プロジェクト: alejandrozepeda/gvm
 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);
 }