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 Jourferie extends FrontApplication{
function __construct()
{
parent::__construct();
$this->load->model('Jourferie_model');
}
/*
* Listing of jourferie
*/
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('jourferie/index?');
$config['total_rows'] = $this->Jourferie_model->get_all_jourferie_count();
$this->pagination->initialize($config);
$this->data['jourferie'] = $this->Jourferie_model->get_all_jourferie($params);
$this->data['_view'] = 'jourferie/index';
$this->load->view('layouts/main',$this->data);
}
/*
* Adding a new jourferie
*/
function add()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('libelle','Libelle','required');
$this->form_validation->set_rules('date','Date','required');
if($this->form_validation->run())
{
$params = array(
'libelle' => $this->input->post('libelle'),
'date' =>$this->input->post('date'),
);
$jourferie_id = $this->Jourferie_model->add_jourferie($params);
redirect('jourferie/index');
}
else
{
$this->data['_view'] = 'jourferie/add';
$this->load->view('layouts/main',$this->data);
}
}
/*
* Editing a jourferie
*/
function edit($id)
{
// check if the jourferie exists before trying to edit it
$this->data['jourferie'] = $this->Jourferie_model->get_jourferie($id);
if(isset($this->data['jourferie']['id']))
{
$this->load->library('form_validation');
$this->form_validation->set_rules('libelle','Libelle','required');
$this->form_validation->set_rules('date','Date','required');
if($this->form_validation->run())
{
$params = array(
'libelle' => $this->input->post('libelle'),
'date' =>$this->input->post('date'),
);
$this->Jourferie_model->update_jourferie($id,$params);
redirect('jourferie/index');
}
else
{
$this->data['_view'] = 'jourferie/edit';
$this->load->view('layouts/main',$this->data);
}
}
else
show_error('The jourferie you are trying to edit does not exist.');
}
/*
* Deleting jourferie
*/
function remove($id)
{
$jourferie = $this->Jourferie_model->get_jourferie($id);
// check if the jourferie exists before trying to delete it
if(isset($jourferie['id']))
{
$this->Jourferie_model->delete_jourferie($id);
redirect('jourferie/index');
}
else
show_error('The jourferie you are trying to delete does not exist.');
}
}