📁
SKYSHELL MANAGER-
🛒
PHP v7.4.33
Create Folder
Create File
Current Path:
home
/
oshofree
/
public_html
/
chbluxuries.com
/
chb_data
/
Name
Size
Permissions
Actions
📁
..
-
0755
🗑️
🔒
📄
config.php
7.06 KB
0444
🗑️
⬇️
✏️
🔒
📄
error_log
11452.3 KB
0644
🗑️
⬇️
✏️
🔒
Editing: Messages.php
<?php class Messages extends My_Controller{ public function __construct(){ parent::__construct(); } public function compose_mail($sender=NULL,$sub_email=NULL){ $this->session_checker->auto_logout(); // Load the list page view $data['alert'] =$this->session->flashdata('alert'); $data['phone_no'] =$this->session->userdata('phone_no'); $data['user_id'] =$this->session->userdata('user_id'); $data['user_name'] =$this->session->userdata('user_name'); $data['email'] =$this->session->userdata('email'); $data['store_id'] =$this->session->userdata('store_id'); $data['store_name'] =$this->session->userdata('store_name'); $data['branch_id'] =$this->session->userdata('branch_id'); $data['store_owner_id'] =$this->session->userdata('store_owner_id'); $data['user_status'] =$this->session->userdata('user_status'); $data['sub_email'] =urldecode($sub_email); //reciever $data['sender'] =$sender; //sender $data['content'] ='compose_message'; $this->load->view($this->layout, $data); } public function send_message(){ $email =urldecode($this->input->post('email')); $message =$this->input->post('msg'); $title =$this->input->post('title'); $sender =urldecode($this->input->post('sender')); $get_site_name =$this->Admin_db->get_site_name(); $get_site_g_name =$this->Admin_db->get_site_g_name(); $get_site_g_pass =$this->Admin_db->get_site_g_pass(); $insert =$this->Admin_db->insert_message($sender,$email,$message,$title); if($insert){ echo 'ok'; }else{ echo 'err'; } } public function read_message(){ $this->session_checker->auto_logout(); // Load the list page view $data['alert'] =$this->session->flashdata('alert'); $data['phone_no'] =$this->session->userdata('phone_no'); $data['user_id'] =$this->session->userdata('user_id'); $data['user_name'] =$this->session->userdata('user_name'); $data['email'] =$this->session->userdata('email'); $data['store_id'] =$this->session->userdata('store_id'); $data['store_name'] =$this->session->userdata('store_name'); $data['branch_id'] =$this->session->userdata('branch_id'); $data['store_owner_id'] =$this->session->userdata('store_owner_id'); $data['user_status'] =$this->session->userdata('user_status'); $data['get_message'] =$this->Admin_db->get_my_messages($data['email']); $data['content'] ='read_message'; $this->load->view($this->layout, $data); } public function delete_msg($id=NULL){ $action =$this->Admin_db->delete_msg($id); if($action){ echo 'ok'; }else{ echo 'err'; } } public function message_all_user(){ $title =$this->input->post('title'); $message =$this->input->post('message'); $site_email =$this->Admin_db->get_site_email(); $sender =$site_email; $all_users =$this->Admin_db->get_all_store_owner(); $data=array(); if(is_array($all_users)){ foreach($all_users as $row){ $reciever =$row['email']; $row_arr =array( 'reciever' => $reciever, 'sender' => $sender, 'title' => $title, 'message' => $message, 'time' => time(), 'date_created' =>date('Y-m-d H:i:sa'), ); array_push($data,$row_arr); } $insert =$this->db->insert_batch('messages', $data); if($insert){ echo 'ok'; }else{ echo 'err'; } }else{ echo 'There are no store owner found on the database'; } } public function send_email($email,$title,$message,$link,$link_title){ $get_site_name =$this->Admin_db->get_site_name(); $get_site_g_name =$this->Admin_db->get_site_g_name(); $get_site_g_pass =$this->Admin_db->get_site_g_pass(); $current_domain = $_SERVER['SERVER_NAME']; $subject =$get_site_name.' | '.$title; $to =$email; $data['title'] =$title; $data['message'] =$message; $data['link'] =$link; $data['link_title'] =$link_title; $this->load->library('email'); $config =array( 'protocol'=> 'ssmtp', 'smtp_host' => 'ssl://ssmtp.googlemail.com', 'smtp_port' => '465', 'smtp_timeout' => '7', 'smtp_user' => $get_site_g_name, 'smtp_pass' => $get_site_g_pass, 'charset' => 'utf-8', 'newline' => "\r\n", 'mailtype' => 'html', // or html 'validation' => FALSE); // bool whether to validate email or not $this->email->set_mailtype("html"); $this->load->initialize($config); $this->email->from("no-reply@$current_domain", $get_site_name); $this->email->to($to); $this->email->subject($subject); $body =$this->load->view($this->layout_3,$data,TRUE); $this->email->message($body); $this->email->send(); } }
💾 Save Changes