AnonSec Shell
Server IP : 162.214.74.102  /  Your IP : 216.73.217.103
Web Server : Apache
System : Linux dedi-4363141.lrsys.com.br 3.10.0-1160.119.1.el7.tuxcare.els25.x86_64 #1 SMP Wed Oct 1 17:37:27 UTC 2025 x86_64
User : lrsys ( 1015)
PHP Version : 5.6.40
Disable Function : exec,passthru,shell_exec,system
MySQL : ON  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /home/lrsys/public_html/lrsys_projetos/sopizzas/application/controllers/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     

Current File : /home/lrsys/public_html/lrsys_projetos/sopizzas/application/controllers/bookorder.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
session_start(); //we need to call PHP's session object to access it through CI
class Bookorder extends CI_Controller {

  function __construct()
  {
     parent::__construct();
     $this->load->helper("url");
     $this->load->helper('form');
     $this->load->library('googlemaps');
     $this->load->model('dashboard_model');
     $this->load->library('form_validation');
     $this->load->model('frontend_model');
     $this->load->library('myemail');

  }

  function index($SearchBy = '')
  {
    if ($this->input->server('REQUEST_METHOD') == 'POST') {
      $this->placeBookOrder();
    }
    else {
      $this->showBookOrder();
    }
  }

  function csrfTesting() {
    print_r($this->input->post());
  }

  function showBookOrder() {
    $data['CateringRestaurantList'] = $this->frontend_model->cateringRestaurantList();
    $data['page'] = 'bookorder';
    $this->load->view('frontend/header',$data);
    $this->load->view('frontend/bulk_parties_order');
    $this->load->view('frontend/footer');
  }

