����JFIF��H�H����Exif��MM�*���� ��3����V�����3������3�(��������������������3�����
Server IP : 74.208.127.88 / Your IP : 3.15.238.90 Web Server : Apache/2.4.41 (Ubuntu) System : Linux ubuntu 5.4.0-163-generic #180-Ubuntu SMP Tue Sep 5 13:21:23 UTC 2023 x86_64 User : www-data ( 33) PHP Version : 7.4.3-4ubuntu2.29 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/html/appOLD/application/controllers/ |
Upload File : |
<?php defined('BASEPATH') OR exit('No direct script access allowed'); class Devices extends CI_Controller { //constructor public function __construct() { parent::__construct(); //si el usuario no está logueado... //lo pateamos... :) como corresponde :) if(!isset($_SESSION['user_id'])){ redirect(base_url('login'), 'refresh'); } //cargamos el modelo $this->load->model('Devices_model'); } public function index() { $user_id = $this->session->userdata('user_id'); $data['devices'] = $this->Devices_model->get_devices($user_id); $this->load->view('head'); $this->load->view('scripts'); $this->load->view('open'); $this->load->view('header',$data); $this->load->view('sidebar'); $this->load->view('contents/devices',$data); $this->load->view('close'); } //llamamos esta función cuando se cambia el selector del dispositivo public function change_device(){ $user_id = $this->session->userdata('user_id'); $device_id = strip_tags($this->input->post('device_id')); $result = $this->Devices_model->change_device($user_id, $device_id); } // cuando agregamos un dispositivo nuevo public function add(){ $user_id = $this->session->userdata('user_id'); $device_alias = strip_tags($this->input->post('device_alias')); $device_serial_number = strip_tags($this->input->post('device_serial_number')); $result = $this->Devices_model->add($user_id, $device_alias, $device_serial_number); //estas variables de sesión las cargamos cuando necesitamos pasar una alerta a sweet alert if ($result == "exist"){ $_SESSION['msg_type'] = "warning"; $_SESSION['msg_title'] = "Warning!"; $_SESSION['msg_body'] = "Serial number alreade exist!"; $_SESSION['msg_footer'] = "https://www.yusasoft.com/"; }elseif ($result == "success"){ $_SESSION['msg_type'] = "success"; $_SESSION['msg_title'] = "Success!"; $_SESSION['msg_body'] = "Device added successfully"; $_SESSION['msg_footer'] = "https://www.yusasoft.com/"; }elseif($resutl == "fail"){ $_SESSION['msg_type'] = "fail"; $_SESSION['msg_title'] = "Fail!"; $_SESSION['msg_body'] = "Fail adding device"; $_SESSION['msg_footer'] = "https://www.yusasoft.com/"; } redirect(base_url('devices'), 'refresh'); } // cuando necesitamos borrar un dispositivo public function delete_device(){ $user_id = $this->session->userdata('user_id'); $device_id = strip_tags($this->input->post('device_id')); $result = $this->Devices_model->delete_device($user_id, $device_id); if ($result == True){ echo "True"; }else { echo "False"; } } }