You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

58 lines
1.1 KiB

<?php
defined('BASEPATH') OR exit('No direct script access allowed');
/**
* Info Class
*/
class Edit extends CI_Controller
{
public function __construct()
{
parent::__construct();
if(! $this->session->userdata('validated')){
redirect(base_url('/login'));
}
if (! ($this->session->admin == '1' OR $this->session->superadmin == '1')) {
redirect(base_url('/dashboard'));
}
}
public function index()
{
$data['page'] = 'edit';
// Get data
$this->load->model('Edit_model');
$lijsten = $this->Edit_model->get_lijst();
// Prepare data
$data['lijsten'] = $lijsten;
// Header
$this->load->view('header', $data);
// lijst list page
$this->load->view('edit_lijst', $data);
// Footer
$this->load->view('footer');
}
public function enable($lijstid)
{
$this->load->model('Edit_model');
$this->Edit_model->change_lijst($lijstid, '1');
redirect(base_url('edit/'));
}
public function disable($lijstid)
{
$this->load->model('Edit_model');
$this->Edit_model->change_lijst($lijstid, '0');
redirect(base_url('edit/'));
}
}