first commit
This commit is contained in:
242
application/views/admin/etc_section/channel_edit.php
Executable file
242
application/views/admin/etc_section/channel_edit.php
Executable file
@@ -0,0 +1,242 @@
|
||||
<?php
|
||||
include_once ("./static_data/code.php");
|
||||
|
||||
$category_code1 = $result1['category_idx'];
|
||||
$category_code2 = $result1['channel_idx'];
|
||||
$etc_section_type = $result1['etc_section_type'];
|
||||
$rank = $result1['rank'];
|
||||
$life_etc_section_idx = $idx;
|
||||
|
||||
|
||||
$menu_code = '67';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
$arr_etc_section_detail_rank = array();
|
||||
foreach ($result2 as $val) {
|
||||
$arr_etc_section_detail_rank[$val['rank']] = array('idx'=>$val['idx'], 'main_img'=> $val['main_img'], 'head_title'=> $val['head_title'], 'title'=> $val['title'], 'content_idx'=> $val['content_idx'], 'hit_count'=>$val['hit_count'], 'editor_name'=>$val['editor_name']);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/etc_section/channel_edit_proc" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="idx" id="idx" value="<?=$idx?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="<?=$search_type?>">
|
||||
<input type="hidden" id="search_keyword" name="search_keyword" value="<?=$search_keyword?>">
|
||||
<input type="hidden" id="search_category" name="search_category" value="<?=$search_category?>">
|
||||
<input type="hidden" id="search_etc_section_type" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="etc_section_type" name="etc_section_type" value="<?=$etc_section_type?>">
|
||||
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="key" name="key">
|
||||
|
||||
|
||||
<div class="common_table news">
|
||||
<h2 class="subtitle"><?=$def_arr_channel_etc_section[$etc_section_type]['name']?></h2>
|
||||
<table>
|
||||
<tr><th colspan="2">채널 <?=$rank?>위</th></tr>
|
||||
<tr>
|
||||
<th>카테고리선택</th>
|
||||
<td class="tl">
|
||||
<select name="category1" id="category1" onchange="change_category(1, this.value)" class="type01">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category1) > 0) {
|
||||
foreach ($arr_category1 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code1==$val['idx']) { echo 'selected'; }?>><?=$val['category_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>채널선택</th>
|
||||
<td class="tl">
|
||||
<select name="category2" id="category2" class="type01" onchange="change_category(2, this.value)">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category2) > 0 && $category_code2!='') {
|
||||
foreach ($arr_category2 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code2==$val['idx']) { echo 'selected'; }?>><?=$val['channel_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?
|
||||
for($z=1;$z<=$def_arr_channel_etc_section[$etc_section_type]['detail_count'];$z++) {
|
||||
$head_title = '';
|
||||
$title = '';
|
||||
$title = '';
|
||||
$main_img_txt = '';
|
||||
$main_img = '';
|
||||
$editor_name = '';
|
||||
$hit_count = '';
|
||||
$content_idx = '';
|
||||
$list_idx = '';
|
||||
|
||||
if(isset($arr_etc_section_detail_rank[$z])== true) {
|
||||
$head_title = $arr_etc_section_detail_rank[$z]['head_title'];
|
||||
$head_title = htmlspecialchars($head_title);
|
||||
$title = $arr_etc_section_detail_rank[$z]['title'];
|
||||
$title = htmlspecialchars($title);
|
||||
$content_idx = $arr_etc_section_detail_rank[$z]['content_idx'];
|
||||
$main_img = $arr_etc_section_detail_rank[$z]['main_img'];
|
||||
$hit_count = $arr_etc_section_detail_rank[$z]['hit_count'];
|
||||
$editor_name = $arr_etc_section_detail_rank[$z]['editor_name'];
|
||||
$list_idx = $arr_etc_section_detail_rank[$z]['idx'];
|
||||
|
||||
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
|
||||
|
||||
}
|
||||
|
||||
switch($etc_section_type) {
|
||||
case '1': $rowspan = '4';break;
|
||||
case '2': $rowspan = '5';break;
|
||||
case '3': $rowspan = '5';break;
|
||||
default : $rowspan = '4';break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th rowspan="<?=$rowspan?>"><?=$z?>위</th>
|
||||
<td class="tl">
|
||||
<input type="hidden" name="list_idx_<?=$z?>" id="list_idx_<?=$z?>" value="<?=$list_idx?>">
|
||||
<input type="hidden" name="content_idx_<?=$z?>" id="content_idx_<?=$z?>" value="<?=$content_idx?>">
|
||||
<input type="text" name="head_title_<?=$z?>" id="head_title_<?=$z?>" class="type02" size="20" placeholder="말머리" value="<?=$head_title?>">
|
||||
<input type="text" name="title_<?=$z?>" id="title_<?=$z?>" size="50" class="type00" placeholder="제목을 입력해주세요." value="<?=$title?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="editor_name_<?=$z?>" id="editor_name_<?=$z?>" class="type02" size="20" placeholder="에디터" value="<?=$editor_name?>" readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">이미지첨부
|
||||
<div id="img_view_<?=$z?>"><?=$main_img_txt?></div>
|
||||
<input type="hidden" name="img_<?=$z?>" id="img_<?=$z?>">
|
||||
<input type="hidden" name="org_img_<?=$z?>" id="org_img_<?=$z?>" value="<?=$main_img?>">
|
||||
<input type="file" name="main_img_<?=$z?>" id="main_img_<?=$z?>" class="input00" size="20" accept="image/*">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? if($etc_section_type != '1') {?>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="hit_count_<?=$z?>" id="hit_count_<?=$z?>" class="type02" size="20" placeholder="조회수" value="<?=$hit_count?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?}?>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<button type="button" class="btn_black" style="width:100px" onclick="open_search_article('<?=$z?>');" style="cursor: pointer;">컨텐츠검색</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:channel_edit_proc();">저장하기</a>
|
||||
<a href="/admin/etc_section/channel_list/6/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_category=<?=$search_category?>&search_etc_section_type=<?=$search_etc_section_type?>&sort=<?=$sort?>">목록으로</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<?
|
||||
$content_type = '3';
|
||||
require_once(APPPATH."views/admin/search/search_article_inc.php");
|
||||
?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function change_category(depth, val){
|
||||
reset();
|
||||
if(depth == 1) {
|
||||
var json_category = '<?=json_encode($arr_category2)?>';
|
||||
json_category = eval(json_category);
|
||||
|
||||
$('#category2').empty();
|
||||
var option = "<option value=''>선택</option>";
|
||||
$('#category2').append(option);
|
||||
|
||||
for(key in json_category) {
|
||||
if(json_category[key]['category_idx'] == val) {
|
||||
option = "<option value='"+json_category[key]['idx']+"'>"+json_category[key]['channel_name']+"</option>";
|
||||
$('#category2').append(option);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
var etc_detail_count = "<?=$def_arr_channel_etc_section[$etc_section_type]['detail_count']?>";
|
||||
function reset(){
|
||||
for(z=1;z<=etc_detail_count;z++) {
|
||||
$("#content_idx_"+z).val('');
|
||||
$("#head_title_"+z).val('');
|
||||
$("#title_"+z).val('');
|
||||
$("#editor_name_"+z).val('');
|
||||
$("#img_"+z).val('');
|
||||
$("#org_img_"+z).val('');
|
||||
$("#main_img_"+z).val('');
|
||||
$("#img_view_"+z).empty();
|
||||
$("#hit_count_"+z).empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function open_search_article(key){
|
||||
$("#key").val("_"+key);
|
||||
$("#article_keyword").val('');
|
||||
commonLayerOpen('search_article');
|
||||
$("#article_keyword").focus();
|
||||
}
|
||||
|
||||
|
||||
var etc_detail_count = "<?=$def_arr_channel_etc_section[$etc_section_type]['detail_count']?>";
|
||||
function channel_edit_proc(){
|
||||
if($("#category1").val()==''){
|
||||
alert("카테고리를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#category2").val()==''){
|
||||
alert("채널을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
for(z=1;z<=etc_detail_count;z++) {
|
||||
if($("#title_"+z).val()!='') {
|
||||
if($("#content_idx_"+z).val()==''){
|
||||
alert("기사를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#main_img_"+z).val()=='' && $("#img_"+z).val()=='' && $("#org_img_"+z).val()=='') {
|
||||
alert("이미지를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
223
application/views/admin/etc_section/channel_list.php
Executable file
223
application/views/admin/etc_section/channel_list.php
Executable file
@@ -0,0 +1,223 @@
|
||||
<?
|
||||
include_once ("./static_data/code.php");
|
||||
$menu_code = '67';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/channel_list/6">
|
||||
<input type="hidden" id="search_etc_section_type" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="search_category" name="search_category" value="<?=$search_category?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="channel_name">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
|
||||
|
||||
<div class="common_tep clearfix type01">
|
||||
<ul class="clearfix">
|
||||
<li style="width:100px">PC섹션</li>
|
||||
<? foreach ($def_arr_channel_etc_section1 as $val) { ?>
|
||||
<li><a href="/admin/etc_section/channel_list/6?search_etc_section_type=<?=$val['code']?>" <? if($search_etc_section_type==$val['code']) { echo 'class="on"';}?>><?=$val['name']?></a></li>
|
||||
<? }?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="searh_area">
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="채널명" onkeypress="if( event.keyCode==13 ){check_search();}">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="common_tep clearfix type01">
|
||||
<ul class="clearfix">
|
||||
<li style="width:100px">모바일섹션</li>
|
||||
<? foreach ($def_arr_channel_etc_section2 as $val) { ?>
|
||||
<li><a href="/admin/etc_section/channel_list/6?search_etc_section_type=<?=$val['code']?>" <? if($search_etc_section_type==$val['code']) { echo 'class="on"';}?>><?=$val['name']?></a></li>
|
||||
<? }?>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span><b>Total:</b> <?=number_format($total_count);?></span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="1" <? if($sort=='1') { echo 'checked';}?> onclick="check_search();"> 최신순</span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="2" <? if($sort=='2') { echo 'checked';}?> onclick="check_search();"> 조회순</span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="3" <? if($sort=='3') { echo 'checked';}?> onclick="check_search();"> 등록글순</span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="4" <? if($sort=='4') { echo 'checked';}?> onclick="check_search();"> 등록에디터순</span>
|
||||
<div class="searh_area">
|
||||
<select name="search_category" onchange="check_search();" style="width:100px">
|
||||
<option value="">카테고리</option>
|
||||
<? foreach ($category_list as $key=>$val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($search_category==$val['idx']){ echo 'selected';}?>><?=$val['category_name']?></option>
|
||||
|
||||
<? }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th>번호</th>
|
||||
<th>순위</th>
|
||||
<th>카테고리</th>
|
||||
<th>채널아이콘</th>
|
||||
<th>채널명</th>
|
||||
<th>등록에디터수</th>
|
||||
<th>등록글수</th>
|
||||
<th>조회수</th>
|
||||
<th>등록일</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="11">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
} else {
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$rank = $val['rank'];
|
||||
$category_name = $val['category_name'];
|
||||
$channel_icon = $val['channel_icon'];
|
||||
$channel_name = $val['channel_name'];
|
||||
$editor_count = $val['editor_count'];
|
||||
$article_count = $val['article_count'];
|
||||
$hit_count = $val['hit_count'];
|
||||
$reg_date = $val['reg_date'];
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><?=$rank?></td>
|
||||
<td><a href="/admin/life/life_category_list/5?search_type=category_name&search_keyword=<?=$category_name?>"><?=$category_name?></a></td>
|
||||
<td><img src="<?=$channel_icon?>" width="35"></td>
|
||||
<td><a href="/admin/life/life_channel_list/5?search_type=channel_name&search_keyword=<?=$channel_name?>"><?=$channel_name?></a></td>
|
||||
<td><?=number_format($editor_count)?></td>
|
||||
<td><?=number_format($article_count)?></td>
|
||||
<td><?=number_format($hit_count)?></td>
|
||||
<td><?=$reg_date?></td>
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:channel_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:channel_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:channel_arr_del_proc()">삭제</a>
|
||||
<a href="javascript:channel_list_reg()">송출관리</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--// 카테고리 등록/수정 layer -->
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
function channel_list_reg(){
|
||||
$("#mode").val('add');
|
||||
$("#input_form").attr("action", "/admin/etc_section/channel_list_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// edit
|
||||
function channel_edit(idx){
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/channel_edit/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function channel_del_proc(idx) {
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/channel_reg_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 복수 삭제
|
||||
function channel_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/etc_section/channel_reg_arr_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// checkbox all checked/unchecked
|
||||
$(function(){
|
||||
$("#allcheck").click(function(){
|
||||
if($("#allcheck").prop("checked")) {
|
||||
$("input:checkbox[name='is_del[]']").prop('checked', true); // 전체선택하기
|
||||
} else {
|
||||
$("input:checkbox[name='is_del[]']").prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
295
application/views/admin/etc_section/channel_list_reg.php
Executable file
295
application/views/admin/etc_section/channel_list_reg.php
Executable file
@@ -0,0 +1,295 @@
|
||||
<?php
|
||||
include_once ("./static_data/code.php");
|
||||
|
||||
$arr_life_etc_section_rank = array();
|
||||
foreach ($arr_etc_section as $val) {
|
||||
$arr_life_etc_section_rank[$val['rank']] = array('idx'=> $val['idx'], 'category_idx'=> $val['category_idx'], 'channel_idx'=> $val['channel_idx']);
|
||||
}
|
||||
|
||||
$arr_life_etc_section_detail_rank = array();
|
||||
foreach ($arr_etc_section_detail as $val) {
|
||||
$arr_life_etc_section_detail_rank[$val['life_etc_section_idx']][$val['rank']] = array('main_img'=> $val['main_img'], 'head_title'=> $val['head_title'], 'title'=> $val['title'], 'content_idx'=> $val['content_idx'], 'hit_count'=>$val['hit_count'], 'editor_name'=>$val['editor_name']);
|
||||
}
|
||||
|
||||
$menu_code = '67';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/etc_section/channel_list_reg_proc" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="idx" id="idx" value="<?=$idx?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="<?=$search_type?>">
|
||||
<input type="hidden" id="search_keyword" name="search_keyword" value="<?=$search_keyword?>">
|
||||
<input type="hidden" id="search_category" name="search_category" value="<?=$search_category?>">
|
||||
<input type="hidden" id="search_etc_section_type" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="key" name="key">
|
||||
<input type="hidden" id="rank1" name="rank1">
|
||||
<input type="hidden" id="rank2" name="rank2">
|
||||
|
||||
|
||||
<?
|
||||
if($def_arr_channel_etc_section[$search_etc_section_type]['display']=='all') {
|
||||
?>
|
||||
<span class="text_blue"><b>* 모바일과 공통 송출관리</b></span>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="common_table news">
|
||||
<table>
|
||||
<tr>
|
||||
<th>기타섹션</th>
|
||||
<td class="tl">
|
||||
<div style="width:80px; float: left"><b>PC섹션</b></div>
|
||||
<? foreach ($def_arr_channel_etc_section1 as $val) { ?>
|
||||
<input type="radio" name="etc_section_type" value="<?=$val['code']?>" onclick="change_etc_section_type('<?=$val['code']?>')" <? if($search_etc_section_type==$val['code']) { echo 'checked';}?>> <?=$val['name']?>
|
||||
<? }?>
|
||||
</br>
|
||||
<div style="width:80px; float: left"><b>모바일섹션</b></div>
|
||||
<? foreach ($def_arr_channel_etc_section2 as $val) { ?>
|
||||
<input type="radio" name="etc_section_type" value="<?=$val['code']?>" onclick="change_etc_section_type('<?=$val['code']?>')" <? if($search_etc_section_type==$val['code']) { echo 'checked';}?>> <?=$val['name']?>
|
||||
<? }?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?
|
||||
for($i=1;$i<=$def_arr_channel_etc_section[$search_etc_section_type]['count'];$i++) {
|
||||
$category_code1 = '';
|
||||
$category_code2 = '';
|
||||
$life_etc_section_idx = '';
|
||||
if(isset($arr_life_etc_section_rank[$i])== true) {
|
||||
$life_etc_section_idx = $arr_life_etc_section_rank[$i]['idx'];
|
||||
$category_code1 = $arr_life_etc_section_rank[$i]['category_idx'];
|
||||
$category_code2 = $arr_life_etc_section_rank[$i]['channel_idx'];
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<tr><th colspan="2">채널 <?=$i?>위</th></tr>
|
||||
<tr>
|
||||
<th>카테고리선택</th>
|
||||
<td class="tl">
|
||||
<select name="category1_<?=$i?>" id="category1_<?=$i?>" onchange="change_category(1, this.value, '<?=$i?>')" class="type01">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category1) > 0) {
|
||||
foreach ($arr_category1 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code1==$val['idx']) { echo 'selected'; }?>><?=$val['category_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>채널선택</th>
|
||||
<td class="tl">
|
||||
<select name="category2_<?=$i?>" id="category2_<?=$i?>" class="type01" onchange="change_category(2, this.value, '<?=$i?>')">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category2) > 0 && $category_code2!='') {
|
||||
foreach ($arr_category2 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code2==$val['idx']) { echo 'selected'; }?>><?=$val['channel_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?
|
||||
for($z=1;$z<=$def_arr_channel_etc_section[$etc_section_type]['detail_count'];$z++) {
|
||||
$head_title = '';
|
||||
$title = '';
|
||||
$title = '';
|
||||
$main_img_txt = '';
|
||||
$main_img = '';
|
||||
$editor_name = '';
|
||||
$hit_count = '';
|
||||
$content_idx = '';
|
||||
|
||||
|
||||
if(isset($arr_life_etc_section_detail_rank[$life_etc_section_idx][$z])== true) {
|
||||
$head_title = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['head_title'];
|
||||
$head_title = htmlspecialchars($head_title);
|
||||
$title = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['title'];
|
||||
$title = htmlspecialchars($title);
|
||||
$content_idx = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['content_idx'];
|
||||
$main_img = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['main_img'];
|
||||
$hit_count = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['hit_count'];
|
||||
$editor_name = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['editor_name'];
|
||||
|
||||
|
||||
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
|
||||
|
||||
}
|
||||
|
||||
switch($etc_section_type) {
|
||||
case '1': $rowspan = '4';break;
|
||||
case '2': $rowspan = '5';break;
|
||||
case '3': $rowspan = '5';break;
|
||||
default : $rowspan = '4';break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th rowspan="<?=$rowspan?>"><?=$z?>위</th>
|
||||
<td class="tl">
|
||||
<input type="hidden" name="content_idx_<?=$i?>_<?=$z?>" id="content_idx_<?=$i?>_<?=$z?>" value="<?=$content_idx?>">
|
||||
<input type="text" name="head_title_<?=$i?>_<?=$z?>" id="head_title_<?=$i?>_<?=$z?>" class="type02" size="20" placeholder="말머리" value="<?=$head_title?>">
|
||||
<input type="text" name="title_<?=$i?>_<?=$z?>" id="title_<?=$i?>_<?=$z?>" size="50" class="type00" placeholder="제목을 입력해주세요." value="<?=$title?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="editor_name_<?=$i?>_<?=$z?>" id="editor_name_<?=$i?>_<?=$z?>" class="type02" size="20" placeholder="에디터" value="<?=$editor_name?>" readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">이미지첨부
|
||||
<div id="img_view_<?=$i?>_<?=$z?>"><?=$main_img_txt?></div>
|
||||
<input type="hidden" name="img_<?=$i?>_<?=$z?>" id="img_<?=$i?>_<?=$z?>">
|
||||
<input type="hidden" name="org_img_<?=$i?>_<?=$z?>" id="org_img_<?=$i?>_<?=$z?>" value="<?=$main_img?>">
|
||||
<input type="file" name="main_img_<?=$i?>_<?=$z?>" id="main_img_<?=$i?>_<?=$z?>" class="input00" size="20" accept="image/*">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? if($etc_section_type != '1') {?>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="hit_count_<?=$i?>_<?=$z?>" id="hit_count_<?=$i?>_<?=$z?>" class="type02" size="20" placeholder="조회수" value="<?=$hit_count?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?}?>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<button type="button" class="btn_black" style="width:100px" onclick="open_search_article('<?=$i?>', '<?=$z?>');" style="cursor: pointer;">컨텐츠검색</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:channel_list_reg_proc()">저장하기</a>
|
||||
<a href="/admin/etc_section/channel_list/6/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_category=<?=$search_category?>&search_etc_section_type=<?=$search_etc_section_type?>&sort=<?=$sort?>">목록으로</a>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<?
|
||||
$content_type = '3';
|
||||
require_once(APPPATH."views/admin/search/search_article_inc.php");
|
||||
?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function change_category(depth, val, rank){
|
||||
reset(rank);
|
||||
if(depth == 1) {
|
||||
var json_category = '<?=json_encode($arr_category2)?>';
|
||||
json_category = eval(json_category);
|
||||
|
||||
$('#category2_'+rank).empty();
|
||||
var option = "<option value=''>선택</option>";
|
||||
$('#category2_'+rank).append(option);
|
||||
|
||||
for(key in json_category) {
|
||||
if(json_category[key]['category_idx'] == val) {
|
||||
option = "<option value='"+json_category[key]['idx']+"'>"+json_category[key]['channel_name']+"</option>";
|
||||
$('#category2_'+rank).append(option);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function open_search_article(rank1, rank2){
|
||||
$("#key").val("_"+rank1+'_'+rank2);
|
||||
$("#rank1").val(rank1);
|
||||
$("#rank2").val(rank2);
|
||||
if($("#category1_"+rank1).val()=='') {
|
||||
alert("카테고리를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#category2_"+rank1).val()=='') {
|
||||
alert("채널을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
$("#article_keyword").val('');
|
||||
commonLayerOpen('search_article');
|
||||
$("#article_keyword").focus();
|
||||
}
|
||||
|
||||
|
||||
var etc_detail_count = "<?=$def_arr_channel_etc_section[$etc_section_type]['detail_count']?>";
|
||||
function reset(rank){
|
||||
for(z=1;z<=etc_detail_count;z++) {
|
||||
$("#content_idx_"+rank+"_"+z).val('');
|
||||
$("#head_title_"+rank+"_"+z).val('');
|
||||
$("#title_"+rank+"_"+z).val('');
|
||||
$("#editor_name_"+rank+"_"+z).val('');
|
||||
$("#img_"+rank+"_"+z).val('');
|
||||
$("#org_img_"+rank+"_"+z).val('');
|
||||
$("#main_img_"+rank+"_"+z).val('');
|
||||
$("#img_view_"+rank+"_"+z).empty();
|
||||
$("#hit_count_"+rank+"_"+z).empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function change_etc_section_type(val){
|
||||
$("#search_etc_section_type").val(val);
|
||||
$("#input_form").attr("action", "/admin/etc_section/channel_list_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
var etc_count = "<?=$def_arr_channel_etc_section[$etc_section_type]['count']?>";
|
||||
var etc_detail_count = "<?=$def_arr_channel_etc_section[$etc_section_type]['detail_count']?>";
|
||||
function channel_list_reg_proc(){
|
||||
for(i=1;i<=etc_count;i++) {
|
||||
if($("#category1_"+i).val()!='') {
|
||||
if($("#category2_"+i).val()==''){
|
||||
alert("채널을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
for(z=1;z<=etc_detail_count;z++) {
|
||||
if($("#title_"+i+'_'+z).val()!='') {
|
||||
if($("#content_idx_"+i+'_'+z).val()==''){
|
||||
alert("기사를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#main_img_"+i+'_'+z).val()=='' && $("#img_"+i+'_'+z).val()=='' && $("#org_img_"+i+'_'+z).val()=='') {
|
||||
alert("이미지를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
277
application/views/admin/etc_section/editor_edit.php
Executable file
277
application/views/admin/etc_section/editor_edit.php
Executable file
@@ -0,0 +1,277 @@
|
||||
<?php
|
||||
include_once ("./static_data/code.php");
|
||||
|
||||
$category_code1 = $result1['category_idx'];
|
||||
$category_code2 = $result1['channel_idx'];
|
||||
$category_code3 = $result1['partner_idx'];
|
||||
$etc_section_type = $result1['etc_section_type'];
|
||||
$rank = $result1['rank'];
|
||||
$life_etc_section_idx = $idx;
|
||||
|
||||
|
||||
$menu_code = '68';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
$arr_etc_section_detail_rank = array();
|
||||
foreach ($result2 as $val) {
|
||||
$arr_etc_section_detail_rank[$val['rank']] = array('idx'=>$val['idx'], 'main_img'=> $val['main_img'], 'head_title'=> $val['head_title'], 'title'=> $val['title'], 'content_idx'=> $val['content_idx'], 'hit_count'=>$val['hit_count'], 'editor_name'=>$val['editor_name']);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/etc_section/editor_edit_proc" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="idx" id="idx" value="<?=$idx?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="<?=$search_type?>">
|
||||
<input type="hidden" id="search_keyword" name="search_keyword" value="<?=$search_keyword?>">
|
||||
<input type="hidden" id="search_category" name="search_category" value="<?=$search_category?>">
|
||||
<input type="hidden" id="search_etc_section_type" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="etc_section_type" name="etc_section_type" value="<?=$etc_section_type?>">
|
||||
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="key" name="key">
|
||||
|
||||
|
||||
<div class="common_table news">
|
||||
<h2 class="subtitle"><?=$def_arr_editor_etc_section[$etc_section_type]['name']?></h2>
|
||||
<table>
|
||||
<tr><th colspan="2">채널 <?=$rank?>위</th></tr>
|
||||
<tr>
|
||||
<th>카테고리선택</th>
|
||||
<td class="tl">
|
||||
<select name="category1" id="category1" onchange="change_category(1, this.value)" class="type01">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category1) > 0) {
|
||||
foreach ($arr_category1 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code1==$val['idx']) { echo 'selected'; }?>><?=$val['category_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>채널선택</th>
|
||||
<td class="tl">
|
||||
<select name="category2" id="category2" class="type01" onchange="change_category(2, this.value)">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category2) > 0 && $category_code2!='') {
|
||||
foreach ($arr_category2 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code2==$val['idx']) { echo 'selected'; }?>><?=$val['channel_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>에디터선택</th>
|
||||
<td class="tl">
|
||||
<select name="category3" id="category3" class="type01" onchange="change_category(3, this.value, '<?=$i?>')">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category3) > 0 && $category_code3!='') {
|
||||
foreach ($arr_category3 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code3==$val['idx']) { echo 'selected'; }?>><?=$val['partner_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
|
||||
<?
|
||||
for($z=1;$z<=$def_arr_editor_etc_section[$etc_section_type]['detail_count'];$z++) {
|
||||
$head_title = '';
|
||||
$title = '';
|
||||
$main_img_txt = '';
|
||||
$main_img = '';
|
||||
$hit_count = '';
|
||||
$content_idx = '';
|
||||
$list_idx = '';
|
||||
|
||||
if(isset($arr_etc_section_detail_rank[$z])== true) {
|
||||
$head_title = $arr_etc_section_detail_rank[$z]['head_title'];
|
||||
$head_title = htmlspecialchars($head_title);
|
||||
$title = $arr_etc_section_detail_rank[$z]['title'];
|
||||
$title = htmlspecialchars($title);
|
||||
$content_idx = $arr_etc_section_detail_rank[$z]['content_idx'];
|
||||
$main_img = $arr_etc_section_detail_rank[$z]['main_img'];
|
||||
$hit_count = $arr_etc_section_detail_rank[$z]['hit_count'];
|
||||
$list_idx = $arr_etc_section_detail_rank[$z]['idx'];
|
||||
|
||||
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
|
||||
|
||||
}
|
||||
|
||||
switch($etc_section_type) {
|
||||
case '4': $rowspan = '3';break;
|
||||
case '5': $rowspan = '4';break;
|
||||
case '6': $rowspan = '3';break;
|
||||
default : $rowspan = '3';break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th rowspan="<?=$rowspan?>"><?=$z?>위</th>
|
||||
<td class="tl">
|
||||
<input type="hidden" name="list_idx_<?=$z?>" id="list_idx_<?=$z?>" value="<?=$list_idx?>">
|
||||
<input type="hidden" name="content_idx_<?=$z?>" id="content_idx_<?=$z?>" value="<?=$content_idx?>">
|
||||
<input type="text" name="head_title_<?=$z?>" id="head_title_<?=$z?>" class="type02" size="20" placeholder="말머리" value="<?=$head_title?>">
|
||||
<input type="text" name="title_<?=$z?>" id="title_<?=$z?>" size="50" class="type00" placeholder="제목을 입력해주세요." value="<?=$title?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">이미지첨부
|
||||
<div id="img_view_<?=$z?>"><?=$main_img_txt?></div>
|
||||
<input type="hidden" name="img_<?=$z?>" id="img_<?=$z?>">
|
||||
<input type="hidden" name="org_img_<?=$z?>" id="org_img_<?=$z?>" value="<?=$main_img?>">
|
||||
<input type="file" name="main_img_<?=$z?>" id="main_img_<?=$z?>" class="input00" size="20" accept="image/*">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? if($etc_section_type == '5') {?>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="hit_count_<?=$z?>" id="hit_count_<?=$z?>" class="type02" size="20" placeholder="조회수" value="<?=$hit_count?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?}?>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<button type="button" class="btn_black" style="width:100px" onclick="open_search_article('<?=$z?>');" style="cursor: pointer;">컨텐츠검색</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:editor_edit_proc();">저장하기</a>
|
||||
<a href="/admin/etc_section/editor_list/6/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_category=<?=$search_category?>&search_etc_section_type=<?=$search_etc_section_type?>&sort=<?=$sort?>">목록으로</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<?
|
||||
$content_type = '3';
|
||||
require_once(APPPATH."views/admin/search/search_article_inc.php");
|
||||
?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function change_category(depth, val){
|
||||
reset();
|
||||
if(depth == 1) {
|
||||
var json_category = '<?=json_encode($arr_category2)?>';
|
||||
json_category = eval(json_category);
|
||||
|
||||
var option = "<option value=''>선택</option>";
|
||||
$('#category2').empty();
|
||||
$('#category2').append(option);
|
||||
|
||||
$('#category3').empty();
|
||||
$('#category3').append(option);
|
||||
|
||||
for(key in json_category) {
|
||||
if(json_category[key]['category_idx'] == val) {
|
||||
option = "<option value='"+json_category[key]['idx']+"'>"+json_category[key]['channel_name']+"</option>";
|
||||
$('#category2').append(option);
|
||||
}
|
||||
}
|
||||
|
||||
} else if(depth == 2) {
|
||||
|
||||
var option = "<option value=''>선택</option>";
|
||||
$('#category3').empty();
|
||||
$('#category3').append(option);
|
||||
|
||||
var json_category = '<?=json_encode($arr_category3)?>';
|
||||
json_category = eval(json_category);
|
||||
|
||||
for(key in json_category) {
|
||||
if(json_category[key]['channel_idx'] == val) {
|
||||
option = $("<option value='"+json_category[key]['idx']+"'>"+json_category[key]['partner_name']+"</option>");
|
||||
$('#category3').append(option);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
var etc_detail_count = "<?=$def_arr_editor_etc_section[$etc_section_type]['detail_count']?>";
|
||||
function reset(){
|
||||
for(z=1;z<=etc_detail_count;z++) {
|
||||
$("#content_idx_"+z).val('');
|
||||
$("#head_title_"+z).val('');
|
||||
$("#title_"+z).val('');
|
||||
$("#editor_name_"+z).val('');
|
||||
$("#img_"+z).val('');
|
||||
$("#org_img_"+z).val('');
|
||||
$("#main_img_"+z).val('');
|
||||
$("#img_view_"+z).empty();
|
||||
$("#hit_count_"+z).empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function open_search_article(key){
|
||||
$("#key").val("_"+key);
|
||||
$("#article_keyword").val('');
|
||||
commonLayerOpen('search_article');
|
||||
$("#article_keyword").focus();
|
||||
}
|
||||
|
||||
|
||||
var etc_detail_count = "<?=$def_arr_editor_etc_section[$etc_section_type]['detail_count']?>";
|
||||
function editor_edit_proc(){
|
||||
if($("#category1").val()==''){
|
||||
alert("카테고리를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#category2").val()==''){
|
||||
alert("채널을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#category3").val()==''){
|
||||
alert("에디터를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
for(z=1;z<=etc_detail_count;z++) {
|
||||
if($("#title_"+z).val()!='') {
|
||||
if($("#content_idx_"+z).val()==''){
|
||||
alert("기사를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#main_img_"+z).val()=='' && $("#img_"+z).val()=='' && $("#org_img_"+z).val()=='') {
|
||||
alert("이미지를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
213
application/views/admin/etc_section/editor_list.php
Executable file
213
application/views/admin/etc_section/editor_list.php
Executable file
@@ -0,0 +1,213 @@
|
||||
<?
|
||||
include_once ("./static_data/code.php");
|
||||
$menu_code = '68';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/editor_list/6">
|
||||
<input type="hidden" id="search_etc_section_type" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="etc_section_type" name="etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="search_category" name="search_category" value="<?=$search_category?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="partner_name">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
|
||||
|
||||
<div class="common_tep clearfix type01">
|
||||
<ul class="clearfix">
|
||||
<li style="width:100px">모바일섹션</li>
|
||||
<? foreach ($def_arr_editor_etc_section as $val) { ?>
|
||||
<li><a href="/admin/etc_section/editor_list/6?search_etc_section_type=<?=$val['code']?>" <? if($search_etc_section_type==$val['code']) { echo 'class="on"';}?>><?=$val['name']?></a></li>
|
||||
|
||||
|
||||
<? }?>
|
||||
|
||||
</ul>
|
||||
|
||||
<div class="searh_area">
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="에디터명" onkeypress="if( event.keyCode==13 ){check_search();}">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span><b>Total:</b> <?=number_format($total_count);?></span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="1" <? if($sort=='1') { echo 'checked';}?> onclick="check_search();"> 최신순</span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="2" <? if($sort=='2') { echo 'checked';}?> onclick="check_search();"> 조회순</span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="3" <? if($sort=='3') { echo 'checked';}?> onclick="check_search();"> 등록글순</span>
|
||||
<div class="searh_area">
|
||||
<select name="search_category" onchange="check_search();" style="width:100px">
|
||||
<option value="">카테고리</option>
|
||||
<? foreach ($category_list as $key=>$val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($search_category==$val['idx']){ echo 'selected';}?>><?=$val['category_name']?></option>
|
||||
|
||||
<? }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th>번호</th>
|
||||
<th>순위</th>
|
||||
<th>카테고리</th>
|
||||
<th>채널명</th>
|
||||
<th>에디터이미지</th>
|
||||
<th>에디터명</th>
|
||||
<th>등록글수</th>
|
||||
<th>조회수</th>
|
||||
<th>등록일</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="11">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
} else {
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$rank = $val['rank'];
|
||||
$category_name = $val['category_name'];
|
||||
$channel_name = $val['channel_name'];
|
||||
$partner_img = $val['partner_img'];
|
||||
$partner_name = $val['partner_name'];
|
||||
$article_count = $val['article_count'];
|
||||
$hit_count = $val['hit_count'];
|
||||
$reg_date = $val['reg_date'];
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><?=$rank?></td>
|
||||
<td><a href="/admin/life/life_category_list/5?search_type=category_name&search_keyword=<?=$category_name?>"><?=$category_name?></a></td>
|
||||
<td><a href="/admin/life/life_channel_list/5?search_type=channel_name&search_keyword=<?=$channel_name?>"><?=$channel_name?></a></td>
|
||||
<td><img src="<?=$partner_img?>" width="35"></td>
|
||||
<td><a href="/admin/life/life_list/5?search_type=editor_name&search_keyword=<?=$partner_name?>"><?=$partner_name?></a></td>
|
||||
<td><?=number_format($article_count)?></td>
|
||||
<td><?=number_format($hit_count)?></td>
|
||||
<td><?=$reg_date?></td>
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:editor_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:editor_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:editor_arr_del_proc()">삭제</a>
|
||||
<a href="javascript:editor_list_reg()">송출관리</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--// 카테고리 등록/수정 layer -->
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
function editor_list_reg(){
|
||||
$("#mode").val('add');
|
||||
$("#input_form").attr("action", "/admin/etc_section/editor_list_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// edit
|
||||
function editor_edit(idx){
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/editor_edit/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function editor_del_proc(idx) {
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/editor_reg_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 복수 삭제
|
||||
function editor_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/etc_section/editor_reg_arr_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// checkbox all checked/unchecked
|
||||
$(function(){
|
||||
$("#allcheck").click(function(){
|
||||
if($("#allcheck").prop("checked")) {
|
||||
$("input:checkbox[name='is_del[]']").prop('checked', true); // 전체선택하기
|
||||
} else {
|
||||
$("input:checkbox[name='is_del[]']").prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
327
application/views/admin/etc_section/editor_list_reg.php
Executable file
327
application/views/admin/etc_section/editor_list_reg.php
Executable file
@@ -0,0 +1,327 @@
|
||||
<?php
|
||||
include_once ("./static_data/code.php");
|
||||
|
||||
$arr_life_etc_section_rank = array();
|
||||
foreach ($arr_etc_section as $val) {
|
||||
$arr_life_etc_section_rank[$val['rank']] = array('idx'=> $val['idx'], 'category_idx'=> $val['category_idx'], 'channel_idx'=> $val['channel_idx'], 'editor_idx'=> $val['partner_idx']);
|
||||
}
|
||||
//
|
||||
//echo "<pre>";
|
||||
//
|
||||
//var_dump($arr_etc_section_detail);
|
||||
|
||||
|
||||
$arr_life_etc_section_detail_rank = array();
|
||||
foreach ($arr_etc_section_detail as $val) {
|
||||
$arr_life_etc_section_detail_rank[$val['life_etc_section_idx']][$val['rank']] = array('main_img'=> $val['main_img'], 'head_title'=> $val['head_title'], 'title'=> $val['title'], 'content_idx'=> $val['content_idx'], 'hit_count'=>$val['hit_count'], 'editor_name'=>$val['editor_name']);
|
||||
}
|
||||
|
||||
$menu_code = '68';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
|
||||
//exit();
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/etc_section/editor_list_reg_proc" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="idx" id="idx" value="<?=$idx?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="<?=$search_type?>">
|
||||
<input type="hidden" id="search_keyword" name="search_keyword" value="<?=$search_keyword?>">
|
||||
<input type="hidden" id="search_category" name="search_category" value="<?=$search_category?>">
|
||||
<input type="hidden" id="search_etc_section_type" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="key" name="key">
|
||||
<input type="hidden" id="rank1" name="rank1">
|
||||
<input type="hidden" id="rank2" name="rank2">
|
||||
|
||||
|
||||
|
||||
<div class="common_table news">
|
||||
<table>
|
||||
<tr>
|
||||
<th>기타섹션</th>
|
||||
<td class="tl">
|
||||
<div style="width:80px; float: left"><b>모바일섹션</b></div>
|
||||
<? foreach ($def_arr_editor_etc_section as $val) { ?>
|
||||
<input type="radio" name="etc_section_type" value="<?=$val['code']?>" onclick="change_etc_section_type('<?=$val['code']?>')" <? if($search_etc_section_type==$val['code']) { echo 'checked';}?>> <?=$val['name']?>
|
||||
<? }?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?
|
||||
for($i=1;$i<=$def_arr_editor_etc_section[$search_etc_section_type]['count'];$i++) {
|
||||
$category_code1 = '';
|
||||
$category_code2 = '';
|
||||
$life_etc_section_idx = '';
|
||||
if(isset($arr_life_etc_section_rank[$i])== true) {
|
||||
$life_etc_section_idx = $arr_life_etc_section_rank[$i]['idx'];
|
||||
$category_code1 = $arr_life_etc_section_rank[$i]['category_idx'];
|
||||
$category_code2 = $arr_life_etc_section_rank[$i]['channel_idx'];
|
||||
$category_code3 = $arr_life_etc_section_rank[$i]['editor_idx'];
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<tr><th colspan="2">에디터 <?=$i?>위</th></tr>
|
||||
<tr>
|
||||
<th>카테고리선택</th>
|
||||
<td class="tl">
|
||||
<select name="category1_<?=$i?>" id="category1_<?=$i?>" onchange="change_category(1, this.value, '<?=$i?>')" class="type01">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category1) > 0) {
|
||||
foreach ($arr_category1 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code1==$val['idx']) { echo 'selected'; }?>><?=$val['category_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>채널선택</th>
|
||||
<td class="tl">
|
||||
<select name="category2_<?=$i?>" id="category2_<?=$i?>" class="type01" onchange="change_category(2, this.value, '<?=$i?>')">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category2) > 0 && $category_code2!='') {
|
||||
foreach ($arr_category2 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code2==$val['idx']) { echo 'selected'; }?>><?=$val['channel_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>에디터선택</th>
|
||||
<td class="tl">
|
||||
<select name="category3_<?=$i?>" id="category3_<?=$i?>" class="type01" onchange="change_category(3, this.value, '<?=$i?>')">
|
||||
<option value="">선택</option>
|
||||
<? if(count($arr_category3) > 0 && $category_code3!='') {
|
||||
foreach ($arr_category3 as $val) {?>
|
||||
<option value="<?=$val['idx']?>" <? if($category_code3==$val['idx']) { echo 'selected'; }?>><?=$val['partner_name']?></option>
|
||||
<? }
|
||||
} ?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
|
||||
<?
|
||||
for($z=1;$z<=$def_arr_editor_etc_section[$etc_section_type]['detail_count'];$z++) {
|
||||
$head_title = '';
|
||||
$title = '';
|
||||
$main_img_txt = '';
|
||||
$main_img = '';
|
||||
$hit_count = '';
|
||||
$content_idx = '';
|
||||
|
||||
|
||||
if(isset($arr_life_etc_section_detail_rank[$life_etc_section_idx][$z])== true) {
|
||||
$head_title = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['head_title'];
|
||||
$head_title = htmlspecialchars($head_title);
|
||||
$title = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['title'];
|
||||
$title = htmlspecialchars($title);
|
||||
$content_idx = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['content_idx'];
|
||||
$main_img = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['main_img'];
|
||||
$hit_count = $arr_life_etc_section_detail_rank[$life_etc_section_idx][$z]['hit_count'];
|
||||
|
||||
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
|
||||
|
||||
}
|
||||
|
||||
switch($etc_section_type) {
|
||||
case '4': $rowspan = '3';break;
|
||||
case '5': $rowspan = '4';break;
|
||||
case '6': $rowspan = '3';break;
|
||||
default : $rowspan = '3';break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<th rowspan="<?=$rowspan?>"><?=$z?>위</th>
|
||||
<td class="tl">
|
||||
<input type="hidden" name="content_idx_<?=$i?>_<?=$z?>" id="content_idx_<?=$i?>_<?=$z?>" value="<?=$content_idx?>">
|
||||
<input type="text" name="head_title_<?=$i?>_<?=$z?>" id="head_title_<?=$i?>_<?=$z?>" class="type02" size="20" placeholder="말머리" value="<?=$head_title?>">
|
||||
<input type="text" name="title_<?=$i?>_<?=$z?>" id="title_<?=$i?>_<?=$z?>" size="50" class="type00" placeholder="제목을 입력해주세요." value="<?=$title?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">이미지첨부
|
||||
<div id="img_view_<?=$i?>_<?=$z?>"><?=$main_img_txt?></div>
|
||||
<input type="hidden" name="img_<?=$i?>_<?=$z?>" id="img_<?=$i?>_<?=$z?>">
|
||||
<input type="hidden" name="org_img_<?=$i?>_<?=$z?>" id="org_img_<?=$i?>_<?=$z?>" value="<?=$main_img?>">
|
||||
<input type="file" name="main_img_<?=$i?>_<?=$z?>" id="main_img_<?=$i?>_<?=$z?>" class="input00" size="20" accept="image/*">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<? if($etc_section_type== '5') {?>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="hit_count_<?=$i?>_<?=$z?>" id="hit_count_<?=$i?>_<?=$z?>" class="type02" size="20" placeholder="조회수" value="<?=$hit_count?>">
|
||||
</td>
|
||||
</tr>
|
||||
<?}?>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<button type="button" class="btn_black" style="width:100px" onclick="open_search_article('<?=$i?>', '<?=$z?>');" style="cursor: pointer;">컨텐츠검색</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:editor_list_reg_proc()">저장하기</a>
|
||||
<a href="/admin/etc_section/editor_list/6/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_category=<?=$search_category?>&search_etc_section_type=<?=$search_etc_section_type?>&sort=<?=$sort?>">목록으로</a>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<?
|
||||
$content_type = '3';
|
||||
require_once(APPPATH."views/admin/search/search_article_inc.php");
|
||||
?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function change_category(depth, val, rank){
|
||||
|
||||
reset(rank);
|
||||
|
||||
if(depth == 1) {
|
||||
|
||||
$('#category3_'+rank).empty();
|
||||
var option = "<option value=''>선택</option>";
|
||||
$('#category3_'+rank).append(option);
|
||||
|
||||
|
||||
|
||||
var json_category = '<?=json_encode($arr_category2)?>';
|
||||
json_category = eval(json_category);
|
||||
|
||||
$('#category2_'+rank).empty();
|
||||
$('#category2_'+rank).append(option);
|
||||
|
||||
for(key in json_category) {
|
||||
if(json_category[key]['category_idx'] == val) {
|
||||
option = "<option value='"+json_category[key]['idx']+"'>"+json_category[key]['channel_name']+"</option>";
|
||||
$('#category2_'+rank).append(option);
|
||||
}
|
||||
}
|
||||
|
||||
} else if(depth == 2) {
|
||||
|
||||
$('#category3_'+rank).empty();
|
||||
var option = "<option value=''>선택</option>";
|
||||
$('#category3_'+rank).append(option);
|
||||
|
||||
var json_category = '<?=json_encode($arr_category3)?>';
|
||||
json_category = eval(json_category);
|
||||
|
||||
for(key in json_category) {
|
||||
if(json_category[key]['channel_idx'] == val) {
|
||||
option = $("<option value='"+json_category[key]['idx']+"'>"+json_category[key]['partner_name']+"</option>");
|
||||
$('#category3_'+rank).append(option);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function open_search_article(rank1, rank2){
|
||||
$("#key").val("_"+rank1+'_'+rank2);
|
||||
$("#rank1").val(rank1);
|
||||
$("#rank2").val(rank2);
|
||||
if($("#category1_"+rank1).val()=='') {
|
||||
alert("카테고리를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#category2_"+rank1).val()=='') {
|
||||
alert("채널을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#category3_"+rank1).val()=='') {
|
||||
alert("에디터를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
$("#article_keyword").val('');
|
||||
commonLayerOpen('search_article');
|
||||
$("#article_keyword").focus();
|
||||
}
|
||||
|
||||
|
||||
var etc_detail_count = "<?=$def_arr_editor_etc_section[$etc_section_type]['detail_count']?>";
|
||||
function reset(rank){
|
||||
for(z=1;z<=etc_detail_count;z++) {
|
||||
$("#content_idx_"+rank+"_"+z).val('');
|
||||
$("#head_title_"+rank+"_"+z).val('');
|
||||
$("#title_"+rank+"_"+z).val('');
|
||||
$("#editor_name_"+rank+"_"+z).val('');
|
||||
$("#img_"+rank+"_"+z).val('');
|
||||
$("#org_img_"+rank+"_"+z).val('');
|
||||
$("#main_img_"+rank+"_"+z).val('');
|
||||
$("#img_view_"+rank+"_"+z).empty();
|
||||
$("#hit_count_"+rank+"_"+z).empty();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
function change_etc_section_type(val){
|
||||
$("#search_etc_section_type").val(val);
|
||||
$("#input_form").attr("action", "/admin/etc_section/editor_list_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
var etc_count = "<?=$def_arr_editor_etc_section[$etc_section_type]['count']?>";
|
||||
var etc_detail_count = "<?=$def_arr_editor_etc_section[$etc_section_type]['detail_count']?>";
|
||||
function editor_list_reg_proc(){
|
||||
for(i=1;i<=etc_count;i++) {
|
||||
if($("#category1_"+i).val()!='') {
|
||||
if($("#category2_"+i).val()==''){
|
||||
alert("채널을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#category3_"+i).val()==''){
|
||||
alert("에디터를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
for(z=1;z<=etc_detail_count;z++) {
|
||||
if($("#title_"+i+'_'+z).val()!='') {
|
||||
if($("#content_idx_"+i+'_'+z).val()==''){
|
||||
alert("기사를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#main_img_"+i+'_'+z).val()=='' && $("#img_"+i+'_'+z).val()=='' && $("#org_img_"+i+'_'+z).val()=='') {
|
||||
alert("이미지를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
398
application/views/admin/etc_section/main_category_company_list.php
Executable file
398
application/views/admin/etc_section/main_category_company_list.php
Executable file
@@ -0,0 +1,398 @@
|
||||
<?php
|
||||
$arr_category2_add = array();
|
||||
foreach ($arr_category2 as $key=>$val) {
|
||||
foreach ($val as $val1) {
|
||||
$arr_category2_add[] = array('p_category_code' => $key, 'category_code' => $val1['category_code'], 'category_name' => $val1['category_name']);
|
||||
}
|
||||
}
|
||||
|
||||
$menu_code = '613';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/main_category_company_list/6" enctype="multipart/form-data">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="del_key" name="del_key">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
<input type="hidden" id="search_type" name="search_type" value="company_name">
|
||||
|
||||
|
||||
|
||||
<div class="common_table clearfix type01">
|
||||
<div class="searh_area">
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" onkeypress="if( event.keyCode==13 ){check_search();}" placeholder="업체명">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span><b>Total:</b> <?=number_format($total_count);?></span>
|
||||
<div class="searh_area">
|
||||
<select name="search_category_code1" id="search_category_code1" onchange="change_category(1)">
|
||||
<option value="">카테고리 1</option>
|
||||
<? foreach ($arr_category1 as $val) { ?>
|
||||
<option value="<?=$val['category_code']?>" <? if($search_category_code1==$val['category_code']) { echo 'selected';}?>><?=$val['category_name']?></option>
|
||||
<? } ?>
|
||||
</select>
|
||||
<select name="search_category_code2" id="search_category_code2" onchange="change_category(2)">
|
||||
<option value="">카테고리 2</option>
|
||||
<?
|
||||
if($search_category_code1!='') {
|
||||
foreach ($arr_category2[$search_category_code1] as $val) { ?>
|
||||
<option value="<?=$val['category_code']?>" <? if($search_category_code2==$val['category_code']) { echo 'selected';}?>><?=$val['category_name']?></option>
|
||||
<? }
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th>번호</th>
|
||||
<th>카테고리</th>
|
||||
<th>로고</th>
|
||||
<th>업체명</th>
|
||||
<th>링크연결</th>
|
||||
<th>조회수</th>
|
||||
<th>등록일</th>
|
||||
<th>출력순서</th>
|
||||
<th>출력상태</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="11">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$company_name = $val['company_name'];
|
||||
$category_name1 = $val['category_name1'];
|
||||
$category_name2 = $val['category_name2'];
|
||||
$logo_img = $val['logo_img'];
|
||||
$homepage = $val['homepage'];
|
||||
$hit_count = $val['hit_count'];
|
||||
$reg_date = $val['reg_date'];
|
||||
$display_sort = $val['display_sort'];
|
||||
$is_direct = $val['is_direct'];
|
||||
$category_code1 = $val['category_code1'];
|
||||
$category_code2 = $val['category_code2'];
|
||||
|
||||
$reg_date = substr($reg_date, 0, 10);
|
||||
|
||||
$is_direct_txt = '';
|
||||
if($is_direct == 'Y') $is_direct_txt = '<span class="text_blue">ON</span>';
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><a href="/admin/etc_section/main_category_list/6?search_category_code1=<?=$category_code1?>"><?=$category_name1?></a> > <a href="/admin/etc_section/main_category_list/6?search_category_code1=<?=$category_code1?>&search_category_code2=<?=$category_code2?>"><?=$category_name2?></a></td>
|
||||
<td><img src="<?=$logo_img?>" width="75"></td>
|
||||
<td><?=$company_name?></td>
|
||||
<td><a href="<?=$homepage?>" target="_blank"><?=$homepage?></a></td>
|
||||
<td><?=$hit_count?></td>
|
||||
<td><?=$reg_date?></td>
|
||||
<td><?=$display_sort?></td>
|
||||
<td><?=$is_direct_txt?></td>
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:company_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:company_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:company_arr_del_proc();">삭제</a>
|
||||
<a href="javascript:company_add();">업체등록</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="reg_layer" style="display:none">
|
||||
<div class="black_board" style="display:block"></div>
|
||||
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
|
||||
<a href="javascript:commonLayerClose('reg_layer')" class="pop_close">x</a>
|
||||
<h2>업체등록</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>카테고리</th>
|
||||
<td class="tl">
|
||||
<select name="category1" id="category1" onchange="change_category1(this.value);">
|
||||
<option value="" selected>선택</option>
|
||||
<? foreach ($arr_category1 as $val) { ?>
|
||||
<option value="<?=$val['category_code']?>" <? if($search_category_code1==$val['category_code']) { echo 'selected';}?>><?=$val['category_name']?></option>
|
||||
<? }?>
|
||||
</select>
|
||||
<select name="category2" id="category2">
|
||||
<option value="" selected>선택</option>
|
||||
<? if($search_category_code1!='') {
|
||||
foreach($arr_category2_add as $val) {
|
||||
if($val['p_category_code'] == $search_category_code1) {
|
||||
?>
|
||||
<option value="<?=$val['category_code']?>" <? if($search_category_code2==$val['category_code']) { echo 'selected';}?>><?=$val['category_name']?></option>
|
||||
<? }
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>업체명</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="company_name" id="company_name" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>홈페이지</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="homepage" id="homepage" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>송출관리</th>
|
||||
<td class="tl">
|
||||
<input type="checkbox" name="is_direct" id="is_direct" class="input00" value="Y"> 바로가기에 노출
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>출력순서</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="display_sort" id="display_sort" class="input00" size="4">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>로고첨부</th>
|
||||
<td class="tl">
|
||||
<span id="load_img"></span>
|
||||
<input type="hidden" name="org_logo_img" id="org_logo_img">
|
||||
<input type="file" name="logo_img" id="logo_img" class="input00">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:company_reg_proc('add')" id="btn_add" style="display:none;">신규등록</a>
|
||||
<a href="javascript:company_reg_proc('edit')" id="bnt_edit" style="display:none;">수정</a>
|
||||
<a href="javascript:commonLayerClose('reg_layer')">취소하기</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--// 카테고리 등록/수정 layer -->
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 등록 - layer 열기
|
||||
function company_add() {
|
||||
form_reset();
|
||||
$("#btn_add").show();
|
||||
commonLayerOpen('reg_layer');
|
||||
}
|
||||
|
||||
// form 초기화
|
||||
function form_reset(){
|
||||
$("#bnt_edit").hide();
|
||||
$("#btn_add").hide();
|
||||
|
||||
console.log("<?=$search_category_code2?>");
|
||||
|
||||
$("#category1").val("<?=$search_category_code1?>").prop("selected", true);
|
||||
$("#category2").val("<?=$search_category_code2?>").prop("selected", true);
|
||||
|
||||
$("#idx").val('');
|
||||
$("#company_name").val('');
|
||||
$("#homepage").val('');
|
||||
$("#display_sort").val('');
|
||||
$("input:checkbox[id='is_direct']").attr("checked", false);
|
||||
$("#org_logo_img").val('');
|
||||
$('#load_img').empty();
|
||||
}
|
||||
|
||||
// 수정 - layer열기
|
||||
function company_edit(idx){
|
||||
form_reset();
|
||||
|
||||
$("#bnt_edit").show();
|
||||
$("#btn_add").hide();
|
||||
|
||||
var form_data = {
|
||||
"idx" : idx
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/etc_section/main_category_company_detail',
|
||||
sync: false,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form_data,
|
||||
success: function (rtn_json) {
|
||||
console.log(rtn_json);
|
||||
if(rtn_json.result_code=='0000') {
|
||||
var result = rtn_json.result_data;
|
||||
$("#idx").val(idx);
|
||||
$("#category1").val(result.category_code1).prop("selected", true);
|
||||
change_category1(result.category_code1);
|
||||
$("#category2").val(result.category_code2).prop("selected", true);
|
||||
|
||||
$("#company_name").val(result.company_name);
|
||||
$("#homepage").val(result.homepage);
|
||||
$("#display_sort").val(result.display_sort);
|
||||
if(result.is_direct=='Y') {
|
||||
$("input:checkbox[id='is_direct']").attr("checked", true);
|
||||
}
|
||||
if(result.logo_img!= '') {
|
||||
$("#org_logo_img").val(result.logo_img);
|
||||
$('#load_img').html('<img src="' + result.logo_img + '" width="100"><br /><input type="checkbox" name="is_del_img" value="Y"> 이미지삭제 ');
|
||||
}
|
||||
commonLayerOpen('reg_layer');
|
||||
} else {
|
||||
alert("데이터로드에 실패했습니다.");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function (rtnHtml) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 저장
|
||||
function company_reg_proc(mode){
|
||||
if($("#category1").val()=='') {
|
||||
alert("카테고리1를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#category2").val()=='') {
|
||||
alert("카테고리2를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#company_name").val()=='') {
|
||||
alert("업체명을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
$("#mode").val(mode);
|
||||
|
||||
$("#input_form").attr("action", "/admin/etc_section/main_category_company_reg_proc");
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
function change_category(depth){
|
||||
if(depth=='1') $("#search_category_code2").val("").prop("selected", true);
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
var json_category = '<?=json_encode($arr_category2_add)?>';
|
||||
json_category = eval(json_category);
|
||||
function change_category1(val){
|
||||
|
||||
$('#category2').empty();
|
||||
var option = '';
|
||||
|
||||
option = $("<option value=''>선택</option>");
|
||||
$('#category2').append(option);
|
||||
|
||||
for(key in json_category) {
|
||||
if(json_category[key]['p_category_code'] == val) {
|
||||
option = $("<option value='"+json_category[key]['category_code']+"'>"+json_category[key]['category_name']+"</option>");
|
||||
$('#category2').append(option);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 삭제
|
||||
function company_del_proc(idx) {
|
||||
if(confirm("업체가 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/main_category_company_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 복수 삭제
|
||||
function company_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("업체가 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/etc_section/main_category_company_arr_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// checkbox all checked/unchecked
|
||||
$(function(){
|
||||
$("#allcheck").click(function(){
|
||||
if($("#allcheck").prop("checked")) {
|
||||
$("input:checkbox[name='is_del[]']").prop('checked', true); // 전체선택하기
|
||||
} else {
|
||||
$("input:checkbox[name='is_del[]']").prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
274
application/views/admin/etc_section/main_category_list.php
Executable file
274
application/views/admin/etc_section/main_category_list.php
Executable file
@@ -0,0 +1,274 @@
|
||||
<?
|
||||
|
||||
$menu_code = '612';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/main_category_list/6" enctype="multipart/form-data">
|
||||
<input type="hidden" id="p_category_code" name="p_category_code">
|
||||
<input type="hidden" id="category_idx" name="category_idx">
|
||||
<input type="hidden" id="del_key" name="del_key">
|
||||
<input type="hidden" id="depth" name="depth">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
<input type="hidden" id="search_type" name="search_type" value="category_name">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="common_table clearfix type01">
|
||||
<div class="searh_area">
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="카테고리명" onkeypress="if( event.keyCode==13 ){check_search();}">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span><b>Total:</b> <?=number_format($total_count);?></span>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<th>아이콘</th>
|
||||
<th>카테고리</th>
|
||||
<th>등록일</th>
|
||||
<th>출력순서</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="6">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$category_code = $val['category_code'];
|
||||
$category_name = $val['category_name'];
|
||||
$category_img = $val['category_img'];
|
||||
$p_category_code= $val['p_category_code'];
|
||||
$depth = $val['depth'];
|
||||
$reg_date = $val['reg_date'];
|
||||
$display_sort = $val['display_sort'];
|
||||
|
||||
$reg_date = substr($reg_date, 0, 10);
|
||||
|
||||
$del_key = $p_category_code;
|
||||
$reply_icon = '';
|
||||
$company_url = '/admin/etc_section/main_category_company_list/6?search_category_code1='.$p_category_code;
|
||||
|
||||
if($depth == 2) {
|
||||
$reply_icon ='<img src="/img/admin/board/icon_reply.gif" style="vertical-align:middle;margin-top:-3px;" border="0"> ';
|
||||
$del_key = $idx;
|
||||
$company_url.='&search_category_code2='.$category_code;
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<input type="hidden" name="display_sort_<?=$idx?>" id="display_sort_<?=$idx?>" value="<?=$display_sort?>">
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><img src="<?=$category_img?>" width="75"></td>
|
||||
<td style="text-align: left;">
|
||||
<input type="hidden" name="category_name_<?=$idx?>" id="category_name_<?=$idx?>" value="<?=$category_name?>">
|
||||
<input type="hidden" name="category_img_<?=$idx?>" id="category_img_<?=$idx?>" value="<?=$category_img?>">
|
||||
<?=$reply_icon?><a href="<?=$company_url?>"><?=$category_name?></a>
|
||||
<? if($depth == 1) {?>
|
||||
<button type="button" class="btn_s_blue" style="width:120px" onclick="category_add('<?=$category_code?>');" style="cursor: pointer;">2차 카테고리등록</button>
|
||||
<? }?>
|
||||
</td>
|
||||
<td><?=$reg_date?></td>
|
||||
<td><?=$display_sort?></td>
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:category_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:category_del_proc('<?=$depth?>', '<?=$del_key?>', '<?=$category_code?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?
|
||||
$dataNumber--;
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:category_add();">카테고리등록</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="category_reg_layer" style="display:none">
|
||||
<div class="black_board" style="display:block"></div>
|
||||
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
|
||||
<a href="javascript:commonLayerClose('category_reg_layer')" class="pop_close">x</a>
|
||||
<h2>카테고리등록</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>카테고리명</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="category_name" id="category_name" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>아이콘</th>
|
||||
<td class="tl">
|
||||
<span id="load_img"></span>
|
||||
<input type="hidden" name="org_category_img" id="org_category_img">
|
||||
<input type="file" name="category_img" id="category_img" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>출력순서</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="display_sort" id="display_sort" class="input03" style="width:50px">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:category_reg_proc('add')" id="btn_category_add" style="display:none;">신규등록</a>
|
||||
<a href="javascript:category_reg_proc('edit')" id="bnt_category_edit" style="display:none;">수정</a>
|
||||
<a href="javascript:commonLayerClose('category_reg_layer')">취소하기</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!--// 카테고리 등록/수정 layer -->
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// 등록 - layer 열기
|
||||
function category_add(p_category_code) {
|
||||
form_reset();
|
||||
|
||||
$("#btn_category_add").show();
|
||||
if(p_category_code != '') {
|
||||
$("#p_category_code").val(p_category_code);
|
||||
}
|
||||
|
||||
commonLayerOpen('category_reg_layer');
|
||||
}
|
||||
|
||||
// 수정 - layer열기
|
||||
function category_edit(idx){
|
||||
form_reset();
|
||||
|
||||
$("#bnt_category_edit").show();
|
||||
|
||||
$("#category_idx").val(idx);
|
||||
$("#category_name").val($("#category_name_"+idx).val());
|
||||
$("#org_category_img").val($("#category_img_"+idx).val());
|
||||
$("#display_sort").val($("#display_sort_"+idx).val());
|
||||
$('#load_img').html('<img src="' + $("#category_img_"+idx).val() + '" width="250"><br /><input type="checkbox" name="is_del_img" value="Y"> 이미지삭제 ');
|
||||
|
||||
commonLayerOpen('category_reg_layer');
|
||||
}
|
||||
|
||||
// form 초기화
|
||||
function form_reset(){
|
||||
$("#bnt_category_edit").hide();
|
||||
$("#btn_category_add").hide();
|
||||
$('#load_img').empty();
|
||||
$("#category_idx").val('');
|
||||
$("#category_name").val('');
|
||||
$("#p_category_code").val('');
|
||||
$("#org_category_img").val('');
|
||||
}
|
||||
|
||||
|
||||
// 카테고리 저장
|
||||
function category_reg_proc(mode){
|
||||
if($("#category_name").val()=='') {
|
||||
alert("카테고리명을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
$("#mode").val(mode);
|
||||
|
||||
$("#input_form").attr("action", "/admin/etc_section/main_category_reg_proc");
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 삭제
|
||||
function category_del_proc(depth, del_key, category_code) {
|
||||
var form_data = {
|
||||
"depth" : depth,
|
||||
"category_code" : category_code
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/etc_section/main_category_code_count',
|
||||
sync: false,
|
||||
type: 'POST',
|
||||
dataType: 'html',
|
||||
data: form_data,
|
||||
success: function (rtnHtml) {
|
||||
if(rtnHtml == 0) {
|
||||
if(depth == '1') {
|
||||
var msg = '하위카테고리까지 모두 삭제됩니다. 삭제하시겠습니까?';
|
||||
} else {
|
||||
var msg = '카테고리가 삭제됩니다. 삭제하시겠습니까?';
|
||||
}
|
||||
if(confirm(msg) == true) { //확인
|
||||
$("#del_key").val(del_key);
|
||||
$("#depth").val(depth);
|
||||
$("#input_form").attr("action", "/admin/etc_section/main_category_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
} else if(rtnHtml > 0) {
|
||||
alert("등록되어있는 글이 있으면 삭제할수 없습니다.");
|
||||
return false;
|
||||
} else {
|
||||
alert("삭제에 실패했습니다. 다시시도해주세요.");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function (rtnHtml) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
140
application/views/admin/etc_section/media_edit.php
Executable file
140
application/views/admin/etc_section/media_edit.php
Executable file
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
include_once ("./static_data/code.php");
|
||||
|
||||
$head_title = $result['head_title'];
|
||||
$head_title = htmlspecialchars($head_title);
|
||||
$title = $result['title'];
|
||||
$title = htmlspecialchars($title);
|
||||
$content_idx = $result['content_idx'];
|
||||
$main_img = $result['main_img'];
|
||||
$etc_section_type = $result['etc_section_type'];
|
||||
$content_type = $result['content_type'];
|
||||
$video_url = $result['video_url'];
|
||||
$rank = $result['rank'];
|
||||
$content_name = $def_arr_content[$content_type];
|
||||
$video_url = str_replace('https://www.youtube.com/embed/','', $video_url);
|
||||
|
||||
$main_img_txt = '';
|
||||
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
|
||||
|
||||
|
||||
switch($search_etc_section_type) {
|
||||
case '1': $rowspan = '5';break;
|
||||
case '2': $rowspan = '4';break;
|
||||
case '3': $rowspan = '5';break;
|
||||
case '4': $rowspan = '4';break;
|
||||
default : $rowspan = '4';break;
|
||||
|
||||
}
|
||||
|
||||
$menu_code = '64';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/etc_section/media_edit_proc" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="idx" id="idx" value="<?=$idx?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="<?=$search_type?>">
|
||||
<input type="hidden" id="search_keyword" name="search_keyword" value="<?=$search_keyword?>">
|
||||
<input type="hidden" id="search_ranking_type" name="search_content_type" value="<?=$search_content_type?>">
|
||||
<input type="hidden" id="search_category_code1" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="key" name="key">
|
||||
|
||||
|
||||
<div class="common_table news">
|
||||
<h2 class="subtitle"><?=$def_arr_etc_section[$etc_section_type]['name']?></h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th rowspan="<?=$rowspan?>"><?=$rank?>위</th>
|
||||
<td class="tl">
|
||||
<input type="hidden" name="content_type" id="content_type" value="<?=$content_type?>">
|
||||
<input type="hidden" name="content_idx" id="content_idx" value="<?=$content_idx?>">
|
||||
<input type="text" name="head_title" id="head_title" class="type02" size="20" placeholder="말머리" value="<?=$head_title?>">
|
||||
<input type="text" name="title" id="title" size="50" class="type00" placeholder="제목을 입력해주세요." value="<?=$title?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="content_name" id="content_name" class="type02" placeholder="카테고리" value="<?=$content_name?>" readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">이미지첨부
|
||||
<div id="img_view"><?=$main_img_txt?></div>
|
||||
<input type="hidden" name="img" id="img">
|
||||
<input type="hidden" name="org_img" id="org_img" value="<?=$main_img?>">
|
||||
<input type="file" name="main_img" id="main_img" class="input00" size="20" accept="image/*">
|
||||
</td>
|
||||
</tr>
|
||||
<? if($etc_section_type!='2' && $etc_section_type!='4') {?>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
youtube url </br>https://youtu.be/<input type="text" name="video_url" id="video_url" class="input00" value="<?=$video_url?>" style="width:200px"> (키만 넣어주세요.)
|
||||
</td>
|
||||
</tr>
|
||||
<? }?>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<button type="button" class="btn_black" style="width:100px" onclick="open_search_article('');" style="cursor: pointer;">컨텐츠검색</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:media_edit_proc();">저장하기</a>
|
||||
<a href="/admin/etc_section/media_list/6/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_content_type=<?=$search_content_type?>&search_etc_section_type=<?=$search_etc_section_type?>&sort=<?=$sort?>">목록으로</a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<?
|
||||
$content_type = 'all';
|
||||
require_once(APPPATH."views/admin/search/search_article_inc.php");
|
||||
?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function open_search_article(key){
|
||||
$("#key").val(key);
|
||||
$("#article_keyword").val('');
|
||||
commonLayerOpen('search_article');
|
||||
$("#article_keyword").focus();
|
||||
}
|
||||
|
||||
function media_edit_proc(){
|
||||
if($("#title").val()!='') {
|
||||
if($("#content_idx").val()==''){
|
||||
alert("기사를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#main_img").val()=='' && $("#img").val()=='' && $("#org_img").val()=='') {
|
||||
alert("메인이미지를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
<? if($etc_section_type!='2' && $etc_section_type!='4') {?>
|
||||
if($("#video_url").val()=='') {
|
||||
alert("영상을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
<? }?>
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
279
application/views/admin/etc_section/media_list.php
Executable file
279
application/views/admin/etc_section/media_list.php
Executable file
@@ -0,0 +1,279 @@
|
||||
<?
|
||||
include_once ("./static_data/code.php");
|
||||
$menu_code = '64';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
|
||||
$arr_display = array();
|
||||
foreach ($arr_display_count as $val) {
|
||||
$arr_display[$val['is_display']] = $val['cnt'];
|
||||
}
|
||||
$is_display1 = 0; $is_display2 = 0;
|
||||
if(isset($arr_display['Y'])==true) $is_display1 = $arr_display['Y'];
|
||||
if(isset($arr_display['N'])==true) $is_display2 = $arr_display['N'];
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/media_list/6">
|
||||
<input type="hidden" id="search_etc_section_type" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="search_is_display" name="search_is_display" value="<?=$search_is_display?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
|
||||
|
||||
<div class="common_tep clearfix type01">
|
||||
<ul class="clearfix">
|
||||
<li style="width:100px">PC섹션</li>
|
||||
<li><a href="/admin/etc_section/media_list/6?search_etc_section_type=2" <? if($search_etc_section_type=='2') { echo 'class="on"';}?>>인기포토</a></li>
|
||||
<li><a href="/admin/etc_section/media_list/6?search_etc_section_type=1" <? if($search_etc_section_type=='1') { echo 'class="on"';}?>>인기영상</a></li>
|
||||
<li><a href="/admin/etc_section/media_list/6?search_etc_section_type=4" <? if($search_etc_section_type=='4') { echo 'class="on"';}?>>카드뉴스</a></li>
|
||||
</ul>
|
||||
<div class="searh_area">
|
||||
<select name="search_type" id="search_type">
|
||||
<option value="" <? if($search_type==''){ echo 'selected';}?>>선택</option>
|
||||
<option value="a.title" <? if($search_type=='a.title'){ echo 'selected';}?>>제목</option>
|
||||
<option value="b.search_name" <? if($search_type=='b.search_name'){ echo 'selected';}?>>작성자</option>
|
||||
</select> <input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" onkeypress="if( event.keyCode==13 ){check_search();}">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="common_tep clearfix type01">
|
||||
<ul class="clearfix">
|
||||
<li style="width:100px">모바일섹션</li>
|
||||
<li><a href="/admin/etc_section/media_list/6?search_etc_section_type=3" <? if($search_etc_section_type=='3') { echo 'class="on"';}?>>은혜로운 영상</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span><b>Total:</b> <?=number_format($total_count);?></span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="1" <? if($sort=='1') { echo 'checked';}?> onclick="check_search();"> 최신순</span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="2" <? if($sort=='2') { echo 'checked';}?> onclick="check_search();"> 조회순</span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="3" <? if($sort=='3') { echo 'checked';}?> onclick="check_search();"> 좋아요순</span>
|
||||
<span style="margin-left: 5px"><input type="radio" name="sort" value="4" <? if($sort=='4') { echo 'checked';}?> onclick="check_search();"> 댓글순</span>
|
||||
<span style="margin-left: 10px">
|
||||
<a href="javascript:search_is_display('Y');"><span class="text_blue">출력중: <?=number_format($is_display1)?></span></a>
|
||||
<a href="javascript:search_is_display('N');"><span class="text_red">예약중: <?=number_format($is_display2)?></span></a>
|
||||
</span>
|
||||
<div class="searh_area">
|
||||
<select name="search_content_type" onchange="check_search();" style="width:100px">
|
||||
<option value="">카테고리</option>
|
||||
<? foreach ($def_arr_content as $key=>$val) {?>
|
||||
<option value="<?=$key?>" <? if($search_content_type==$key){ echo 'selected';}?>><?=$val?></option>
|
||||
|
||||
<? }?>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th>번호</th>
|
||||
<th>썸네일</th>
|
||||
<th>카테고리</th>
|
||||
<th>구분</th>
|
||||
<th>제목</th>
|
||||
<th>작성자</th>
|
||||
<th>등록일시</br>(예약일시)</th>
|
||||
<th>순위</th>
|
||||
<th>조회수</th>
|
||||
<th>좋아요수</th>
|
||||
<th>댓글수</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="14">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
} else {
|
||||
$now_date = date("Y-m-d");
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$title = $val['title'];
|
||||
$main_img = $val['main_img'];
|
||||
$content_idx = $val['content_idx'];
|
||||
$content_type = $val['content_type'];
|
||||
$etc_section_type = $val['etc_section_type'];
|
||||
$search_name = $val['search_name'];
|
||||
$reg_date = $val['reg_date'];
|
||||
$hit_count = $val['hit_count'];
|
||||
$like_count = $val['like_count'];
|
||||
$comment_count = $val['comment_count'];
|
||||
$rank = $val['rank'];
|
||||
$is_display = $val['is_display'];
|
||||
$display_date = $val['display_date'];
|
||||
|
||||
$display_date_txt = '';
|
||||
if($is_display == 'N') {
|
||||
$display_date_txt = '</br><span class="text_green">('.$display_date.')</span>';
|
||||
}
|
||||
|
||||
$content_txt = $def_arr_content[$content_type];
|
||||
$etc_section_txt = $def_arr_etc_section[$etc_section_type]['name'];
|
||||
|
||||
$new = '';
|
||||
if($reg_date == $now_date) $new = '<img src="/img/admin/board/icon_new.gif" style="vertical-align:middle;margin-top:-3px;" border="0"> ';
|
||||
|
||||
switch ($content_type) {
|
||||
case '1':
|
||||
$view_url = '/admin/news/news_reg/2?mode=edit&idx='.$content_idx;
|
||||
$search_url = '/admin/news/news_list/3?search_type=reporter_name&search_keyword='.$search_name;
|
||||
break;
|
||||
case '2':
|
||||
$view_url = '/admin/column/column_reg/3?mode=edit&idx='.$content_idx;
|
||||
$search_url = '/admin/column/column_list/3?search_type=column_name&search_keyword='.$search_name;
|
||||
break;
|
||||
case '3':
|
||||
$view_url = '/admin/life/life_reg/5?mode=edit&idx='.$content_idx;
|
||||
$search_url = '/admin/life/life_list/3?search_type=editor_name&search_keyword='.$search_name;
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><img src="<?=$main_img?>" width="35"></td>
|
||||
<td><?=$content_txt?></td>
|
||||
<td><?=$etc_section_txt?></td>
|
||||
<td class="title" style="text-align:left;">
|
||||
<a href="javascript:media_edit('<?=$idx?>')"><?=$new?><?=$title?></a>
|
||||
<button type="button" class="btn_s_blue" style="width:80px" onclick="location.href='<?=$view_url?>'" style="cursor: pointer;"><?=$content_txt?>보기</button>
|
||||
</td>
|
||||
<td><a href="<?=$search_url?>"><?=$search_name?></a></td>
|
||||
<td><?=$reg_date?><?=$display_date_txt?></td>
|
||||
<td><?=$rank?></td>
|
||||
<td><?=number_format($hit_count)?></td>
|
||||
<td><?=number_format($like_count)?></td>
|
||||
<td><?=number_format($comment_count)?></td>
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:media_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:media_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:media_arr_del_proc()">삭제</a>
|
||||
<a href="javascript:media_list_reg()">송출관리</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
function search_is_display(type){
|
||||
$("#search_is_display").val(type);
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
function media_list_reg(){
|
||||
$("#mode").val('add');
|
||||
$("#input_form").attr("action", "/admin/etc_section/media_list_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// edit
|
||||
function media_edit(idx){
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/media_edit/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function media_del_proc(idx) {
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/media_reg_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 복수 삭제
|
||||
function media_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/etc_section/media_reg_arr_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// checkbox all checked/unchecked
|
||||
$(function(){
|
||||
$("#allcheck").click(function(){
|
||||
if($("#allcheck").prop("checked")) {
|
||||
$("input:checkbox[name='is_del[]']").prop('checked', true); // 전체선택하기
|
||||
} else {
|
||||
$("input:checkbox[name='is_del[]']").prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
199
application/views/admin/etc_section/media_list_reg.php
Executable file
199
application/views/admin/etc_section/media_list_reg.php
Executable file
@@ -0,0 +1,199 @@
|
||||
<?php
|
||||
include_once ("./static_data/code.php");
|
||||
|
||||
$arr_etc_section_rank = array();
|
||||
foreach ($arr_etc_section as $val) {
|
||||
$arr_etc_section_rank[$val['rank']] = array('content_idx'=> $val['content_idx'], 'content_type'=> $val['content_type'],'head_title'=>$val['head_title'], 'title'=>$val['title'], 'main_img'=>$val['main_img'], 'main_video'=>$val['main_video'], 'video_url'=>$val['video_url']);
|
||||
}
|
||||
|
||||
|
||||
$menu_code = '64';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/etc_section/media_list_reg_proc" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="idx" id="idx" value="<?=$idx?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="<?=$search_type?>">
|
||||
<input type="hidden" id="search_keyword" name="search_keyword" value="<?=$search_keyword?>">
|
||||
<input type="hidden" id="search_content_type" name="search_content_type" value="<?=$search_content_type?>">
|
||||
<input type="hidden" id="search_etc_section_type" name="search_etc_section_type" value="<?=$search_etc_section_type?>">
|
||||
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="key" name="key">
|
||||
|
||||
|
||||
<?
|
||||
if($def_arr_etc_section[$search_etc_section_type]['display']=='all') {
|
||||
?>
|
||||
<span class="text_blue"><b>* 모바일과 공통 송출관리</b></span>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="common_table news">
|
||||
<table>
|
||||
<tr>
|
||||
<th>기타섹션</th>
|
||||
<td class="tl">
|
||||
<div style="width:80px; float: left"><b>PC섹션</b></div>
|
||||
<input type="radio" name="etc_section_type" value="2" onclick="change_etc_section_type('2')" <? if($search_etc_section_type==2) { echo 'checked';}?>> 인기포토
|
||||
<input type="radio" name="etc_section_type" value="1" onclick="change_etc_section_type('1')" <? if($search_etc_section_type==1) { echo 'checked';}?>> 인기영상
|
||||
<input type="radio" name="etc_section_type" value="4" onclick="change_etc_section_type('4')" <? if($search_etc_section_type==4) { echo 'checked';}?>> 카드뉴스
|
||||
</br>
|
||||
<div style="width:80px; float: left"><b>모바일섹션</b></div>
|
||||
<input type="radio" name="etc_section_type" value="3" onclick="change_etc_section_type('3')" <? if($search_etc_section_type==3) { echo 'checked';}?>> 은혜로운 영상
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?
|
||||
for($i=1;$i<=$def_arr_etc_section[$search_etc_section_type]['count'];$i++) {
|
||||
|
||||
$head_title = '';
|
||||
$title = '';
|
||||
$main_img = '';
|
||||
$main_img_txt = '';
|
||||
$main_video = '';
|
||||
$main_video_txt = '';
|
||||
$content_idx = '';
|
||||
$content_type = '';
|
||||
$content_name = '';
|
||||
$video_url = '';
|
||||
if(isset($arr_etc_section_rank[$i])== true) {
|
||||
$head_title = $arr_etc_section_rank[$i]['head_title'];
|
||||
$head_title = htmlspecialchars($head_title);
|
||||
$title = $arr_etc_section_rank[$i]['title'];
|
||||
$title = htmlspecialchars($title);
|
||||
$content_idx = $arr_etc_section_rank[$i]['content_idx'];
|
||||
$main_img = $arr_etc_section_rank[$i]['main_img'];
|
||||
$content_type = $arr_etc_section_rank[$i]['content_type'];
|
||||
$video_url = $arr_etc_section_rank[$i]['video_url'];
|
||||
$content_name = $def_arr_content[$content_type];
|
||||
|
||||
$video_url = str_replace('https://www.youtube.com/embed/','', $video_url);
|
||||
|
||||
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
|
||||
|
||||
}
|
||||
|
||||
switch($search_etc_section_type) {
|
||||
case '1': $rowspan = '5';break;
|
||||
case '2': $rowspan = '4';break;
|
||||
case '3': $rowspan = '5';break;
|
||||
case '4': $rowspan = '4';break;
|
||||
default : $rowspan = '4';break;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<tr>
|
||||
<th rowspan="<?=$rowspan?>"><?=$i?>위</th>
|
||||
<td class="tl">
|
||||
<input type="hidden" name="content_type<?=$i?>" id="content_type<?=$i?>" value="<?=$content_type?>">
|
||||
<input type="hidden" name="content_idx<?=$i?>" id="content_idx<?=$i?>" value="<?=$content_idx?>">
|
||||
<input type="text" name="head_title<?=$i?>" id="head_title<?=$i?>" class="type02" size="20" placeholder="말머리" value="<?=$head_title?>">
|
||||
<input type="text" name="title<?=$i?>" id="title<?=$i?>" size="50" class="type00" placeholder="제목을 입력해주세요." value="<?=$title?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="content_name<?=$i?>" id="content_name<?=$i?>" class="type02" placeholder="카테고리" value="<?=$content_name?>" readonly>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">이미지첨부
|
||||
<div id="img_view<?=$i?>"><?=$main_img_txt?></div>
|
||||
<input type="hidden" name="img<?=$i?>" id="img<?=$i?>">
|
||||
<input type="hidden" name="org_img<?=$i?>" id="org_img<?=$i?>" value="<?=$main_img?>">
|
||||
<input type="file" name="main_img<?=$i?>" id="main_img<?=$i?>" class="input00" size="20" accept="image/*">
|
||||
</td>
|
||||
</tr>
|
||||
<? if($search_etc_section_type!='2' && $search_etc_section_type!='4') {?>
|
||||
|
||||
<td class="tl">
|
||||
youtube url </br>https://youtu.be/<input type="text" name="video_url<?=$i?>" id="video_url<?=$i?>" class="input00" value="<?=$video_url?>" style="width:200px"> (키만 넣어주세요.)
|
||||
</td>
|
||||
|
||||
<? }?>
|
||||
|
||||
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<button type="button" class="btn_black" style="width:100px" onclick="open_search_article('<?=$i?>');" style="cursor: pointer;">컨텐츠검색</button>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:media_list_reg_proc()">저장하기</a>
|
||||
<a href="/admin/etc_section/media_list/6/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_content_type=<?=$search_content_type?>&search_etc_section_type=<?=$search_etc_section_type?>&sort=<?=$sort?>">목록으로</a>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
<?
|
||||
$content_type = 'all';
|
||||
require_once(APPPATH."views/admin/search/search_article_inc.php");
|
||||
?>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function open_search_article(key){
|
||||
$("#key").val(key);
|
||||
$("#article_keyword").val('');
|
||||
commonLayerOpen('search_article');
|
||||
$("#article_keyword").focus();
|
||||
}
|
||||
|
||||
|
||||
function change_etc_section_type(val){
|
||||
$("#search_etc_section_type").val(val);
|
||||
$("#input_form").attr("action", "/admin/etc_section/media_list_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
var etc_count_count = "<?=$def_arr_etc_section[$search_etc_section_type]['count']?>";
|
||||
function media_list_reg_proc(){
|
||||
for(i=1;i<=etc_count_count;i++) {
|
||||
if($("#title"+i).val()!='') {
|
||||
if($("#content_idx"+i).val()==''){
|
||||
alert("기사를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#main_img"+i).val()=='' && $("#img"+i).val()=='' && $("#org_img"+i).val()=='') {
|
||||
alert("이미지를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
<? if($search_etc_section_type!='2' && $search_etc_section_type!='4') {?>
|
||||
if($("#video_url"+i).val()=='') {
|
||||
alert("영상을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
<? }?>
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
</script>
|
||||
5
application/views/admin/etc_section/press_detail.php
Executable file
5
application/views/admin/etc_section/press_detail.php
Executable file
@@ -0,0 +1,5 @@
|
||||
<?
|
||||
echo json_encode($result);
|
||||
|
||||
|
||||
?>
|
||||
298
application/views/admin/etc_section/press_list.php
Executable file
298
application/views/admin/etc_section/press_list.php
Executable file
@@ -0,0 +1,298 @@
|
||||
<?
|
||||
|
||||
$menu_code = '611';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/press_list/6" enctype="multipart/form-data">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
<input type="hidden" id="search_type" name="search_type" value="press_name">
|
||||
<input type="hidden" id="search_click1" name="search_click1" value="<?=$search_click1?>">
|
||||
|
||||
|
||||
|
||||
|
||||
<div class="common_table clearfix type01">
|
||||
<div class="searh_area">
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="언론사명" onkeypress="if( event.keyCode==13 ){check_search();}">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span><b>Total:</b> <?=number_format($total_count);?></span>
|
||||
<a href="javascript:click_search('1', 'search_click1');"><span style="margin-left:5px"><b>바로가기:</b> <?=number_format($direct_count);?></span></a>
|
||||
<span style="margin-left:10px"><input type="radio" name="sort" value="1" <? if($sort=='1') { echo 'checked';}?> onclick="check_search();"> 최신순</span>
|
||||
<span style="margin-left:5px"><input type="radio" name="sort" value="2" <? if($sort=='2') { echo 'checked';}?> onclick="check_search();"> 등록기사순</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th>번호</th>
|
||||
<th>로고</th>
|
||||
<th>언론사명</th>
|
||||
<th>등록기사수</th>
|
||||
<th>홈페이지</th>
|
||||
<th>등록일</th>
|
||||
<th>출력순서</th>
|
||||
<th>바로가기</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="10">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
$now_date = date("Y-m-d");
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$logo_img = $val['logo_img'];
|
||||
$press_name = $val['press_name'];
|
||||
$article_count = $val['article_count'];
|
||||
$homepage = $val['homepage'];
|
||||
$reg_date = $val['reg_date'];
|
||||
$display_sort = $val['display_sort'];
|
||||
$is_direct = $val['is_direct'];
|
||||
|
||||
$reg_date = substr($reg_date, 0, 10);
|
||||
|
||||
$is_direct_txt = '';
|
||||
if($is_direct=='Y') $is_direct_txt = '<span class="text_blue">ON</span>';
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><img src="<?=$logo_img?>" width="55"></td>
|
||||
<td><?=$press_name?></td>
|
||||
<td><?=$article_count?></td>
|
||||
<td><a href="<?=$homepage?>" target="_blank"><?=$homepage?></a></td>
|
||||
<td><?=$reg_date?></td>
|
||||
<td><?=$display_sort?></td>
|
||||
<td><?=$is_direct_txt?></td>
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:press_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:press_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:press_arr_del_proc();">삭제</a>
|
||||
<a href="javascript:press_add();">언론사등록</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="reg_layer" style="display:none">
|
||||
<div class="black_board" style="display:block"></div>
|
||||
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
|
||||
<a href="javascript:commonLayerClose('reg_layer')" class="pop_close">x</a>
|
||||
<h2>언론사등록</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>언론사명</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="press_name" id="press_name" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>홈페이지</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="homepage" id="homepage" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>송출관리</th>
|
||||
<td class="tl">
|
||||
<input type="checkbox" name="is_direct" id="is_direct" class="input00" value="Y"> 바로가기에 노출
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>출력순서</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="display_sort" id="display_sort" class="type03" size="4">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>로고첨부</th>
|
||||
<td class="tl">
|
||||
<span id="load_img"></span>
|
||||
<input type="hidden" name="org_logo_img" id="org_logo_img">
|
||||
<input type="file" name="logo_img" id="logo_img" class="input00">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:press_reg_proc('add')" id="btn_add" style="display:none;">신규등록</a>
|
||||
<a href="javascript:press_reg_proc('edit')" id="bnt_edit" style="display:none;">수정</a>
|
||||
<a href="javascript:commonLayerClose('reg_layer')">취소하기</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
function click_search(type, id){
|
||||
$("#"+id).val(type);
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// 등록 - layer 열기
|
||||
function press_add() {
|
||||
form_reset();
|
||||
$("#bnt_edit").hide();
|
||||
$("#btn_add").show();
|
||||
|
||||
commonLayerOpen('reg_layer');
|
||||
}
|
||||
|
||||
// 수정 - layer열기
|
||||
function press_edit(idx){
|
||||
form_reset();
|
||||
|
||||
$("#bnt_edit").show();
|
||||
$("#btn_add").hide();
|
||||
|
||||
var form_data = {
|
||||
"idx" : idx
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/etc_section/press_detail',
|
||||
sync: false,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form_data,
|
||||
success: function (rtn_json) {
|
||||
console.log(rtn_json);
|
||||
if(rtn_json.result_code=='0000') {
|
||||
var result = rtn_json.result_data;
|
||||
$("#idx").val(idx);
|
||||
$("#press_name").val(result.press_name);
|
||||
$("#homepage").val(result.homepage);
|
||||
$("#display_sort").val(result.display_sort);
|
||||
if(result.is_direct=='Y') {
|
||||
$("input:checkbox[id='is_direct']").attr("checked", true);
|
||||
}
|
||||
if(result.logo_img!= '') {
|
||||
$("#org_logo_img").val(result.logo_img);
|
||||
$('#load_img').html('<img src="' + result.logo_img + '" style="max-width:150px"><br /><input type="checkbox" name="is_del_img" value="Y"> 이미지삭제 ');
|
||||
}
|
||||
commonLayerOpen('reg_layer');
|
||||
} else {
|
||||
alert("데이터로드에 실패했습니다.");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function (rtnHtml) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
// 언론사 저장
|
||||
function press_reg_proc(mode){
|
||||
$("#mode").val(mode);
|
||||
if($("#press_name").val()=='') {
|
||||
alert("언론사명을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
$("#input_form").attr("action", "/admin/etc_section/press_reg_proc/6");
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
// form 초기화
|
||||
function form_reset(){
|
||||
$("#idx").val('');
|
||||
$("#press_name").val('');
|
||||
$("#homepage").val('');
|
||||
$("#display_sort").val('');
|
||||
$("input:checkbox[id='is_direct']").attr("checked", false);
|
||||
$("#org_logo_img").val('');
|
||||
$('#load_img').empty();
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function press_del_proc(idx) {
|
||||
if(confirm("언론사가 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/press_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 복수 삭제
|
||||
function press_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("언론사가 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/etc_section/press_arr_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// checkbox all checked/unchecked
|
||||
$(function(){
|
||||
$("#allcheck").click(function(){
|
||||
if($("#allcheck").prop("checked")) {
|
||||
$("input:checkbox[name='is_del[]']").prop('checked', true); // 전체선택하기
|
||||
} else {
|
||||
$("input:checkbox[name='is_del[]']").prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
294
application/views/admin/etc_section/recommend_app_list.php
Executable file
294
application/views/admin/etc_section/recommend_app_list.php
Executable file
@@ -0,0 +1,294 @@
|
||||
<?
|
||||
$menu_code = '62';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/recommend_app_list/6" enctype="multipart/form-data">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="del_key" name="del_key">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
<input type="hidden" id="search_type" name="search_type" value="app_name">
|
||||
|
||||
|
||||
|
||||
<div class="common_table clearfix type01">
|
||||
<div class="searh_area">
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="어플명" onkeypress="if( event.keyCode==13 ){check_search();}">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
<span><b>Total:</b> <?=number_format($total_count);?></span>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th>번호</th>
|
||||
<th>앱아이콘</th>
|
||||
<th>어플명</th>
|
||||
<th>링크연결</th>
|
||||
<th>조회수</th>
|
||||
<th>등록일</th>
|
||||
<th>출력순서</th>
|
||||
<th>출력상태</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="10">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
|
||||
} else {
|
||||
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$app_name = $val['app_name'];
|
||||
$icon_img = $val['icon_img'];
|
||||
$market_url = $val['market_url'];
|
||||
$hit_count = $val['hit_count'];
|
||||
$reg_date = $val['reg_date'];
|
||||
$display_sort = $val['display_sort'];
|
||||
$is_direct = $val['is_direct'];
|
||||
|
||||
$reg_date = substr($reg_date, 0, 10);
|
||||
|
||||
$is_direct_txt = '';
|
||||
if($is_direct == 'Y') $is_direct_txt = '<span class="text_blue">ON</span>';
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><img src="<?=$icon_img?>" width="75"></td>
|
||||
<td><?=$app_name?></td>
|
||||
<td><a href="<?=$market_url?>" target="_blank"><?=$market_url?></a></td>
|
||||
<td><?=$hit_count?></td>
|
||||
<td><?=$reg_date?></td>
|
||||
<td><?=$display_sort?></td>
|
||||
<td><?=$is_direct_txt?></td>
|
||||
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:app_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:app_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:app_arr_del_proc();">삭제</a>
|
||||
<a href="javascript:app_add();">어플등록</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="reg_layer" style="display:none">
|
||||
<div class="black_board" style="display:block"></div>
|
||||
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
|
||||
<a href="javascript:commonLayerClose('reg_layer')" class="pop_close">x</a>
|
||||
<h2>추천어플등록</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>어플명</th>
|
||||
<td>
|
||||
<input type="text" name="app_name" id="app_name" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>마켓주소</th>
|
||||
<td>
|
||||
<input type="text" name="market_url" id="market_url" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>송출관리</th>
|
||||
<td class="tl">
|
||||
<input type="checkbox" name="is_direct" id="is_direct" class="input00" value="Y"> 펼침메뉴에 노출
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>출력순서</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="display_sort" id="display_sort" class="type03" size="4">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>로고첨부</th>
|
||||
<td class="tl">
|
||||
<span id="load_img"></span>
|
||||
<input type="hidden" name="org_icon_img" id="org_icon_img">
|
||||
<input type="file" name="icon_img" id="icon_img" class="input00">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:app_reg_proc('add')" id="btn_add" style="display:none;">신규등록</a>
|
||||
<a href="javascript:app_reg_proc('edit')" id="bnt_edit" style="display:none;">수정</a>
|
||||
<a href="javascript:commonLayerClose('reg_layer')">취소하기</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--// 카테고리 등록/수정 layer -->
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// 등록 - layer 열기
|
||||
function app_add() {
|
||||
form_reset();
|
||||
$("#btn_add").show();
|
||||
commonLayerOpen('reg_layer');
|
||||
}
|
||||
|
||||
// form 초기화
|
||||
function form_reset(){
|
||||
$("#bnt_edit").hide();
|
||||
$("#btn_add").hide();
|
||||
|
||||
$("#idx").val('');
|
||||
$("#app_name").val('');
|
||||
$("#marker_url").val('');
|
||||
$("#display_sort").val('');
|
||||
$("input:checkbox[id='is_direct']").attr("checked", false);
|
||||
$("#org_icon_img").val('');
|
||||
$('#load_img').empty();
|
||||
}
|
||||
|
||||
// 수정 - layer열기
|
||||
function app_edit(idx){
|
||||
form_reset();
|
||||
|
||||
$("#bnt_edit").show();
|
||||
|
||||
var form_data = {
|
||||
"idx" : idx
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/etc_section/recommend_app_detail',
|
||||
sync: false,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form_data,
|
||||
success: function (rtn_json) {
|
||||
console.log(rtn_json);
|
||||
if(rtn_json.result_code=='0000') {
|
||||
var result = rtn_json.result_data;
|
||||
$("#idx").val(idx);
|
||||
$("#app_name").val(result.app_name);
|
||||
$("#market_url").val(result.market_url);
|
||||
$("#display_sort").val(result.display_sort);
|
||||
if(result.is_direct=='Y') {
|
||||
$("input:checkbox[id='is_direct']").attr("checked", true);
|
||||
}
|
||||
if(result.icon_img!= '') {
|
||||
$("#org_icon_img").val(result.icon_img);
|
||||
$('#load_img').html('<img src="' + result.icon_img + '" width="250"><br /><input type="checkbox" name="is_del_img" value="Y"> 이미지삭제 ');
|
||||
}
|
||||
commonLayerOpen('reg_layer');
|
||||
} else {
|
||||
alert("데이터로드에 실패했습니다.");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function (rtnHtml) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 저장
|
||||
function app_reg_proc(mode){
|
||||
if($("#app_name").val()=='') {
|
||||
alert("어플명을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#market_url").val()=='') {
|
||||
alert("마켓주소를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
$("#mode").val(mode);
|
||||
|
||||
$("#input_form").attr("action", "/admin/etc_section/recommend_app_reg_proc");
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function app_del_proc(idx) {
|
||||
if(confirm("추천앱이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/recommend_app_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 복수 삭제
|
||||
function app_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("추천앱이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/etc_section/recommend_app_arr_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// checkbox all checked/unchecked
|
||||
$(function(){
|
||||
$("#allcheck").click(function(){
|
||||
if($("#allcheck").prop("checked")) {
|
||||
$("input:checkbox[name='is_del[]']").prop('checked', true); // 전체선택하기
|
||||
} else {
|
||||
$("input:checkbox[name='is_del[]']").prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
328
application/views/admin/etc_section/today_word_list.php
Executable file
328
application/views/admin/etc_section/today_word_list.php
Executable file
@@ -0,0 +1,328 @@
|
||||
<link rel="stylesheet" href="<?=DIR_CSS?>/jquery-ui.min.css" />
|
||||
<script src="<?=DIR_JS?>/jquery-ui.min.js"></script>
|
||||
|
||||
<?
|
||||
$menu_code = '63';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/today_word_list/6" enctype="multipart/form-data">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
<input type="hidden" id="search_type" name="search_type" value="word">
|
||||
|
||||
|
||||
<div class="common_table clearfix type01">
|
||||
<div class="searh_area">
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="성경구절" onkeypress="if( event.keyCode==13 ){check_search();}">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
<span><b>Total:</b> <?=number_format($total_count);?></span>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th>번호</th>
|
||||
<th>성경구절</th>
|
||||
<th>성경본문</th>
|
||||
<th>노출일</th>
|
||||
<th>출력상태</th>
|
||||
<th>관리</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
$i =0;
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="7">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
|
||||
$i=1;
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$word = $val['word'];
|
||||
$title = $val['title'];
|
||||
$display_date = $val['display_date'];
|
||||
$is_display = $val['is_display'];
|
||||
|
||||
$is_display_txt = '';
|
||||
if($is_display == 'Y') $is_display_txt = '<span class="text_blue">ON</span>';
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><?=$word?></td>
|
||||
<td><?=$title?></td>
|
||||
<td><input type="text" name="display_date_<?=$idx?>" id="display_date_<?=$i?>" style="width:100px" size="12" value="<?=$display_date?>" /></td>
|
||||
<td><?=$is_display_txt?></td>
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:today_word_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:today_word_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?
|
||||
$i++;
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:today_word_arr_del_proc();">삭제</a>
|
||||
<a href="javascript:today_word_add();">오늘의말씀등록</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div id="reg_layer" style="display:none">
|
||||
<div class="black_board" style="display:block"></div>
|
||||
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
|
||||
<a href="javascript:commonLayerClose('reg_layer')" class="pop_close">x</a>
|
||||
<h2>오늘의말씀 등록</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>성경구절</th>
|
||||
<td>
|
||||
<input type="text" name="word" id="word" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>성경본문</th>
|
||||
<td>
|
||||
<input type="text" name="title" id="title" class="input00" size="30">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>노출일시</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="display_date" id="display_date" class="type02" size="12" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:today_word_reg_proc('add')" id="btn_add" style="display:none;">신규등록</a>
|
||||
<a href="javascript:today_word_reg_proc('edit')" id="bnt_edit" style="display:none;">수정</a>
|
||||
<a href="javascript:commonLayerClose('reg_layer')">취소하기</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--// 카테고리 등록/수정 layer -->
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// 등록 - layer 열기
|
||||
function today_word_add() {
|
||||
form_reset();
|
||||
$("#btn_add").show();
|
||||
commonLayerOpen('reg_layer');
|
||||
}
|
||||
|
||||
// form 초기화
|
||||
function form_reset(){
|
||||
$("#bnt_edit").hide();
|
||||
$("#btn_add").hide();
|
||||
|
||||
$("#idx").val('');
|
||||
$("#word").val('');
|
||||
$("#title").val('');
|
||||
$("#display_date").val('');
|
||||
}
|
||||
|
||||
// 수정 - layer열기
|
||||
function today_word_edit(idx){
|
||||
form_reset();
|
||||
|
||||
$("#bnt_edit").show();
|
||||
|
||||
var form_data = {
|
||||
"idx" : idx
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/etc_section/today_word_detail',
|
||||
sync: false,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form_data,
|
||||
success: function (rtn_json) {
|
||||
console.log(rtn_json);
|
||||
if(rtn_json.result_code=='0000') {
|
||||
var result = rtn_json.result_data;
|
||||
$("#idx").val(idx);
|
||||
$("#word").val(result.word);
|
||||
$("#title").val(result.title);
|
||||
$("#display_date").val(result.display_date);
|
||||
|
||||
commonLayerOpen('reg_layer');
|
||||
} else {
|
||||
alert("데이터로드에 실패했습니다.");
|
||||
return false;
|
||||
}
|
||||
},
|
||||
error: function (rtnHtml) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 저장
|
||||
function today_word_reg_proc(mode){
|
||||
if($("#word").val()=='') {
|
||||
alert("어플명을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#market_url").val()=='') {
|
||||
alert("마켓주소를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#display_date").val()!='') {
|
||||
var display_date = new Date($('#display_date').val());
|
||||
var now_date = new Date();
|
||||
now_date.setHours(0, 0, 0, 0);
|
||||
if (display_date < now_date){
|
||||
alert('노출일을 이전으로 등록할수 없습니다.');
|
||||
return false;
|
||||
}
|
||||
}
|
||||
$("#mode").val(mode);
|
||||
|
||||
$("#input_form").attr("action", "/admin/etc_section/today_word_reg_proc");
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function today_word_del_proc(idx) {
|
||||
if(confirm("오늘의말씀이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/today_word_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 복수 삭제
|
||||
function today_word_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("오늘의말씀이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/etc_section/today_word_arr_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// checkbox all checked/unchecked
|
||||
$(function(){
|
||||
$("#allcheck").click(function(){
|
||||
if($("#allcheck").prop("checked")) {
|
||||
$("input:checkbox[name='is_del[]']").prop('checked', true); // 전체선택하기
|
||||
} else {
|
||||
$("input:checkbox[name='is_del[]']").prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// jquery datepicker
|
||||
$("#display_date").datepicker({
|
||||
inline: true,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
buttonImage:"/img/btn_date.png",
|
||||
showOn: "both",
|
||||
buttonImageOnly: true
|
||||
|
||||
});
|
||||
for(z=1;z<"<?=$i?>";z++) {
|
||||
var datepicker_id = "display_date_"+z;
|
||||
$("#"+datepicker_id).datepicker({
|
||||
inline: true,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
buttonImage:"/img/btn_date.png",
|
||||
showOn: "both",
|
||||
buttonImageOnly: true,
|
||||
onSelect: function (dateText, inst) {
|
||||
change_display_date(dateText, inst)
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
function change_display_date(dateText, inst){
|
||||
var datepicker_id = inst.id;
|
||||
name = $('#'+datepicker_id).attr('name');
|
||||
var idx = name.replace("display_date_", "");
|
||||
|
||||
var form_data = {
|
||||
"display_date" : dateText,
|
||||
"idx" : idx
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/etc_section/today_word_display_date_update',
|
||||
sync: false,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form_data,
|
||||
success: function (rtn_json) {
|
||||
if(rtn_json.result_code!='0000') {
|
||||
alert("저장에 실패했습니다.");
|
||||
return false;
|
||||
} else {
|
||||
window.location.reload(true);
|
||||
}
|
||||
},
|
||||
error: function (rtnHtml) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
352
application/views/admin/etc_section/weather_list.php
Executable file
352
application/views/admin/etc_section/weather_list.php
Executable file
@@ -0,0 +1,352 @@
|
||||
<link rel="stylesheet" href="<?=DIR_CSS?>/jquery-ui.min.css" />
|
||||
<script src="<?=DIR_JS?>/jquery-ui.min.js"></script>
|
||||
|
||||
<?
|
||||
$menu_code = '65';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
$arr_display_status = array();
|
||||
foreach ($display_status_result as $val) {
|
||||
$arr_display_status[$val['display_status']] = $val['cnt'];
|
||||
}
|
||||
|
||||
$use_count = 0; $reservation_count = 0;
|
||||
if(isset($arr_display_status[1])==true) $use_count = $arr_display_status[1];
|
||||
if(isset($arr_display_status[0])==true) $reservation_count = $arr_display_status[0];
|
||||
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/etc_section/weather_list/6" enctype="multipart/form-data">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
<input type="hidden" id="search_display_status" name="search_display_status">
|
||||
|
||||
|
||||
<div class="common_table clearfix type01">
|
||||
<div class="searh_area">
|
||||
<select name="search_type" id="search_type">
|
||||
<option value="" <? if($search_type==''){ echo 'selected';}?>>선택</option>
|
||||
<option value="continent" <? if($search_type=='continent'){ echo 'selected';}?>>대륙</option>
|
||||
<option value="country" <? if($search_type=='country'){ echo 'selected';}?>>나라</option>
|
||||
<option value="weather_content" <? if($search_type=='weather_content'){ echo 'selected';}?>>날씨코멘트</option>
|
||||
<option value="reg_date" <? if($search_type=='reg_date'){ echo 'selected';}?>>등록일시</option>
|
||||
<option value="news_title" <? if($search_type=='news_title'){ echo 'selected';}?>>관련뉴스</option>
|
||||
</select>
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" onkeypress="if( event.keyCode==13 ){check_search();}">
|
||||
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="common_table">
|
||||
<span><a href="javascript:click_search()"><b>Total:</b> <?=number_format($total_count);?></a></span>
|
||||
<span style="margin-left: 10px"><a href="javascript:click_search('1')" class="text_blue"><b>출력중:</b> <?=number_format($use_count);?></a></span>
|
||||
<span style="margin-left: 10px"><a href="javascript:click_search('0')" class="text_red"><b>예약중:</b> <?=number_format($reservation_count);?></a></span>
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th>번호</th>
|
||||
<th>순위</th>
|
||||
<th>대륙</th>
|
||||
<th>나라</th>
|
||||
<th>날씨</th>
|
||||
<th>코멘트</th>
|
||||
<th>등록일시</br>(예약일)</th>
|
||||
<th>관련뉴스</th>
|
||||
<th>출력상태</th>
|
||||
<th>관리</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
<?
|
||||
if(count($list)==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="11">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?
|
||||
} else {
|
||||
|
||||
$i=1;
|
||||
$dataNumber = ($total_count + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$rank = $val['rank'];
|
||||
$continent = $val['continent'];
|
||||
$country = $val['country'];
|
||||
$weather_icon = $val['weather_icon'];
|
||||
$weather_content= $val['weather_content'];
|
||||
$display_date = $val['display_date'];
|
||||
$display_status = $val['display_status'];
|
||||
$reg_date = $val['reg_date'];
|
||||
$news_title = $val['news_title'];
|
||||
$news_idx = $val['news_idx'];
|
||||
|
||||
$display_date_txt = '';
|
||||
if($display_status == '0') {
|
||||
$display_date_txt = '</br><span class="text_green">('.$display_date.')</span>';
|
||||
}
|
||||
|
||||
$arr_news_title = explode("||||", $news_title);
|
||||
if(count($arr_news_title) > 1) $news_title = $arr_news_title[0].' 외 '.(count($arr_news_title)-1).'개';
|
||||
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
|
||||
<td><?=$dataNumber?></td>
|
||||
<td><?=$rank?></td>
|
||||
<td><?=$continent?></td>
|
||||
<td><?=$country?></td>
|
||||
<td><img src="<?=$weather_icon?>" width="50"></td>
|
||||
<td><?=$weather_content?></td>
|
||||
<td><?=$reg_date?><?=$display_date_txt?></td>
|
||||
<td><a href="/web/news/news_view/<?=$news_idx?>" target="_blank"><?=$news_title?></a></td>
|
||||
<td>
|
||||
<? if($display_status == '0') {?>
|
||||
<select name="display_status_<?=$idx?>" id="display_status_<?=$idx?>" onchange="change_display_status(this);">
|
||||
<option value="1" <? if($display_status=='1') { echo 'selected';}?>>출력</option>
|
||||
<option value="0" <? if($display_status=='0') { echo 'selected';}?>>예약</option>
|
||||
</select>
|
||||
<? } else if($display_status == '1') {
|
||||
echo '<span class="text_blue">출력</span>';
|
||||
} else {
|
||||
echo '';
|
||||
}
|
||||
|
||||
?>
|
||||
</td>
|
||||
<td class="tool_btn">
|
||||
<a href="javascript:weather_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="javascript:weather_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
<?
|
||||
$i++;
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="write_btn">
|
||||
<a href="javascript:weather_icon_add();">날씨아이콘등록</a>
|
||||
<a href="javascript:weather_arr_del_proc();">삭제</a>
|
||||
<a href="javascript:weather_list_reg();">송출관리</a>
|
||||
<a href="javascript:weather_add();">영적기상도등록</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="icon_reg_layer" style="display:none">
|
||||
<div class="black_board" style="display:block"></div>
|
||||
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
|
||||
<a href="javascript:commonLayerClose('icon_reg_layer')" class="pop_close">x</a>
|
||||
<h2>날씨아이콘</h2>
|
||||
<table>
|
||||
<tr style="height:50px">
|
||||
<th>아이콘리스트</th>
|
||||
<td class="tl">
|
||||
<div class="icon_list" style="overflow-y: scroll; height:150px;">
|
||||
<? foreach ($weather_icon_list as $val) {?>
|
||||
<a href="javascript:;" class="por">
|
||||
<img src="<?=$val['weather_icon']?>" alt=""/>
|
||||
</a>
|
||||
<? }?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>아이콘첨부</th>
|
||||
<td class="tl">
|
||||
<input type="file" name="weather_icon" id="weather_icon" class="input00" size="30" >
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:weather_icon_add_proc()">신규등록</a>
|
||||
<a href="javascript:commonLayerClose('icon_reg_layer')">취소하기</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function check_search(){
|
||||
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
|
||||
alert("검색할 항목을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#search_type").val()=='reg_date') {
|
||||
if(check_date($("#search_keyword").val())==false) {
|
||||
alert("날짜를 정확히 입력해주세요. (YYYY-MM-DD)");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// 날짜체크
|
||||
function check_date(val){
|
||||
var regexp= /^\d{4}-\d{2}-\d{2}$/;
|
||||
if( !regexp.test(val) ) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function click_search(status){
|
||||
$("#search_display_status").val(status);
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 송출관리
|
||||
function weather_list_reg(){
|
||||
$("#mode").val('add');
|
||||
$("#input_form").attr("action", "/admin/etc_section/weather_list_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
|
||||
// add
|
||||
function weather_add(){
|
||||
$("#mode").val('add');
|
||||
$("#input_form").attr("action", "/admin/etc_section/weather_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
// edit
|
||||
function weather_edit(idx){
|
||||
$("#idx").val(idx);
|
||||
$("#mode").val('edit');
|
||||
$("#input_form").attr("action", "/admin/etc_section/weather_reg/6");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
// 삭제
|
||||
function weather_del_proc(idx) {
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#idx").val(idx);
|
||||
$("#input_form").attr("action", "/admin/etc_section/weather_reg_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 복수 삭제
|
||||
function weather_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/etc_section/weather_reg_arr_del_proc");
|
||||
$("#input_form").submit();
|
||||
} else { //취소
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// 날씨아이콘등록
|
||||
function weather_icon_add(){
|
||||
commonLayerOpen('icon_reg_layer');
|
||||
}
|
||||
|
||||
|
||||
function weather_icon_add_proc(){
|
||||
var weather_icon = $("#weather_icon").val();
|
||||
if(weather_icon=='') {
|
||||
alert("아이콘을 등록해주세요.");
|
||||
return false;
|
||||
}
|
||||
$("#input_form").attr("action", "/admin/etc_section/weather_icon_add_proc");
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// checkbox all checked/unchecked
|
||||
$(function(){
|
||||
$("#allcheck").click(function(){
|
||||
if($("#allcheck").prop("checked")) {
|
||||
$("input:checkbox[name='is_del[]']").prop('checked', true); // 전체선택하기
|
||||
} else {
|
||||
$("input:checkbox[name='is_del[]']").prop("checked", false);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
function change_display_status(t){
|
||||
var val = t.value;
|
||||
var select_id = t.id;
|
||||
var idx = select_id.replace("display_status_", "");
|
||||
|
||||
var form_data = {
|
||||
"display_status" : val,
|
||||
"idx" : idx
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/etc_section/weather_display_status_update',
|
||||
sync: false,
|
||||
type: 'POST',
|
||||
dataType: 'json',
|
||||
data: form_data,
|
||||
success: function (rtn_json) {
|
||||
if(rtn_json.result_code!='0000') {
|
||||
alert("저장에 실패했습니다.");
|
||||
return false;
|
||||
} else {
|
||||
window.location.reload(true);
|
||||
}
|
||||
},
|
||||
error: function (rtnHtml) {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
396
application/views/admin/etc_section/weather_list_reg.php
Executable file
396
application/views/admin/etc_section/weather_list_reg.php
Executable file
@@ -0,0 +1,396 @@
|
||||
<?php
|
||||
include_once ("./static_data/continent.php");
|
||||
|
||||
$menu_code = '65';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
|
||||
|
||||
|
||||
$arr_weather_rank = array();
|
||||
foreach ($arr_weather as $val) {
|
||||
$arr_weather_rank[$val['rank']] = array('continent'=> $val['continent'], 'country'=> $val['country'],'weather_icon'=>$val['weather_icon'], 'weather_content'=>$val['weather_content'], 'display_date'=>$val['display_date'], 'display_status'=>$val['display_status'], 'is_auto_setting'=>$val['is_auto_setting'], 'tag'=>$val['tag']);
|
||||
}
|
||||
|
||||
$arr_relation_article_rank = array();
|
||||
foreach ($arr_relation_article as $val) {
|
||||
$arr_relation_article_rank[$val['rank']][] = array('title'=> $val['title'], 'relation_article_idx'=> $val['idx']);
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/etc_section/weather_list_reg_proc" method="post" enctype="multipart/form-data">
|
||||
<input type="hidden" name="idx" id="idx" value="<?=$idx?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="<?=$search_type?>">
|
||||
<input type="hidden" id="search_keyword" name="search_keyword" value="<?=$search_keyword?>">
|
||||
<input type="hidden" id="search_display_status" name="search_display_status" value="<?=$search_display_status?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="rank" name="rank">
|
||||
|
||||
|
||||
<span class="text_blue"><b>* 모바일과 공통 송출관리</b></span>
|
||||
<div class="common_table news">
|
||||
<table>
|
||||
|
||||
|
||||
<?
|
||||
for($z=1;$z<=10;$z++) {
|
||||
|
||||
$continent = '';
|
||||
$country = '';
|
||||
$weather_icon = '';
|
||||
$weather_content = '';
|
||||
$tag = '';
|
||||
$is_auto_setting = 'Y';
|
||||
$continent_key = '';
|
||||
if(isset($arr_weather_rank[$z])== true) {
|
||||
$continent = $arr_weather_rank[$z]['continent'];
|
||||
$country = $arr_weather_rank[$z]['country'];
|
||||
$weather_icon = $arr_weather_rank[$z]['weather_icon'];
|
||||
$weather_content = $arr_weather_rank[$z]['weather_content'];
|
||||
$weather_content = htmlspecialchars($weather_content);
|
||||
$tag = $arr_weather_rank[$z]['tag'];
|
||||
$tag = str_replace(" ", ",", $tag);
|
||||
$is_auto_setting = $arr_weather_rank[$z]['is_auto_setting'];
|
||||
|
||||
$continent_key_tmp = array_keys($arr_continent1, $continent);
|
||||
$continent_key = $continent_key_tmp[0];
|
||||
|
||||
}
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<th rowspan="6"><?=$z?>위</th>
|
||||
<td class="tl">
|
||||
<select name="continent<?=$z?>" id="continent<?=$z?>" onchange="change_continent(this.value, '<?=$z?>')">
|
||||
<option value="">대륙선택</option>
|
||||
<? foreach ($arr_continent1 as $key=>$val) {?>
|
||||
<option value="<?=$key?>" <? if($continent==$val) { echo 'selected';}?>><?=$val?></option>
|
||||
|
||||
<? }?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
|
||||
<td class="tl">
|
||||
<select name="country<?=$z?>" id="country<?=$z?>">
|
||||
<option value="">나라선택</option>
|
||||
<? if(isset($arr_continent2[$continent_key])==true) {
|
||||
foreach ($arr_continent2[$continent_key] as $val) {
|
||||
?>
|
||||
<option value="<?=$val?>" <? if($country==$val) { echo 'selected';}?>><?=$val?></option>
|
||||
<? }
|
||||
|
||||
}?>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
날씨아이콘
|
||||
<button type="button" class="btn_black" style="width:100px" onclick="view_icon('<?=$z?>');" style="cursor: pointer;">선택하기</button>
|
||||
<input type="hidden" name="weather_icon<?=$z?>" id="weather_icon<?=$z?>" value="<?=$weather_icon?>">
|
||||
<div id="icon_img<?=$z?>">
|
||||
<? if($weather_icon!='') { ?>
|
||||
<img src="<?=$weather_icon?>" width="50px">
|
||||
<? } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="weather_content<?=$z?>" id="weather_content<?=$z?>" value="<?=$weather_content?>" placeholder="날씨코멘트">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">
|
||||
<input type="text" name="tag<?=$z?>" id="tag<?=$z?>" class="type01" value="<?=$tag?>"> 최대 5개까지 입력 가능(,로 구분해주세요.)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="tl">관련뉴스
|
||||
<input type="radio" name="is_auto_setting<?=$z?>" id="is_auto_setting<?=$z?>" onclick="click_relation_news_auto_setting('Y', '<?=$z?>');" value="Y" <? if($is_auto_setting=='Y') { echo 'checked';}?>> 자동설정
|
||||
<input type="radio" name="is_auto_setting<?=$z?>" id="is_auto_setting<?=$z?>" onclick="click_relation_news_auto_setting('N', '<?=$z?>');" value="N" <? if($is_auto_setting=='N') { echo 'checked';}?>> 수정설정
|
||||
<div class="two_box_type01 clearfix" id="no_auto_setting_content<?=$z?>" style="display:none; margin-top:10px;">
|
||||
<div class="con">
|
||||
<div class="searh_area fn mb10">
|
||||
<input type="text" name="article_keyword<?=$z?>" id="article_keyword<?=$z?>" class="input00" size="20" placeholder="검색어 입력" onkeypress="if( event.keyCode==13 ){search_article('<?=$z?>');}">
|
||||
<a href="javascript:search_article('<?=$z?>');" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
<div class="mb10">
|
||||
<input type="radio" name="article_sort<?=$z?>" id="article_sort<?=$z?>" value="1" onclick="search_article('<?=$z?>');" checked> 최신순
|
||||
<input type="radio" name="article_sort<?=$z?>" id="article_sort<?=$z?>" value="2" onclick="search_article('<?=$z?>');"> 오래된순
|
||||
|
||||
검색결과 <span class="mark" id="result_count<?=$z?>">0</span>건
|
||||
</div>
|
||||
<div class="list scs">
|
||||
<ul id="result<?=$z?>">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="con">
|
||||
<h3 class="mb10">선택된 뉴스 항목</h3>
|
||||
<div class="list type02 scs">
|
||||
<ul id="selected_news<?=$z?>">
|
||||
<?
|
||||
if(isset($arr_relation_article_rank[$z])==true) {
|
||||
$i=1;
|
||||
foreach ($arr_relation_article_rank[$z] as $val) {
|
||||
?>
|
||||
<li><input type="checkbox" name="relation_idxs<?=$z?>[]" id="relation_idx<?=$z?>_<?=$i?>" value="<?=$val['relation_article_idx']?>" onclick="delete_article('<?=$i?>', '<?=$z?>');" checked><a href="/web/news/news_view/<?=$val['relation_article_idx']?>" target="_blank"><?=$val['title']?></a></li>
|
||||
<?
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<?
|
||||
|
||||
if($is_auto_setting=='N') {
|
||||
?>
|
||||
<script type="text/javascript">
|
||||
$("#no_auto_setting_content<?=$z?>").show();
|
||||
</script>
|
||||
|
||||
|
||||
<?
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:weather_list_reg_proc()">저장하기</a>
|
||||
<a href="/admin/etc_section/weather_list/6/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_display_status=<?=$search_display_status?>">목록으로</a>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="icon_reg_layer" style="display:none">
|
||||
<div class="black_board" style="display:block"></div>
|
||||
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
|
||||
<a href="javascript:commonLayerClose('icon_reg_layer')" class="pop_close">x</a>
|
||||
<h2>채널아이콘</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width:150px">아이콘선택</th>
|
||||
<td class="tl">
|
||||
<div class="icon_list" style="overflow-y: scroll; height:150px;">
|
||||
<? foreach ($weather_icon_list as $val) {?>
|
||||
<a href="#;" class="por">
|
||||
<input type="radio" name="sel_weather_icon" id="sel_weather_icon" class="stebox" value="<?=$val['weather_icon']?>">
|
||||
<img src="<?=$val['weather_icon']?>" width="50px" />
|
||||
</a>
|
||||
<? }?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:select_weather_icon('add')">적용하기</a>
|
||||
<a href="javascript:commonLayerClose('icon_reg_layer')">취소하기</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// 대륙변경
|
||||
function change_continent(val, rank){
|
||||
var json_category = '<?=json_encode($arr_continent2)?>';
|
||||
json_category = eval(json_category);
|
||||
|
||||
$('#country'+rank).empty();
|
||||
var option = "<option value=''>선택</option>";
|
||||
$('#country'+rank).append(option);
|
||||
for(key in json_category[val]) {
|
||||
option = $("<option value='"+json_category[val][key]+"'>"+json_category[val][key]+"</option>");
|
||||
$('#country'+rank).append(option);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// 아이콘 보기
|
||||
function view_icon(rank){
|
||||
$("#rank").val(rank);
|
||||
commonLayerOpen('icon_reg_layer')
|
||||
|
||||
}
|
||||
|
||||
// 아이콘 적용
|
||||
function select_weather_icon(){
|
||||
var weather_icon = $("input[type=radio][id=sel_weather_icon]:checked").val();
|
||||
var rank = $("#rank").val();
|
||||
|
||||
if(weather_icon == '' || weather_icon == undefined) {
|
||||
alert("적용할 아이콘이 없습니다.");
|
||||
} else {
|
||||
$("#weather_icon"+rank).val(weather_icon);
|
||||
$("#icon_img"+rank).empty();
|
||||
$("#icon_img"+rank).html('<img src="'+weather_icon+'" width="50px">');
|
||||
}
|
||||
|
||||
commonLayerClose('icon_reg_layer')
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 관련뉴스검색
|
||||
function click_relation_news_auto_setting(type, rank){
|
||||
$("#rank").val(rank);
|
||||
if(type == 'Y') {
|
||||
$("#no_auto_setting_content"+rank).hide();
|
||||
} else {
|
||||
$("#no_auto_setting_content"+rank).show();
|
||||
$("#article_keyword"+rank).focus();
|
||||
}
|
||||
}
|
||||
|
||||
function search_article(rank){
|
||||
$("#rank").val(rank);
|
||||
|
||||
var article_keyword = $("#article_keyword"+rank).val();
|
||||
var article_sort = $(":input:radio[name=article_sort"+rank+"]:checked").val();
|
||||
|
||||
if(article_keyword == '') {
|
||||
alert("검색어를 입력해주세요");
|
||||
return false;
|
||||
}
|
||||
var form_data = {
|
||||
"content_type" : "1",
|
||||
"article_keyword" : article_keyword,
|
||||
"sort" : article_sort,
|
||||
"type" : 'JSON'
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/search/search_article_list',
|
||||
async : false,
|
||||
type : 'POST',
|
||||
dataType : 'JSON',
|
||||
data : form_data,
|
||||
success: function (rtnJson) {
|
||||
if(rtnJson.result_code == '0000') {
|
||||
if(article_sort==1) {
|
||||
data = sortJSON(rtnJson.result_data.list,'reg_date', '321'); // 123 or 321
|
||||
} else {
|
||||
data = sortJSON(rtnJson.result_data.list,'reg_date', '123'); // 123 or 321
|
||||
}
|
||||
$('#result_count'+rank).html(rtnJson.result_data.count);
|
||||
$('#result'+rank).empty();
|
||||
|
||||
|
||||
|
||||
if(rtnJson.result_data.count == 0) {
|
||||
$('#result'+rank).html("<li>검색된 내용이 없습니다.</li>");
|
||||
} else {
|
||||
for(key in data) {
|
||||
var title = data[key]['title'];
|
||||
title = title.replace(/'/g, "'");
|
||||
title = title.replace(/"/g, '"');
|
||||
|
||||
$('#result'+rank).append('<li class="title"><a href="javascript:;" onclick="select_article(\''+data[key]['idx']+'\', \''+title+'\');">'+title+'</a></li>');
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
alert("뉴스검색에 실패했습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
error: function(jqXHR, exception) {
|
||||
console.log(jqXHR);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function select_article(idx, title){
|
||||
var rank = $("#rank").val();
|
||||
var index = ($("input[name=\"relation_idxs"+rank+"[]\"]").length)+1;
|
||||
$('#selected_news'+rank).append('<li><input type="checkbox" name="relation_idxs'+rank+'[]" id="relation_idx'+rank+'_'+index+'" value="'+idx+'" onclick="delete_article('+index+', '+rank+');"> <a href="/web/news/news_view/'+idx+'" target="_blank">'+title+'</a></li>');
|
||||
$("input[name='relation_idxs"+rank+"[]'][value=" + idx + "]").attr("checked", true);
|
||||
}
|
||||
|
||||
function delete_article(idx, rank) {
|
||||
$("#rank").val(rank);
|
||||
var checkbox_id = 'relation_idx'+rank+'_'+idx;
|
||||
if($('input:checkbox[id=checkbox_id]').is(":checked") == false){
|
||||
$("#"+checkbox_id).parent().remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function weather_list_reg_proc(){
|
||||
for(i=1;i<=10;i++) {
|
||||
if($("#continent"+i).val()!='') {
|
||||
if($("#country"+i).val()==''){
|
||||
alert("나라를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#weather_icon"+i).val()=='') {
|
||||
alert("날씨아이콘을 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#weather_content"+i).val()=='') {
|
||||
alert("날씨코멘트를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var is_auto_setting = $("input[type=radio][id=is_auto_setting"+i+"]:checked").val();
|
||||
if(is_auto_setting == 'Y' && $("#tag"+i).val()=='') {
|
||||
alert("관련뉴스를 자동설정 하시려면 tag가 필요합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
// 아이콘 이미지 선택
|
||||
$(".icon_list a").click(function(){
|
||||
$(".icon_list a").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
408
application/views/admin/etc_section/weather_reg.php
Executable file
408
application/views/admin/etc_section/weather_reg.php
Executable file
@@ -0,0 +1,408 @@
|
||||
<?php
|
||||
include_once ("./static_data/continent.php");
|
||||
|
||||
if($mode=='edit') {
|
||||
$continent = $result['continent'];
|
||||
$country = $result['country'];
|
||||
$weather_icon = $result['weather_icon'];
|
||||
$weather_content = $result['weather_content'];
|
||||
$weather_content = htmlspecialchars($weather_content);
|
||||
$reg_date = $result['reg_date'];
|
||||
$display_status = $result['display_status'];
|
||||
$display_date = $result['display_date'];
|
||||
$tag = $result['tag'];
|
||||
$tag = str_replace(" ", ",", $tag);
|
||||
$is_auto_setting = $result['is_auto_setting'];
|
||||
$rank = $result['rank'];
|
||||
|
||||
$continent_key_tmp = array_keys($arr_continent1, $continent);
|
||||
$continent_key = $continent_key_tmp[0];
|
||||
} else {
|
||||
$continent = '';
|
||||
$country = '';
|
||||
$weather_icon = '';
|
||||
$weather_content = '';
|
||||
$display_status = '';
|
||||
$display_date = date("Y-m-d");
|
||||
$tag = '';
|
||||
$is_auto_setting = 'Y';
|
||||
$rank = '';
|
||||
$arr_relation_article = array();
|
||||
}
|
||||
|
||||
|
||||
$menu_code = '65';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
|
||||
<link rel="stylesheet" href="<?=DIR_CSS?>/jquery-ui.min.css" />
|
||||
<script src="<?=DIR_JS?>/jquery-ui.min.js"></script>
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/etc_section/weather_reg_proc" method="post">
|
||||
<input type="hidden" name="idx" id="idx" value="<?=$idx?>">
|
||||
<input type="hidden" id="search_type" name="search_type" value="<?=$search_type?>">
|
||||
<input type="hidden" id="search_keyword" name="search_keyword" value="<?=$search_keyword?>">
|
||||
<input type="hidden" id="search_display_status" name="search_display_status" value="<?=$search_display_status?>">
|
||||
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
|
||||
<input type="hidden" id="page" name="page" value="<?=$page?>">
|
||||
<input type="hidden" id="key" name="key">
|
||||
|
||||
|
||||
<div class="common_table news">
|
||||
<h2 class="subtitle">영적기상도 등록</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th>대륙</th>
|
||||
<td class="tl">
|
||||
<select name="continent" id="continent" onchange="change_continent(this.value)">
|
||||
<option value="">선택</option>
|
||||
<? foreach ($arr_continent1 as $key=>$val) {?>
|
||||
<option value="<?=$key?>" <? if($continent==$val) { echo 'selected';}?>><?=$val?></option>
|
||||
|
||||
<? }?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>나라</th>
|
||||
<td class="tl">
|
||||
<select name="country" id="country">
|
||||
<option value="">선택</option>
|
||||
<? if(isset($arr_continent2[$continent_key])==true) {
|
||||
foreach ($arr_continent2[$continent_key] as $val) {
|
||||
?>
|
||||
<option value="<?=$val?>" <? if($country==$val) { echo 'selected';}?>><?=$val?></option>
|
||||
<? }
|
||||
|
||||
}?>
|
||||
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>날씨아이콘</th>
|
||||
<td class="tl">
|
||||
<button type="button" class="btn_black" style="width:100px" onclick="view_icon();" style="cursor: pointer;">선택하기</button>
|
||||
<input type="hidden" name="weather_icon" id="weather_icon" value="<?=$weather_icon?>">
|
||||
<div id="icon_img">
|
||||
<? if($weather_icon!='') { ?>
|
||||
<img src="<?=$weather_icon?>" width="50px">
|
||||
<? } ?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>날씨코멘트</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="weather_content" id="weather_content" value="<?=$weather_content?>">
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>순위</th>
|
||||
<td class="tl">
|
||||
<select name="rank" id="rank">
|
||||
<option value="">선택</option>
|
||||
<? for ($i=1; $i<=10; $i++) {?>
|
||||
<option value="<?=$i?>" <? if($rank==$i) { echo 'selected';}?>><?=$i?>위</option>
|
||||
<? }?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>등록일시</th>
|
||||
<td class="tl">
|
||||
<? if($mode=='add' || $display_status == '0') {?>
|
||||
<input type="text" name="display_date" id="display_date" value="<?=$display_date?>" class="type02" size="10">
|
||||
<?
|
||||
} else {
|
||||
?>
|
||||
<?=$reg_date?>
|
||||
|
||||
<?}?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>태그</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="tag" id="tag" class="type01" value="<?=$tag?>"> 최대 5개까지 입력 가능(,로 구분해주세요.)
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>관련뉴스</th>
|
||||
<td class="tl">
|
||||
<input type="radio" name="is_auto_setting" id="is_auto_setting" onclick="click_relation_news_auto_setting('Y');" value="Y" <? if($is_auto_setting=='Y') { echo 'checked';}?>> 자동설정
|
||||
<input type="radio" name="is_auto_setting" id="is_auto_setting" onclick="click_relation_news_auto_setting('N');" value="N" <? if($is_auto_setting=='N') { echo 'checked';}?>> 수정설정
|
||||
<div class="two_box_type01 clearfix" id="no_auto_setting_content" style="display:none; margin-top:10px;">
|
||||
<div class="con">
|
||||
<div class="searh_area fn mb10">
|
||||
<input type="text" name="article_keyword" id="article_keyword" class="input00" size="20" placeholder="검색어 입력" onkeypress="if( event.keyCode==13 ){search_article();}">
|
||||
<a href="javascript:search_article();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
<div class="mb10">
|
||||
<input type="radio" name="article_sort" id="article_sort" value="1" onclick="search_article();" checked> 최신순
|
||||
<input type="radio" name="article_sort" id="article_sort" value="2" onclick="search_article();"> 오래된순
|
||||
|
||||
검색결과 <span class="mark" id="result_count">0</span>건
|
||||
</div>
|
||||
<div class="list scs">
|
||||
<ul id="result">
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="con">
|
||||
<h3 class="mb10">선택된 뉴스 항목</h3>
|
||||
<div class="list type02 scs">
|
||||
<ul id="selected_news">
|
||||
<? $i=1;
|
||||
foreach ($arr_relation_article as $val) { ?>
|
||||
<li><input type="checkbox" name="relation_idxs[]" id="relation_idx_<?=$i?>" value="<?=$val['relation_article_idx']?>" onclick="delete_article('<?=$i?>');" checked><a href="/web/news/news_view/<?=$val['relation_article_idx']?>" target="_blank"><?=$val['title']?></a></li>
|
||||
<?
|
||||
$i++;
|
||||
} ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
|
||||
|
||||
</table>
|
||||
</div>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:weather_reg_proc();">저장하기</a>
|
||||
<a href="/admin/etc_section/weather_list/6/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_display_status=<?=$search_display_status?>">목록으로</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="icon_reg_layer" style="display:none">
|
||||
<div class="black_board" style="display:block"></div>
|
||||
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
|
||||
<a href="javascript:commonLayerClose('icon_reg_layer')" class="pop_close">x</a>
|
||||
<h2>채널아이콘</h2>
|
||||
<table>
|
||||
<tr>
|
||||
<th style="width:150px">아이콘선택</th>
|
||||
<td class="tl">
|
||||
<div class="icon_list" style="overflow-y: scroll; height:150px;">
|
||||
<? foreach ($weather_icon_list as $val) {?>
|
||||
<a href="#;" class="por">
|
||||
<input type="radio" name="sel_weather_icon" id="sel_weather_icon" class="stebox" value="<?=$val['weather_icon']?>">
|
||||
<img src="<?=$val['weather_icon']?>" width="50px" />
|
||||
</a>
|
||||
<? }?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:select_weather_icon('add')">적용하기</a>
|
||||
<a href="javascript:commonLayerClose('icon_reg_layer')">취소하기</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</form>
|
||||
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
<? if($is_auto_setting=='N') {?>
|
||||
$("#no_auto_setting_content").show();
|
||||
<? }?>
|
||||
// 대륙변경
|
||||
function change_continent(val){
|
||||
var json_category = '<?=json_encode($arr_continent2)?>';
|
||||
json_category = eval(json_category);
|
||||
|
||||
$('#country').empty();
|
||||
var option = "<option value=''>선택</option>";
|
||||
$('#country').append(option);
|
||||
for(key in json_category[val]) {
|
||||
option = $("<option value='"+json_category[val][key]+"'>"+json_category[val][key]+"</option>");
|
||||
$('#country').append(option);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 아이콘 보기
|
||||
function view_icon(){
|
||||
commonLayerOpen('icon_reg_layer')
|
||||
|
||||
}
|
||||
|
||||
// 아이콘 적용
|
||||
function select_weather_icon(){
|
||||
var weather_icon = $("input[type=radio][id=sel_weather_icon]:checked").val();
|
||||
|
||||
if(weather_icon == '' || weather_icon == undefined) {
|
||||
alert("적용할 아이콘이 없습니다.");
|
||||
} else {
|
||||
$("#weather_icon").val(weather_icon);
|
||||
$("#icon_img").empty();
|
||||
$("#icon_img").html('<img src="'+weather_icon+'" width="50px">');
|
||||
}
|
||||
|
||||
commonLayerClose('icon_reg_layer')
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 관련뉴스검색
|
||||
function click_relation_news_auto_setting(type){
|
||||
if(type == 'Y') {
|
||||
$("#no_auto_setting_content").hide();
|
||||
|
||||
} else {
|
||||
$("#no_auto_setting_content").show();
|
||||
$("#article_keyword").focus();
|
||||
}
|
||||
}
|
||||
|
||||
function search_article(){
|
||||
var article_keyword = $("#article_keyword").val();
|
||||
var article_sort = $(":input:radio[name=article_sort]:checked").val();
|
||||
|
||||
if(article_keyword == '') {
|
||||
alert("검색어를 입력해주세요");
|
||||
return false;
|
||||
}
|
||||
var form_data = {
|
||||
"content_type" : "<?=DEF_NEWS_CODE?>",
|
||||
"article_keyword" : article_keyword,
|
||||
"sort" : article_sort,
|
||||
"type" : 'JSON'
|
||||
};
|
||||
$.ajax({
|
||||
url: '/admin/search/search_article_list',
|
||||
async : false,
|
||||
type : 'POST',
|
||||
dataType : 'JSON',
|
||||
data : form_data,
|
||||
success: function (rtnJson) {
|
||||
if(rtnJson.result_code == '0000') {
|
||||
if(article_sort==1) {
|
||||
data = sortJSON(rtnJson.result_data.list,'reg_date', '321'); // 123 or 321
|
||||
} else {
|
||||
data = sortJSON(rtnJson.result_data.list,'reg_date', '123'); // 123 or 321
|
||||
}
|
||||
$('#result_count').html(rtnJson.result_data.count);
|
||||
$('#result').empty();
|
||||
|
||||
|
||||
|
||||
if(rtnJson.result_data.count == 0) {
|
||||
$('#result').html("<li>검색된 내용이 없습니다.</li>");
|
||||
} else {
|
||||
for(key in data) {
|
||||
var title = data[key]['title'];
|
||||
title = title.replace(/'/g, "'");
|
||||
title = title.replace(/"/g, '"');
|
||||
|
||||
$('#result').append('<li class="title"><a href="javascript:;" onclick="select_article(\''+data[key]['idx']+'\', \''+title+'\');">'+title+'</a></li>');
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
alert("뉴스검색에 실패했습니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
},
|
||||
error: function(jqXHR, exception) {
|
||||
console.log(jqXHR);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function select_article(idx, title){
|
||||
var index = ($("input[name=\"relation_idxs[]\"]").length)+1;
|
||||
$('#selected_news').append('<li><input type="checkbox" name="relation_idxs[]" id="relation_idx_'+index+'" value="'+idx+'" onclick="delete_article('+index+');"> <a href="/web/news/news_view/'+idx+'" target="_blank">'+title+'</a></li>');
|
||||
$("input[name='relation_idxs[]'][value=" + idx + "]").attr("checked", true);
|
||||
}
|
||||
|
||||
function delete_article(idx) {
|
||||
var checkbox_id = 'relation_idx_'+idx;
|
||||
if($('input:checkbox[id=checkbox_id]').is(":checked") == false){
|
||||
$("#"+checkbox_id).parent().remove();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// 저장
|
||||
function weather_reg_proc(){
|
||||
if($("#continent").val()==''){
|
||||
alert("대륙을 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#country").val()==''){
|
||||
alert("나라를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
if($("#weather_icon").val()=='') {
|
||||
alert("날씨이미지를 선택해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#weather_content").val()=='') {
|
||||
alert("날씨코멘트를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#rank").val()=='') {
|
||||
alert("순위를 입력해주세요.");
|
||||
return false;
|
||||
}
|
||||
|
||||
var is_auto_setting = $("input[type=radio][id=is_auto_setting]:checked").val();
|
||||
if(is_auto_setting == 'Y' && $("#tag").val()=='') {
|
||||
alert("관련뉴스를 자동설정 하시려면 tag가 필요합니다.");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
// 아이콘 이미지 선택
|
||||
$(".icon_list a").click(function(){
|
||||
$(".icon_list a").removeClass("on");
|
||||
$(this).addClass("on");
|
||||
});
|
||||
|
||||
|
||||
// jquery datepicker
|
||||
$("#display_date").datepicker({
|
||||
inline: true,
|
||||
dateFormat: 'yy-mm-dd',
|
||||
buttonImage:"/img/admin/btn_date.jpg",
|
||||
showOn: "both",
|
||||
buttonImageOnly: true
|
||||
|
||||
});
|
||||
$('img.ui-datepicker-trigger').css({'cursor':'pointer', 'width':'30px'}); //아이콘(icon) 위치
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user