  function placeBookOrder() {
    // echo "<pre>";
    // print_r($this->input->post());
    // echo "</pre>";
    // exit();
    $choose_party_type = $this->input->post('choose_party_type');
    $choose_food = $this->input->post('choose_food');
    $choose_delivery_method = $this->input->post('choose_delivery_method');
    $favorite_restaurant = $this->input->post('favorite_restaurant');
    $assigned_caterer = $this->input->post('favorite_restaurant');
    $booking_number_of_attendees_over12 = $this->input->post('booking_number_of_attendees_over12');
    $booking_number_of_attendees_under12 = $this->input->post('booking_number_of_attendees_under12');
    $booking_date = $this->input->post('booking_date');
    $booking_start_time = $this->input->post('booking_start_time');
    $booking_end_time = $this->input->post('booking_end_time');
    $booking_required_delivery_time = $this->input->post('booking_required_delivery_time');
    $booking_required_pick_up_chosen = $this->input->post('booking_required_pick_up_chosen');
    $booking_location_name_address = $this->input->post('booking_location_name_address');
    $booking_party_theme = $this->input->post('booking_party_theme');
    $booking_special_request = $this->input->post('booking_special_request');

    // Private party
    $booking_name = $this->input->post('booking_name');
    $booking_website_address = $this->input->post('booking_website_address');
    $booking_home_address = $this->input->post('booking_home_address');
    $booking_telephone_number = $this->input->post('booking_telephone_number');
    $booking_mobile_number = $this->input->post('booking_mobile_number');
    $booking_email_address = $this->input->post('booking_email_address');
    $booking_best_time = $this->input->post('booking_best_time');
    $private_event_type = $this->input->post('private_event_type');
    $private_event_type_other = $this->input->post('private_event_type_other');
    $private_additional_service = $this->input->post('private_additional_service');

    // Business party
    $booking_title = $this->input->post('booking_title');
    $booking_ordering_person = $this->input->post('booking_ordering_person');
    $booking_company_name = $this->input->post('booking_company_name');
    $booking_company_tax_id = $this->input->post('booking_company_tax_id');
    $booking_company_address = $this->input->post('booking_company_address');
    $booking_company_number = $this->input->post('booking_company_number');
    $booking_company_owner_name = $this->input->post('booking_company_owner_name');
    $booking_company_owner_number = $this->input->post('booking_company_owner_number');
    $booking_company_website_address = $this->input->post('booking_company_website_address');
    $booking_company_email_address = $this->input->post('booking_company_email_address');
    $booking_number_ordering_person = $this->input->post('booking_number_ordering_person');
    $booking_best_time_to_reach = $this->input->post('booking_best_time_to_reach');
    $booking_email_address_ordering_person = $this->input->post('booking_email_address_ordering_person');
    $business_event_type = $this->input->post('business_event_type');
    $business_event_type_other = $this->input->post('business_event_type_other');
    $business_additional_service = $this->input->post('business_additional_service');
    // Request from app
    $requestType = $this->input->post('book_from');

    $restaurant_contact_email = '';
    if ($favorite_restaurant != '') {
      $this->db->select('restaurant_name, restaurant_contact_email');
      $this->db->from('rt_restaurant');
      $this->db->where('restaurant_id', $favorite_restaurant);
      $query = $this->db->get();
      $restDetails = $query->row_array();
      $favorite_restaurant = $restDetails['restaurant_name'];
      $restaurant_contact_email = $restDetails['restaurant_contact_email'];
    }

    $myData = array();
    if ($choose_party_type == 'private') {
      $myData['Party Type: '] = 'Private Party';
      if ($booking_name !== '') {
        $myData['Booking Name'] = $booking_name;
      }
      if ($booking_website_address !== '') {
        $myData['Website Address'] = $booking_website_address;
      }
      if ($booking_home_address !== '') {
        $myData['Home Address'] = $booking_home_address;
      }
      if ($booking_telephone_number !== '') {
        $myData['Telephone No.'] = $booking_telephone_number;
      }
      if ($booking_mobile_number !== '') {
        $myData['Mobile No.'] = $booking_mobile_number;
      }
      if ($booking_email_address !== '') {
        $myData['Email Address'] = $booking_email_address;
      }
      if ($booking_best_time !== '') {
        $myData['Best Time to Reach'] = date('h:i A', strtotime($booking_best_time));
        $booking_best_time = date('h:i A', strtotime($booking_best_time));
      }
      // if ($ !== '') {
      //   $myData[''] = $;
      // }
    }
    else if ($choose_party_type == 'business') {
      $myData['Party Type: '] = 'Corporate / Business Party Party';
      if ($booking_ordering_person !== '') {
        $myData['Ordering Persone'] = $booking_ordering_person;
      }
      if ($booking_title !== '') {
        $myData['Title'] = $booking_title;
      }
      if ($booking_company_name !== '') {
        $myData['Comapny Name'] = $booking_company_name;
      }
      if ($booking_company_tax_id !== '') {
        $myData['Tax ID'] = $booking_company_tax_id;
      }
      if ($booking_company_address !== '') {
        $myData['Company Address'] = $booking_company_address;
      }
      if ($booking_company_number !== '') {
        $myData['Company Phone No.'] = $booking_company_number;
      }
      if ($booking_company_owner_name !== '') {
        $myData['Company Owner / CEO'] = $booking_company_owner_name;
      }
      if ($booking_company_owner_number !== '') {
        $myData['Company Owner / CEO Mobile No.'] = $booking_company_owner_number;
      }
      if ($booking_company_website_address !== '') {
        $myData['Website Address'] = $booking_company_website_address;
      }
      if ($booking_company_email_address !== '') {
        $myData['Company Owner / CEO Email Address'] = $booking_company_email_address;
      }
      if ($booking_number_ordering_person !== '') {
        $myData['Order Persone Mobile No.'] = $booking_number_ordering_person;
      }
      if ($booking_best_time_to_reach !== '') {
        $myData['Best Time to Reach'] = date('h:i A', strtotime($booking_best_time_to_reach));
        $booking_best_time_to_reach = date('h:i A', strtotime($booking_best_time_to_reach));
      }
      if ($booking_email_address_ordering_person !== '') {
        $myData['Order Persone Email Address'] = $booking_email_address_ordering_person;
      }
      // if ($ !== '') {
      //   $myData[''] = $;
      // }
    }
    if ($choose_food !== '') {
      $myData['Food Type'] = $choose_food;
    }
    if ($choose_delivery_method !== '') {
      $myData['Delivery Method'] = ucfirst($choose_delivery_method);
    }
    if ($favorite_restaurant !== '') {
      $myData['Favorite Restaurant'] = $favorite_restaurant;
    }
    if ($booking_number_of_attendees_over12 !== '') {
      $myData['Attendees (Over 12 Yr. Age)'] = $booking_number_of_attendees_over12;
    }
    if ($booking_number_of_attendees_under12 !== '') {
      $myData['Attendees (Under 12 Yr. Age)'] = $booking_number_of_attendees_under12;
    }
    if ($booking_date !== '') {
      $myData['Date'] = date('m/d/Y', strtotime($booking_date));
      $booking_date = date('m/d/Y', strtotime($booking_date));
    }
    if ($booking_start_time !== '') {
      $myData['Starting Time'] = date('h:i A', strtotime($booking_start_time));
      $booking_start_time = date('h:i A', strtotime($booking_start_time));
    }
    if ($booking_end_time !== '') {
      $myData['End Time'] = date('h:i A', strtotime($booking_end_time));
      $booking_end_time = date('h:i A', strtotime($booking_end_time));
    }
    if ($booking_required_delivery_time !== '') {
      $myData['Delivery Time'] = date('h:i A', strtotime($booking_required_delivery_time));
      $booking_required_delivery_time = date('h:i A', strtotime($booking_required_delivery_time));
      $booking_required_pick_up_chosen = '';
    }
    if ($booking_required_pick_up_chosen !== '' && $booking_required_delivery_time === '') {
      $myData['Pick-Up Time'] = date('h:i A', strtotime($booking_required_pick_up_chosen));
      $booking_required_pick_up_chosen = date('h:i A', strtotime($booking_required_pick_up_chosen));
    }
    if ($booking_location_name_address !== '') {
      $myData['Location Name / Address'] = $booking_location_name_address;
    }
    if ($booking_party_theme !== '') {
      $myData['Party Theme'] = $booking_party_theme;
    }
    if ($booking_special_request !== '') {
      $myData['Special Request'] = $booking_special_request;
    }
    // if ($ !== '') {
    //   $myData[''] = $;
    // }
    if ($choose_party_type == 'private') {
      if ($private_event_type !== '') {
        $myData['Event / Party Type'] = $private_event_type;
      }
      if ($private_event_type_other !== '' && strtolower($private_event_type) === 'other') {
        $myData['Event / Party Type'] = $private_event_type. '('.$private_event_type_other.')';
      }
      if (is_array($private_additional_service) && sizeof($private_additional_service) > 0 && $requestType !== 'application') {
        $myData['Additional Services'] = implode(', ', array_filter($private_additional_service));
        $private_additional_service = implode(', ', array_filter($private_additional_service));
      }
      else {
        $myData['Additional Services'] = $private_additional_service;
      }
    }
    else if ($choose_party_type == 'business') {
      if ($business_event_type !== '') {
        $myData['Event / Party Type'] = $business_event_type;
      }
      if ($business_event_type_other !== '' && strtolower($business_event_type) === 'other') {
        $myData['Event / Party Type'] = $business_event_type. '('.$business_event_type_other.')';
      }
      if (is_array($business_additional_service) && sizeof($business_additional_service) > 0 && $requestType !== 'application') {
        $myData['Additional Services'] = implode(', ', array_filter($business_additional_service));
        $business_additional_service = implode(', ', array_filter($business_additional_service));
      }
      else {
        $myData['Additional Services'] = $business_additional_service;
      }
    }

    // Saving in database
    $data_in['choose_party_type'] = $choose_party_type;
    $data_in['choose_food'] = $choose_food;
    $data_in['choose_delivery_method'] = $choose_delivery_method;
    $data_in['favorite_restaurant'] = $favorite_restaurant;
    $data_in['booking_number_of_attendees_over12'] = $booking_number_of_attendees_over12;
    $data_in['booking_number_of_attendees_under12'] = $booking_number_of_attendees_under12;
    $data_in['booking_date'] = $booking_date;
    $data_in['booking_start_time'] = $booking_start_time;
    $data_in['booking_end_time'] = $booking_end_time;
    $data_in['booking_required_delivery_time'] = $booking_required_delivery_time;
    $data_in['booking_required_pick_up_chosen'] = $booking_required_pick_up_chosen;
    $data_in['booking_location_name_address'] = $booking_location_name_address;
    $data_in['booking_party_theme'] = $booking_party_theme;
    $data_in['booking_special_request'] = $booking_special_request;
    $data_in['assigned_caterer'] = $assigned_caterer;

    // Private Party
    $data_in['booking_name'] = $booking_name;
    $data_in['booking_website_address'] = $booking_website_address;
    $data_in['booking_home_address'] = $booking_home_address;
    $data_in['booking_telephone_number'] = $booking_telephone_number;
    $data_in['booking_mobile_number'] = $booking_mobile_number;
    $data_in['booking_email_address'] = $booking_email_address;
    $data_in['booking_best_time'] = $booking_best_time;
    $data_in['private_event_type'] = $private_event_type;
    $data_in['private_event_type_other'] = $private_event_type_other;
    $data_in['private_additional_service'] = $private_additional_service;

    // Business Party
    $data_in['booking_title'] = $booking_title;
    $data_in['booking_ordering_person'] = $booking_ordering_person;
    $data_in['booking_company_name'] = $booking_company_name;
    $data_in['booking_company_tax_id'] = $booking_company_tax_id;
    $data_in['booking_company_address'] = $booking_company_address;
    $data_in['booking_company_number'] = $booking_company_number;
    $data_in['booking_company_owner_name'] = $booking_company_owner_name;
    $data_in['booking_company_owner_number'] = $booking_company_owner_number;
    $data_in['booking_company_website_address'] = $booking_company_website_address;
    $data_in['booking_company_email_address'] = $booking_company_email_address;
    $data_in['booking_number_ordering_person'] = $booking_number_ordering_person;
    $data_in['booking_best_time_to_reach'] = $booking_best_time_to_reach;
    $data_in['booking_email_address_ordering_person'] = $booking_email_address_ordering_person;
    $data_in['business_event_type'] = $business_event_type;
    $data_in['business_event_type_other'] = $business_event_type_other;
    $data_in['business_additional_service'] = $business_additional_service;
    $data_in['booked_from'] = $requestType;

    $this->db->trans_start();
    $this->db->insert('rt_order_caterer', $data_in);
    $this->db->trans_complete();

    // Setting up mail
    $booking_details = '';
    foreach ($myData as $key => $value) {
      $booking_details .= '<div style="font-family: arial, sans-serif;"><div style="width: 150px;float: left;">'.$key.'</div>:&nbsp;'.$value.'</div><div style="clear: both;"></div><br>';
    }

    $variables['sub_heading'] = 'New booking request has been placed. Please check.';
    $variables['booking_details'] = $booking_details;
    $image_path = base_url().'assets/';
    $variables['image_path'] = $image_path;
    $variables['site_address'] = SITE_ADDRESS;
    $variables['sender_name'] = SITENAME;
    $variables['site_name'] = SITENAME;
    $template_name = 'bulk_parties_order';
    $mail_data = $this->frontend_model->getEmailTemplate($template_name);
    $mailcontent=htmlspecialchars_decode($mail_data->template);
    $subject = $mail_data->subject;
    $mailcontent_admin = $mailcontent;
    foreach($variables as $key => $value) {
      $mailcontent_admin = str_replace('{{'.$key.'}}', $value, $mailcontent_admin);
    }
    $this->send_my_mail(SITE_FEEDBACK_EMAIL, $subject, $mailcontent_admin);
    if ($restaurant_contact_email != '' && $favorite_restaurant != '') {
      $this->send_my_mail($restaurant_contact_email, $subject, $mailcontent_admin);
    }
    $variables['sub_heading'] = 'We have received your booking request. One of our executive will reach you soon. Plesae check your booking details below.';
    $mailcontent_user = $mailcontent;
    foreach($variables as $key => $value) {
      $mailcontent_user = str_replace('{{'.$key.'}}', $value, $mailcontent_user);
    }
    if ($choose_party_type == 'private') {
      $this->send_my_mail($booking_email_address, $subject, $mailcontent_user);
    }
    else if ($choose_party_type == 'business') {
      $this->send_my_mail($booking_company_email_address, $subject, $mailcontent_user);
      $this->send_my_mail($booking_email_address_ordering_person, $subject, $mailcontent_user);
    }
    // {{booking_details}} = <div style="font-family: arial, sans-serif;"><div style="width: 77px;float: left;">Email</div>:&nbsp;{{email}}</div>;
    $data['title']  = "Thank You";  
    $data['page'] = "bookorder";
    $this->load->view('frontend/header',$data);
    $this->load->view('frontend/thankyou');
    $this->load->view('frontend/footer');
  }

