| Server IP : 103.48.194.25 / Your IP : 216.73.216.231 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 : 8.2.20 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/hocthongminh.net-bk/public_html/webadmin/components/bnhtml/controllers/ |
Upload File : |
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class Bnhtml extends CI_Controller
{
var $filename = '';
public function __construct()
{
parent::__construct();
$this->load->helper('file') ;
$this->filename = ROOT_SITE.'cache/json/bnhtml.php';
$this->permit_library->check_permit();
$this->session->set_userdata(array('Url'=>uri_string()));
}
function index()
{
$data['title'] = 'Thông tin quảng cáo';
if(isset($_POST['bt_submit']))
{
$this->createfile() ;
redirect('bnhtml/index');
}
else
{
$str = read_file($this->filename);
$rs = json_decode($str);
$data['lb_subject'] = isset($rs->lb_subject)? $rs->lb_subject : '';
$data['lb_content'] = isset($rs->lb_content)? $rs->lb_content : '';
$data['bl_active'] = isset($rs->bl_active)? $rs->bl_active : '';
$data['page'] = 'edit';
$this->load->view("layout/skin",$data);
}
}
function createfile()
{
$data['lb_subject'] = $this->input->post('lb_subject');
$data['lb_content'] = $this->input->post('lb_content');
$data['bl_active'] = (int) $this->input->post('bl_active');
$str = json_encode($data); //trit($str);
write_file($this->filename, $str);
}
}
?>