X7ROOT File Manager
Current Path:
/home/jurarevi/beta.jurareview.ro/application/controllers
home
/
jurarevi
/
beta.jurareview.ro
/
application
/
controllers
/
📁
..
📄
announcements.php
(2.85 KB)
📄
chapters.php
(8.95 KB)
📄
config.php
(2.01 KB)
📄
contact.php
(2.52 KB)
📄
headerFooter.php
(1.39 KB)
📄
home.php
(731 B)
📄
index.html
(114 B)
📄
login.php
(925 B)
📄
menu.php
(2.19 KB)
📄
pagini.php
(3.86 KB)
📄
search.php
(1.19 KB)
📄
sidebars.php
(2.18 KB)
📄
test.php
(773 B)
📄
volumes.php
(8.79 KB)
📄
welcome.php
(770 B)
Editing: sidebars.php
<?php class Sidebars extends MY_Controller { function __construct() { parent::__construct(); $this->load->model('sidebars_model'); } public function index() { $this->checkAuthentification(); $data = []; $data['sidebar'] = $this->sidebars_model->get_main_sidebar(); $data['page_title'] = 'Edit sidebar'; $this->load->view('common/header', $data); $this->load->view('admin/admin_menu', $data); $this->load->view('admin/sidebar_edit', $data); $this->load->view('common/footer', $data); } public function get_main_sidebar() { return $this->sidebars_model->get_main_sidebar(); } public function update_main_sidebar() { $this->checkAuthentification(); $image = isset($_POST['Image']) ? $_POST['Image'] : ''; if (!empty($_FILES)) { $image_file = reset($_FILES); if (isset($image_file['size']) && $image_file['size'] > 0) { $target_file = "resources/sidebar/sidebar_" . date('d_m_Y_h_i_s') . '.' . pathinfo($image_file["name"], PATHINFO_EXTENSION); move_uploaded_file($image_file["tmp_name"], $target_file); $image = $target_file; } } $this->sidebars_model->update_main_sidebar($image, isset($_POST['FirstButtonText']) ? $_POST['FirstButtonText'] : '', isset($_POST['FirstButtonUrl']) ? $_POST['FirstButtonUrl'] : '', isset($_POST['SecondButtonText']) ? $_POST['SecondButtonText'] : '', isset($_POST['SecondButtonUrl']) ? $_POST['SecondButtonUrl'] : '', isset($_POST['ThirdButtonText']) ? $_POST['ThirdButtonText'] : '', isset($_POST['ThirdButtonUrl']) ? $_POST['ThirdButtonUrl'] : '' ); header("Location: /sidebars"); } public function checkAuthentification() { $this->load->helper('cookie'); $logInCookie = get_cookie('juraLogInCookie'); if (empty($logInCookie) || 1 !== (int) $logInCookie) { header('Location: /login'); } return true; } }
Upload File
Create Folder