Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
academy-lms
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Phạm Văn Đoan
academy-lms
Commits
9429f7ad
Commit
9429f7ad
authored
Mar 04, 2020
by
Trần Văn Minh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chỉnh sửa hiển thị danh sách user
parent
33c1587a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
12 deletions
+12
-12
User_model.php
application/models/User_model.php
+1
-1
user_add.php
application/views/backend/admin/user/user_add.php
+5
-5
user_edit.php
application/views/backend/admin/user/user_edit.php
+6
-6
No files found.
application/models/User_model.php
View file @
9429f7ad
...
...
@@ -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
)
{
...
...
application/views/backend/admin/user/user_add.php
View file @
9429f7ad
...
...
@@ -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
)
:
?>
...
...
application/views/backend/admin/user/user_edit.php
View file @
9429f7ad
...
...
@@ -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
)
:
?>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment