| Server IP : 103.48.194.25 / Your IP : 216.73.217.33 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/thegioimaycongnghiep.vn/public_html/webadmin/controllers/ |
Upload File : |
<?php if (! defined('BASEPATH')) exit('No direct script access allowed');
class gioithieu extends CI_Controller
{
public function __construct()
{
parent::__construct();
$this->pre_message = "";
$this->load->config('config_gioithieu') ;
$this->permit_library->check_permit();
$this->session->set_userdata(array('Url'=>uri_string()));
}
function index()
{
$data['title'] = 'Cập nhật thông tin giới thiệu';
if(isset($_POST['bt_submit']))
{
$this->create_gioithieu() ;
redirect('gioithieu');
}
$data['page'] = 'gioithieu/edit';
$this->load->view("layout/skin",$data);
}
function create_gioithieu()
{
//upload hinh anh
$img = $this->input->post("lb_image");
$img_name = end(explode('/', $img)) ;
if($img)
{
if(file_exists(ROOT_IMG.'gioithieu/'.$img_name))
{
unlink(ROOT_IMG.'gioithieu/'.$img_name);
}
//fn_resize_image(ROOT_IMG.$img, ROOT_IMG.'gioithieu/'.$img_name, 220, 180);
copy(ROOT_IMG.$img, ROOT_IMG.'gioithieu/'.$img_name);
$lb_image = $img_name;
}
$str = "<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');\n/**\n* Cache file for config_gioithieu.\n* Date: ".date('d/m/y H:i:s').".\n**/";
$str .= "\n";
$str .= "\n\$config['title_gioithieu'] = '".htmlspecialchars($this->input->post('lb_subject'),ENT_QUOTES,'UTF-8')."' ;";
$str .= "\n";
$str .= "\n\$config['images_gioithieu'] = '".$lb_image."' ;";
$str .= "\n";
$str .= "\n\$config['gioithieu'] = '".htmlspecialchars($this->input->post('lb_content'),ENT_QUOTES,'UTF-8')."' ;";
$str .= "\n";
$str .= "\n\n/* End of file config_gioithieu quatangmythuat.com*/\n/* Location: ./cache/config_gioithieu.php */\n\n?>";
write_file(ROOT_IMG.'cache/config_gioithieu.php', $str);
}
}
?>