public function reactivate($cabinet = null) { if ($this->isLogged()) { $page = $this->getPage(); $this->load->model('DisabledModel'); $deact = new DisabledModel(); if (!$deact->isdisabled($cabinet)) { $this->decidetask($cabinet); } switch ($this->session->userdata('role')) { case '1': $data['disabled'] = $deact->isdisabled($cabinet); $this->load->view('template/super/header', $page); $this->load->view('super/reactivate', $data); break; case '2': $this->load->view('public/norole'); break; } $this->load->view('template/public/footer'); } }
public function confirmreact() { if ($this->isLogged()) { $page = $this->getPage(); $this->load->model('DisabledModel'); $deact = new DisabledModel(); $deactdata['iddisabled'] = $this->input->get('iddisabled'); $deactdata['cabinet'] = $this->input->get('cabinet'); $deactdata['reason'] = $this->input->get('reason'); $deactdata['date'] = $this->input->get('date'); $deactdata['status'] = false; if ($deact->update($deactdata)) { redirect(base_url('utilities')); } else { return false; } } }