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 Affectation_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
/*
* Get affectation by id
*/
function get_affectation($id)
{
return $this->db->get_where('affectation',array('id'=>$id))->row_array();
}
/*
* Get all affectation count
*/
function get_all_affectation_count()
{
$this->db->from('affectation');
return $this->db->count_all_results();
}
/*
* Get all affectation
*/
function get_all_affectation($params = array())
{
//$this->db->order_by('id', 'desc');
if(isset($params) && !empty($params))
{
$this->db->limit($params['limit'], $params['offset']);
}
$this->db->select('*,affectation.id as idaffectation, fonction.libelle as poste , planning.libelle as planning , service.libelle as equipe , societe.nom as entreprise, users.nom as name');
$this->db->from('affectation');
$this->db->join('fonction', 'fonction.id = affectation.fonction_id');
$this->db->join('users', 'users.id = affectation.users_id');
$this->db->join('societe', 'societe.id = affectation.societe_id');
$this->db->join('service', 'service.id = affectation.service_id');
$this->db->join('planning', 'planning.id = affectation.planning_id');
$this->db->order_by('affectation.id', 'DESC');
$query = $this->db->get()->result_array();
return $query;
}
/*
* function to add new affectation
*/
function add_affectation($params)
{
$this->db->insert('affectation',$params);
return $this->db->insert_id();
}
/*
* function to update affectation
*/
function update_affectation($id,$params)
{
$this->db->where('id',$id);
return $this->db->update('affectation',$params);
}
/*
* function to delete affectation
*/
function delete_affectation($id)
{
return $this->db->delete('affectation',array('id'=>$id));
}
}