first commit

This commit is contained in:
pakerpale
2020-06-10 06:19:03 +09:00
commit cd6b5b7832
6081 changed files with 624389 additions and 0 deletions

View File

@@ -0,0 +1,191 @@
<?php
include_once ("./static_data/code.php");
if($search_comment_type == 'Y') {
$menu_code = '262';
} else {
$menu_code = '261';
}
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/news/news_comment_list/2">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="search_comment_type" name="search_comment_type" value="<?=$search_comment_type?>">
<input type="hidden" id="search_today" name="search_today" value="<?=$search_today?>">
<input type="hidden" id="search_today_best" name="search_today_best" value="<?=$search_today_best?>">
<input type="hidden" id="idx" name="idx">
<input type="hidden" id="mode" name="mode">
<div class="common_table clearfix type01">
<div class="searh_area">
<select name="search_type" id="search_type">
<option value="">선택</option>
<option value="write_name" <? if($search_type=='write_name'){ echo 'selected';}?>>닉네임</option>
<option value="write_id" <? if($search_type=='write_id'){ echo 'selected';}?>>아이디</option>
<option value="comment" <? if($search_type=='comment'){ 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 clearfix">
<span style="font-weight:bold">Total:</span> <?=number_format($total_count);?>
<a href="javascript:search_today();"><span style="font-weight:bold">오늘신규:</span> <?=number_format($new_count);?></a>
<a href="/admin/news/news_comment_list/2?search_comment_type=Y"><span style="font-weight:bold" class="text_red">배댓전체:</span> <?=number_format($best_count);?></a>
<a href="javascript:search_today_best();"><span style="font-weight:bold" class="text_blue">오늘의배댓:</span> <?=number_format($best_new_count);?></a>
<div class="searh_area">
<select name="search_news_type" onchange="check_search();">
<option value="">기능별</option>
<? foreach ($def_arr_news_type as $key=>$val) {?>
<option value="<?=$key?>" <? if($search_news_type==$key){ echo 'selected';}?>><?=$val?></option>
<? }?>
</select>
<select name="search_theme_type" onchange="check_search();">
<option value="">테마별</option>
<? foreach ($def_arr_news_theme as $val) {?>
<option value="<?=$val['code']?>" <? if($search_theme_type==$val['code']){ echo 'selected';}?>><?=$val['name']?></option>
<? }?>
</select>
</div>
</div>
<div class="common_table">
<table>
<?
if(count($list)==0) {
?>
<tr><td>등록된 내용이 없습니다.</td></tr>
<?
} else {
$now_date = date("Y-m-d");
$dataNumber = ($total_count + $limit)-($page*$limit);
foreach($list as $val) {
$idx = $val['idx'];
$p_idx = $val['p_idx'];
$member_img = $val['member_img'];
$write_name = $val['write_name'];
$write_id = $val['write_id'];
$reg_date = $val['reg_date'];
$like_count = $val['like_count'];
$bad_count = $val['bad_count'];
$title = $val['title'];
$press_name = $val['press_name'];
$reporter_name = $val['reporter_name'];
$news_type = $val['news_type'];
$theme_types = $val['theme_types'];
$comment = $val['comment'];
$category_name1 = $val['category_name1'];
$category_name2 = $val['category_name2'];
$category_name3 = $val['category_name3'];
$content_idx = $val['content_idx'];
$is_best = $val['is_best'];
$best_txt = '';
if($is_best == 'Y') {
$best_txt = '[best]';
}
$category_name = $category_name1;
if($category_name2!='') $category_name.= '> '.$category_name2;
if($category_name3!='') $category_name.= '> '.$category_name3;
$parent_comment = '';
if($p_idx!=$idx) {
# model - 카테고리 list
$ci=& get_instance();
$ci->load->model('admin/comm/m_comment');
$arr_parent_comment = $ci->m_comment->comment_where_p_idx_select($p_idx);
if(count($arr_parent_comment) > 0) {
$parent_comment = '</br></br>---------------- 원댓글 내용 --------------------</br>';
$parent_comment.= $arr_parent_comment['comment'];
}
}
$comment = $comment.$parent_comment.'<p>&nbsp;</p>';
?>
<tr>
<th style="text-align: left">
<img src="<?=$member_img?>" width="25"> <?=$write_name?>(<?=$write_id?>) <?=$reg_date?>
</th>
<th style="text-align: right">
<?=$best_txt?> <img src="/img/web/img_thumbup.jpg" style="vertical-align:middle;margin-top:-3px;"><?=number_format($like_count)?> <img src="/img/web/img_thumbdown.jpg" style="vertical-align:middle;margin-top:-3px;"><?=number_format($bad_count)?>
<button type="button" class="btn_s_blue" style="width:40px" onclick="news_comment_del_proc('<?=$idx?>');" style="cursor: pointer;">삭제</button>
</th>
</tr>
<tr>
<td style="text-align: left">
<a href="/web/news/news_view/<?=$content_idx?>" target="_blank">[<?=$category_name?>]</br><?=$title?></a>
</td>
<td style="text-align:right"><?=$def_arr_news_type[$news_type]?> | <?=$press_name?> | <?=$reporter_name?>기자</td>
</tr>
<tr>
<td style="text-align:left;vertical-align: top" colspan="2"><?=$comment?></td>
</tr>
<?
$dataNumber--;
}
}
?>
</table>
<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_today(){
$("#search_today").val('Y');
$("#input_form").submit();
}
function search_today_best(){
$("#search_today_best").val('Y');
$("#input_form").submit();
}
// 삭제
function news_comment_del_proc(idx) {
if(confirm("댓글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/news/news_comment_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
</script>

View File

@@ -0,0 +1,356 @@
<?php
$arr_category_add1 = array();
$arr_category_add2 = array();
$arr_category_add3 = array();
foreach ($arr_category as $key=>$val) {
if($val['depth'] == '1') {
$arr_category_add1[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '2') {
$arr_category_add2[$val['p_category_code']][] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '3') {
$arr_category_add3[$val['p_category_code']][] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
}
}
$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'];
$menu_code = '23';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
$colspan = '14';
?>
<form name="input_form" id="input_form" method="post" action="/admin/news/news_list/2">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="search_news_type" name="search_news_type" value="<?=$search_news_type?>">
<input type="hidden" id="idx" name="idx">
<input type="hidden" id="mode" name="mode">
<input type="hidden" id="search_click1" name="search_click1" value="<?=$search_click1?>">
<input type="hidden" id="search_click2" name="search_click2" value="<?=$search_click2?>">
<div class="common_tep clearfix type01">
<ul class="clearfix">
<li><a href="/admin/news/news_list/2" <? if($search_news_type=='') { echo 'class="on"';}?>>전체</a></li>
<li><a href="/admin/news/news_list/2?search_news_type=1" <? if($search_news_type=='1') { echo 'class="on"';}?>>일반뉴스</a></li>
<li><a href="/admin/news/news_list/2?search_news_type=2" <? if($search_news_type=='2') { echo 'class="on"';}?>>포토뉴스</a></li>
<li><a href="/admin/news/news_list/2?search_news_type=3" <? if($search_news_type=='3') { echo 'class="on"';}?>>동영상뉴스</a></li>
<li><a href="/admin/news/news_list/2?search_news_type=4" <? if($search_news_type=='4') { echo 'class="on"';}?>>영상링크뉴스</a></li>
</ul>
<div class="searh_area">
<select name="search_type" id="search_type">
<option value="">선택</option>
<option value="title" <? if($search_type=='title'){ echo 'selected';}?>>제목</option>
<option value="press_name" <? if($search_type=='press_name'){ echo 'selected';}?>>언론사</option>
<option value="reporter_name" <? if($search_type=='reporter_name'){ echo 'selected';}?>>기자</option>
<option value="tag" <? if($search_type=='tag'){ 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>
<!-- 20190226추가 -->
<div class="write_btn">
<a href="javascript:news_arr_del_proc();">삭제</a>
<a href="javascript:news_add();">뉴스등록</a>
</div>
<!-- -->
<div class="common_table" style="margin-top: 30px">
<? if($search_type=='tag' && $search_keyword!='') {?><h2 class="subtitle"><?=$search_keyword?></h2><? }?>
<span style="font-weight:bold">Total:</span> <?=number_format($total_count);?>
<a href="javascript:click_search('1', 'search_click1');"><span style="margin-left: 5px;font-weight:bold">오늘신규:</span> <?=number_format($new_count);?></a>
<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:click_search('1', 'search_click2');"><span class="text_blue">출력중: <?=number_format($is_display1)?></span></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:click_search('2', 'search_click2');"><span class="text_red">예약중: <?=number_format($is_display2)?></span></a>
</span>
<div class="searh_area">
<select name="search_category_code1" onchange="category_search()" class="type01">
<option value="">1차섹션</option>
<? if(count($arr_category_add1) > 0) {
foreach ($arr_category_add1 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" onchange="category_search()" class="type01">
<option value="">2차섹션</option>
<? if(isset($arr_category_add2[$search_category_code1])==true) {
foreach ($arr_category_add2[$search_category_code1] as $val) {
?>
<option value="<?=$val['category_code']?>" <? if($search_category_code2==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
}
?>
</select>
<select name="search_category_code3" onchange="category_search()" class="type01">
<option value="">3차섹션</option>
<? if(isset($arr_category_add3[$search_category_code2])==true) {
foreach ($arr_category_add3[$search_category_code2] as $val) {?>
<option value="<?=$val['category_code']?>" <? if($search_category_code3==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
} ?>
</select>
</div>
</div>
<!-- 테이블 시작-->
<div class="common_table">
<table>
<thead>
<th><input type="checkbox" name="allcheck" id="allcheck"></th>
<th>번호</th>
<th>썸네일</th>
<th>섹션</th>
<th>기능</th>
<th>제목</th>
<th>언론사</th>
<th>기자</th>
<th>등록일시</br>(예약일시)</th>
<th>상태</th>
<th>조회수</th>
<th>좋아요</th>
<th>댓글수</th>
<? if($search_type=='tag' && $search_keyword!='' ) {
$colspan="15";
?>
<th>태그</th>
<? }?>
<th>관리</th>
</thead>
<tbody>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="<?=$colspan?>">등록된 내용이 없습니다.</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'];
$category_code = $val['category_code'];
$category_name1 = $val['category_name1'];
$news_type = $val['news_type'];
$press_name = $val['press_name'];
$reporter_name = $val['reporter_name'];
$reg_date = $val['reg_date'];
$hit_count = $val['hit_count'];
$like_count = $val['review_count1'];
$comment_count = $val['comment_count'];
$is_display = $val['is_display'];
$display_date = $val['display_date'];
$tag = $val['tag'];
switch ($news_type) {
case '1': $news_type_txt = '일반뉴스'; break;
case '2': $news_type_txt = '포토뉴스'; break;
case '3': $news_type_txt = '동영상뉴스'; break;
case '4': $news_type_txt = '영상링크뉴스'; break;
}
$display_date_txt = '';
if($is_display == 'N') {
$display_date_txt = '</br><span class="text_green">('.$display_date.')</span>';
}
$arr_tag = explode(" ", $tag);
$tag_count = count($arr_tag);
$tag_txt = '';
foreach ($arr_tag as $key=>$val) {
if($key > 0) $tag_txt.= ', ';
$tag_txt.='<a href="/admin/news/news_list/2?search_type=tag&search_keyword='.$val.'" class="text_blue">'.$val.'</a>';
if($key==2) break;
}
if($tag_count > 3) {
$tag_txt.=' 외 '.($tag_count-3).'개';
}
$category_code1 = substr($category_code, 0, 2);
$new = '';
if($reg_date == $now_date) $new = '<img src="/img/admin/board/icon_new.gif" style="vertical-align:middle;margin-top:-3px;" border="0"> ';
?>
<tr>
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
<td><?=$dataNumber?></td>
<td><img src="<?=$main_img?>" width="35"></td>
<td><a href="/admin/news/news_list/2?search_category_code1=<?=$category_code1?>"><?=$category_name1?></a></td>
<td><?=$news_type_txt?></td>
<td style="text-align:left;" class="title"><a href="javascript:news_edit('<?=$idx?>')"><?=$new?><?=$title?></a></td>
<td><?=$press_name?></td>
<td><?=$reporter_name?></td>
<td><?=$reg_date?><?=$display_date_txt?></td>
<td>
<? if($is_display == 'N') {?>
<select name="is_display_<?=$idx?>" id="is_display_<?=$idx?>" onchange="change_is_display(this);">
<option value="Y" <? if($is_display=='Y') { echo 'selected';}?>>출력</option>
<option value="N" <? if($is_display=='N') { echo 'selected';}?>>예약</option>
</select>
<? } else {
echo '출력';
}
?>
</td>
<td><?=$hit_count?></td>
<td><?=$like_count?></td>
<td><?=$comment_count?></td>
<? if($search_type=='tag' && $search_keyword!='' ) {?>
<td class="text_blue"><?=$tag_txt?></td>
<? }?>
<td class="tool_btn">
<a href="javascript:news_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
<a href="javascript:news_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
</td>
</tr>
<?
$dataNumber--;
}
}
?>
</tbody>
</table>
</div>
<div class="write_btn">
<a href="javascript:news_arr_del_proc();">삭제</a>
<a href="javascript:news_add();">뉴스등록</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 click_search(type, id){
$("#"+id).val(type);
$("#input_form").submit();
}
function category_search(){
$("#input_form").submit();
}
function news_add(){
$("#mode").val('add');
$("#input_form").attr("action", "/admin/news/news_reg/2");
$("#input_form").submit();
}
// edit
function news_edit(idx){
$("#idx").val(idx);
$("#mode").val('edit');
$("#input_form").attr("action", "/admin/news/news_reg/2");
$("#input_form").submit();
}
// 삭제
function news_del_proc(idx) {
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/news/news_reg_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
// 복수 삭제
function news_arr_del_proc() {
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
alert("삭제할 내용이 없습니다.");
return false;
}
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#input_form").attr("action", "/admin/news/news_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);
}
})
})
function change_is_display(t){
var val = t.value;
var select_id = t.id;
var idx = select_id.replace("is_display_", "");
var form_data = {
"is_display" : val,
"idx" : idx
};
$.ajax({
url: '/admin/news/news_is_display_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>

View File

@@ -0,0 +1,145 @@
<?php
include_once ("./static_data/code.php");
$head_title = $result['head_title'];
$head_title = htmlspecialchars($head_title);
$title = $result['title'];
$title = htmlspecialchars($title);
$sub_content = $result['sub_content'];
$sub_content = htmlspecialchars($sub_content);
$content_idx = $result['content_idx'];
$hit_count = $result['hit_count'];
$review_count1 = $result['review_count1'];
$comment_count = $result['comment_count'];
$main_img = $result['main_img'];
$ranking_type = $result['ranking_type'];
$rank = $result['rank'];
$press_name = $result['press_name'];
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
$menu_code = '25';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
$rowspan='6';
?>
<form name="input_form" id="input_form" action="/admin/news/news_ranking_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_ranking_type" value="<?=$search_ranking_type?>">
<input type="hidden" id="search_category_code1" name="search_category_code1" value="<?=$search_category_code1?>">
<input type="hidden" id="search_category_code2" name="search_category_code2" value="<?=$search_category_code2?>">
<input type="hidden" id="search_category_code3" name="search_category_code3" value="<?=$search_category_code3?>">
<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="mode" name="ranking_type" value="<?=$ranking_type?>">
<div class="common_table">
<h2 class="subtitle"><?=$def_arr_ranking[$ranking_type]['name']?></h2>
<table>
<tr>
<th rowspan="<?=$rowspan?>"><?=$rank?>위(썸네일)</th>
<td class="tl">
<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" class="type00" size="50" placeholder="제목을 입력해주세요." value="<?=$title?>">
</td>
</tr>
<tr>
<td class="tl">
<textarea id="sub_content" name="sub_content" placeholder="기사 간략 노출(2줄)" rows="2" cols="80"><?=$sub_content?></textarea>
</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">
</td>
</tr>
<tr>
<td class="tl">
<input type="text" name="press_name" id="press_name" class="type03" placeholder="언론사명" value="<?=$press_name?>" readonly>
</td>
</tr>
<? if($ranking_type == '1') {?>
<tr>
<td class="tl">
<input type="text" name="hit_count" id="hit_count" class="type03" size="20" placeholder="조회수" value="<?=$hit_count?>">
</td>
</tr>
<? } else if($ranking_type == '2') {?>
<tr>
<td class="tl">
<input type="text" name="comment_count" id="comment_count" class="type03" size="20" placeholder="댓글수" value="<?=$comment_count?>" readonly>
</td>
</tr>
<? } else if($ranking_type == '3') {?>
<tr>
<td class="tl">
<input type="text" name="review_count" id="review_count" class="type03" size="20" placeholder="공감수" value="<?=$review_count1?>">
</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:news_ranking_list_reg_proc();">저장하기</a>
<a href="/admin/news/news_ranking_list/2/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_ranking_type=<?=$search_ranking_type?>&search_category_code1=<?=$search_category_code1?>&search_category_code2=<?=$search_category_code2?>&search_category_code3=<?=$search_category_code3?>&sort=<?=$sort?>">목록으로</a>
</div>
</form>
<? 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 news_ranking_list_reg_proc(){
if($("#title").val()!='') {
if($("#content_idx").val()==''){
alert("기사를 선택해주세요.");
return false;
}
if($("#main_img").val()=='' && $("#img").val()=='' && $("#org_img").val()=='') {
alert("메인이미지를 입력해주세요.");
return false;
}
}
$("#input_form").submit();
}
</script>

View File

@@ -0,0 +1,270 @@
<?php
include_once ("./static_data/code.php");
$arr_category_add1 = array();
$arr_category_add2 = array();
$arr_category_add3 = array();
foreach ($arr_category as $key=>$val) {
if($val['depth'] == '1') {
$arr_category_add1[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '2') {
$arr_category_add2[$val['p_category_code']][] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '3') {
$arr_category_add3[$val['p_category_code']][] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
}
}
$menu_code = '251';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/news/news_ranking_list/2">
<input type="hidden" id="search_ranking_type" name="search_ranking_type" value="<?=$search_ranking_type?>">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="search_click1" name="search_click1" value="<?=$search_click1?>">
<input type="hidden" id="idx" name="idx">
<input type="hidden" id="mode" name="mode">
<div class="common_tep clearfix type01">
<ul class="clearfix">
<li><a href="/admin/news/news_ranking_list/2" <? if($search_ranking_type=='') { echo 'class="on"';}?>>전체</a></li>
<? foreach($def_arr_ranking as $val) {
$css = '';
if($search_ranking_type == $val['code']) {
$css = ' class="on"';
}
?>
<li><a href="/admin/news/news_ranking_list/2?search_ranking_type=<?=$val['code']?>" <?=$css?>><?=$val['name']?></a></li>
<? }?>
</ul>
<div class="searh_area">
<select name="search_type" id="search_type">
<option value="">선택</option>
<option value="title" <? if($search_type=='title'){ echo 'selected';}?>>제목</option>
<option value="press_name" <? if($search_type=='press_name'){ echo 'selected';}?>>언론사</option>
<option value="reporter_name" <? if($search_type=='reporter_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_table clearfix" style="margin-top: 30px">
<span style="font-weight:bold">Total:</span> <?=number_format($total_count);?>
<a href="javascript:click_search('1', 'search_click1');"><span style="font-weight:bold">오늘신규:</span> <?=number_format($new_count);?></a>
<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_code1" onchange="category_search()">
<option value="">1차섹션</option>
<? if(count($arr_category_add1) > 0) {
foreach ($arr_category_add1 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" onchange="category_search()">
<option value="">2차섹션</option>
<? if(isset($arr_category_add2[$search_category_code1])==true) {
foreach ($arr_category_add2[$search_category_code1] as $val) {
?>
<option value="<?=$val['category_code']?>" <? if($search_category_code2==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
}
?>
</select>
<select name="search_category_code3" onchange="category_search()">
<option value="">3차섹션</option>
<? if(isset($arr_category_add3[$search_category_code2])==true) {
foreach ($arr_category_add3[$search_category_code2] as $val) {?>
<option value="<?=$val['category_code']?>" <? if($search_category_code3==$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>
<th>댓글수</th>
<th>관리</th>
</tr>
</thead>
<tbody>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="14">등록된 내용이 없습니다.</td>
</tr>
<?
} else {
$now_date = date("Y-m-d");
foreach($list as $val) {
$idx = $val['idx'];
$title = $val['title'];
$main_img = $val['main_img'];
$category_name1 = $val['category_name1'];
$category_code = $val['category_code'];
$ranking_type = $val['ranking_type'];
$press_name = $val['press_name'];
$reporter_name = $val['reporter_name'];
$reg_date = $val['reg_date'];
$hit_count = $val['hit_count'];
$like_count = $val['like_count'];
$comment_count = $val['comment_count'];
$reg_date = $val['reg_date'];
$display_date = $val['display_date'];
$is_display = $val['is_display'];
$rank = $val['rank'];
$content_idx = $val['content_idx'];
$ranking_type_txt = $def_arr_ranking[$ranking_type]['name'];
$display_date_txt = '';
if($is_display == 'N') {
$display_date_txt = '</br><span class="text_green">('.$display_date.')</span>';
}
$category_code1 = substr($category_code, 0, 2);
?>
<tr>
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
<td><?=$rank?></td>
<td><img src="<?=$main_img?>" width="35"></td>
<td><a href="/admin/news/news_ranking_list/2?search_category_code1=<?=$category_code1?>"><?=$category_name1?></a></td>
<td><?=$ranking_type_txt?></td>
<td style="text-align:left;" class="title"><a href="/admin/news/news_reg/2?mode=edit&idx=<?=$content_idx?>"><?=$title?></a></td>
<td><?=$press_name?></td>
<td><?=$reporter_name?></td>
<td><?=$reg_date?><?=$display_date_txt?></td>
<td><?=$hit_count?></td>
<td><?=$like_count?></td>
<td><?=$comment_count?></td>
<td class="tool_btn">
<a href="javascript:news_ranking_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
<a href="javascript:news_ranking_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
</td>
</tr>
<?
}
}
?>
</tbody>
</table>
</div>
<div class="write_btn">
<a href="javascript:news_ranking_reg_arr_del_proc()">삭제</a>
<a href="javascript:news_ranking_list_reg()">송출관리</a>
<a href="/admin/news/news_reg/2?mode=add">뉴스등록</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 category_search(){
$("#input_form").submit();
}
function click_search(type, id){
$("#"+id).val(type);
$("#input_form").submit();
}
function news_ranking_list_reg(){
$("#mode").val('add');
$("#input_form").attr("action", "/admin/news/news_ranking_list_reg/2");
$("#input_form").submit();
}
// edit
function news_ranking_edit(idx){
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/news/news_ranking_edit/2");
$("#input_form").submit();
}
// 삭제
function news_ranking_del_proc(idx) {
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/news/news_ranking_reg_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
// 복수 삭제
function news_ranking_reg_arr_del_proc() {
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
alert("삭제할 내용이 없습니다.");
return false;
}
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#input_form").attr("action", "/admin/news/news_ranking_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>

View File

@@ -0,0 +1,181 @@
<?php
include_once ("./static_data/code.php");
$arr_ranking_list = array();
foreach ($arr_ranking as $val) {
$arr_ranking_list[$val['rank']] = array('content_idx'=> $val['content_idx'], 'head_title'=>$val['head_title'], 'title'=>$val['title'], 'sub_content'=>$val['sub_content'], 'main_img'=>$val['main_img'], 'hit_count'=>$val['hit_count'], 'comment_count'=>$val['comment_count'], 'review_count1'=>$val['review_count1'], 'press_name'=>$val['press_name']);
}
$menu_code = '25';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/news/news_ranking_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_ranking_type" name="search_ranking_type" value="<?=$search_ranking_type?>">
<input type="hidden" id="search_category_code1" name="search_category_code1" value="<?=$search_category_code1?>">
<input type="hidden" id="search_category_code2" name="search_category_code2" value="<?=$search_category_code2?>">
<input type="hidden" id="search_category_code3" name="search_category_code3" value="<?=$search_category_code3?>">
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
<input type="hidden" id="key" name="key">
<div class="common_table">
<table>
<tr>
<th>테마</th>
<td class="tl">
<? foreach($def_arr_ranking as $val) {?>
<input type="radio" name="ranking_type" value="<?=$val['code']?>" onclick="change_ranking_type('<?=$val['code']?>')" <? if($search_ranking_type==$val['code']) { echo 'checked';}?>> <?=$val['name']?>&nbsp;&nbsp;
<? }?>
</td>
</tr>
<?
for($i=1;$i<=$def_arr_ranking[$search_ranking_type]['count'];$i++) {
$head_title = '';
$title = '';
$sub_content = '';
$main_img = '';
$main_img_txt = '';
$content_idx = '';
$hit_count = '';
$review_count1 = '';
$comment_count = '';
$press_name = '';
if(isset($arr_ranking_list[$i])== true) {
$head_title = $arr_ranking_list[$i]['head_title'];
$head_title = htmlspecialchars($head_title);
$title = $arr_ranking_list[$i]['title'];
$title = htmlspecialchars($title);
$sub_content = $arr_ranking_list[$i]['sub_content'];
$sub_content = htmlspecialchars($sub_content);
$content_idx = $arr_ranking_list[$i]['content_idx'];
$hit_count = $arr_ranking_list[$i]['hit_count'];
$review_count1 = $arr_ranking_list[$i]['review_count1'];
$comment_count = $arr_ranking_list[$i]['comment_count'];
$main_img = $arr_ranking_list[$i]['main_img'];
$press_name = $arr_ranking_list[$i]['press_name'];
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
}
$rowspan='6';
?>
<tr>
<th rowspan="<?=$rowspan?>"><?=$i?>위(썸네일)</th>
<td class="tl">
<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" placeholder="말머리" value="<?=$head_title?>"> <input type="text" name="title<?=$i?>" id="title<?=$i?>" class="type00" placeholder="제목을 입력해주세요." value="<?=$title?>">
</td>
</tr>
<tr>
<td class="tl">
<textarea id="content<?=$i?>" name="content<?=$i?>" placeholder="기사 간략 노출(2줄)" rows="2" cols="80"><?=$sub_content?></textarea>
</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">
</td>
</tr>
<tr>
<td class="tl">
<input type="text" name="press_name<?=$i?>" id="press_name<?=$i?>" class="type03" placeholder="언론사명" value="<?=$press_name?>" readonly>
</td>
</tr>
<? if($search_ranking_type == '1') {?>
<tr>
<td class="tl">
<input type="text" name="hit_count<?=$i?>" id="hit_count<?=$i?>" class="type03" placeholder="조회수" value="<?=$hit_count?>">
</td>
</tr>
<? } else if($search_ranking_type == '2') {?>
<tr>
<td class="tl">
<input type="text" name="comment_count<?=$i?>" id="comment_count<?=$i?>" class="type03" size="20" placeholder="댓글수" value="<?=$comment_count?>" readonly>
</td>
</tr>
<? } else if($search_ranking_type == '3') {?>
<tr>
<td class="tl">
<input type="text" name="review_count<?=$i?>" id="review_count<?=$i?>" class="type03" size="20" placeholder="공감수" value="<?=$review_count1?>">
</td>
</tr>
<? } ?>
<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:news_ranking_list_reg_proc()">저장하기</a>
<a href="/admin/news/news_ranking_list/2/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_ranking_type=<?=$search_ranking_type?>&search_category_code1=<?=$search_category_code1?>&search_category_code2=<?=$search_category_code2?>&search_category_code3=<?=$search_category_code3?>&sort=<?=$sort?>">목록으로</a>
</div>
</form>
<? 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_ranking_type(ranking_code){
$("#search_ranking_type").val(ranking_code);
$("#input_form").attr("action", "/admin/news/news_ranking_list_reg/2");
$("#input_form").submit();
}
var ranking_count = "<?=$def_arr_ranking[$search_ranking_type]['count']?>";
function news_ranking_list_reg_proc(){
for(i=1;i<=ranking_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;
}
}
}
$("#input_form").submit();
}
</script>

View File

@@ -0,0 +1,208 @@
<?php
include_once ("./static_data/code.php");
$arr_category_add1 = array();
$arr_category_add2 = array();
$arr_category_add3 = array();
foreach ($arr_category as $key=>$val) {
if($val['depth'] == '1') {
$arr_category_add1[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '2') {
$arr_category_add2[$val['p_category_code']][] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '3') {
$arr_category_add3[$val['p_category_code']][] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
}
}
$menu_code = '252';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/news/news_ranking_log_list/2">
<input type="hidden" id="search_ranking_type" name="search_ranking_type" value="<?=$search_ranking_type?>">
<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><a href="/admin/news/news_ranking_log_list/2" <? if($search_ranking_type=='') { echo 'class="on"';}?>>전체</a></li>
<? foreach($def_arr_ranking as $val) {
$css = '';
if($search_ranking_type == $val['code']) {
$css = ' class="on"';
}
?>
<li><a href="/admin/news/news_ranking_log_list/2?search_ranking_type=<?=$val['code']?>" <?=$css?>><?=$val['name']?></a></li>
<? }?>
</ul>
<div class="searh_area">
<select name="search_type" id="search_type">
<option value="">선택</option>
<option value="title" <? if($search_type=='title'){ echo 'selected';}?>>제목</option>
<option value="press_name" <? if($search_type=='press_name'){ echo 'selected';}?>>언론사</option>
<option value="reporter_name" <? if($search_type=='reporter_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_table clearfix" style="margin-top: 30px">
<span style="font-weight:bold">Total:</span> <?=number_format($total_count);?>
<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: 5px"><input type="radio" name="sort" value="5" <? if($sort=='5') { echo 'checked';}?> onclick="check_search();"> 공유순</span>
<div class="searh_area">
<select name="search_category_code1" onchange="category_search()" class="type01">
<option value="">1차섹션</option>
<? if(count($arr_category_add1) > 0) {
foreach ($arr_category_add1 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" onchange="category_search()" class="type01">
<option value="">2차섹션</option>
<? if(isset($arr_category_add2[$search_category_code1])==true) {
foreach ($arr_category_add2[$search_category_code1] as $val) {
?>
<option value="<?=$val['category_code']?>" <? if($search_category_code2==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
}
?>
</select>
<select name="search_category_code3" onchange="category_search()" class="type01">
<option value="">3차섹션</option>
<? if(isset($arr_category_add3[$search_category_code2])==true) {
foreach ($arr_category_add3[$search_category_code2] as $val) {?>
<option value="<?=$val['category_code']?>" <? if($search_category_code3==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
} ?>
</select>&nbsp;&nbsp;&nbsp;&nbsp;
<select name="search_year" onchange="check_search()" class="type01">
<option value="">선택</option>
<? for ($i=2018;$i<=date("Y");$i++) {?>
<option value="<?=$i?>" <? if($search_year==$i) { echo 'selected';}?>><?=$i?></option>
<? } ?>
</select>
<select name="search_month" onchange="check_search()" class="type01">
<option value="">선택</option>
<? for ($i=1;$i<=12;$i++) {?>
<option value="<?=sprintf('%02d',$i)?>" <? if($search_month==sprintf('%02d',$i)) { echo 'selected';}?>><?=sprintf('%02d',$i)?></option>
<? } ?>
</select>
<select name="search_day" onchange="check_search()" class="type01">
<option value="">선택</option>
<?
$end_day = date("t", mktime(0, 0, 0, $search_month, 1, $search_year));
for ($i=1;$i<=$end_day;$i++) {?>
<option value="<?=sprintf('%02d',$i)?>" <? if($search_day==sprintf('%02d',$i)) { echo 'selected';}?>><?=sprintf('%02d',$i)?></option>
<? } ?>
</select>
</div>
</div>
<div class="common_table">
<table>
<thead>
<tr>
<th>순위</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="13">등록된 내용이 없습니다.</td>
</tr>
<?
} else {
foreach($list as $val) {
$idx = $val['idx'];
$title = $val['title'];
$main_img = $val['main_img'];
$category_name1 = $val['category_name1'];
$ranking_type = $val['ranking_type'];
$press_name = $val['press_name'];
$reporter_name = $val['reporter_name'];
$reg_date = $val['reg_date'];
$hit_count = $val['hit_count'];
$like_count = $val['like_count'];
$comment_count = $val['comment_count'];
$share_count = $val['share_count'];
$reg_date = $val['reg_date'];
$rank = $val['rank'];
$ranking_type_txt = $def_arr_ranking[$ranking_type]['name'];
?>
<tr>
<td><?=$rank?></td>
<td><img src="<?=$main_img?>" width="35"></td>
<td><?=$category_name1?></td>
<td><?=$ranking_type_txt?></td>
<td style="text-align:left;">&nbsp;&nbsp;<?=$title?></td>
<td><?=$press_name?></td>
<td><?=$reporter_name?></td>
<td><?=$reg_date?></td>
<td><?=$hit_count?></td>
<td><?=$like_count?></td>
<td><?=$comment_count?></td>
</tr>
<?
}
}
?>
</tbody>
</table>
</div>
<div class="pasing_wrap">
<?=$pagination?>
</div>
</div>
</form>
<script type="text/javascript">
function check_search(){
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
alert("검색할 항목을 선택해주세요.");
return false;
}
$("#input_form").submit();
}
function category_search(){
$("#input_form").submit();
}
</script>

View File

@@ -0,0 +1,778 @@
<?php
include_once ("./static_data/code.php");
$arr_theme_reg = array();
for($i=1;$i<=10;$i++) {
$arr_theme_reg[$i] = '';
}
$arr_section_reg = array();
for($i=1;$i<=10;$i++) {
$arr_section_reg[$i] = '';
}
if($mode=='edit') {
$title = $result['title'];
$title = htmlspecialchars($title);
$content = htmlentities($result['content']);
$category_code = $result['category_code'];
$press_idx = $result['press_idx'];
$reporter_name = $result['reporter_name'];
$reporter_email = $result['reporter_email'];
$sub_title = $result['sub_title'];
$sub_title = htmlspecialchars($sub_title);
$tag = $result['tag'];
$org_url = $result['org_url'];
$hit_count = $result['hit_count'];
$review_count1 = $result['review_count1'];
$review_count2 = $result['review_count2'];
$review_count3 = $result['review_count3'];
$review_count4 = $result['review_count4'];
$review_count5 = $result['review_count5'];
$is_auto_setting = $result['is_auto_setting'];
$reg_date = $result['reg_date'];
$display_date = $result['display_date'];
$is_display = $result['is_display'];
$main_img = $result['main_img'];
$news_type = $result['news_type'];
$video_url = $result['video_url'];
$video_url = str_replace('https://www.youtube.com/embed/','', $video_url);
$category_code1 = substr($category_code, 0, 2);
$category_code2 = substr($category_code, 0, 4);
$category_code3 = substr($category_code, 0, 6);
$arr_display_date = explode(' ', $display_date);
$display_date = $arr_display_date[0];
$arr_display_time = explode(':', $arr_display_date[1]);
$display_hour = $arr_display_time[0];
$display_min = $arr_display_time[1];
$display_sec = $arr_display_time[2];
$tag = str_replace(' ', ',', $tag);
foreach ($arr_theme as $val) {
$arr_theme_reg[$val['theme_type']] = $val['rank'];
}
foreach ($arr_section as $val) {
$arr_section_reg[$val['etc_section_type']] = $val['rank'];
}
$relation_news_style = "none";
if($is_auto_setting=='N') {
$relation_news_style = "block";
}
} else {
$category_code1 = '';
$category_code2 = '';
$category_code3 = '';
$title = '';
$content = '';
$press_idx = '';
$reporter_name = '';
$reporter_email = '';
$sub_title = '';
$tag = '';
$org_url = '';
$hit_count = 0;
$review_count1 = 0;
$review_count2 = 0;
$review_count3 = 0;
$review_count4 = 0;
$review_count5 = 0;
$is_auto_setting= 'Y';
$display_date = '';
$display_hour = '';
$display_min = '';
$display_sec = '';
$main_img = '';
$news_type = $search_news_type;
$video_url = '';
if($news_type == '') $news_type = '1';
$relation_news_style = "none";
}
$arr_category_add1 = array();
$arr_category_add2 = array();
$arr_category_add3 = array();
foreach ($arr_category as $key=>$val) {
if($val['depth'] == '1') {
$arr_category_add1[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '2') {
$arr_category_add2[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '3') {
$arr_category_add3[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
}
}
?>
<link rel="stylesheet" href="<?=DIR_CSS?>/jquery-ui.min.css" />
<script src="<?=DIR_JS?>/jquery-ui.min.js"></script>
<script src="<?=DIR_JS?>/admin/jquery.multiselect.js"></script>
<link href="<?=DIR_CSS?>/admin/jquery.multiselect.css" rel="stylesheet">
<script src="/ckeditor/ckeditor.js"></script>
<?
$menu_code = '23';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/news/news_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_news_type" name="search_news_type" value="<?=$search_news_type?>">
<input type="hidden" id="search_category_code1" name="search_category_code1" value="<?=$search_category_code1?>">
<input type="hidden" id="search_category_code2" name="search_category_code2" value="<?=$search_category_code2?>">
<input type="hidden" id="search_category_code3" name="search_category_code3" value="<?=$search_category_code3?>">
<input type="hidden" id="search_click1" name="search_click1" value="<?=$search_click1?>">
<input type="hidden" id="search_click2" name="search_click2" value="<?=$search_click2?>">
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
<input type="hidden" id="img_path" name="img_path">
<div class="common_table news">
<table>
<tr>
<th>기능</th>
<td class="tl">
<input type="radio" name="news_type" value="1" <? if($news_type=='1') { echo 'checked';}?>> 일반뉴스&nbsp;&nbsp;
<input type="radio" name="news_type" value="2" <? if($news_type=='2') { echo 'checked';}?>> 포토뉴스&nbsp;&nbsp;
<input type="radio" name="news_type" value="3" <? if($news_type=='3') { echo 'checked';}?>> 동영상뉴스&nbsp;&nbsp;
<input type="radio" name="news_type" value="4" <? if($news_type=='4') { echo 'checked';}?>> 영상링크뉴스
</td>
</tr>
<tr>
<th>언론사</th>
<td class="tl">
<select name="press_idx" id="press_idx" class="type01">
<option value="">선택</option>
<? foreach ($arr_press as $val) {?>
<option value="<?=$val['idx']?>" <? if($press_idx==$val['idx']) { echo 'selected';}?>><?=$val['press_name']?></option>
<? }?>
</select>
</td>
</tr>
<tr>
<th>기자</th>
<td class="tl">
<input type="text" name="reporter_name" id="reporter_name" class="type01" value="<?=$reporter_name?>">
</td>
</tr>
<tr>
<th>기자이메일</th>
<td class="tl">
<input type="text" name="reporter_email" id="reporter_email" class="type01" value="<?=$reporter_email?>">
</td>
</tr>
<tr>
<th>뉴스제목</th>
<td class="tl">
<input type="text" name="title" id="title" value="<?=$title?>">
</td>
</tr>
<tr>
<th>부제목</th>
<td class="tl">
<input type="text" name="sub_title" id="sub_title" value="<?=$sub_title?>">
</td>
</tr>
<tr>
<th>메인이미지</th>
<td class="tl">
<input type="file" name="main_img" id="main_img" class="input00" size="100">
<? if($main_img!='') { ?>
<input type="checkbox" name="is_del_img" value="Y">삭제
<img src="<?=$main_img?>" width="100px"></br>
<? } else {
$main_img = '';
}
?>
<input type="hidden" name="org_main_img" id="org_main_img" value="<?=$main_img?>">
</td>
</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_category_add1) > 0) {
foreach ($arr_category_add1 as $val) {?>
<option value="<?=$val['category_code']?>" <? if($category_code1==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
} ?>
</select>
<select name="category2" id="category2" onchange="change_category(2, this.value)" class="type01">
<option value="">선택</option>
<? if(count($arr_category_add2) > 0) {
foreach ($arr_category_add2 as $val) {?>
<option value="<?=$val['category_code']?>" <? if($category_code2==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
} ?>
</select>
<select name="category3" id="category3" class="type01">
<option value="">선택</option>
<? if(count($arr_category_add3) > 0) {
foreach ($arr_category_add3 as $val) {?>
<option value="<?=$val['category_code']?>" <? if($category_code3==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
} ?>
</select>
</td>
</tr>
<tr>
<th>태그</th>
<td class="tl">
<input type="text" name="tag" id="tag" class="type01" value="<?php echo $tag ? $tag: str_replace('-', ',', cleanUrl($title))?>"> 최대 5개까지 입력 가능(,로 구분해주세요.)
</td>
</tr>
<tr>
<th>기사원본주소</th>
<td class="tl">
기사의 원본 주소를 입력하면 기사 클릭시 기사원본의 주소로 이동합니다.</br>
<input type="text" name="org_url" id="org_url" class="input00" value="<?=$org_url?>">
</td>
</tr>
<tr>
<th>youtube 주소</th>
<td class="tl">
https://youtu.be/<input type="text" name="video_url" id="video_url" class="input00" value="<?=$video_url?>" style="width:200px"> (키만 넣어주세요.)
</td>
</tr>
<tr>
<th>기사본문</th>
<td>
<textarea name="content" id="ir1" style="width:100%; height:500px;" /><?=$content?></textarea>
</td>
</tr>
<tr>
<th>조회수</th>
<td class="tl">
<input type="text" name="hit_count" id="hit_count" class="type03" value=""> (관리자가 임의적으로 조회수를 설정할 수 있습니다.)
</td>
</tr>
<tr>
<th>리뷰수</th>
<td class="tl">
<? $arr_review_txt = array('좋아요', '훈훈해요', '슬퍼요', '화나요', '후속기사원해요');
for($i=1;$i<=5;$i++) { ?>
<img style='vertical-align:middle;margin-right:7px;width:35px;margin-left:30px;border:2px solid #ded239;border-radius:50%;' src="/img/web/img_reaction<?=$i?>.png" alt="">
<input type="text" name="review_count<?=$i?>" id="review_count<?=$i?>" value="<?=${"review_count".$i}?>" class="type03" placeholder="<?=$arr_review_txt[$i-1]?>">
<? } ?>
<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(관리자가 임의적으로 리뷰수를 설정할 수 있으나 리뷰 합산 수가 조회수 이상이 될 수는 없습니다)
</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';}?>> 자동설정&nbsp;&nbsp;
<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:<?=$relation_news_style?>; 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>&nbsp;최신순&nbsp;
<input type="radio" name="article_sort" id="article_sort" value="2" onclick="search_article();">&nbsp;오래된순&nbsp;
&nbsp;&nbsp;&nbsp;검색결과&nbsp; <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>
<h2 class="subtitle"><span>PC</span>뉴스테마설정</h2>
<table>
<tr>
<th>헤드라인뉴스<br />(모바일공통)</td>
<td class="tl">
<div class="two_box_type01 clearfix headline">
<div class="con thum_wrap">
<div class="thumil on">
<img src="/img/admin/news_1.png" alt="">
</div>
</div>
</div>
<? for($i=1;$i<=$def_arr_news_theme[1]['count'];$i++){?>
<input type="radio" name="theme_type1" value="<?=$i?>" <? if($arr_theme_reg[1] == $i) { echo 'checked';}?>> <?=$i?>위&nbsp;&nbsp;
<? }?>
</td>
</tr>
<tr>
<th>주요뉴스</th>
<td class="tl">
<div class="opt_box">
<select name="theme_type2" class="type01">
<option value="">순위설정</option>
<? for($i=1;$i<=$def_arr_news_theme[2]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_theme_reg[2] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/news_2.png" width="200px">
</td>
</tr>
<tr>
<th>이 시간 추천뉴스<br />(모바일공통)</th>
<td class="tl">
<div class="opt_box">
<select name="theme_type3" class="type01">
<option value="">순위선택</option>
<? for($i=1;$i<=$def_arr_news_theme[3]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_theme_reg[3] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/news_3.png" width="400px">
</td>
</tr>
<tr>
<th>오늘의 포토뉴스</th>
<td class="tl">
<div class="opt_box">
<select name="theme_type4" class="type01">
<option value="">순위선택</option>
<? for($i=1;$i<=$def_arr_news_theme[4]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_theme_reg[4] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/news_4.png" width="600px">
</td>
</tr>
</table>
<h2 class="subtitle"><span>모바일</span>뉴스테마설정</h2>
<table>
<tr>
<th>메인(빅원)</td>
<td class="tl">
<div class="opt_box">
<select name="theme_type5" class="type01">
<option value="">순위선택</option>
<? for($i=1;$i<=$def_arr_news_theme[5]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_theme_reg[5] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/news_5.png" width="400px">
</td>
</tr>
<tr>
<th>뷰(추천기사)</td>
<td class="tl">
<div class="opt_box">
<select name="theme_type6" class="type01">
<option value="">순위설정</option>
<? for($i=1;$i<=$def_arr_news_theme[6]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_theme_reg[6] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/news_6.png" width="400px">
</td>
</tr>
</table>
<h2 class="subtitle">기타섹션 <span>(모바일공통)</span></h2>
<table>
<tr>
<th>인기영상</td>
<td class="tl">
<div class="opt_box">
<select name="section_type1" class="type01">
<option value="">순위선택</option>
<? for($i=1;$i<=$def_arr_etc_section[1]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_section_reg[1] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/section1.png" width="300px">
</td>
</tr>
<tr>
<th>인기포토</td>
<td class="tl">
<div class="opt_box">
<select name="section_type2" class="type01">
<option value="">순위설정</option>
<? for($i=1;$i<=$def_arr_etc_section[2]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_section_reg[2] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/section1.png" width="300px">
</td>
</tr>
<tr>
<th>은혜로운영상<br />(모바일전용)</td>
<td class="tl">
<div class="opt_box">
<select name="section_type3" class="type01">
<option value="">순위설정</option>
<? for($i=1;$i<=$def_arr_etc_section[3]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_section_reg[3] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/section2.png" width="250px">
</td>
</tr>
<tr>
<th>카드뉴스</td>
<td class="tl">
<div class="opt_box">
<select name="section_type4" class="type01">
<option value="">순위설정</option>
<? for($i=1;$i<=$def_arr_etc_section[4]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_section_reg[4] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/news_10.png" width="250px">
</td>
</tr>
</table>
<h2 class="subtitle">등록일시설정</h2>
<table>
<tr>
<th>등록일시</th>
<td class="tl">
<? if($mode=='add') {?>
<input type="text" name="display_date" id="display_date" value="<?=$display_date?>" class="type02" size="10" placeholder="예약일">
<input type="text" name="display_hour" id="display_hour" value="<?=$display_hour?>" class="type03" size="3" placeholder="시">:<input type="text" name="display_min" id="display_min" value="<?=$display_min?>" class="type03" size="3" placeholder="분">:<input type="text" name="display_sec" id="display_sec" value="<?=$display_sec?>" class="type03" size="3" placeholder="초">
<?} else {?>
<? if($is_display=='N') {?>
<input type="text" name="display_date" id="display_date" value="<?=$display_date?>" class="type02" size="10" placeholder="예약일">
<input type="text" name="display_hour" id="display_hour" value="<?=$display_hour?>" class="type03" size="3" placeholder="시">:<input type="text" name="display_min" id="display_min" value="<?=$display_min?>" class="type03" size="3" placeholder="분">:<input type="text" name="display_sec" id="display_sec" value="<?=$display_sec?>" class="type03" size="3" placeholder="초">
<? } else {?>
<input type="hidden" name="display_date" value="<?=$display_date?>">
<input type="hidden" name="display_hour" value="<?=$display_hour?>">
<input type="hidden" name="display_min" value="<?=$display_min?>">
<input type="hidden" name="display_sec" value="<?=$display_sec?>">
<?=$display_date?> <?=$display_hour?>:<?=$display_min?>:<?=$display_sec?>
<? }
}
?>
</td>
</tr>
</table>
</div>
<div class="write_btn tc">
<a href="javascript:news_reg_proc();">저장하기</a>
<a href="/admin/news/news_list/2/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_news_type=<?=$search_news_type?>&search_category_code1=<?=$search_category_code1?>&search_category_code2=<?=$search_category_code2?>&search_category_code3=<?=$search_category_code3?>&sort=<?=$sort?>&search_click1=<?=$search_click1?>&search_click2=<?=$search_click2?>">취소하기</a>
<?if($mode=='edit') {?>
<!-- <a class="del_news" href="javascript:news_del_proc();">삭제하기</a> -->
<?}?>
</div>
</form>
<!-- <script type="text/javascript">
function news_del_proc() {
var link =`/admin/news/news_list/2/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_news_type=<?=$search_news_type?>&search_category_code1=<?=$search_category_code1?>&search_category_code2=<?=$search_category_code2?>&search_category_code3=<?=$search_category_code3?>&sort=<?=$sort?>&search_click1=<?=$search_click1?>&search_click2=<?=$search_click2?>`;
let post_data = <?=$result['idx']?>;
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$.post({
url:'/admin/news/news_del_proc_ajax',
data:post_data,
success:function(data){
console.log(data);
// location.href=url;
}
});
}else{ //취소
return;
}
}
</script> -->
<script type="text/javascript">
var oEditors = [];
var oEditors2 = [];
$(function(){
nhn.husky.EZCreator.createInIFrame({
oAppRef: oEditors,
elPlaceHolder: "ir1",
sSkinURI: "/smarteditor/SmartEditor2Skin.html",
htParams : {
bUseToolbar : true,
bUseVerticalResizer : true,
bUseModeChanger : true,
fOnBeforeUnload : function(){
}
},
fOnAppLoad : function(){
},
fCreator: "createSEditor2"
});
nhn.husky.EZCreator.createInIFrame({
oAppRef: oEditors2,
elPlaceHolder: "ir2",
sSkinURI: "/smarteditor/SmartEditor2Skin.html",
htParams : {
bUseToolbar : true,
bUseVerticalResizer : true,
bUseModeChanger : true,
fOnBeforeUnload : function(){
}
},
fOnAppLoad : function(){
},
fCreator: "createSEditor2"
});
});
</script>
<script type="text/javascript">
function news_reg_proc(){
oEditors.getById["ir1"].exec("UPDATE_CONTENTS_FIELD", []);
if($("#press_idx").val()=='') {
alert("언론사를 선택해주세요.");
return false;
}
if($("#reporter_name").val()=='') {
alert("기자를 입력해주세요.");
return false;
}
if($("#title").val()=='') {
alert("제목을 입력해주세요.");
return false;
}
if($("#main_img").val()=='' && $("#org_main_img").val()=='') {
alert("메인이미지를 입력해주세요.");
return false;
}
if($("#category1").val()=='') {
alert("1차 섹션을 선택해주세요.");
return false;
}
// if($("#category2").val()=='') {
// alert("2차 섹션을 선택해주세요.");
// return false;
// }
if($("#ir1").val()=='' || $("#ir1").val()=='null' || $("#ir1").val()=='&nbsp;' || $("#ir1").val()=='<p>&nbsp;</p>') {
alert("기사본문을 입력해주세요.");
oEditors.getById["ir1"].exec("focus");
return false;
}
var hit_count = parseInt($("#hit_count").val());
var review_count = parseInt($("#review_count1").val()) + parseInt($("#review_count2").val()) + parseInt($("#review_count3").val()) + parseInt($("#review_count4").val()) + parseInt($("#review_count5").val());
if(review_count > hit_count) {
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();
}
function change_category(depth, val){
if(depth == 1) {
var json_category = '<?=json_encode($arr_category_add2)?>';
json_category = eval(json_category);
$('#category2').empty();
$('#category3').empty();
var option = "<option value=''>선택</option>";
$('#category2').append(option);
$('#category3').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);
}
}
} else {
var json_category = '<?=json_encode($arr_category_add3)?>';
json_category = eval(json_category);
$('#category3').empty();
var option = "<option value=''>선택</option>";
$('#category3').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>");
$('#category3').append(option);
}
}
}
}
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, "&#039;");
title = title.replace(/"/g, '&quot;');
console.log(title);
$('#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();
}
}
// 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>

View File

@@ -0,0 +1,390 @@
<?php
$arr_category_add1 = array();
$arr_category_add2 = array();
$arr_category_add3 = array();
foreach ($arr_category as $key=>$val) {
if($val['depth'] == '1') {
$arr_category_add1[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '2') {
$arr_category_add2[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '3') {
$arr_category_add3[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
}
}
$menu_code = '22';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/news/news_section_list/2">
<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="org_category_code" name="org_category_code">
<input type="hidden" id="search_type" name="search_type" value="category_name">
<div class="common_tep 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">
<?
foreach ($arr_depth_count as $val) {
?>
<span style="margin-right:10px;"><span style="font-weight:bold"><?=$val['depth']?>차: </span> <?=number_format($val['cnt']);?></span>
<?
}
?>
</div>
<div class="common_table">
<span style="margin-right:10px;"><span style="font-weight:bold">Total:</span> <?=number_format($total_count);?></span>
<span style="margin-right:10px;"><span style="font-weight:bold">전체글수:</span> <?=number_format($article_count);?></span>
<span style="margin-right:10px;"><span style="font-weight:bold" class="text_blue">오늘글수:</span> <?=number_format($today_article_count);?></span>
</div>
<!-- 테이블 시작-->
<div class="common_table">
<table>
<thead>
<th>번호</th>
<th>뉴스섹션</th>
<th>전체글수</th>
<th>오늘의글수</th>
<th>출력순위</th>
<th>생성일자</th>
<th>관리</th>
</thead>
<tbody>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="7">등록된 내용이 없습니다.</td>
</tr>
<?
} else {
$ci=& get_instance();
$ci->load->model('admin/news/m_news');
$dataNumber = ($total_count + $limit)-($page*$limit);
foreach($list as $val) {
$idx = $val['idx'];
$category_code = $val['category_code'];
$category_name = $val['category_name'];
$p_category_code= $val['p_category_code'];
$display_sort = $val['display_sort'];
$total_count = $val['total_count'];
$today_count = $val['today_count'];
$depth = $val['depth'];
$reg_date = $val['reg_date'];
$reg_date = substr($reg_date, 0, 10);
$category_code1 = substr($category_code, 0, 2);
$category_code2 = substr($category_code, 0, 4);
$category_code3 = substr($category_code, 0, 6);
$del_key = $category_code;
$reply_icon = '';
if($depth != 1) {
for($i=1;$i<=$depth;$i++) {
$reply_icon.= '&nbsp;&nbsp;&nbsp;&nbsp;';
}
$reply_icon.='<img style="vertical-align:middle;margin-top:-3px;" src="/img/admin/board/icon_reply.gif" border="0"> ';
}
# 전체 글수
$req_data = array();
$req_data['category_code'] = ${"category_code".$depth};
$total_count = $ci->m_news->news_section_code_count($req_data);
# 오늘글
$req_data = array();
$req_data['category_code'] = ${"category_code".$depth};
$req_data['display_date'] = date("Y-m-d").' 00:00:00';
$today_count = $ci->m_news->news_section_code_count($req_data);
?>
<tr>
<td><?=$dataNumber?></td>
<td style="text-align: left">
<input type="hidden" name="category_name_<?=$idx?>" id="category_name_<?=$idx?>" value="<?=$category_name?>">
<input type="hidden" name="display_sort_<?=$idx?>" id="display_sort_<?=$idx?>" value="<?=$display_sort?>">
<a href="/admin/news/news_list/2?search_category_code1=<?=$category_code1?>&search_category_code2=<?=$category_code2?>&search_category_code3=<?=$category_code3?>"><?=$reply_icon?><?=$category_name?></a>
<? if($depth != 3) {?>
<button type="button" class="btn_s_blue" style="width:110px" onclick="category_add('<?=$depth?>', '<?=$category_code?>');" style="cursor: pointer;"><?=$depth+1?>차 섹션등록</button>
<? }?>
</td>
<td><?=$total_count?><button type="button" class="btn_s_blue" style="width:40px" onclick="category_article_move('<?=$category_code?>')" style="cursor: pointer;">이동</button></td>
<td><?=$today_count?></td>
<td><?=$display_sort?></td>
<td><?=$reg_date?></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('0', '');">1차 섹션등록</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><input type="text" name="category_name" id="category_name"></td>
</tr>
<tr>
<th>노출순서</th>
<td><input type="text" name="display_sort" id="display_sort"></td>
</tr>
</table>
<div class="write_btn tc">
<a href="javascript:category_reg_proc('add')" id="btn_category_add">신규등록</a>
<a href="javascript:category_reg_proc('edit')" id="bnt_category_edit">수정</a>
<a href="javascript:commonLayerClose('category_reg_layer')">취소하기</a>
</div>
</div>
</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">
<? if(count($arr_category_add1)>0){?>
<select name="category1" id="category1" onchange="change_category(1, this.value)" class="type01">
<option value="">선택</option>
<? foreach ($arr_category_add1 as $val) {?>
<option value="<?=$val['category_code']?>"><?=$val['category_name']?></option>
<? }?>
</select>
<? }?>
<select name="category2" id="category2" onchange="change_category(2, this.value)" class="type01">
<option value="">선택</option>
</select>
<select name="category3" id="category3" class="type01">
<option value="">선택</option>
</select>
</td>
</tr>
</table>
<div class="write_btn tc">
<a href="javascript:category_article_move_proc('add')"">이동</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();
}
// 등록 - layer 열기
function category_add(depth, p_category_code) {
$("#bnt_category_edit").hide();
$("#btn_category_add").show();
$("#depth").val('');
$("#category_idx").val('');
$("#p_category_code").val('');
$("#category_name").val('');
$("#depth").val(depth);
if(p_category_code != '') {
$("#p_category_code").val(p_category_code);
}
commonLayerOpen('category_reg_layer');
}
// 등록 - layer열기
function category_edit(idx){
$("#bnt_category_edit").show();
$("#btn_category_add").hide();
$("#depth").val('');
$("#category_idx").val('');
$("#p_category_code").val('');
$("#category_name").val('');
$("#category_idx").val(idx);
$("#category_name").val($("#category_name_"+idx).val());
commonLayerOpen('category_reg_layer');
}
// 카테고리 저장
function category_reg_proc(mode){
$("#mode").val(mode);
if($("#category_name").val()=='') {
alert("카테고리명을 입력해주세요.");
return false;
}
$("#input_form").attr("action", "/admin/news/news_section_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/news/news_section_code_count',
sync: false,
type: 'POST',
dataType: 'html',
data: form_data,
success: function (rtnHtml) {
if(rtnHtml == 0) {
if(depth == '3') {
var msg = '카테고리가 삭제됩니다. 삭제하시겠습니까?';
} else {
var msg = '하위카테고리까지 모두 삭제됩니다. 삭제하시겠습니까?';
}
if(confirm(msg) == true) { //확인
$("#del_key").val(del_key);
$("#input_form").attr("action", "/admin/news/news_section_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
} else if(rtnHtml > 0) {
alert("등록되어있는 글이 있으면 삭제할수 없습니다.");
return false;
} else {
alert("삭제에 실패했습니다. 다시시도해주세요.");
return false;
}
},
error: function (rtnHtml) {
return false;
}
});
}
function category_article_move(org_category_code){
$("#org_category_code").val(org_category_code);
commonLayerOpen('reg_layer');
}
function category_article_move_proc(){
if(confirm("등록된 글이 모두 이동됩니다. 진행하시겠습니까?") == true) { //확인
$("#input_form").attr("action", "/admin/news/news_section_article_move_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
function change_category(depth, val){
if(depth == '1') {
$('#category2').empty();
$('#category3').empty();
var option = "<option value=''>선택</option>";
$('#category2').append(option);
$('#category3').append(option);
var json_category = '<?=json_encode($arr_category_add2)?>';
json_category = eval(json_category);
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);
}
}
} else if(depth == '2') {
$('#category3').empty();
var option = "<option value=''>선택</option>";
$('#category3').append(option);
var json_category = '<?=json_encode($arr_category_add3)?>';
json_category = eval(json_category);
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>");
$('#category3').append(option);
}
}
}
}
</script>

View File

@@ -0,0 +1,44 @@
<?php
$arr_stat_time = explode(':', $stat_time);
$stat_time1 = $arr_stat_time[0];
$stat_time2 = $arr_stat_time[1];
$stat_time3 = $arr_stat_time[2];
$menu_code = '211';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/news/news_setting_reg_proc" method="post">
<input type="hidden" name="idx" value="<?=$idx?>">
<div class="common_table">
<table>
<tr>
<th>언론사 노출</th>
<td class="tl">
<input type="radio" name="etc_char1" id="etc_char1" value="N" class="input00" <? if($etc_char1=='N') { echo 'checked';}?>> 언론사 노출 비허용
<input type="radio" name="etc_char1" id="etc_char1" value="Y" class="input00" <? if($etc_char1=='Y') { echo 'checked';}?>> 언론사 노출 허용
</br>* 뉴스 메인페이지와 뉴스랭킹페이지 메인 리스트상에서의 언론사명이 노출 되는 것에 대한 허용 여부를 설정합니다.
</br>* 뷰 페이지에서는 무조건 노출하는 것을 기본으로 하며, 본 설정 기능과는 무관합니다.
</td>
</tr>
</table>
</div>
<div class="write_btn tc">
<a href="javascript:news_setting_reg_proc()">저장하기</a>
</div>
</form>
<script type="text/javascript">
function news_setting_reg_proc(){
$("#input_form").submit();
}
</script>

View File

@@ -0,0 +1,89 @@
<?
$menu_code = '27';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/news/news_tag_list/2">
<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="tag">
<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 style="font-weight:bold">Total:</span> <?=number_format($total_count);?>
<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>
<table>
<thead>
<th>번호</th>
<th>태그명</th>
<th>등록글수</th>
</thead>
<tbody>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="3">등록된 내용이 없습니다.</td>
</tr>
<?
} else {
$dataNumber = ($total_count + $limit)-($page*$limit);
foreach($list as $val) {
$tag = $val['tag'];
$article_count = $val['cnt'];
?>
<tr>
<td><?=number_format($dataNumber)?></td>
<td class="title"><a href="/admin/news/news_list/2?search_type=tag&search_keyword=<?=$tag?>"><?=$tag?></a></td>
<td><?=number_format($article_count)?></td>
</tr>
<?
$dataNumber--;
}
}
?>
</tbody>
</table>
<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();
}
</script>

View File

@@ -0,0 +1,131 @@
<?php
include_once ("./static_data/code.php");
$head_title = $result['head_title'];
$head_title = htmlspecialchars($head_title);
$title = $result['title'];
$title = htmlspecialchars($title);
$sub_content = $result['sub_content'];
$sub_content = htmlspecialchars($sub_content);
$content_idx = $result['content_idx'];
$main_img = $result['theme_img'];
$theme_type = $result['theme_type'];
$rank = $result['rank'];
$press_name = $result['press_name'];
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
$menu_code = '24';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
$rowspan = "3";
if($theme_type=='1' || $theme_type=='6' ) {
$rowspan = "4";
}
?>
<form name="input_form" id="input_form" action="/admin/news/news_theme_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_theme_type" value="<?=$search_theme_type?>">
<input type="hidden" id="search_category_code1" name="search_category_code1" value="<?=$search_category_code1?>">
<input type="hidden" id="search_category_code2" name="search_category_code2" value="<?=$search_category_code2?>">
<input type="hidden" id="search_category_code3" name="search_category_code3" value="<?=$search_category_code3?>">
<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="mode" name="theme_type" value="<?=$theme_type?>">
<input type="hidden" id="mode" name="mode" value="edit">
<div class="common_table news">
<h2 class="subtitle"><?=$def_arr_news_theme[$theme_type]['name']?></h2>
<?
if($def_arr_news_theme[$theme_type]['display']=='all') {
?>
<span class="text_blue"><b>* 모바일과 공통 송출관리</b></span>
<?
}
?>
<table>
<tr>
<th rowspan="<?=$rowspan?>"><?=$rank?>위</th>
<td class="tl">
<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" class="type00" size="50" placeholder="제목을 입력해주세요." value="<?=$title?>">
</td>
</tr>
<? if($theme_type == '1') {?>
<tr>
<td class="tl">
<textarea id="sub_content" name="sub_content" placeholder="기사 간략 노출(2줄)" rows="2" cols="80"><?=$sub_content?></textarea>
</td>
</tr>
<? }?>
<? if($theme_type == '6') {?>
<tr>
<td class="tl">
<input type="text" name="press_name" id="press_name" class="type02" size="20" placeholder="언론사" value="<?=$press_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="theme_img" id="theme_img" class="input00" size="20">
</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:news_theme_list_reg_proc();">저장하기</a>
<a href="/admin/news/news_theme_list/2/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_theme_type=<?=$search_theme_type?>&search_category_code1=<?=$search_category_code1?>&search_category_code2=<?=$search_category_code2?>&search_category_code3=<?=$search_category_code3?>&sort=<?=$sort?>">목록으로</a>
</div>
</form>
<? 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 news_theme_list_reg_proc(){
if($("#title").val()!='') {
if($("#content_idx").val()==''){
alert("기사를 선택해주세요.");
return false;
}
<? if($theme_type != '3') {?>
if($("#theme_img").val()=='' && $("#img").val()=='' && $("#org_img").val()=='') {
alert("메인이미지를 입력해주세요.");
return false;
}
<?}?>
}
$("#input_form").submit();
}
</script>

View File

@@ -0,0 +1,315 @@
<?php
include_once ("./static_data/code.php");
$arr_category_add1 = array();
$arr_category_add2 = array();
$arr_category_add3 = array();
foreach ($arr_category as $key=>$val) {
if($val['depth'] == '1') {
$arr_category_add1[] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '2') {
$arr_category_add2[$val['p_category_code']][] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
} else if($val['depth'] == '3') {
$arr_category_add3[$val['p_category_code']][] = array('category_code'=>$val['category_code'], 'category_name'=>$val['category_name'], 'p_category_code'=> $val['p_category_code']);
}
}
$menu_code = '24';
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/news/news_theme_list/2">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="search_theme_type" name="search_theme_type" value="<?=$search_theme_type?>">
<input type="hidden" id="search_click1" name="search_click1" value="<?=$search_click1?>">
<input type="hidden" id="search_click2" name="search_click2" value="<?=$search_click2?>">
<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/news/news_theme_list/2" <? if($search_theme_type=='') { echo 'class="on"';}?>>전체</a></li>
<? foreach($def_arr_news_theme1 as $val) {
$css = '';
if($search_theme_type == $val['code']) {
$css = ' class="on"';
}
?>
<li><a href="/admin/news/news_theme_list/2?search_theme_type=<?=$val['code']?>" <?=$css?>><?=$val['name']?></a></li>
<? }?>
</ul>
<div class="searh_area">
<select name="search_type" id="search_type">
<option value="">선택</option>
<option value="a.title" <? if($search_type=='a.title'){ echo 'selected';}?>>제목</option>
<option value="b.press_name" <? if($search_type=='b.press_name'){ echo 'selected';}?>>언론사</option>
<option value="b.reporter_name" <? if($search_type=='b.reporter_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>
<? foreach($def_arr_news_theme2 as $val) {
$css = '';
if($search_theme_type == $val['code']) {
$css = ' class="on"';
}
?>
<li><a href="/admin/news/news_theme_list/2?search_theme_type=<?=$val['code']?>" <?=$css?>><?=$val['name']?></a></li>
<? }?>
</ul>
</div>
<div class="write_btn">
<!-- <a href="javascript:news_theme_reg_arr_del_proc()">삭제</a> -->
<a href="javascript:news_theme_list_reg()">송출관리</a>
<!-- <a href="/admin/news/news_reg/2?mode=add">뉴스등록</a> -->
</div>
<div class="common_table clearfix" style="margin-top: 30px">
<span style="font-weight:bold">Total:</span> <?=number_format($total_count);?>
<a href="javascript:click_search('1', 'search_click1');"><span style="font-weight:bold">오늘신규:</span> <?=number_format($new_count);?></a>
<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:click_search('1', 'search_click2');"><span class="text_blue">출력중: <?=number_format($is_display1)?></span></a>&nbsp;&nbsp;&nbsp;
<a href="javascript:click_search('2', 'search_click2');"><span class="text_red">예약중: <?=number_format($is_display2)?></span></a>
</span>
<div class="searh_area">
<select name="search_category_code1" onchange="category_search()">
<option value="">1차섹션</option>
<? if(count($arr_category_add1) > 0) {
foreach ($arr_category_add1 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" onchange="category_search()">
<option value="">2차섹션</option>
<? if(isset($arr_category_add2[$search_category_code1])==true) {
foreach ($arr_category_add2[$search_category_code1] as $val) {
?>
<option value="<?=$val['category_code']?>" <? if($search_category_code2==$val['category_code']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
}
?>
</select>
<select name="search_category_code3" onchange="category_search()">
<option value="">3차섹션</option>
<? if(isset($arr_category_add3[$search_category_code2])==true) {
foreach ($arr_category_add3[$search_category_code2] as $val) {?>
<option value="<?=$val['category_code']?>" <? if($search_category_code3==$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>등록일시</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'];
$category_name1 = $val['category_name1'];
$category_code = $val['category_code'];
$theme_type = $val['theme_type'];
$press_name = $val['press_name'];
$reporter_name = $val['reporter_name'];
$reg_date = $val['reg_date'];
$hit_count = $val['hit_count'];
$like_count = $val['review_count1'];
$comment_count = $val['comment_count'];
$is_display = $val['is_display'];
$display_date = $val['display_date'];
$rank = $val['rank'];
$content_idx = $val['content_idx'];
$display_date_txt = '';
if($is_display == 'N') {
$display_date_txt = '</br><span class="text_green">('.$display_date.')</span>';
}
$theme_type_txt = $def_arr_news_theme[$theme_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"> ';
$category_code1 = substr($category_code, 0, 2);
?>
<tr>
<td><input type="checkbox" name="is_del[]" value="<?=$idx?>"></td>
<td><?=$dataNumber?></td>
<td><img src="<?=$main_img?>" width="35"></td>
<td><a href="/admin/news/news_theme_list/2?search_category_code1=<?=$category_code1?>"><?=$category_name1?></a></td>
<td><?=$theme_type_txt?></td>
<td class="title" style="text-align:left;"><a href="/admin/news/news_reg/2?mode=edit&idx=<?=$content_idx?>"><?=$new?><?=$title?></a></td>
<td><?=$press_name?></td>
<td><?=$reporter_name?></td>
<td><?=$reg_date?><?=$display_date_txt?></td>
<td><?=$rank?></td>
<td><?=$hit_count?></td>
<td><?=$like_count?></td>
<td><?=$comment_count?></td>
<td class="tool_btn">
<a href="javascript:news_them_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
<a href="javascript:news_theme_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
</td>
</tr>
<?
$dataNumber--;
}
}
?>
</tbody>
</table>
</div>
<div class="write_btn">
<a href="javascript:news_theme_reg_arr_del_proc()">삭제</a>
<a href="javascript:news_theme_list_reg()">송출관리</a>
<a href="/admin/news/news_reg/2?mode=add">뉴스등록</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 category_search(){
$("#input_form").submit();
}
function click_search(type, id){
$("#"+id).val(type);
$("#input_form").submit();
}
function news_theme_list_reg(){
$("#mode").val('add');
$("#input_form").attr("action", "/admin/news/news_theme_list_reg/2");
$("#input_form").submit();
}
// edit
function news_them_edit(idx){
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/news/news_theme_edit/2");
$("#input_form").submit();
}
// 삭제
function news_theme_del_proc(idx) {
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/news/news_theme_reg_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
// 복수 삭제
function news_theme_reg_arr_del_proc() {
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
alert("삭제할 내용이 없습니다.");
return false;
}
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#input_form").attr("action", "/admin/news/news_theme_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>

View File

@@ -0,0 +1,190 @@
<?php
include_once ("./static_data/code.php");
$arr_theme_rank = array();
foreach ($arr_theme as $val) {
$arr_theme_rank[$val['rank']] = array('content_idx'=> $val['content_idx'], 'head_title'=>$val['head_title'], 'title'=>$val['title'], 'sub_content'=>$val['sub_content'], 'theme_img'=>$val['theme_img'], 'press_name'=>$val['press_name']);
}
$menu_code = '24';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/news/news_theme_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_theme_type" name="search_theme_type" value="<?=$search_theme_type?>">
<input type="hidden" id="search_category_code1" name="search_category_code1" value="<?=$search_category_code1?>">
<input type="hidden" id="search_category_code2" name="search_category_code2" value="<?=$search_category_code2?>">
<input type="hidden" id="search_category_code3" name="search_category_code3" value="<?=$search_category_code3?>">
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
<input type="hidden" id="key" name="key">
<?
if($def_arr_news_theme[$search_theme_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_news_theme1 as $val) {?>
<input type="radio" name="theme_type" value="<?=$val['code']?>" onclick="change_theme_type('<?=$val['code']?>')" <? if($search_theme_type==$val['code']) { echo 'checked';}?>> <?=$val['name']?>&nbsp;&nbsp;
<? }?>
</br>
<div style="width:80px; float: left"><b>모바일섹션</b></div>
<? foreach($def_arr_news_theme2 as $val) {?>
<input type="radio" name="theme_type" value="<?=$val['code']?>" onclick="change_theme_type('<?=$val['code']?>')" <? if($search_theme_type==$val['code']) { echo 'checked';}?>> <?=$val['name']?>&nbsp;&nbsp;
<? }?>
</td>
</tr>
<?
for($i=1;$i<=$def_arr_news_theme[$search_theme_type]['count'];$i++) {
$title_txt = '';
if($i==1 && $search_theme_type =='1') $title_txt = ' (탑헤드라인)';
$head_title = '';
$title = '';
$sub_content = '';
$theme_img = '';
$theme_img_txt = '';
$content_idx = '';
$press_name = '';
if(isset($arr_theme_rank[$i])== true) {
$head_title = $arr_theme_rank[$i]['head_title'];
$head_title = htmlspecialchars($head_title);
$title = $arr_theme_rank[$i]['title'];
$title = htmlspecialchars($title);
$sub_content= $arr_theme_rank[$i]['sub_content'];
$sub_content = htmlspecialchars($sub_content);
$content_idx= $arr_theme_rank[$i]['content_idx'];
$theme_img = $arr_theme_rank[$i]['theme_img'];
$press_name = $arr_theme_rank[$i]['press_name'];
if($theme_img!='') $theme_img_txt = '<img src="'.$theme_img.'" width=250>';
}
$rowspan = "3";
if($search_theme_type=='1' || $search_theme_type=='6' ) {
$rowspan = "4";
}
if($search_theme_type=='1' && $i > 1) {
$rowspan = "3";
}
?>
<tr>
<th rowspan="<?=$rowspan?>"><?=$i?>위<?=$title_txt?></th>
<td class="tl">
<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?>" class="type00" size="50" placeholder="제목을 입력해주세요." value="<?=$title?>">
</td>
</tr>
<? if($search_theme_type == '1') {
$display = 'style="display:none"';
if($i==1) $display = 'style="display:block"';
?>
<tr <?=$display?>>
<td class="tl">
<textarea id="sub_content<?=$i?>" name="sub_content<?=$i?>" placeholder="기사 간략 노출(2줄)" rows="2" cols="80"><?=$sub_content?></textarea>
</td>
</tr>
<? }?>
<? if($search_theme_type == '6') {?>
<tr>
<td class="tl">
<input type="text" name="press_name<?=$i?>" id="press_name<?=$i?>" class="type02" size="20" placeholder="언론사" value="<?=$press_name?>" readonly>
</td>
</tr>
<? }?>
<tr>
<td class="tl">
<div id="img_view<?=$i?>"><?=$theme_img_txt?></div>
<input type="hidden" name="img<?=$i?>" id="img<?=$i?>">
<input type="hidden" name="org_img<?=$i?>" id="org_img<?=$i?>" value="<?=$theme_img?>">
<input type="file" name="theme_img<?=$i?>" id="theme_img<?=$i?>" class="input00" size="20">
</td>
</tr>
<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:news_theme_list_reg_proc()">저장하기</a>
<a href="/admin/news/news_theme_list/3/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_theme_type=<?=$search_theme_type?>&search_category_code1=<?=$search_category_code1?>&search_category_code2=<?=$search_category_code2?>&search_category_code3=<?=$search_category_code3?>&sort=<?=$sort?>">목록으로</a>
</div>
</form>
<? 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_theme_type(theme_code){
$("#search_theme_type").val(theme_code);
$("#input_form").attr("action", "/admin/news/news_theme_list_reg/2");
$("#input_form").submit();
}
var theme_count = "<?=$def_arr_news_theme[$search_theme_type]['count']?>";
function news_theme_list_reg_proc(){
for(i=1;i<=theme_count;i++) {
if($("#title"+i).val()!='') {
if($("#content_idx"+i).val()==''){
alert("기사를 선택해주세요.");
return false;
}
<? if($search_theme_type != '3') {?>
if($("#theme_img"+i).val()=='' && $("#img"+i).val()=='' && $("#org_img"+i).val()=='') {
alert("메인이미지를 입력해주세요.");
return false;
}
<? }?>
}
}
$("#input_form").submit();
}
</script>