  function send_my_mail($mail_To,$mail_subject,$mail_Body,$mail_CC="")
  {
      $mail_From = SITENAME;

      $mail = new PHPMailer();

      //Your SMTP servers details

      $mail->IsSMTP(); // set mailer to use SMTP
      $mail->Host = SMTP_HOST; // specify main and backup server or localhost
      $mail->SMTPAuth = true; // turn on SMTP authentication
      $mail->Username = SMTP_USER; // SMTP username
      $mail->Password = SMTP_PASSWORD; // SMTP password It should be same as that of the SMTP user

      //$mail->PluginDir = "/home/phpaucti/public_html/website_development/coding/includes/";
      $mail->From = $mail->Username; //Default From email same as smtp user
      $mail->FromName = $mail_From;
      $emailArr = explode(',',$mail_To);
      foreach($emailArr AS $emailVal) {
      $mail->AddAddress($emailVal, ""); //Email address where you wish to receive/collect those emails.
      }

      /*$emailCCArr = explode(',',$mail_CC);
      foreach($emailCCArr AS $emailCCVal) {
      $mail->AddCC($emailCCVal, ""); //Email address where you wish to receive/collect those emails.
      }*/


      $mail->WordWrap = 100; // set word wrap to 50 characters
      $mail->IsHTML(true); // set email format to HTML
      $mail->Subject = $mail_subject;
      $message = $mail_Body;
      $mail->Body = $message;

      if(!$mail->Send())
      {
      /*echo "Message could not be sent. <p>";
      echo "Mailer Error: " . $mail->ErrorInfo;
      exit;*/
      }
      else
      {
      //echo 'ok';
      }

  }

}

Anon7 - 2022
AnonSec Team