Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac-quanmin
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
HTML5-李恒逸
sunac-quanmin
Commits
7a530d7e
Commit
7a530d7e
authored
Jun 27, 2017
by
html5-李恒逸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改渠道楼盘
parent
b4378990
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
147 additions
and
6 deletions
+147
-6
channeladmin.php
html/application/controllers/admin/channeladmin.php
+5
-0
channelParent.php
html/application/views/admin/channel/channelParent.php
+142
-6
No files found.
html/application/controllers/admin/channeladmin.php
View file @
7a530d7e
...
...
@@ -127,6 +127,11 @@ class Channeladmin extends CI_Controller
$this
->
data
[
'channel_id'
]
=
$channelId
;
$this
->
data
[
'manager_name'
]
=
urldecode
(
$channelName
);
$this
->
data
[
'parents'
]
=
$this
->
channel
->
get_parent_channel
(
$channelId
);
$this
->
data
[
'type'
]
=
$this
->
get_roles
();
//获取地区数据
$this
->
data
[
'region'
]
=
$this
->
get_region
();
//获取楼盘数据列表
$this
->
data
[
'building'
]
=
$this
->
get_building
();
//修改当前渠道的上级
$parentId
=
$this
->
input
->
post
();
...
...
html/application/views/admin/channel/channelParent.php
View file @
7a530d7e
<style
type=
"text/css"
>
ul
#channel_list
{
width
:
100%
;
...
...
@@ -116,6 +116,79 @@
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3"
>
地区
<span
class=
"required"
>
*
</span>
</label>
<div
class=
"col-md-4"
>
<input
onclick=
"select_region_all();"
id=
"region_all"
type=
'checkbox'
>
全选
<?php
if
(
isset
(
$data
[
'region_id'
])){
?>
<?php
$region_arr
=
explode
(
','
,
$data
[
'region_id'
]);
?>
<?php
foreach
(
$region
as
$keyid
=>
$region_value
){
?>
<?php
$checked
=
""
;
?>
<?php
foreach
(
$region_arr
as
$rid
){
?>
<?php
if
(
$rid
==
$region_value
[
'region_code'
]){
?>
<?php
$checked
=
"checked"
;
?>
<?php
}
?>
<?php
}
?>
<input
onclick=
"select_region(
<?php
echo
$keyid
;
?>
);"
id=
"region_
<?php
echo
$keyid
;
?>
"
type=
'checkbox'
name=
'region_id[]'
value=
"
<?php
echo
$region_value
[
'region_code'
];
?>
"
<?php
echo
$checked
;
?>
>
<?php
echo
$region_value
[
'region_name'
];
?>
<?php
}
?>
<?php
}
else
{
?>
<?php
foreach
(
$region
as
$keyid
=>
$region_value
){
?>
<input
onclick=
"select_region(
<?php
echo
$keyid
;
?>
);"
id=
"region_
<?php
echo
$keyid
;
?>
"
type=
'checkbox'
name=
'region_id[]'
value=
"
<?php
echo
$region_value
[
'region_code'
];
?>
"
>
<?php
echo
$region_value
[
'region_name'
];
?>
<?php
}
?>
<?php
}
?>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3"
>
楼盘
<span
class=
"required"
>
*
</span>
</label>
<div
class=
"col-md-4"
>
<div><input
onclick=
"select_building_all();"
id=
"building_all"
type=
'checkbox'
>
全选
</div>
<?php
foreach
(
$region
as
$keyid
=>
$region_value
){
$dispaly_val
=
"none"
;
if
(
isset
(
$data
[
'region_id'
])){
foreach
(
$region_arr
as
$rid
){
if
(
$rid
==
$region_value
[
'region_code'
]){
$dispaly_val
=
"block"
;
}
}
}
?>
<div
id=
"building_region_
<?php
echo
$keyid
?>
"
style=
"display:
<?php
echo
$dispaly_val
?>
"
><table
><tr><td
style=
"width:53px;"
>
<?php
echo
$region_value
[
'region_name'
]
.
":</td><td>"
;
if
(
isset
(
$data
[
'building_id'
])){
$building_arr
=
explode
(
','
,
$data
[
'building_id'
]);
foreach
(
$building
as
$keyid_b
=>
$building_value
){
$checked
=
""
;
foreach
(
$building_arr
as
$bid
){
if
(
$bid
==
$keyid_b
){
$checked
=
"checked"
;
}
}
if
(
$building_value
[
'region_code'
]
==
$region_value
[
'region_code'
]
){
?>
<input
type=
'checkbox'
id=
"
<?php
echo
'b_r_'
.
$keyid
;
?>
"
name=
'building_id[]'
value=
"
<?php
echo
$keyid_b
;
?>
"
<?php
echo
$checked
;
?>
>
<?php
echo
$building_value
[
'building_name'
];
?>
<?php
}
}
}
else
{
foreach
(
$building
as
$keyid_b
=>
$building_value
){
if
(
$building_value
[
'region_code'
]
==
$region_value
[
'region_code'
]
){
?>
<input
type=
'checkbox'
id=
"
<?php
echo
'b_r_'
.
$keyid
;
?>
"
name=
'building_id[]'
value=
"
<?php
echo
$keyid_b
;
?>
"
>
<?php
echo
$building_value
[
'building_name'
];
?>
<?php
}
}
}
?>
</td></tr></table><hr></div>
<?php
}
?>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3"
>
密码:
<span
class=
"required"
>
*
...
...
@@ -135,7 +208,7 @@
<input
id=
"ag_pwd"
name=
"ag_pwd"
type=
"password"
class=
"form-control"
/>
</div>
</div>
<div
class=
"form-actions fluid"
>
<div
class=
"col-md-offset-3 col-md-9"
>
<button
type=
"submit"
class=
"btn green "
name=
"admin"
id=
"prev-btn"
>
提交
</button>
...
...
@@ -176,7 +249,7 @@
// initiate layout and plugins
App
.
init
();
//校验
});
</script>
<script>
...
...
@@ -229,9 +302,73 @@
// $('#parent_name').attr("value",name);
// $('#channel_list').hide();
// }
function
select_region
(
rid
){
//获取该城市是否被选中
var
checkbox
=
document
.
getElementById
(
'region_'
+
rid
);
if
(
checkbox
.
checked
){
document
.
getElementById
(
'building_region_'
+
rid
).
style
.
display
=
"block"
;
}
else
{
document
.
getElementById
(
'building_region_'
+
rid
).
style
.
display
=
"none"
;
//循环所有楼盘
var
elements
=
document
.
getElementsByName
(
"building_id[]"
);
var
str
=
""
+
elements
.
length
;
for
(
var
i
=
0
;
i
<
elements
.
length
;
i
++
)
{
if
(
elements
[
i
].
id
==
"b_r_"
+
rid
)
{
if
(
elements
[
i
].
checked
){
elements
[
i
].
click
();
}
}
}
}
}
function
select_region_all
(){
var
checkbox_region_all
=
document
.
getElementById
(
'region_all'
);
var
elements_region
=
document
.
getElementsByName
(
"region_id[]"
);
for
(
var
i
=
0
;
i
<
elements_region
.
length
;
i
++
)
{
if
(
checkbox_region_all
.
checked
&&
!
elements_region
[
i
].
checked
){
elements_region
[
i
].
click
();
}
if
(
!
checkbox_region_all
.
checked
&&
elements_region
[
i
].
checked
){
elements_region
[
i
].
click
();
}
}
}
function
select_building_all
(){
var
checkbox_building_all
=
document
.
getElementById
(
'building_all'
);
var
elements_building
=
document
.
getElementsByName
(
"building_id[]"
);
var
elements_region
=
document
.
getElementsByName
(
"region_id[]"
);
for
(
var
i
=
0
;
i
<
elements_building
.
length
;
i
++
)
{
for
(
var
j
=
0
;
j
<
elements_region
.
length
;
j
++
)
{
if
(
checkbox_building_all
.
checked
&&
!
elements_building
[
i
].
checked
&&
elements_region
[
j
].
checked
&&
elements_building
[
i
].
id
==
"b_r_"
+
elements_region
[
j
].
id
.
split
(
"_"
)[
1
]){
elements_building
[
i
].
click
();
}
if
(
!
checkbox_building_all
.
checked
&&
elements_building
[
i
].
checked
){
elements_building
[
i
].
click
();
}
}
}
}
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>
\ No newline at end of file
</html>
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