mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-10-23 08:38:37 -04:00
Version 2.0_RC1. Upgrade to CI 2.1.0.
Tom git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@24 c3eb156b-1dc0-44e1-88ae-e38439141b53
This commit is contained in:
1 parent
335982638e
commit
ecdf3a5aa1
231 files changed
+24332
No files matched your search
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
class Module extends CI_Model
|
||||
{
|
||||
function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
function get_module_name($module_id)
|
||||
{
|
||||
$query = $this->db->get_where('modules', array('module_id' => $module_id), 1);
|
||||
|
||||
if ($query->num_rows() ==1)
|
||||
{
|
||||
$row = $query->row();
|
||||
return $this->lang->line($row->name_lang_key);
|
||||
}
|
||||
|
||||
return $this->lang->line('error_unknown');
|
||||
}
|
||||
|
||||
function get_module_desc($module_id)
|
||||
{
|
||||
$query = $this->db->get_where('modules', array('module_id' => $module_id), 1);
|
||||
if ($query->num_rows() ==1)
|
||||
{
|
||||
$row = $query->row();
|
||||
return $this->lang->line($row->desc_lang_key);
|
||||
}
|
||||
|
||||
return $this->lang->line('error_unknown');
|
||||
}
|
||||
|
||||
function get_all_modules()
|
||||
{
|
||||
$this->db->from('modules');
|
||||
$this->db->order_by("sort", "asc");
|
||||
return $this->db->get();
|
||||
}
|
||||
|
||||
function get_allowed_modules($person_id)
|
||||
{
|
||||
$this->db->from('modules');
|
||||
$this->db->join('permissions','permissions.module_id=modules.module_id');
|
||||
$this->db->where("permissions.person_id",$person_id);
|
||||
$this->db->order_by("sort", "asc");
|
||||
return $this->db->get();
|
||||
}
|
||||
}
|
||||
?>
|
||||
Reference in new issue
Block a user