Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
杨建斌
/
page
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
1
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
59b0f22e
authored
2018-03-30 14:57:29 +0800
by
wang
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init
1 parent
878e56db
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
18 deletions
application/controllers/Perm.php
application/views/perm/staffAdd.php
application/views/perm/staffEdit.php
application/controllers/Perm.php
View file @
59b0f22
...
...
@@ -26,9 +26,19 @@ class Perm extends CI_Controller {
$this
->
load
->
view
(
'perm/staffAdd'
);
}
public
function
staffEdit
()
public
function
staffEdit
(
$id
)
{
$this
->
load
->
view
(
'perm/staffEdit'
);
$url
=
$this
->
config
->
item
(
'apiBaseUrl'
)
.
'system/user/get/'
.
$id
;
$result
=
file_get_contents
(
$url
);
$json
=
json_decode
(
$result
);
$ret
=
$json
->
data
;
// $roles =
$data
=
array
(
'item'
=>
$ret
,
'id'
=>
$id
);
$this
->
load
->
view
(
'perm/staffEdit'
,
$data
);
}
//重置密码
...
...
application/views/perm/staffAdd.php
View file @
59b0f22
...
...
@@ -92,7 +92,7 @@
name
:
data
[
'name'
],
username
:
data
[
'username'
],
telephone
:
data
[
'phone'
],
id
c
ard
:
data
[
'idcard'
],
id
C
ard
:
data
[
'idcard'
],
password
:
data
[
'password'
],
roleIds
:
rolesid
,
// roles:data['roles'],
...
...
application/views/perm/staffEdit.php
View file @
59b0f22
...
...
@@ -4,43 +4,47 @@
<div
class=
"panel panel-default"
>
<div
class=
"panel-body"
>
<form
action=
"system/user/update"
id=
"edit"
>
<input
type=
"hidden"
value=
"
<?=
$id
?>
"
name=
"id"
>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
用户名
</label>
<input
type=
"text"
class=
"form-control input-text"
name=
"username"
value=
""
>
<input
type=
"text"
class=
"form-control input-text"
name=
"username"
value=
"
<?=
$item
->
username
?>
"
>
</div>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
真实姓名
</label>
<input
type=
"text"
class=
"form-control input-text"
name=
"name"
value=
""
>
<input
type=
"text"
class=
"form-control input-text"
name=
"name"
value=
"
<?=
$item
->
name
?>
"
>
</div>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
手机号
</label>
<input
type=
"text"
class=
"form-control input-text"
name=
"phone"
value=
""
>
<input
type=
"text"
class=
"form-control input-text"
name=
"phone"
value=
"
<?=
$item
->
phone
?>
"
>
</div>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
身份证号码
</label>
<input
type=
"text"
class=
"form-control input-text"
name=
"id
card"
value=
"
"
>
<input
type=
"text"
class=
"form-control input-text"
name=
"id
Card"
value=
"
<?=
$item
->
idCard
?>
"
>
</div>
</div>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
所属网点
</label>
<select
class=
"select"
size=
"5"
name=
"children
"
multiple
>
<select
class=
"select"
name=
"children"
size=
"5
"
multiple
>
<option
selected
value
>
请选择
</option>
<option
value
>
请选择
</option>
<option
value
>
请选择
</option>
<option
value
>
请选择
</option>
<option
value
>
请选择
</option>
<?php
foreach
(
$this
->
session
->
departments
as
$k
=>
$v
)
:
?>
<option
value=
"
<?=
$v
->
id
?>
"
>
<?=
$v
->
name
?>
</option>
<?php
if
(
$v
->
children
&&
!
empty
(
$v
->
children
))
:
?>
<?php
foreach
(
$v
->
children
as
$kk
=>
$vv
)
:
?>
<option
value=
"
<?=
$vv
->
id
?>
"
<?php
if
(
$item
->
department_id
==
$v
->
id
)
echo
'selected'
;
?>
>
<?=
$vv
->
name
?>
</option>
<?php
endforeach
;
?>
<?php
endif
;
?>
<?php
endforeach
;
?>
</select>
</div>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
角色
</label>
<select
class=
"select"
size=
"5"
name=
"roles"
multiple
>
<option
selected
value
>
请选择
</option>
<option
value
>
请选择
</option>
<option
value
>
请选择
</option>
<option
value
>
请选择
</option>
<option
value
>
请选择
</option>
<?php
foreach
(
$this
->
session
->
role
as
$k
=>
$v
)
:
?>
<option
value=
"
<?=
$v
->
id
?>
"
<?php
if
(
$item
->
department_id
==
$v
->
id
)
echo
'selected'
;
?>
></option>
<?=
$v
->
nameZh
?>
</option>
<?php
endforeach
;
?>
</select>
</div>
</div>
...
...
@@ -80,7 +84,7 @@
name
:
data
[
'name'
],
username
:
data
[
'username'
],
telephone
:
data
[
'phone'
],
id
card
:
data
[
'idc
ard'
],
id
Card
:
data
[
'idC
ard'
],
password
:
data
[
'password'
],
roleIds
:
rolesid
,
// roles:data['roles'],
...
...
@@ -94,7 +98,7 @@
// return false;
$
.
ajax
({
type
:
'post'
,
url
:
apiBaseUrl
+
targetUrl
,
url
:
apiBaseUrl
+
targetUrl
+
$
(
"input[name='id']"
).
val
()
,
cache
:
false
,
data
:
JSON
.
stringify
(
newData
),
dataType
:
'json'
,
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
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 post a comment