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 Ligneacce_model extends CI_Model
{
function __construct()
{
parent::__construct();
}
/*
* Get ligneacce by id
*/
function get_ligneacce($id)
{
return $this->db->get_where('access',array('id'=>$id))->row_array();
}
/*
* Get all ligneacces
*/
function get_all_ligneacces()
{
$this->db->order_by('users_id', 'asc');
$this->db->order_by('module_id', 'desc');
$this->db->select('*, access.id as idaccess');
$this->db->from('access');
$this->db->join('module', 'module.id = access.module_id');
$this->db->join('action', 'action.id = access.action_id');
$this->db->join('users', 'users.id = access.users_id');
return $this->db->get()->result_array();
}
function getForListModule()
{
$this->db->order_by('order', 'desc');
$this->db->select('*,id, module as text');
return $this->db->from('module')->get()->result_array();
}
function getForListAction()
{
$this->db->order_by('id', 'desc');
$this->db->select('*,id, name as text');
return $this->db->from('action')->get()->result_array();
}
/*
* function to add new ligneacce
*/
function add_ligneacce($params)
{
$this->db->insert('access',$params);
return $this->db->insert_id();
}
/*
* function to update ligneacce
*/
function update_ligneacce($id,$params)
{
$this->db->where('id',$id);
return $this->db->update('module',$params);
}
/*
* function to delete ligneacce
*/
function delete_ligneacce($id)
{
return $this->db->delete('access',array('id'=>$id));
}
}