Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
devManagerSys
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
李远洪
devManagerSys
Commits
5dbe497e
Commit
5dbe497e
authored
Nov 20, 2020
by
liyuanhong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
second commit
parent
2fdfca3c
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
325 additions
and
58 deletions
+325
-58
app/Config/App.php
app/Config/App.php
+1
-1
app/Controllers/DevManage.php
app/Controllers/DevManage.php
+28
-0
app/Controllers/DevManageCtr.php
app/Controllers/DevManageCtr.php
+55
-0
app/Controllers/Home.php
app/Controllers/Home.php
+25
-31
app/Controllers/UserManage.php
app/Controllers/UserManage.php
+2
-2
app/Models/DevManageModel.php
app/Models/DevManageModel.php
+43
-4
app/Models/HomeModel.php
app/Models/HomeModel.php
+0
-0
app/Views/devManage/aside.php
app/Views/devManage/aside.php
+5
-0
app/Views/devManage/borrow_check.php
app/Views/devManage/borrow_check.php
+49
-0
app/Views/devManage/dev_detail.php
app/Views/devManage/dev_detail.php
+12
-11
app/Views/devManage/dev_manage.php
app/Views/devManage/dev_manage.php
+2
-1
app/Views/header.php
app/Views/header.php
+1
-1
app/Views/home/show_dev_detail.php
app/Views/home/show_dev_detail.php
+3
-1
app/Views/home/show_devs.php
app/Views/home/show_devs.php
+95
-2
app/Views/userManage/aside.php
app/Views/userManage/aside.php
+4
-4
app/Views/userManage/show_role.php
app/Views/userManage/show_role.php
+0
-0
No files found.
app/Config/App.php
View file @
5dbe497e
...
...
@@ -22,7 +22,7 @@ class App extends BaseConfig
|
*/
// public $baseURL = 'http://localhost:8080/';
public
$baseURL
=
'http://10.16.
4.205
:8080/'
;
public
$baseURL
=
'http://10.16.
9.166
:8080/'
;
// public $baseURL = 'http://localhost/ci4/public/';
...
...
app/Controllers/DevManage.php
View file @
5dbe497e
...
...
@@ -120,4 +120,32 @@ class DevManage extends BaseController
return
view
(
'devManage/category_manage'
,
$data
);
}
/****************************************************
* 签借审核页面
/****************************************************/
public
function
borrowCheckPage
(){
$data
=
array
();
$username
=
$this
->
request
->
getGet
(
"username"
);
$token
=
$this
->
request
->
getGet
(
"token"
);
if
(
$username
==
""
||
$token
==
""
){
$data
[
"userInfo"
]
=
[];
}
else
{
$signModel
=
new
\App\Models\SignModel
();
$userInfo
=
$signModel
->
getItemByUsername
(
$username
);
if
(
$userInfo
[
0
][
"token"
]
==
$token
){
$data
[
"userInfo"
]
=
$userInfo
[
0
];
$data
[
"notification"
]
=
[];
//TODO 小红点的逻辑需要加上
}
else
{
$data
[
"userInfo"
]
=
[];
}
}
$data
[
"uri"
]
=
getUriInfo
(
$this
->
request
);
$data
[
"category"
]
=
array
();
$devManageModel
=
new
\App\Models\DevManageModel
();
$data
[
"category"
][
"firstCategory"
]
=
$devManageModel
->
getAllFirstCategory
();
$data
[
"category"
][
"secondCategory"
]
=
$devManageModel
->
getSecondCategoryByFirstCategoryId
();
return
view
(
'devManage/borrow_check'
,
$data
);
}
}
app/Controllers/DevManageCtr.php
View file @
5dbe497e
...
...
@@ -409,5 +409,60 @@ class DevManageCtr extends BaseController
}
/////////////////////////////////////////////////// 设备签借区域 ////////////////////////////////////////////////////////////////
/****************************************************
* 添加设备签借信息
/****************************************************/
function
addDevBorrowInfo
(){
$result
=
array
();
$param
=
$this
->
request
->
getJSON
();
$timest
=
time
();
$curTime
=
date
(
"Y-m-d H:i:s"
,
$timest
);
$item
=
array
();
$item
[
"dev_id"
]
=
$param
->
devId
;
$item
[
"user_id"
]
=
$param
->
userId
;
$item
[
"borrower"
]
=
$param
->
borrower
;
$item
[
"comment"
]
=
$param
->
comment
;
$item
[
"borrower_time"
]
=
$curTime
;
$item
[
"borrow_status"
]
=
1
;
//1:表示申请签借中,还未通过审核
try
{
$devManageModel
=
new
\App\Models\DevManageModel
();
$borrowInfo1
=
$devManageModel
->
searchBorrowerInfoByDevid
(
$item
);
$borrowInfo2
=
$devManageModel
->
searchBorrowInfoByBorrowerAndDevid
(
$item
);
if
(
count
(
$borrowInfo1
)
==
0
||
count
(
$borrowInfo1
)
>
1
){
if
(
count
(
$borrowInfo2
)
==
0
){
$devManageModel
->
insertBorrowInfo
(
$item
);
$result
[
"status"
]
=
SUCESS
;
$result
[
"message"
]
=
"设备申请成功!"
;
}
else
{
$result
[
"status"
]
=
COMMON_FAIL
;
$result
[
"message"
]
=
"你已经申请该设备!"
;
}
}
else
if
(
$borrowInfo1
[
0
][
"borrow_status"
]
==
2
){
$result
[
"status"
]
=
COMMON_FAIL
;
$result
[
"message"
]
=
"该设备已经借出!"
;
}
else
{
if
(
count
(
$borrowInfo2
)
==
0
){
$devManageModel
->
insertBorrowInfo
(
$item
);
$result
[
"status"
]
=
SUCESS
;
$result
[
"message"
]
=
"设备申请成功!"
;
}
else
{
$result
[
"status"
]
=
COMMON_FAIL
;
$result
[
"message"
]
=
"你已经申请该设备!"
;
}
}
}
catch
(
Exception
$e
){
$result
[
"status"
]
=
COMMON_FAIL
;
$message
=
$e
->
getMessage
();
$result
[
"message"
]
=
$message
;
}
$this
->
response
->
setHeader
(
'Content-Type'
,
'application/json'
)
->
setHeader
(
'charset'
,
'utf-8'
);
$result
=
json_encode
(
$result
);
echo
$result
;
}
}
app/Controllers/Home.php
View file @
5dbe497e
...
...
@@ -51,15 +51,15 @@ class Home extends BaseController
$item
[
"page"
]
=
$page
;
$item
[
"perPage"
]
=
$perPage
;
if
(
$username
==
""
||
$token
==
""
){
$data
[
"userInfo"
]
=
[];
}
else
{
$signModel
=
new
\App\Models\SignModel
();
$userInfo
=
$signModel
->
getItemByUsername
(
$username
);
if
(
$username
==
""
||
$token
==
""
||
$userInfo
[
0
][
"token"
]
==
$token
){
$data
[
"userInfo"
]
=
[];
}
else
{
$devManageModel
=
new
\App\Models\DevManageModel
();
$devices
=
$devManageModel
->
getDevicesAllInfoByPage
(
$item
);
$totalNums
=
$devManageModel
->
getTatalDeviceNum
()[
0
][
"total"
];
if
(
$userInfo
[
0
][
"token"
]
==
$token
){
$data
[
"userInfo"
]
=
$userInfo
[
0
];
$data
[
"devices"
]
=
$devices
;
$data
[
"pageInfo"
]
=
array
();
...
...
@@ -67,12 +67,9 @@ class Home extends BaseController
$data
[
"pageInfo"
][
"perPage"
]
=
$perPage
;
$data
[
"pageInfo"
][
"total"
]
=
$totalNums
;
$data
[
"notification"
]
=
[];
$data
[
"uri"
]
=
getUriInfo
(
$this
->
request
);
//TODO 小红点的逻辑需要加上
}
else
{
$data
[
"userInfo"
]
=
[];
}
}
$data
[
"uri"
]
=
getUriInfo
(
$this
->
request
);
return
view
(
'home/show_devs'
,
$data
);
}
...
...
@@ -86,26 +83,23 @@ class Home extends BaseController
$token
=
$this
->
request
->
getGet
(
"token"
);
$devId
=
(
int
)
$this
->
request
->
getGet
(
"devId"
);
if
(
$username
==
""
||
$token
==
""
){
$data
[
"userInfo"
]
=
[];
}
else
{
$signModel
=
new
\App\Models\SignModel
();
$userInfo
=
$signModel
->
getItemByUsername
(
$username
);
if
(
$username
==
""
||
$token
==
""
||
$userInfo
[
0
][
"token"
]
==
$token
){
$data
[
"userInfo"
]
=
[];
}
else
{
$devManageModel
=
new
\App\Models\DevManageModel
();
$devInfo
=
$devManageModel
->
getDeviceInfoById
(
$devId
);
$devImg
=
$devManageModel
->
getDevImgsById
(
$devId
);
if
(
count
(
$devInfo
)
==
0
){
$devInfo
[
0
]
=
array
();
}
if
(
$userInfo
[
0
][
"token"
]
==
$token
){
$data
[
"userInfo"
]
=
$userInfo
[
0
];
$data
[
"devInfo"
]
=
$devInfo
[
0
];
$data
[
"devImg"
]
=
$devImg
;
$data
[
"notification"
]
=
[];
//TODO 小红点的逻辑需要加上
}
else
{
$data
[
"userInfo"
]
=
[];
}
}
$data
[
"uri"
]
=
getUriInfo
(
$this
->
request
);
return
view
(
'home/show_dev_detail'
,
$data
);
...
...
app/Controllers/UserManage.php
View file @
5dbe497e
...
...
@@ -56,7 +56,7 @@ class UserManage extends BaseController
/****************************************************
* 展示权限页面
/****************************************************/
public
function
showR
ights
Page
(){
public
function
showR
ole
Page
(){
$data
=
array
();
$username
=
$this
->
request
->
getGet
(
"username"
);
$token
=
$this
->
request
->
getGet
(
"token"
);
...
...
@@ -77,6 +77,6 @@ class UserManage extends BaseController
}
}
$data
[
"uri"
]
=
getUriInfo
(
$this
->
request
);
return
view
(
'userManage/show_r
ights
'
,
$data
);
return
view
(
'userManage/show_r
ole
'
,
$data
);
}
}
\ No newline at end of file
app/Models/DevManageModel.php
View file @
5dbe497e
...
...
@@ -137,10 +137,12 @@ class DevManageModel extends Model
public
function
getDevicesAllInfoByPage
(
$data
){
$sql
=
'select t1.*,
t2.category_name,
t3.org_section_name
t3.org_section_name,
t4.id as borrow_id,t4.borrower,t4.user_id,t4.borrow_status
from devices t1
left join first_category t2 on t1.first_category_id = t2.id
left join org_section t3 on t1.org_section_id = t3.id limit '
.
((
$data
[
"page"
]
-
1
)
*
$data
[
"perPage"
])
.
','
.
$data
[
"perPage"
];
left join org_section t3 on t1.org_section_id = t3.id
left join dev_borrow t4 on t1.borrow_id = t4.id limit '
.
((
$data
[
"page"
]
-
1
)
*
$data
[
"perPage"
])
.
','
.
$data
[
"perPage"
];
$allFirstCategoryObj
=
$this
->
db
->
query
(
$sql
);
$result
=
$allFirstCategoryObj
->
getResultArray
();
return
$result
;
...
...
@@ -152,10 +154,12 @@ class DevManageModel extends Model
public
function
getDeviceInfoById
(
$id
){
$sql
=
'select t1.*,
t2.category_name,
t3.org_section_name
t3.org_section_name,
t4.id as borrow_id,t4.borrower,t4.user_id,t4.borrow_status
from devices t1
left join first_category t2 on t1.first_category_id = t2.id
left join org_section t3 on t1.org_section_id = t3.id where t1.id='
.
$id
;
left join org_section t3 on t1.org_section_id = t3.id
left join dev_borrow t4 on t1.borrow_id = t4.id where t1.id='
.
$id
;
$allFirstCategoryObj
=
$this
->
db
->
query
(
$sql
);
$result
=
$allFirstCategoryObj
->
getResultArray
();
return
$result
;
...
...
@@ -229,4 +233,39 @@ class DevManageModel extends Model
$sql
=
"delete from dev_img where dev_id="
.
$data
[
"dev_id"
]
.
" and id="
.
$data
[
"img_id"
];
$this
->
db
->
query
(
$sql
);
}
/////////////////////////////////////////////////// 设备签借区域 ////////////////////////////////////////////////////////////////
/****************************************************
* 添加设备签借信息
/****************************************************/
public
function
insertBorrowInfo
(
$data
){
$sql
=
'insert into dev_borrow (dev_id,user_id,borrower,comment,borrower_time,borrow_status) values ('
.
$data
[
"dev_id"
]
.
','
.
$data
[
"user_id"
]
.
',"'
.
$data
[
"borrower"
]
.
'","'
.
$data
[
"comment"
]
.
'","'
.
$data
[
"borrower_time"
]
.
'",'
.
$data
[
"borrow_status"
]
.
')'
;
$this
->
db
->
query
(
$sql
);
}
/****************************************************
* 根据用户名和设备id查询签借信息
/****************************************************/
public
function
searchBorrowInfoByBorrowerAndDevid
(
$data
){
$sql
=
'select * from dev_borrow where borrower="'
.
$data
[
"borrower"
]
.
'" and dev_id='
.
$data
[
"dev_id"
];
$obj
=
$this
->
db
->
query
(
$sql
);
$result
=
$obj
->
getResultArray
();
return
$result
;
}
/****************************************************
* 根据设备id查询签借信息
/****************************************************/
public
function
searchBorrowerInfoByDevid
(
$data
){
$sql
=
'select * from dev_borrow where borrower="'
.
$data
[
"borrower"
]
.
'" and dev_id='
.
$data
[
"dev_id"
];
$obj
=
$this
->
db
->
query
(
$sql
);
$result
=
$obj
->
getResultArray
();
return
$result
;
}
}
\ No newline at end of file
app/Models/HomeM
e
del.php
→
app/Models/HomeM
o
del.php
View file @
5dbe497e
File moved
app/Views/devManage/aside.php
View file @
5dbe497e
...
...
@@ -12,6 +12,9 @@
<li
<?php
if
(
$data
[
"uri"
][
"seg"
][
1
]
==
"categoryManagePage"
){
echo
"class='active'"
;}
?>
onclick=
"leftSwich(this)"
id=
"left_category_man"
>
<a><i
class=
"icon-chevron-right"
></i>
分类管理
</a>
</li>
<li
<?php
if
(
$data
[
"uri"
][
"seg"
][
1
]
==
"borrowCheckPage"
){
echo
"class='active'"
;}
?>
onclick=
"leftSwich(this)"
id=
"left_borrow_check"
>
<a><i
class=
"icon-chevron-right"
></i>
签借审核
</a>
</li>
</ul>
</div>
</div>
...
...
@@ -38,6 +41,8 @@
window
.
location
.
href
=
"
http://
"
+
host
+
"
/devManage/devDetail
"
+
"
?username=
"
+
username
+
"
&token=
"
+
token
;;
}
else
if
(
id
==
"
left_category_man
"
){
window
.
location
.
href
=
"
http://
"
+
host
+
"
/devManage/categoryManagePage
"
+
"
?username=
"
+
username
+
"
&token=
"
+
token
;;
}
else
if
(
id
==
"
left_borrow_check
"
){
window
.
location
.
href
=
"
http://
"
+
host
+
"
/devManage/borrowCheckPage
"
+
"
?username=
"
+
username
+
"
&token=
"
+
token
;;
}
}
...
...
app/Views/devManage/borrow_check.php
0 → 100644
View file @
5dbe497e
<?php
$data
=
$this
->
data
;
?>
<?=
view
(
"header.php"
,
$data
);
?>
<?=
view
(
"devManage/aside.php"
,
$data
);
?>
<div
class=
"span9"
id=
"content"
style=
"width:100%;"
>
<div
style=
"width:100%;min-height:700px;"
>
<div
class=
"row-fluid"
style=
"width:auto;margin:0px 10px;"
>
<!-- block -->
<div
class=
"block"
>
<div
class=
"block-content collapse in"
>
<div
class=
"span12"
>
<table
class=
"table table-striped"
>
<thead>
<tr>
<th>
#
</th>
<th>
昵称
</th>
<th>
用户名
</th>
<th>
角色
</th>
<th>
部门
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody>
<?php
//for($i = 0;$i < count($data["users"]);$i++){ ?>
<
tr
>
<
td
>
1
</
td
>
<
td
>
啊啊啊
</
td
>
<
td
>
不不不
</
td
>
<
td
>
擦擦擦
</
td
>
<
td
>
对对对
</
td
>
<
td
>
<
button
class
=
"btn btn-primary btn-mini"
href
=
"#editUserWindow"
data
-
toggle
=
"modal"
onclick
=
"showEditUserWindow(this)"
>
编辑
</
button
>
<
button
class
=
"btn btn-danger btn-mini"
onclick
=
"delUser(this)"
>
删除
</
button
>
</
td
>
</
tr
>
<?
php
//} ?>
</
tbody
>
</
table
>
</
div
>
</
div
>
</
div
>
<!--
/
block
-->
</
div
>
</
div
>
</
div
>
<?=
view
(
"footer.php"
,
$data
);
?>
app/Views/devManage/dev_detail.php
View file @
5dbe497e
...
...
@@ -7,10 +7,10 @@
<div
style=
"margin:0px 10px;margin-top:10px;padding:0px 10px;_background:pink;_min-height:50px;"
>
<input
class=
"input-xlarge focused"
id=
"dev_id"
type=
"text"
value=
"
<?php
if
(
count
(
$data
[
"devInfo"
])
!=
0
){
echo
$data
[
"devInfo"
][
"id"
];}
?>
"
placeholder=
"输入设备id"
style=
"display:inline;margin: 0px;width:200px;"
>
<button
class=
"btn btn-primary"
onclick=
"showDevById()"
>
查 看
</button>
<?php
if
(
count
(
$data
[
"devInfo"
])
!=
0
){
?>
<button
class=
"btn btn-primary"
onclick=
"editDevInfo(this)"
status=
"0"
>
编 辑
</button>
<button
class=
"btn btn-primary"
>
提 交
</button>
<form
class=
"form-horizontal"
style=
"display:inline;"
>
<div
style=
"margin-bottom:0px;display:inline-block;border-style: solid;border-width: 1px;border-color: #ddd;border-radius: 5px;"
>
<label
class=
"control-label"
for=
"fileInput"
style=
"width:110px;"
>
上传设备图片:
</label>
...
...
@@ -20,6 +20,7 @@
</div>
</form>
<button
class=
"btn btn-primary"
onclick=
"uploadFile()"
>
上 传
</button>
<?php
}
?>
</div>
<div
class=
"row-fluid"
_style=
"margin:0px 10px;padding:0px 10px;"
>
...
...
app/Views/devManage/dev_manage.php
View file @
5dbe497e
...
...
@@ -40,10 +40,11 @@
<td>
<?=
$data
[
"devices"
][
$i
][
"dev_system"
]
?>
</td>
<td
first_category_id=
"
<?=
$data
[
"devices"
][
$i
][
"first_category_id"
]
?>
"
>
<?=
$data
[
"devices"
][
$i
][
"category_name"
]
?>
</td>
<td>
<?=
$data
[
"devices"
][
$i
][
"org_section_name"
]
?>
</td>
<td><span
style=
"padding:4px;"
class=
"label label-
inverse
"
>
签借人
</span></td>
<td><span
style=
"padding:4px;"
class=
"label label-
success"
title=
"系统用户
"
>
签借人
</span></td>
<td>
<button
class=
"btn btn-primary btn-mini"
href=
"#editDevWindow"
data-toggle=
"modal"
onclick=
"showEdtiDevWindow(this)"
>
编辑
</button>
<button
class=
"btn btn-primary btn-mini"
onclick=
"gotoDevDetail(this)"
>
详情
</button>
<button
class=
"btn btn-primary btn-mini"
onclick=
""
>
借出
</button>
<button
class=
"btn btn-danger btn-mini"
onclick=
"deleteDev(this)"
>
删除
</button>
</td>
</tr>
...
...
app/Views/header.php
View file @
5dbe497e
...
...
@@ -30,7 +30,7 @@
<ul
class=
"nav pull-right"
>
<a
href=
"#"
><span
class=
"badge badge-important pull-right"
style=
"position: absolute;left: 25px;top: 1px;padding: 1px 5px;z-index:100;"
onclick=
"alertMes()"
>
10
</span></a>
<li
class=
"dropdown"
>
<a
href=
"#"
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"icon-user"
></i>
远洪
,你好!
<i
class=
"caret"
></i>
<a
href=
"#"
role=
"button"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
>
<i
class=
"icon-user"
></i>
<?=
$data
[
"userInfo"
][
"nick"
]
?>
,你好!
<i
class=
"caret"
></i>
</a>
<ul
class=
"dropdown-menu"
>
...
...
app/Views/home/show_dev_detail.php
View file @
5dbe497e
...
...
@@ -7,7 +7,9 @@
<div
style=
"margin:0px 10px;margin-top:10px;padding:0px 10px;_background:pink;_min-height:50px;"
>
<input
class=
"input-xlarge focused"
id=
"dev_id"
type=
"text"
value=
"
<?php
if
(
count
(
$data
[
"devInfo"
])
!=
0
){
echo
$data
[
"devInfo"
][
"id"
];}
?>
"
placeholder=
"输入设备id"
style=
"display:inline;margin: 0px;width:200px;"
>
<button
class=
"btn btn-primary"
onclick=
"showDevById()"
>
查 看
</button>
<?php
if
(
count
(
$data
[
"devInfo"
])
!=
0
){
?>
<button
class=
"btn btn-primary"
>
签 借
</button>
<?php
}
?>
</div>
<div
class=
"row-fluid"
_style=
"margin:0px 10px;padding:0px 10px;"
>
...
...
app/Views/home/show_devs.php
View file @
5dbe497e
...
...
@@ -27,6 +27,7 @@
<th>
系统
</th>
<th>
分类
</th>
<th>
部门
</th>
<th>
签借人
</th>
<th>
操作
</th>
</tr>
</thead>
...
...
@@ -41,9 +42,12 @@
<td>
<?=
$data
[
"devices"
][
$i
][
"dev_system"
]
?>
</td>
<td
first_category_id=
"
<?=
$data
[
"devices"
][
$i
][
"first_category_id"
]
?>
"
>
<?=
$data
[
"devices"
][
$i
][
"category_name"
]
?>
</td>
<td>
<?=
$data
[
"devices"
][
$i
][
"org_section_name"
]
?>
</td>
<td><span
style=
"padding:4px;"
class=
"label label-success"
title=
"系统用户"
>
签借人
</span></td>
<td>
<button
class=
"btn btn-primary btn-mini"
onclick=
"gotoShowDevDetail(this)"
>
详情
</button>
<button
class=
"btn btn-primary btn-mini"
>
签借
</button>
<?php
if
(
$data
[
"devices"
][
$i
][
"borrow_status"
]
!=
2
){
?>
<button
userId=
'
<?php
if
(
$data
[
"userInfo"
]
!=
[]){
echo
$data
[
"userInfo"
][
"id"
];}
else
{
echo
"0"
;}
?>
'
class=
"btn btn-primary btn-mini"
href=
"#showBorrowWindow"
data-toggle=
"modal"
onclick=
"showBorrowWindow(this)"
>
签借
</button>
<?php
}
?>
</td>
</tr>
<?php
}
?>
...
...
@@ -70,7 +74,47 @@
</div>
</div>
</div>
<?=
view
(
"footer.php"
,
$data
);
?>
<!-- 展示签借弹窗 -->
<div
id=
"showBorrowWindow"
class=
"modal hide"
style=
"width:500px;transform: translateX(-50%);margin:0px;left:50%;"
>
<div
class=
"modal-header"
>
<button
data-dismiss=
"modal"
class=
"close"
type=
"button"
>
×
</button>
<h3>
签借设备
</h3>
</div>
<div
class=
"modal-body"
>
<?php
if
(
$data
[
"userInfo"
]
!=
[]){
?>
<table>
<tr>
<td><label>
签借原因:
</label></td>
<td><textarea
style=
"width:380px;height:40px;margin-bottom:0px;"
id=
"borrow_comment"
></textarea></td>
</tr>
<tr>
<td></td>
<td>
<button
id=
"send_borrow_button"
devId=
""
userId=
"
<?=
$data
[
"userInfo"
][
"id"
]
?>
"
user_name=
"
<?=
$data
[
"userInfo"
][
"nick"
]
?>
"
data-dismiss=
"modal"
class=
"btn btn-primary"
style=
"width:100%;"
onclick=
"sendBorrow(this)"
>
确 定
</button>
</td>
</tr>
</table>
<?php
}
else
{
?>
<table>
<tr>
<td><label>
输入名字:
</label></td>
<td><input
class=
"input-xlarge focused"
id=
"user_name"
type=
"text"
value=
""
style=
"display:inline;margin: 0px;width:380px;"
></td>
</tr>
<tr>
<td><label>
签借原因:
</label></td>
<td><textarea
style=
"width:100%;height:40px;margin-bottom:0px;"
id=
"borrow_comment"
></textarea></td>
</tr>
<tr>
<td></td>
<td>
<button
id=
"send_borrow_button"
userId=
"0"
devId=
""
data-dismiss=
"modal"
class=
"btn btn-primary"
style=
"width:380px;"
onclick=
"sendBorrow(this)"
>
确 定
</button>
</td>
</tr>
</table>
<?php
}
?>
</div>
</div>
<style>
.modal-body
table
tr
td
label
,
input
,
select
{
...
...
@@ -130,6 +174,55 @@ function gotoShowDevDetail(e){
}
window
.
location
.
href
=
"
http://
"
+
host
+
"
/home/showDevDetail
"
+
"
?username=
"
+
username
+
"
&token=
"
+
token
+
"
&devId=
"
+
devId
;
}
/*****************************************************
* 展示签借弹窗
*****************************************************/
function
showBorrowWindow
(
e
){
var
userId
=
$
(
e
).
attr
(
"
userId
"
);
if
(
userId
==
0
){
var
devId
=
$
(
e
).
parent
().
parent
().
attr
(
"
dev_id
"
);
$
(
"
#send_borrow_button
"
).
attr
(
"
devId
"
,
devId
);
}
else
{
var
devId
=
$
(
e
).
parent
().
parent
().
attr
(
"
dev_id
"
);
$
(
"
#send_borrow_button
"
).
attr
(
"
devId
"
,
devId
);
}
}
/*****************************************************
* 发送签借信息
*****************************************************/
function
sendBorrow
(
e
){
var
userId
=
$
(
e
).
attr
(
"
userId
"
);
var
devId
=
$
(
e
).
attr
(
"
devId
"
);
var
comment
=
$
(
"
#borrow_comment
"
).
val
();
if
(
userId
==
0
){
var
borrower
=
$
(
e
).
attr
(
"
user_name
"
);
}
else
{
var
borrower
=
$
(
e
).
attr
(
"
user_name
"
);
}
var
host
=
window
.
location
.
host
;
var
url
=
"
http://
"
+
host
+
"
/devManageCtr/addDevBorrowInfo
"
var
postData
=
{};
postData
[
"
userId
"
]
=
userId
;
postData
[
"
devId
"
]
=
devId
;
postData
[
"
comment
"
]
=
comment
;
postData
[
"
borrower
"
]
=
borrower
;
$
.
ajax
({
url
:
url
,
data
:
JSON
.
stringify
(
postData
),
type
:
"
DELETE
"
,
dataType
:
"
json
"
,
contentType
:
"
application/json
"
,
success
:
function
(
data
)
{
if
(
data
.
status
==
"
200
"
){
location
.
reload
();
}
else
{
alert
(
data
.
message
);
}
}
});
}
</script>
...
...
app/Views/userManage/aside.php
View file @
5dbe497e
...
...
@@ -6,8 +6,8 @@
<li
<?php
if
(
$data
[
"uri"
][
"seg"
][
1
]
==
"/"
||
$data
[
"uri"
][
"seg"
][
1
]
==
"userManagePage"
){
echo
"class='active'"
;}
?>
onclick=
"leftSwich(this)"
id=
"left_org_manage"
>
<a><i
class=
"icon-chevron-right"
></i>
用户管理
</a>
</li>
<li
<?php
if
(
$data
[
"uri"
][
"seg"
][
1
]
==
"showR
ightsPage"
){
echo
"class='active'"
;}
?>
onclick=
"leftSwich(this)"
id=
"left_show_rights
"
>
<a><i
class=
"icon-chevron-right"
></i>
查看
权限
</a>
<li
<?php
if
(
$data
[
"uri"
][
"seg"
][
1
]
==
"showR
olePage"
){
echo
"class='active'"
;}
?>
onclick=
"leftSwich(this)"
id=
"left_show_role
"
>
<a><i
class=
"icon-chevron-right"
></i>
查看
角色
</a>
</li>
</ul>
</div>
...
...
@@ -32,8 +32,8 @@
if
(
id
==
"
left_org_manage
"
){
window
.
location
.
href
=
"
http://
"
+
host
+
"
/userManage?username=
"
+
username
+
"
&token=
"
+
token
;
}
else
if
(
id
==
"
left_show_r
ights
"
){
window
.
location
.
href
=
"
http://
"
+
host
+
"
/userManage/showR
ights
Page?username=
"
+
username
+
"
&token=
"
+
token
;
}
else
if
(
id
==
"
left_show_r
ole
"
){
window
.
location
.
href
=
"
http://
"
+
host
+
"
/userManage/showR
ole
Page?username=
"
+
username
+
"
&token=
"
+
token
;
}
}
...
...
app/Views/userManage/show_r
ights
.php
→
app/Views/userManage/show_r
ole
.php
View file @
5dbe497e
File moved
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