Commit 9429f7ad by Trần Văn Minh

chỉnh sửa hiển thị danh sách user

parent 33c1587a
......@@ -21,7 +21,7 @@ class User_model extends CI_Model {
// lấy danh sách các đơn vị tổ chức cùng nhánh
$organization_id = $this->session->userdata('organization_id');
$arr = all_child_organization($organization_id);
array_push($arr, $organization_id);
// array_push($arr, $organization_id);
if ($this->session->userdata('account_type') < 4) {
if ($this->session->userdata('is_supper_admin') == 0){
if($this->session->userdata('account_type') == 1) {
......
......@@ -7,7 +7,7 @@
$result = account_type($number, $is_supper_admin, $children_org);
?>
<?php
function children_orgs($organization, $parent_id = 0, $text = "")
function children_orgs($organization, $parent_id = 0,$is_supper_admin, $text = "")
{
foreach($organization as $k=>$organ)
{
......@@ -15,11 +15,11 @@ function children_orgs($organization, $parent_id = 0, $text = "")
{
echo '<option value=\''.$organ['id'].'\'';
if($is_supper_admin == 0) {
if($organ['id'] == $organization_id) echo 'disabled'; };
if($organ['id'] == $parent_id) echo 'disabled'; };
echo '>'.$text.' '.$organ['name'].'</option>';
$id = $organ['id'];
unset($organization[$k]);
children_orgs($organization, $id, $text."--");
children_orgs($organization, $id, $is_supper_admin, $text."--");
}
}
}
......@@ -103,9 +103,9 @@ function children_orgs($organization, $parent_id = 0, $text = "")
<?php
if($children_org != array()) {
if($is_supper_admin == 0) {
children_orgs($organization, $organization_id);
children_orgs($organization, $organization_id, $is_supper_admin);
} else {
children_orgs($organization);
children_orgs($organization,0, $is_supper_admin);
}
} else {
foreach ($organization as $organ): ?>
......
......@@ -7,7 +7,7 @@
$number = $this->session->userdata('account_type');
$result = account_type($number, $is_supper_admin, $children_org);
function children_orgs($organization, $parent_id = 0, $text = "")
function children_orgs($organization, $parent_id = 0, $is_supper_admin, $text = "")
{
foreach($organization as $k=>$organ)
{
......@@ -15,12 +15,12 @@
{
echo '<option value=\''.$organ['id'].'\'';
if($is_supper_admin == 0) {
if($organ['id'] == $organization_id) echo 'disabled'; };
if($organ['id'] == $user_data['organization_id']) echo 'selected';
if($organ['id'] == $parent_id) echo 'disabled'; };
if($organ['id'] == $parent_id) echo 'selected';
echo '>'.$text.' '.$organ['name'].'</option>';
$id = $organ['id'];
unset($organization[$k]);
children_orgs($organization, $id, $text."--");
children_orgs($organization, $id, $is_supper_admin, $text."--");
}
}
}
......@@ -104,9 +104,9 @@
<?php
if($children_org != array()) {
if($is_supper_admin == 0) {
children_orgs($organization, $user_data['organization_id']);
children_orgs($organization, $user_data['organization_id'], $is_supper_admin);
} else {
children_orgs($organization);
children_orgs($organization, 0, $is_supper_admin);
}
} else {
foreach ($organization as $organ): ?>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment