Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
iwl-live
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
Anthony.Suerte
iwl-live
Commits
11165036
Commit
11165036
authored
Jul 09, 2021
by
Anthony.Suerte
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Admin List Pagination Fix
parent
98fd0e78
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
74 additions
and
44 deletions
+74
-44
tmp_admin_user_list.php
system/en/template/tmp_admin_user_list.php
+6
-5
sql.xml
system/lib/sql.xml
+15
-0
logic.php
system/logic/admin_user/logic.php
+13
-5
model.php
system/logic/admin_user/model.php
+34
-29
tmp_admin_user_list.php
system/template/tmp_admin_user_list.php
+6
-5
No files found.
system/en/template/tmp_admin_user_list.php
View file @
11165036
...
...
@@ -20,25 +20,26 @@ include_once('template/base_head.php');
</colgroup>
<tr>
<th>
User Account Number
</th>
<td><input
type=
"text"
id=
"s_user_account"
name=
"s_user_account"
value=
""
class=
"w100p"
></td>
<td><input
type=
"text"
id=
"s_user_account"
name=
"s_user_account"
value=
"
<?=
$this
->
getField
(
"sUserAccount"
)
?>
"
class=
"w100p"
></td>
</tr>
<tr>
<th>
Department
</th>
<td>
<?php
echo
$this
->
getDepartmentDropdown
();
?>
</td>
<td>
<?php
echo
$this
->
getDepartmentDropdown
(
$this
->
getField
(
"sDepartment"
)
);
?>
</td>
</tr>
<tr>
<th>
Name
</th>
<td><input
type=
"text"
id=
"s_name"
name=
"s_name"
value=
""
class=
"w100p"
></td>
<td><input
type=
"text"
id=
"s_name"
name=
"s_name"
value=
"
<?=
$this
->
getField
(
"sName"
)
?>
"
class=
"w100p"
></td>
</tr>
<tr>
<th>
Username
</th>
<td><input
type=
"text"
id=
"email"
name=
"email"
value=
""
class=
"w100p"
></td>
<td><input
type=
"text"
id=
"email"
name=
"email"
value=
"
<?=
$this
->
getField
(
"userName"
)
?>
"
class=
"w100p"
></td>
</tr>
<tr>
<td
colspan=
"2"
>
<span
class=
"th"
>
Date of Last Login
</span>
<?php
$this
->
dispLoginFlg
();
?>
<input
type=
"text"
id=
"s_last_login_from"
name=
"s_last_login_from"
value=
""
class=
"px110"
>
-
<input
type=
"text"
id=
"s_last_login_to"
name=
"s_last_login_to"
value=
""
class=
"px110"
>
<input
type=
"text"
id=
"s_last_login_from"
name=
"s_last_login_from"
value=
"
<?=
$this
->
getField
(
"sLastLoginFrom"
)
?>
"
class=
"px110"
>
-
<input
type=
"text"
id=
"s_last_login_to"
name=
"s_last_login_to"
value=
"
<?=
$this
->
getField
(
"sLastLoginTo"
)
?>
"
class=
"px110"
>
</td>
</tr>
</table>
...
...
system/lib/sql.xml
View file @
11165036
...
...
@@ -12841,7 +12841,22 @@ WHERE
WHERE
1
__ELEMENT01__
__ELEMENT02__
</LIST_ADMIN_USER>
<COUNT_ADMIN_USER>
SELECT
count(*) AS admin_ctr
FROM
v_users_admin AS data
INNER JOIN
t_admin_user_access AS admin_access
ON (admin_access.user_account = data.user_account)
INNER JOIN
t_admin_department AS department
ON (department.ad_id = admin_access.department_id)
WHERE 1
__ELEMENT01__
</COUNT_ADMIN_USER>
<SELECT_ADMIN_USER>
SELECT
data.u_id AS u_id
...
...
system/logic/admin_user/logic.php
View file @
11165036
...
...
@@ -23,16 +23,13 @@ class LogicAdminUser extends AdminUserModelClass {
* @return : TRUE:ロジック成功、FALSE:ロジック失敗
-------------------------------------------------------------------------*/
function
logic
()
{
try
{
$saveResult
=
true
;
// 初期データ処理
$this
->
init
();
if
(
$this
->
getType
()
==
TYPE_ADMIN_USER_SEARCH_ALL
||
$this
->
getType
()
==
TYPE_ADMIN_USER_LIST
||
$this
->
getType
()
==
NO_STRING
)
{
$this
->
lists
();
}
elseif
(
$this
->
getType
()
==
TYPE_ADMIN_USER_IMPORT
)
{
if
(
$this
->
getType
()
==
TYPE_ADMIN_USER_IMPORT
)
{
$saveResult
=
$this
->
saveUserAdminCSV
();
//check if save has failed
...
...
@@ -70,8 +67,11 @@ class LogicAdminUser extends AdminUserModelClass {
$this
->
deleteAdminUser
();
$this
->
popUpSessionMessage
(
INFO
,
'I_COMPLATE_DELETE'
,
array
());
$this
->
lists
();
}
else
{
$this
->
lists
();
}
}
catch
(
Exception
$e
)
{
throw
$e
;
}
...
...
@@ -88,6 +88,14 @@ class LogicAdminUser extends AdminUserModelClass {
// データの取得
$where
=
$this
->
getWhere
();
//echo "<pre>";
//echo ($this -> setElementParam('LIST_ADMIN_USER', $where));
$totalFetch
=
$this
->
getRowData
(
$this
->
accessSelect
(
"COUNT_ADMIN_USER"
,
$where
));
$this
->
setTotal
(
$this
->
getColumnData
(
$totalFetch
,
'admin_ctr'
));
$this
->
setResult
(
$this
->
accessSelect
(
'LIST_ADMIN_USER'
,
$where
));
$this
->
selectDepartmentList
();
}
...
...
system/logic/admin_user/model.php
View file @
11165036
...
...
@@ -33,6 +33,8 @@ class AdminUserModelClass extends ModelClassEx {
*
*/
private
$lang
=
NO_STRING
;
private
$defPageCount
=
VAR_DEFAULT_PAGE_COUNT
;
private
$total
;
/*-------------------------------------------------------------------------
* @function_name: コントロールパネルシステムindexモデルクラスコンストラクタ
...
...
@@ -296,7 +298,6 @@ class AdminUserModelClass extends ModelClassEx {
// 変数宣言部
$where
=
NO_STRING
;
$rtn
=
array
();
$statuses
=
array
();
//search via useraccount
if
(
$this
->
sUserAccount
!=
NO_STRING
)
{
...
...
@@ -313,6 +314,10 @@ class AdminUserModelClass extends ModelClassEx {
$where
.=
' AND department.ad_id LIKE (\')%'
.
$this
->
sDepartment
.
'%(\')'
;
}
if
(
$this
->
userName
!=
NO_STRING
)
{
$where
.=
' AND data.user_name LIKE (\')%'
.
$this
->
userName
.
'%(\')'
;
}
//search via last login date (FROM)
if
(
$this
->
loginFlg
!=
NO_STRING
){
if
(
$this
->
sLastLoginFrom
!=
'2014/01/01'
...
...
@@ -327,10 +332,9 @@ class AdminUserModelClass extends ModelClassEx {
}
// ページ数
$start
=
(
$this
->
getTargetPage
()
-
VAL_INT_1
)
*
VAR_DEFAULT_PAGE_COUNT
;
$end
=
$this
->
getTargetPage
()
*
VAR_DEFAULT_PAGE_COUNT
;
$start
=
(
$this
->
getTargetPage
()
-
VAL_INT_1
)
*
$this
->
defPageCount
;
$page
=
' LIMIT '
.
$start
.
DELIMIT_COMMA
.
VAL_INT_50
;
$page
=
' LIMIT '
.
$start
.
DELIMIT_COMMA
.
$this
->
defPageCount
;
//chck if search is not search all
if
(
$this
->
getType
()
==
TYPE_ADMIN_USER_SEARCH_ALL
)
{
...
...
@@ -352,6 +356,10 @@ class AdminUserModelClass extends ModelClassEx {
$this
->
rs
=
$rs
;
}
public
function
setTotal
(
$total
){
$this
->
total
=
$total
;
}
/*-------------------------------------------------------------------------
* @function_name: ページャの表示
* @parameter : なし
...
...
@@ -359,8 +367,8 @@ class AdminUserModelClass extends ModelClassEx {
-------------------------------------------------------------------------*/
function
dispPager
()
{
echo
$this
->
getPagerCommon
(
$this
->
getTargetPage
()
,
$this
->
getTotalPageCommon
(
VAR_DEFAULT_PAGE_COUNT
,
count
(
$this
->
rs
)
)
,
count
(
$this
->
rs
)
,
$this
->
getTotalPageCommon
(
$this
->
defPageCount
,
$this
->
total
)
,
$this
->
total
,
NO_STRING
);
}
...
...
@@ -496,14 +504,7 @@ class AdminUserModelClass extends ModelClassEx {
$row
=
null
;
if
(
$this
->
isLoopData
(
$this
->
rs
))
{
$start
=
(
$this
->
getTargetPage
()
-
VAL_INT_1
)
*
VAR_DEFAULT_PAGE_COUNT
;
$end
=
$this
->
getTargetPage
()
*
VAR_DEFAULT_PAGE_COUNT
;
$listCount
=
count
(
$this
->
rs
);
for
(
$cnt
=
$start
;
$cnt
<
$end
&&
$cnt
<
$listCount
;
$cnt
++
)
{
$row
=
$this
->
getRowData
(
$this
->
rs
,
$cnt
);
foreach
(
$this
->
rs
as
$row
){
$rtn
.=
'<tr>'
.
'<td>'
.
$this
->
getColumnData
(
$row
,
COLUMN_USER_ACCOUNT
)
.
'</td>'
.
'<td>'
.
$this
->
getColumnData
(
$row
,
COLUMN_DEPARTMENT_NAME
)
.
'</td>'
...
...
@@ -512,9 +513,7 @@ class AdminUserModelClass extends ModelClassEx {
.
'<td>'
.
$this
->
getColumnData
(
$row
,
COLUMN_LAST_LOGIN_TIME
)
.
'</td>'
.
'<td class="blocka"><a href="javascript:actionDetail(\''
.
$this
->
getColumnData
(
$row
,
COLUMN_USER_ACCOUNT
)
.
'\');"><span class="fa fa-info-circle fa-lg"></span></a></td>'
.
'</tr>'
;
}
}
else
{
$rtn
=
'<tr><td colspan="6">'
.
$this
->
getMessage
(
INFO
,
'I_NO_SUCHE_SEARCH_DATA'
,
array
())
.
'</td></tr>'
;
}
...
...
@@ -580,7 +579,7 @@ class AdminUserModelClass extends ModelClassEx {
</tr>
<tr>
<th>Department</th>
<td>'
.
$this
->
getDepartmentDropdown
(
$this
->
getColumnData
(
$row
,
COLUMN_DEPARTMENT_NAME
))
.
'</td>
<td>'
.
$this
->
getDepartmentDropdown
(
$this
->
getColumnData
(
$row
,
COLUMN_DEPARTMENT_NAME
)
,
true
)
.
'</td>
</tr>
<tr>
<th>Name</th>
...
...
@@ -772,6 +771,10 @@ class AdminUserModelClass extends ModelClassEx {
echo
$rtn
;
}
public
function
getField
(
$fieldName
){
return
$this
->
{
$fieldName
};
}
/*-------------------------------------------------------------------------
* @function_name: setParameterCSV
* @parameter : $adminUserData - array containing admin user data
...
...
@@ -834,7 +837,7 @@ class AdminUserModelClass extends ModelClassEx {
* @parameter : $departName - default null
* @return :
-------------------------------------------------------------------------*/
public
function
getDepartmentDropdown
(
$
departName
=
null
)
{
public
function
getDepartmentDropdown
(
$
findWhat
=
null
,
$forDepartmentName
=
false
)
{
$rtn
=
NO_STRING
;
$departmentList
=
$this
->
getDepartmentList
();
...
...
@@ -842,8 +845,10 @@ class AdminUserModelClass extends ModelClassEx {
<option value="">--- All ---</option>'
;
foreach
(
$departmentList
as
$department
)
{
$comparedColumn
=
$forDepartmentName
?
COLUMN_NAME
:
COLUMN_AD_ID
;
//check if department name is not null and is equal to the department name of the current option
if
(
$this
->
getColumnData
(
$department
,
COLUMN_NAME
)
==
$departName
)
{
if
(
$this
->
getColumnData
(
$department
,
$comparedColumn
)
==
$findWhat
)
{
$rtn
.=
'<option value='
.
$this
->
getColumnData
(
$department
,
COLUMN_AD_ID
)
.
' selected=\'selected\' >'
.
$this
->
getColumnData
(
$department
,
COLUMN_NAME
)
.
'</option>'
;
}
else
{
$rtn
.=
'<option value='
.
$this
->
getColumnData
(
$department
,
COLUMN_AD_ID
)
.
'>'
.
$this
->
getColumnData
(
$department
,
COLUMN_NAME
)
.
'</option>'
;
...
...
system/template/tmp_admin_user_list.php
View file @
11165036
...
...
@@ -20,25 +20,26 @@ include_once('template/base_head.php');
</colgroup>
<tr>
<th>
ユーザーアカウント
</th>
<td><input
type=
"text"
id=
"s_user_account"
name=
"s_user_account"
value=
""
class=
"w100p"
></td>
<td><input
type=
"text"
id=
"s_user_account"
name=
"s_user_account"
value=
"
<?=
$this
->
getField
(
"sUserAccount"
)
?>
"
class=
"w100p"
></td>
</tr>
<tr>
<th>
部門
</th>
<td>
<?php
echo
$this
->
getDepartmentDropdown
();
?>
</td>
<td>
<?php
echo
$this
->
getDepartmentDropdown
(
$this
->
getField
(
"sDepartment"
)
);
?>
</td>
</tr>
<tr>
<th>
名前
</th>
<td><input
type=
"text"
id=
"s_name"
name=
"s_name"
value=
""
class=
"w100p"
></td>
<td><input
type=
"text"
id=
"s_name"
name=
"s_name"
value=
"
<?=
$this
->
getField
(
"sName"
)
?>
"
class=
"w100p"
></td>
</tr>
<tr>
<th>
ユーザー名
</th>
<td><input
type=
"text"
id=
"email"
name=
"email"
value=
""
class=
"w100p"
></td>
<td><input
type=
"text"
id=
"email"
name=
"email"
value=
"
<?=
$this
->
getField
(
"userName"
)
?>
"
class=
"w100p"
></td>
</tr>
<tr>
<td
colspan=
"2"
>
<span
class=
"th"
>
最終ログイン
</span>
<?php
$this
->
dispLoginFlg
();
?>
<input
type=
"text"
id=
"s_last_login_from"
name=
"s_last_login_from"
value=
""
class=
"px110"
>
-
<input
type=
"text"
id=
"s_last_login_to"
name=
"s_last_login_to"
value=
""
class=
"px110"
>
<input
type=
"text"
id=
"s_last_login_from"
name=
"s_last_login_from"
value=
"
<?=
$this
->
getField
(
"sLastLoginFrom"
)
?>
"
class=
"px110"
>
-
<input
type=
"text"
id=
"s_last_login_to"
name=
"s_last_login_to"
value=
"
<?=
$this
->
getField
(
"sLastLoginTo"
)
?>
"
class=
"px110"
>
</td>
</tr>
</table>
...
...
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