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
d60067b8
authored
2018-03-21 22:00:03 +0800
by
yangjianbin
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
init
1 parent
1a86bbf4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
116 additions
and
2 deletions
application/controllers/Config.php
application/views/config/edit.php
application/controllers/Config.php
View file @
d60067b
...
...
@@ -14,7 +14,11 @@ class Config extends CI_Controller {
public
function
edit
(
$id
=
null
)
{
var_dump
(
$id
);
$this
->
load
->
view
(
'config/add'
);
$res
=
json_decode
(
file_get_contents
(
'http://151.28ms.com:8088/config/product/'
.
$id
));
$data
=
$res
->
data
;
$arr
=
array
(
'data'
=>
$data
);
$this
->
load
->
view
(
'config/edit'
,
$arr
);
}
}
...
...
application/views/config/edit.php
0 → 100644
View file @
d60067b
<?php
$this
->
load
->
view
(
'common/header'
);
?>
<body>
<div
class=
"panel panel-default mb-20"
>
<div
class=
"panel-body cl"
>
<form
action=
'config/product'
method=
"post"
class=
"form form-horizontal"
id=
"add"
>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
产品名称
</label>
<input
type=
"text"
name=
"productName"
class=
"form-control input-text"
value=
"
<?=
$data
->
productName
?>
"
>
</div>
</div>
<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=
"annualInterestRate"
value=
"
<?=
$data
->
annualInterestRate
?>
"
>
<span
class=
"glyphicon form-control-feedback"
>
%
</span>
</div>
</div>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
罚息
</label>
<smail
class=
"c-999"
>
罚息=利率*N%
</smail>
<input
name=
"interestPenalty"
type=
"text"
class=
"form-control input-text"
value=
""
placeholder=
"请输入N"
>
</div>
</div>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
滞纳金
</label>
<input
name=
"overdueFine"
type=
"text"
class=
"form-control input-text"
value=
""
>
</div>
</div>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
还款方式
</label>
<span
class=
"form-control select-box"
>
<select
class=
"select"
size=
"1"
name=
"repaymentMode"
>
<option>
请选择
</option>
<option
value=
"1"
>
1
</option>
</select>
</span>
</div>
</div>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
借款期限
</label>
<input
name=
"loanDeadline"
type=
"text"
class=
"form-control input-text"
value=
""
>
<span
class=
"glyphicon form-control-feedback"
>
月
</span>
</div>
</div>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-4 col-md-2"
>
<label>
授额上限
</label>
<input
type=
"text"
name=
"loanLimit"
class=
"form-control input-text"
value=
""
>
<span
class=
"glyphicon form-control-feedback"
>
元
</span>
</div>
</div>
<div
class=
"row cl"
>
<div
class=
"form-group col-sm-12 col-md-12"
>
<label>
备注
</label>
<textarea
name=
"remark"
class=
"textarea"
></textarea>
</div>
</div>
</form>
</div>
</div>
<div
class=
"row cl col-sm-12 pb-20"
>
<div
class=
"col-sm-2"
>
<button
class=
"btn btn-primary btn-block"
onclick=
"save();"
>
保存
</button>
</div>
<div
class=
"col-sm-2"
>
<button
class=
"btn btn-warning btn-block"
onclick=
"layer_close();"
>
取消
</button>
</div>
</div>
<?php
$this
->
load
->
view
(
'common/footer'
);
?>
<script>
function
save
()
{
var
targetUrl
=
$
(
"#add"
).
attr
(
"action"
);
var
data
=
$
(
"#add"
).
serializeJson
();
$
.
ajax
({
type
:
'post'
,
url
:
apiBaseUrl
+
targetUrl
,
cache
:
false
,
data
:
JSON
.
stringify
(
data
),
dataType
:
'json'
,
contentType
:
"application/json; charset=UTF-8"
,
success
:
function
(
data
)
{
if
(
data
.
msg
)
{
layer
.
alert
(
data
.
msg
);
}
else
if
(
data
.
code
!=
0
)
{
layer
.
alert
(
'请求失败'
);
}
else
{
layer
.
alert
(
'请求成功'
);
}
if
(
!
data
.
code
)
{
window
.
parent
.
reload
();
layer_close
();
}
},
error
:
function
()
{
layer
.
alert
(
"请求失败"
)
}
})
}
</script>
</body>
</html>
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