Uname:
Linux webm016.cluster127.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64
Software:
Apache
PHP version:
7.4.33 [ PHP INFO ] PHP os:
Linux
Server Ip:
54.36.31.145
Your Ip:
216.73.216.182
User:
homesquasz (91404) | Group:
users (100)
Safe Mode:
OFF
Disable Function:
_dyuweyrj4,_dyuweyrj4r,dl
<?php
/*
* Generated by CRUDigniter v3.2
* www.crudigniter.com
*/
class Typeconge extends FrontApplication{
function __construct()
{
parent::__construct();
$this->load->model('Typeconge_model');
}
/*
* Listing of typeconge
*/
function index()
{
$params['limit'] = RECORDS_PER_PAGE;
$params['offset'] = ($this->input->get('per_page')) ? $this->input->get('per_page') : 0;
$config = $this->config->item('pagination');
$config['base_url'] = site_url('typeconge/index?');
$config['total_rows'] = $this->Typeconge_model->get_all_typeconge_count();
$this->pagination->initialize($config);
$this->data['typeconge'] = $this->Typeconge_model->get_all_typeconge($params);
$this->data['_view'] = 'typeconge/index';
$this->load->view('layouts/main',$this->data);
}
/*
* Adding a new typeconge
*/
function add()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('libelle','Libelle','required');
if($this->form_validation->run())
{
$params = array(
'libelle' => $this->input->post('libelle'),
);
$typeconge_id = $this->Typeconge_model->add_typeconge($params);
redirect('typeconge/index');
}
else
{
$this->data['_view'] = 'typeconge/add';
$this->load->view('layouts/main',$this->data);
}
}
/*
* Editing a typeconge
*/
function edit($id)
{
// check if the typeconge exists before trying to edit it
$this->data['typeconge'] = $this->Typeconge_model->get_typeconge($id);
if(isset($this->data['typeconge']['id']))
{
$this->load->library('form_validation');
$this->form_validation->set_rules('libelle','Libelle','required');
if($this->form_validation->run())
{
$params = array(
'libelle' => $this->input->post('libelle'),
);
$this->Typeconge_model->update_typeconge($id,$params);
redirect('typeconge/index');
}
else
{
$this->data['_view'] = 'typeconge/edit';
$this->load->view('layouts/main',$this->data);
}
}
else
show_error('The typeconge you are trying to edit does not exist.');
}
/*
* Deleting typeconge
*/
function remove($id)
{
$typeconge = $this->Typeconge_model->get_typeconge($id);
// check if the typeconge exists before trying to delete it
if(isset($typeconge['id']))
{
$this->Typeconge_model->delete_typeconge($id);
redirect('typeconge/index');
}
else
show_error('The typeconge you are trying to delete does not exist.');
}
}