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,190 @@
<?
$menu_code = '521';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/life/life_category_list/5">
<input type="hidden" id="category_idx" name="category_idx">
<input type="hidden" id="search_type" name="search_type" value="category_name">
<div class="common_table clearfix type01">
<div class="searh_area">
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="카테고리명" onkeypress="if( event.keyCode==13 ){check_search();}">
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
</div>
</div>
<div class="common_table">
<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>
<table>
<tr>
<th>번호</th>
<th>카테고리</th>
<th>등록채널 수</th>
<th>등록에디터 수</th>
<th>등록 글 수</th>
<th>조회수</th>
<th>노출순서</th>
<th>생성일자</th>
<th>관리</th>
</tr>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="9">등록된 내용이 없습니다.</td>
</tr>
<?
} else {
$dataNumber = ($total_count + $limit)-($page*$limit);
foreach($list as $val) {
$idx = $val['idx'];
$category_name = $val['category_name'];
$channel_count = $val['channel_count'];
$editor_count = $val['editor_count'];
$article_count = $val['article_count'];
$hit_count = $val['hit_count'];
$display_sort = $val['display_sort'];
$reg_date = $val['reg_date'];
?>
<tr>
<td><?=$dataNumber?></td>
<td><?=$category_name?></td>
<td><?=number_format($channel_count, 0)?></td>
<td><?=number_format($editor_count, 0)?></td>
<td><?=number_format($article_count, 0)?></td>
<td><?=number_format($hit_count, 0)?></td>
<td><?=number_format($display_sort, 0)?></td>
<td><?=$reg_date?></td>
<td class="tool_btn">
<a href="javascript:category_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
</td>
</tr>
<?
$dataNumber--;
}
}
?>
</table>
</div>
<div class="write_btn">
<a href="javascript:commonLayerOpen('category_reg_layer');">카테고리등록</a>
</div>
<div class="pasing_wrap">
<?=$pagination?>
</div>
</form>
<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_add_proc('add')">신규등록</a>
<a href="javascript:commonLayerClose('category_reg_layer')">취소하기</a>
</div>
</div>
</div>
<script type="text/javascript">
function check_search(){
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
alert("검색할 항목을 선택해주세요.");
return false;
}
$("#input_form").submit();
}
// 카테고리 등록
function category_add_proc(){
var category_name = $("#category_name").val();
var display_sort = $("#display_sort").val();
if(category_name=='') {
alert("카테고리명을 입력해주세요.");
return false;
}
var form_data = {
"category_name" : category_name,
"display_sort" : display_sort
};
$.ajax({
url: '/admin/life/life_category_add_proc',
sync: false,
type: 'POST',
dataType: 'html',
data: form_data,
success: function (rtnHtml) {
if(rtnHtml.trim()=='0000') {
alert("저장되었습니다.");
window.location.reload(true);
} else {
alert("등록에 실패했습니다.");
commonLayerClose('category_reg_layer');
return false;
}
},
error: function (rtnHtml) {
return false;
}
});
}
// 삭제
function category_del_proc(idx) {
if(confirm("회원이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#category_idx").val(idx);
$("#input_form").attr("action", "/admin/life/life_category_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
</script>

View File

@@ -0,0 +1,204 @@
<?
$menu_code = '522';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/life/life_channel_list/5" enctype="multipart/form-data">
<input type="hidden" id="search_type" name="search_type" value="channel_name">
<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_table clearfix type01">
<div class="searh_area">
<input type="text" name="search_keyword" id="search_keyword" value="<?=$search_keyword?>" placeholder="채널명" onkeypress="if( event.keyCode==13 ){check_search();}">
<a href="javascript:check_search();" class="btn"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
</div>
</div>
<div class="common_table" style="margin-top: 30px">
<span 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>
<div class="searh_area">
<select name="search_category" onchange="check_search();">
<option value="">전체</option>
<? foreach($category_list as $val) {?>
<option value="<?=$val['idx']?>" <? if($search_category==$val['idx']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }?>
</select>
</div>
</div>
<div class="common_table">
<table>
<tr>
<th>번호</th>
<th>카테고리</th>
<th>채널아이콘</th>
<th>채널명</th>
<th>등록에디터 수</th>
<th>등록 글 수</th>
<th>조회수</th>
<th>생성일자</th>
<th>관리</th>
</tr>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="9">등록된 내용이 없습니다.</td>
</tr>
<?
} else {
$dataNumber = ($total_count + $limit)-($page*$limit);
foreach($list as $val) {
$idx = $val['idx'];
$category_idx = $val['category_idx'];
$category_name = $val['category_name'];
$channel_icon = $val['channel_icon'];
$channel_name = $val['channel_name'];
$editor_count = $val['editor_count'];
$article_count = $val['article_count'];
$hit_count = $val['hit_count'];
$reg_date = $val['reg_date'];
$reg_date = substr($reg_date, 0, 10);
?>
<tr>
<td><?=$dataNumber?></td>
<td><a href="/admin/life/life_category_list/5?search_type=category_name&search_keyword=<?=$category_name?>"><?=$category_name?></a></td>
<td><img src="<?=$channel_icon?>" width="40px"></td>
<td><a href="/admin/member/editor_list/4?$search_category_code1=<?=$category_idx?>&search_category_code2=<?=$idx?>"><?=$channel_name?></a></td>
<td><?=number_format($editor_count)?></td>
<td><?=number_format($article_count)?></td>
<td><?=number_format($hit_count)?></td>
<td><?=$reg_date?></td>
<td class="tool_btn">
<a href="javascript:channel_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
<a href="javascript:channel_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
</td>
</tr>
<?
$dataNumber--;
}
}
?>
</table>
</div>
<div class="write_btn">
<a href="javascript:channel_icon_add();">채널아이콘등록</a>
<a href="/admin/life/life_channel_reg/5">채널등록</a>
</div>
<div class="pasing_wrap">
<?=$pagination?>
</div>
<div id="icon_reg_layer" style="display:none">
<div class="black_board" style="display:block"></div>
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
<a href="javascript:commonLayerClose('icon_reg_layer')" class="pop_close">x</a>
<h2>채널아이콘</h2>
<table>
<tr style="height:50px">
<th>아이콘리스트</th>
<td class="tl">
<div class="icon_list" style="overflow-y: scroll; height:150px;">
<? foreach ($channel_icon_list as $val) {?>
<a href="javascript:;" class="por">
<img src="<?=$val['channel_icon']?>" alt=""/>
</a>
<? }?>
</div>
</td>
</tr>
<tr>
<th>아이콘첨부</th>
<td class="tl">
<input type="file" name="channel_icon" id="channel_icon" class="input00" size="30" >
</td>
</tr>
</table>
<div class="write_btn tc">
<a href="javascript:channel_icon_add_proc()">신규등록</a>
<a href="javascript:commonLayerClose('icon_reg_layer')">취소하기</a>
</div>
</div>
</div>
</form>
<script type="text/javascript">
function check_search(){
if($("#search_type").val()=="" && $("#search_keyword").val()!=""){
alert("검색할 항목을 선택해주세요.");
return false;
}
$("#input_form").submit();
}
// edit
function channel_edit(idx){
$("#idx").val(idx);
$("#mode").val('edit');
$("#input_form").attr("action", "/admin/life/life_channel_reg/5");
$("#input_form").submit();
}
// 채널아이콘등록
function channel_icon_add(){
commonLayerOpen('icon_reg_layer');
}
function channel_icon_add_proc(){
var channel_icon = $("#channel_icon").val();
if(channel_icon=='') {
alert("아이콘을 등록해주세요.");
return false;
}
$("#input_form").attr("action", "/admin/life/life_channel_icon_add_proc");
$("#input_form").submit();
}
// 삭제
function channel_del_proc(idx) {
$("#idx").val(idx);
if(confirm("채널을 삭제하면 하위글도 모두 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#category_idx").val(idx);
$("#input_form").attr("action", "/admin/life/life_channel_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
</script>

View File

@@ -0,0 +1,235 @@
<?php
$category_idx = $search_category;
$channel_name = '';
$channel_intro = '';
$channel_icon = '';
$main_img = '';
if($mode=='edit') {
$category_idx = $result[0]['category_idx'];
$channel_name = $result[0]['channel_name'];
$channel_intro = $result[0]['channel_intro'];
$channel_intro = htmlspecialchars($channel_intro);
$channel_icon = $result[0]['channel_icon'];
$main_img = $result[0]['main_img'];
}
$menu_code = '52';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<link href="/css/admin/multi-select.css" media="screen" rel="stylesheet" type="text/css">
<script src="/js/admin/jquery.multi-select.js" type="text/javascript"></script>
<script src="/js/admin/jquery.quicksearch.js" type="text/javascript"></script>
<form name="input_form" id="input_form" method="post" action="/admin/life/life_channel_reg_proc" enctype="multipart/form-data">
<input type="hidden" id="mode" name="mode" value="<?=$mode?>">
<input type="hidden" id="idx" name="idx" value="<?=$idx?>">
<input type="hidden" id="editor_count" name="editor_count" value="<?=$editor_count?>">
<input type="hidden" id="editor_val" name="editor_val" value="">
<div class="common_table news">
<table>
<tr>
<th>카테고리</th>
<td class="tl">
<select name="category_idx" id="category_idx">
<option value="">선택</option>
<? foreach($category_list as $val) {?>
<option value="<?=$val['idx']?>" <? if($category_idx==$val['idx']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }?>
</select>
</td>
</tr>
<tr>
<th>채널명</th>
<td class="tl"><input type="text" name="channel_name" id="channel_name" class="type01" size="100" value="<?=$channel_name?>"></td>
</tr>
<tr>
<th>한줄소개</th>
<td class="tl"><input type="text" name="channel_intro" id="channel_intro" class="input00" size="100" value="<?=$channel_intro?>"></td>
</tr>
<tr>
<th>체널아이콘</th>
<td class="tl">
<button type="button" class="btn_black" style="width:100px" onclick="view_channel_icon();" style="cursor: pointer;">선택하기</button>
<input type="hidden" name="channel_icon" id="channel_icon" value="<?=$channel_icon?>">
<div id="icon_img">
<? if($channel_icon!='') { ?>
<img src="<?=$channel_icon?>" width="100px">
<? } ?>
</div>
</td>
</tr>
<tr>
<th>대문이미지</th>
<td class="tl">
<? if($main_img!='') { ?>
<input type="checkbox" name="is_del_main_img" value="Y">삭제
<input type="hidden" name="org_main_img" value="<?=$main_img?>">
<img src="<?=$main_img?>" width="100px"></br>
<? } ?>
<input type="file" name="main_img" id="main_img" class="input00">
</td>
</tr>
<tr>
<th>에디터등록</th>
<td class="tl">
<div style="border:solid 0px #5362a4;width:45%;float:left;">
<select multiple="multiple" id="editor" name="editor[]">
<? foreach($editor_all_list as $val) {?>
<option value="<?=$val['idx']?>"><?=$val['partner_name']?>(<?=$val['partner_id']?>)</option>
<? }?>
<? foreach($channel_editor_list as $val) {?>
<option value="<?=$val['idx']?>" selected><?=$val['partner_name']?>(<?=$val['partner_id']?>)</option>
<? }?>
</select>
</div>
</td>
</tr>
</table>
</div>
<div class="write_btn tc">
<a href="javascript:channel_reg_proc();">저장하기</a>
<a href="/admin/life/life_channel_list/5/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_category=<?=$search_category?>">목록으로</a>
</div>
<div id="icon_reg_layer" style="display:none">
<div class="black_board" style="display:block"></div>
<div class="pop_con common_table moving_all" style="display:block;top:100px;">
<a href="javascript:commonLayerClose('icon_reg_layer')" class="pop_close">x</a>
<h2>채널아이콘</h2>
<table>
<tr>
<th>아이콘선택</th>
<td class="tl">
<div class="icon_list" style="overflow-y: scroll; height:150px;">
<? foreach ($channel_icon_list as $val) {?>
<a href="#;" class="por">
<input type="radio" name="sel_channel_icon" id="sel_channel_icon" class="stebox" value="<?=$val['channel_icon']?>">
<img src="<?=$val['channel_icon']?>" alt=""/>
</a>
<? }?>
</div>
</td>
</tr>
</table>
<div class="write_btn tc">
<a href="javascript:select_channel_icon('add')">적용하기</a>
<a href="javascript:commonLayerClose('icon_reg_layer')">취소하기</a>
</div>
</div>
</div>
</form>
<script type="text/javascript">
var editor_num = new Array();
$('#editor').multiSelect({
selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='이름 or 아이디' style='padding: 10px;margin-left: 5px; width:280px;'>",
selectionHeader: "<div style='height:37px;text-align:right;width:280px'>에디터: <span id='edit_count_txt'><?=number_format($editor_count)?></span>, 등록글수: <?=number_format($article_count)?></div>",
afterInit: function(ms){
var that = this,
$selectableSearch = that.$selectableUl.prev(),
selectableSearchString = '#'+that.$container.attr('id')+' .ms-elem-selectable:not(.ms-selected)';
that.qs1 = $selectableSearch.quicksearch(selectableSearchString)
.on('keydown', function(e){
if (e.which === 40){
that.$selectableUl.focus();
return false;
}
});
},
afterSelect: function(e){
this.qs1.cache();
var new_editor_count = parseInt($("#editor_count").val())+1;
$("#editor_count").val(new_editor_count);
$("#edit_count_txt").html(new_editor_count);
$('#editor').find('option[value="'+e[0]+'"]').prop('selected', true);
},
afterDeselect: function(e){
this.qs1.cache();
var new_editor_count = parseInt($("#editor_count").val())-1;
$("#editor_count").val(new_editor_count);
$("#edit_count_txt").html(new_editor_count);
$('#editor').find('option[value="'+e[0]+'"]').prop('selected', false);
}
});
// 아이콘 보기
function view_channel_icon(){
commonLayerOpen('icon_reg_layer')
}
// 아이콘 적용
function select_channel_icon(){
var channel_icon = $("input[type=radio][id=sel_channel_icon]:checked").val();
$("#channel_icon").val(channel_icon);
$("#icon_img").empty();
$("#icon_img").html('<img src="'+channel_icon+'" width="40">');
commonLayerClose('icon_reg_layer')
}
// 채널추가
function channel_reg_proc(){
if($("#category_idx").val()=='') {
alert("카테고리를 선택해주세요.");
return false;
}
if($("#channel_name").val()=='') {
alert("채널명을 등록해주세요.");
return false;
}
$('.ms-selection').find('.ms-list').find('li.ms-selected span').each(function(e, val){
$('#editor option').each(function(i, v){
if($(v).text() == $(val).text()) {
editor_num[e] = $(v).val();
}
});
});
$('#editor_val').val(editor_num.join(','));
$("#input_form").submit();
}
$(".icon_list a").click(function(){
$(".icon_list a").removeClass("on");
$(this).addClass("on");
});
</script>

View File

@@ -0,0 +1,199 @@
<?php
include_once ("./static_data/code.php");
if($search_comment_type == 'Y') {
$menu_code = '562';
} else {
$menu_code = '561';
}
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/life/life_comment_list/5">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="page" name="search_comment_type" value="<?=$search_comment_type?>">
<input type="hidden" id="idx" name="idx">
<input type="hidden" id="mode" name="mode">
<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?>">
<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/life/life_comment_list/5?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_life_type" onchange="check_search();">
<option value="">기능별</option>
<? foreach ($def_arr_life_type as $key=>$val) {?>
<option value="<?=$key?>" <? if($search_life_type==$key){ echo 'selected';}?>><?=$val?></option>
<? }?>
</select>
<select name="search_theme_type" onchange="check_search();">
<option value="">테마별</option>
<? foreach ($def_arr_life_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'];
$life_type = $val['life_type'];
$theme_types = $val['theme_types'];
$comment = $val['comment'];
$content_idx = $val['content_idx'];
$category_name1 = $val['category_name1'];
$category_name2 = $val['category_name2'];
$is_best = $val['is_best'];
$content_idx = $val['content_idx'];
$best_txt = '';
if($is_best == 'Y') {
$best_txt = '[best]';
}
$category_name = $category_name1;
if($category_name2!='') $category_name.= '> '.$category_name2;
$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:60px" onclick="location.href='/admin/life/life_reg/5?mode=edit&idx=<?=$content_idx?>'" style="cursor: pointer;">글보기</button>
<button type="button" class="btn_s_blue" style="width:40px" onclick="life_comment_del_proc('<?=$idx?>');" style="cursor: pointer;">삭제</button>
</th>
</tr>
<tr>
<td style="text-align: left">
<a href="/web/life/life_view/<?=$content_idx?>" target="_blank">[<?=$category_name?>]</br><?=$title?></a>
</td>
<td style="text-align:right"><?=$def_arr_life_type[$life_type]?></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 life_comment_del_proc(idx) {
if(confirm("댓글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/life/life_comment_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
</script>

View File

@@ -0,0 +1,337 @@
<?php
include_once ("./static_data/code.php");
$arr_category_add1 = array();
$arr_category_add2 = array();
foreach ($arr_category1 as $key=>$val) {
$arr_category_add1[] = array('category_code'=>$val['idx'], 'category_name'=>$val['category_name']);
}
foreach ($arr_category2 as $key=>$val) {
$arr_category_add2[$val['category_idx']][] = array('category_code'=>$val['idx'], 'category_name'=>$val['channel_name']);
}
$menu_code = '53';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
# 에디터체크
$admin_type = $this->session->userdata('Adm_Type');
$colspan = '14';
$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/life/life_list/5">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="search_life_type" name="search_life_type" value="<?=$search_life_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><a href="/admin/life/life_list/5" <? if($search_life_type=='') { echo 'class="on"';}?>>전체</a></li>
<? foreach ($def_arr_life_type as $key=>$val) {?>
<li><a href="/admin/life/life_list/5?search_life_type=<?=$key?>" <? if($search_life_type==$key) { echo 'class="on"';}?>><?=$val?></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="editor_name" <? if($search_type=='editor_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>
<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="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>
<? if($admin_type == '0') {?>
<div class="searh_area">
<select name="search_category_code1" onchange="category_search()" class="type01">
<option value="">카테고리</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="">채널</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>
</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_name1 = $val['category_name1'];
$category_name2 = $val['category_name2'];
$life_type = $val['life_type'];
$editor_name = $val['editor_name'];
$reg_date = $val['reg_date'];
$hit_count = $val['hit_count'];
$like_count = $val['like_count'];
$comment_count = $val['comment_count'];
$is_display = $val['is_display'];
$display_date = $val['display_date'];
$tag = $val['tag'];
$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/life/life_list/5?search_type=tag&search_keyword='.$val.'" class="text_blue">'.$val.'</a>';
if($key==2) break;
}
if($tag_count > 3) {
$tag_txt.=' 외 '.($tag_count-3).'개';
}
$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/life/life_category_list/5?search_type=category_name&search_keyword=<?=$category_name1?>"><?=$category_name1?></a></td>
<td><a href="/admin/life/life_channel_list/5?search_type=channel_name&search_keyword=<?=$category_name2?>"><?=$category_name2?></a></td>
<td><?=$def_arr_life_type[$life_type]?></td>
<td><a href="/admin/life/life_list/5?search_type=editor_name&search_keyword=<?=$editor_name?>"><?=$editor_name?></a></td>
<td style="text-align:left;" class="title"><a href="javascript:life_edit('<?=$idx?>')"><?=$new?><?=$title?></a></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:life_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
<a href="javascript:life_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
</td>
</tr>
<?
$dataNumber--;
}
}
?>
</tbody>
</table>
</div>
<div class="write_btn">
<a href="javascript:life_arr_del_proc();">삭제</a>
<a href="javascript:life_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 life_add(){
$("#mode").val('add');
$("#input_form").attr("action", "/admin/life/life_reg/5");
$("#input_form").submit();
}
// edit
function life_edit(idx){
$("#idx").val(idx);
$("#mode").val('edit');
$("#input_form").attr("action", "/admin/life/life_reg/5");
$("#input_form").submit();
}
// 삭제
function life_del_proc(idx) {
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/life/life_reg_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
// 복수 삭제
function life_arr_del_proc() {
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
alert("삭제할 내용이 없습니다.");
return false;
}
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#input_form").attr("action", "/admin/life/life_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/life/life_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,141 @@
<?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'];
$share_count = $result['share_count'];
$comment_count = $result['comment_count'];
$main_img = $result['main_img'];
$ranking_type = $result['ranking_type'];
$rank = $result['rank'];
$editor_name = $result['editor_name'];
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
$menu_code = '55';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/life/life_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_theme_type" name="search_theme_type" value="<?=$search_theme_type?>">
<input type="hidden" id="search_life_type" name="search_life_type" value="<?=$search_life_type?>">
<input type="hidden" id="mode" name="mode" value="edit">
<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 news">
<h2 class="subtitle"><?=$def_arr_ranking[$ranking_type]['name']?></h2>
<table>
<tr>
<th rowspan="6"><?=$rank?>위(썸네일)</th>
<td class="tl">
<input type="hidden" name="content_idx" id="content_idx" value="<?=$content_idx?>">
<input type="text" name="title" id="title" size="50" placeholder="제목을 입력해주세요." value="<?=$title?>">
</td>
</tr>
<tr>
<td class="tl">
<input type="text" name="sub_content" id="sub_content" size="50" placeholder="내용 간략노출" value="<?=$sub_content?>">
</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="editor_name" id="editor_name" class="type03" placeholder="에디터명" value="<?=$editor_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="share_count" id="share_count" class="type03" size="20" placeholder="공감수" value="<?=$share_count?>">
</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:life_ranking_list_reg_proc();">저장하기</a>
<a href="/admin/life/life_ranking_list/5/<?=$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_theme_type=<?=$search_theme_type?>&search_life_type=<?=$search_life_type?>">목록으로</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 life_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,264 @@
<?php
include_once ("./static_data/code.php");
$arr_category_add1 = array();
$arr_category_add2 = array();
foreach ($arr_category1 as $key=>$val) {
$arr_category_add1[] = array('category_code'=>$val['idx'], 'category_name'=>$val['category_name']);
}
foreach ($arr_category2 as $key=>$val) {
$arr_category_add2[$val['category_idx']][] = array('category_code'=>$val['idx'], 'category_name'=>$val['channel_name']);
}
$menu_code = '551';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/life/life_ranking_list/5">
<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_ranking_type" name="search_ranking_type" value="<?=$search_ranking_type?>">
<div class="common_tep clearfix type01">
<ul class="clearfix">
<li><a href="/admin/life/life_ranking_list/5" <? 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/life/life_ranking_list/5?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="editor_name" <? if($search_type=='editor_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);?>
<div class="searh_area">
<select name="search_life_type" onchange="category_search()">
<option value="">기능</option>
<? if(count($def_arr_life_type) > 0) {
foreach ($def_arr_life_type as $key=>$val) {?>
<option value="<?=$key?>" <? if($search_life_type==$key) { echo 'selected'; }?>><?=$val?></option>
<? }
} ?>
</select>
<select name="search_category_code1" onchange="category_search()">
<option value="">카테고리</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="">채널</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>
</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>
<th>관리</th>
</tr>
</thead>
<tbody>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="15">등록된 내용이 없습니다.</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_name2 = $val['category_name2'];
$ranking_type = $val['ranking_type'];
$life_type = $val['life_type'];
$editor_name = $val['editor_name'];
$reg_date = $val['reg_date'];
$hit_count = $val['hit_count'];
$like_count = $val['like_count'];
$comment_count = $val['comment_count'];
$rank = $val['rank'];
$content_idx = $val['content_idx'];
$ranking_type_txt = $def_arr_ranking[$ranking_type]['name'];
$life_type_txt = $def_arr_life_type[$life_type];
$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><?=$rank?></td>
<td><img src="<?=$main_img?>" width="35"></td>
<td><?=$ranking_type_txt?></td>
<td><a href="/admin/life/life_category_list/5?search_type=category_name&search_keyword=<?=$category_name1?>"><?=$category_name1?></a></td>
<td><a href="/admin/life/life_channel_list/5?search_type=channel_name&search_keyword=<?=$category_name2?>"><?=$category_name2?></a></td>
<td><?=$life_type_txt?></td>
<td style="text-align:left;" class="title"><a href="/admin/life/life_reg/5?mode=edit&idx=<?=$content_idx?>"><?=$new?><?=$title?></a></td>
<td><a href="/admin/life/life_list/5?search_type=editor_name&search_keyword=<?=$editor_name?>"><?=$editor_name?></a></td>
<td><?=$reg_date?></td>
<td><?=$hit_count?></td>
<td><?=$like_count?></td>
<td><?=$comment_count?></td>
<td class="tool_btn">
<a href="javascript:life_ranking_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
<a href="javascript:life_ranking_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
</td>
</tr>
<?
$dataNumber--;
}
}
?>
</tbody>
</table>
</div>
<div class="write_btn">
<a href="javascript:life_ranking_reg_arr_del_proc()">삭제</a>
<a href="javascript:life_ranking_list_reg()">송출관리</a>
<a href="/admin/life/life_reg/5?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 life_ranking_list_reg(){
$("#mode").val('add');
$("#input_form").attr("action", "/admin/life/life_ranking_list_reg/5");
$("#input_form").submit();
}
// edit
function life_ranking_edit(idx){
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/life/life_ranking_edit/5");
$("#input_form").submit();
}
// 삭제
function life_ranking_del_proc(idx) {
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/life/life_ranking_reg_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
// 복수 삭제
function life_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/life/life_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,180 @@
<?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'], 'share_count'=>$val['share_count'], 'editor_name'=>$val['editor_name']);
}
$menu_code = '55';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/life/life_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_theme_type" name="search_theme_type" value="<?=$search_theme_type?>">
<input type="hidden" id="search_life_type" name="search_life_type" value="<?=$search_life_type?>">
<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 news">
<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 = '';
$share_count = '';
$comment_count = '';
$editor_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'];
$share_count = $arr_ranking_list[$i]['share_count'];
$comment_count = $arr_ranking_list[$i]['comment_count'];
$main_img = $arr_ranking_list[$i]['main_img'];
$editor_name = $arr_ranking_list[$i]['editor_name'];
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
}
?>
<tr>
<th rowspan="6"><?=$i?>위(썸네일)</th>
<td class="tl">
<input type="hidden" name="content_idx<?=$i?>" id="content_idx<?=$i?>" value="<?=$content_idx?>">
<input type="text" name="title<?=$i?>" id="title<?=$i?>" placeholder="제목을 입력해주세요." value="<?=$title?>">
</td>
</tr>
<tr>
<td class="tl">
<input type="text" name="content<?=$i?>" id="content<?=$i?>" placeholder="내용간략노출" value="<?=$sub_content?>">
</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="editor_name<?=$i?>" id="editor_name<?=$i?>" class="type03" placeholder="에디터명" value="<?=$editor_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="share_count<?=$i?>" id="share_count<?=$i?>" class="type03" size="20" placeholder="공감수" value="<?=$share_count?>">
</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:life_ranking_list_reg_proc()">저장하기</a>
<a href="/admin/life/life_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_theme_type=<?=$search_theme_type?>&search_life_type=<?=$search_life_type?>">목록으로</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/life/life_ranking_list_reg/5");
$("#input_form").submit();
}
var ranking_count = "<?=$def_arr_ranking[$search_ranking_type]['count']?>";
function life_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,197 @@
<?php
include_once ("./static_data/code.php");
$arr_category_add1 = array();
$arr_category_add2 = array();
foreach ($arr_category1 as $key=>$val) {
$arr_category_add1[] = array('category_code'=>$val['idx'], 'category_name'=>$val['category_name']);
}
foreach ($arr_category2 as $key=>$val) {
$arr_category_add2[$val['category_idx']][] = array('category_code'=>$val['idx'], 'category_name'=>$val['channel_name']);
}
$menu_code = '552';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/life/life_ranking_log_list/5">
<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/life/life_ranking_log_list/5" <? 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/life/life_ranking_log_list/5?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="editor_name" <? if($search_type=='editor_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);?>
<div class="searh_area">
<select name="search_life_type" onchange="category_search()">
<option value="">기능</option>
<? if(count($def_arr_life_type) > 0) {
foreach ($def_arr_life_type as $key=>$val) {?>
<option value="<?=$key?>" <? if($search_life_type==$key) { echo 'selected'; }?>><?=$val?></option>
<? }
} ?>
</select>
<select name="search_category_code1" onchange="category_search()">
<option value="">카테고리</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="">채널</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>
</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>
<th>댓글수</th>
</tr>
</thead>
<tbody>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="12">등록된 내용이 없습니다.</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_name2 = $val['category_name2'];
$ranking_type = $val['ranking_type'];
$life_type = $val['life_type'];
$editor_name = $val['editor_name'];
$reg_date = $val['reg_date'];
$hit_count = $val['hit_count'];
$like_count = $val['like_count'];
$comment_count = $val['comment_count'];
$rank = $val['rank'];
$content_idx = $val['content_idx'];
$ranking_type_txt = $def_arr_ranking[$ranking_type]['name'];
$life_type_txt = $def_arr_life_type[$life_type];
?>
<tr>
<td><?=$rank?></td>
<td><img src="<?=$main_img?>" width="35"></td>
<td><?=$ranking_type_txt?></td>
<td><a href="/admin/life/life_category_list/5?search_type=category_name&search_keyword=<?=$category_name1?>"><?=$category_name1?></a></td>
<td><a href="/admin/life/life_channel_list/5?search_type=channel_name&search_keyword=<?=$category_name2?>"><?=$category_name2?></a></td>
<td><?=$life_type_txt?></td>
<td style="text-align:left;" class="title"><a href="/admin/life/life_reg/5?mode=edit&idx=<?=$content_idx?>"><?=$title?></a></td>
<td><a href="/admin/life/life_list/5?search_type=editor_name&search_keyword=<?=$editor_name?>"><?=$editor_name?></a></td>
<td><?=$reg_date?></td>
<td><?=$hit_count?></td>
<td><?=$like_count?></td>
<td><?=$comment_count?></td>
</tr>
<?
$dataNumber--;
}
}
?>
</tbody>
</table>
</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();
}
</script>

View File

@@ -0,0 +1,587 @@
<?php
include_once ("./static_data/code.php");
$arr_theme_reg = array();
for($i=11;$i<=21;$i++) {
$arr_theme_reg[$i] = '';
}
$arr_section_reg = array();
for($i=1;$i<=4;$i++) {
$arr_section_reg[$i] = '';
}
$admin_type = $this->session->userdata('Adm_Type');
$admin_id = $this->session->userdata('Adm_Id');
if($mode=='edit') {
// 칼럼리스트는 자기 글만 삭제 가능
$write_id = $result['write_id'];
if($admin_type == '1') {
if($write_id != $admin_id) {
gf_alert("잘못된 접근입니다.", "/admin/main");
exit;
}
}
$title = $result['title'];
$title = htmlspecialchars($title);
$content = htmlentities($result['content']);
$category_code1 = $result['category_idx'];
$category_code2 = $result['channel_idx'];
$category_code3 = $result['partner_idx'];
$head_title = $result['head_title'];
$head_title = htmlspecialchars($head_title);
$sub_title = $result['sub_title'];
$sub_title = htmlspecialchars($sub_title);
$tag = $result['tag'];
$org_url = $result['org_url'];
$hit_count = $result['hit_count'];
$like_count = $result['like_count'];
$display_date = $result['display_date'];
$is_display = $result['is_display'];
$org_main_img = $result['main_img'];
$life_type = $result['life_type'];
$main_img = $result['main_img'];
$video_url = $result['video_url'];
if($video_url !='') $video_url = str_replace('https://www.youtube.com/embed/','', $video_url);
$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'];
}
} else {
$main_img = '';
$category_code1 = '';
$category_code2 = '';
$category_code3 = '';
$title = '';
$head_title = '';
$content = '';
$sub_title = '';
$tag = '';
$org_url = '';
$hit_count = 0;
$like_count = 0;
$video_url = '';
$display_date = '';
$display_hour = '';
$display_min = '';
$display_sec = '';
$life_type = $search_life_type;
if($life_type == '') $life_type = '1';
}
?>
<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 = '53';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/life/life_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_life_type" name="search_life_type" value="<?=$search_life_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_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">
<? foreach ($def_arr_life_type as $key=>$val) {?>
<input type="radio" name="life_type" value="<?=$key?>" <? if($life_type==$key) { echo 'checked';}?>> <?=$val?>&nbsp;&nbsp;
<? }?>
</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_category1) > 0) {
foreach ($arr_category1 as $val) {?>
<option value="<?=$val['idx']?>" <? if($category_code1==$val['idx']) { echo 'selected'; }?>><?=$val['category_name']?></option>
<? }
} ?>
</select>
</td>
</tr>
<tr>
<th>채널</th>
<td class="tl">
<select name="category2" id="category2" onchange="change_category(2, this.value)" class="type01">
<option value="">선택</option>
<? if(count($arr_category2) > 0) {
foreach ($arr_category2 as $val) {?>
<option value="<?=$val['idx']?>" <? if($category_code2==$val['idx']) { echo 'selected'; }?>><?=$val['channel_name']?></option>
<? }
} ?>
</select>
</td>
</tr>
<tr>
<th>에디터</th>
<td class="tl">
<select name="category3" id="category3" class="type01">
<option value="">선택</option>
<? if(count($arr_category3) > 0) {
foreach ($arr_category3 as $val) {?>
<option value="<?=$val['idx']?>" <? if($category_code3==$val['idx']) { echo 'selected'; }?>><?=$val['partner_name']?></option>
<? }
} ?>
</select>
</td>
</tr>
<tr>
<th>말머리</th>
<td class="tl">
<input type="text" name="head_title" id="head_title" class="type02" value="<?=$head_title?>">
</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">
<input type="text" name="tag" id="tag" class="type01" value="<?=$tag?>"> 최대 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 id="content" name="content"><?=$content?></textarea> -->
<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="<?=$hit_count?>"> (관리자가 임의적으로 조회수를 설정할 수 있습니다.)
</td>
</tr>
<tr>
<th>좋아요수</th>
<td class="tl">
<input type="text" name="like_count" id="like_count" class="type03" value="<?=$like_count?>"> (관리자가 임의적으로 좋아요수를 설정할 수 있으나 조회수 이상이 될 수는 없습니다)
</td>
</tr>
</table>
<? if($admin_type=='0') {?>
<h2 class="subtitle"><span>PC</span>테마설정</h2>
<table>
<? foreach($def_arr_life_theme as $key=>$val) {
if($key == '16') break;
$add_txt = '';
$width = "300px";
if($key == '13' || $key == '14') {
$add_txt = '</br>(모바일공통)';
$width="400px";
}
?>
<tr>
<th><?=$val['name']?><?=$add_txt?></td>
<td class="tl">
<div class="opt_box">
<select name="theme_type<?=$key?>" class="type01">
<option value="">순위설정</option>
<? for($i=1;$i<=$def_arr_life_theme[$key]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_theme_reg[$key] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/life<?=$key?>.png" width="<?=$width?>">
<? if($key==13){ ?><img src="/img/admin/1.png" width="300px"><? }?>
<? if($key==14){ ?><img src="/img/admin/2.png" width="250px"><? }?>
<? if($key==15){ ?><img src="/img/admin/3.png" width="400px"><? }?>
</td>
</tr>
<? }?>
</table>
<h2 class="subtitle"><span>모바일</span>테마설정</h2>
<table>
<? for($key=16;$key<=21;$key++){
$add_txt = '라이프</br>';
if($key <= '19') {
$add_txt = '은혜</br>';
}
?>
<tr>
<th><?=$add_txt?><?=$def_arr_life_theme[$key]['name']?></td>
<td class="tl">
<div class="opt_box">
<select name="theme_type<?=$key?>" class="type01">
<option value="">순위설정</option>
<? for($i=1;$i<=$def_arr_life_theme[$key]['count'];$i++){?>
<option value="<?=$i?>" <? if($arr_theme_reg[$key] == $i) { echo 'selected';}?>><?=$i?>위</option>
<? }?>
</select>
</div>
<img src="/img/admin/life<?=$key?>.png" width="350px">
</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(true) {?>
<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:life_reg_proc();">저장하기</a>
<a href="/admin/life/life_list/2/<?=$page?>?search_type=<?=$search_type?>&search_keyword=<?=$search_keyword?>&search_category_code1=<?=$search_category_code1?>&search_category_code2=<?=$search_category_code2?>&search_life_type=<?=$search_life_type?>&sort=<?=$sort?>&search_click1=<?=$search_click1?>&search_click2=<?=$search_click2?>">취소하기</a>
</div>
</form>
<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">
$(document).ready(function() {
/*
CKEDITOR.replace('content', {
height: '400px'
});
*/
});
function life_reg_proc(){
//CKEDITOR.instances.content.updateElement();
oEditors.getById["ir1"].exec("UPDATE_CONTENTS_FIELD", []);
//oEditors2.getById["ir2"].exec("UPDATE_CONTENTS_FIELD", []);
if($("#category1").val()=='') {
alert("카테고리를 선택해주세요.");
return false;
}
if($("#category2").val()=='') {
alert("채널을 선택해주세요.");
return false;
}
if($("#category3").val()=='') {
alert("에디터를 선택해주세요.");
return false;
}
if($("#title").val()=='') {
alert("제목을 입력해주세요.");
return false;
}
if($("#main_img").val()=='' && $("#org_main_img").val()=='') {
alert("메인이미지를 입력해주세요.");
return false;
}
/*
if($("#content").val()=='') {
alert("내용을 입력해주세요.");
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 like_count = parseInt($("#like_count").val());
if(like_count > hit_count) {
alert("좋아요수가 조회수 이상이 될수 없습니다.");
return false;
}
$("#input_form").submit();
}
function change_category(depth, val){
if(depth == 1) {
var json_category = '<?=json_encode($arr_category2)?>';
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]['category_idx'] == val) {
option = $("<option value='"+json_category[key]['idx']+"'>"+json_category[key]['channel_name']+"</option>");
$('#category2').append(option);
}
}
} else {
var json_category = <?=json_encode($arr_category3)?>;
$('#category3').empty();
var option = "<option value=''>선택</option>";
$('#category3').append(option);
for(key in json_category) {
if(json_category[key]['channel_idx'] == val) {
option = $("<option value='"+json_category[key]['idx']+"'>"+json_category[key]['partner_name']+"</option>");
$('#category3').append(option);
}
}
}
}
// 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,85 @@
<?php
$is_duplication = $result['is_duplication'];
$no_duplication_setting = $result['no_duplication_setting'];
$stat_time = $result['stat_time'];
$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 = '51';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/life/life_setting_reg_proc" method="post">
<input type="hidden" name="idx" value="<?=$idx?>">
<div class="common_table news">
<h2 class="subtitle">조회수설정</h2>
<table>
<tr>
<th rowspan="3">집계설정</th>
<td colspan="3" class="tl">
<input type="radio" name="is_duplication" id="is_duplication" value="N" class="input00" <? if($is_duplication=='N') { echo 'checked';}?>> 중복집계 비허용&nbsp;&nbsp;
<input type="radio" name="is_duplication" id="is_duplication" value="Y" class="input00" <? if($is_duplication=='Y') { echo 'checked';}?>> 중복집계 허용
<div>
한 명당 여러 번의 집계가 가능한지 불가능한지를 설정합니다.</br>
중복집계 비허용 : 중복집계를 비허용으로 설정하시면 아래의 중복집계 판단 기준에 따라 중복이라고 판단되면 집계에 포함되지 않습니다..</br>
중복집계허용 : 중복잡계 판단 기준과 관계없이 모두 집계가 됩니다.</br>
</div>
</td>
</tr>
<tr>
<td colspan="3" class="tl">
<div><b>중복집계 판단 기준 설정 (중복집계 비허용시)</b></div>
<input type="radio" name="no_duplication_setting" id="no_duplication_setting" value="1" class="input00" <? if($no_duplication_setting=='1') { echo 'checked';}?>> 아이디 기준 중복방지&nbsp;&nbsp;
<input type="radio" name="no_duplication_setting" id="no_duplication_setting" value="2" class="input00" <? if($no_duplication_setting=='2') { echo 'checked';}?>> 아아피 기준 중복방지
<div>
중복집계를 비허용으로 설정하셨을 경우 중복기준을 아이디로 할 것인지 아이피로 할 것인지의 선택</br>
아이디 기준 중복방지 : 중복집계를 비허용으로 하셨다면 같은 아이디로 접속시 중복으로 판단하고 집계가 되지 않습니다.</br>
아이피 기중 중복장지 : 중복집계를 비허용으로 하셨다면 같은 아이피에서 접속시 중복으로 판단하고 집계가 되지 않습니다.</br>
</div>
</td>
</tr>
<tr>
<td colspan="3" class="tl">
<div><b>집계 허용시간</b></div>
<input type="text" name="stat_time1" id="stat_time1" class="type03" size="5" value="<?=$stat_time1?>">시간 <input type="text" name="stat_time2" id="stat_time2" class="type03" size="5" value="<?=$stat_time2?>">분 <input type="text" name="stat_time3" id="stat_time3" class="type03" size="5" value="<?=$stat_time3?>">초
<div>
관리자의 랭킹집계관리 페이지에서 랭킹집계를 관리자가 수동으로 랭킹을 집계하셔야 합니다.</br>
랭킹집계는 랭킹집계관리 페이지에서재집계버튼, 전체재집계버튼, 집계시작버튼으로 집계를 하실수 있습니다.</br>
출력중 : 출력중으로 설정하시면 수동집계시 해당 집계가 사용자화면에 출력됩니다.</br>
미출력 : 미출력으로 설정하시면 수동집계시 해당 집계가 사용자화면에 출력되지 않습니다. </br>
예) 2013년 2월 랭킹집계는 출력으로 되어있고 3월 랭킹집계는 미출력으로 되어있다면 2013년 2월 랭킹집계는 출력되지만 3월은 출력되지 않습니다.</br>
수동 집계 방식은 관리자가 랭킹을 직접 집계하고 출력상태로 해놓아야지만 사용자가 볼수 있습니다.</br>
</div>
</td>
</tr>
</table>
</div>
<div class="write_btn tc">
<a href="javascript:life_setting_reg_proc()">저장하기</a>
</div>
</form>
<script type="text/javascript">
function life_setting_reg_proc(){
if($("#stat_time1").val()=='' && $("#stat_time2").val()=='' && $("#stat_time3").val()=='') {
alert("집계허용시간을 설정해주세요.");
return false;
}
$("#input_form").submit();
}
</script>

View File

@@ -0,0 +1,97 @@
<?
$menu_code = '57';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" method="post" action="/admin/life/life_tag_list/5">
<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 {
$now_date = date("Y-m-d");
$dataNumber = ($total_count + $limit)-($page*$limit);
foreach($list as $val) {
$tag = $val['tag'];
$article_count = $val['cnt'];
?>
<tr>
<td><?=$dataNumber?></td>
<td class="title"><a href="/admin/life/life_list/5?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,167 @@
<?php
include_once ("./static_data/code.php");
$head_title = $result['head_title'];
$head_title = htmlspecialchars($head_title);
$sub_title = $result['sub_title'];
$sub_title = htmlspecialchars($sub_title);
$title = $result['title'];
$title = htmlspecialchars($title);
$content_idx = $result['content_idx'];
$main_img = $result['theme_img'];
$theme_type = $result['theme_type'];
$rank = $result['rank'];
$hit_count = $result['hit_count'];
$like_count = $result['like_count'];
$editor_name = $result['editor_name'];
$main_img_txt = '';
if($main_img!='') $main_img_txt = '<img src="'.$main_img.'" width=250>';
switch($theme_type) {
case '11': $rowspan = '4';break;
case '17': $rowspan = '4';break;
case '19': $rowspan = '5';break;
case '20': $rowspan = '4';break;
case '21': $rowspan = '5';break;
default : $rowspan = '3';break;
}
$menu_code = '54';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/life/life_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_life_type" name="search_life_type" value="<?=$search_life_type?>">
<input type="hidden" id="sort" name="sort" value="<?=$sort?>">
<input type="hidden" id="page" name="page" value="<?=$page?>">
<input type="hidden" id="key" name="key">
<input type="hidden" id="mode" name="theme_type" value="<?=$theme_type?>">
<div class="common_table news">
<h2 class="subtitle"><?=$def_arr_life_theme[$theme_type]['name']?></h2>
<?
if($def_arr_life_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?>">
<? if($theme_type=='11' || $theme_type=='16' || $theme_type=='17' || $theme_type=='18' || $theme_type=='19' || $theme_type=='20' || $theme_type=='21') {?>
<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=='11'){?>
<tr>
<td class="tl">
<input type="text" name="sub_title" id="sub_title" placeholder="부제목" value="<?=$sub_title?>">
</td>
</tr>
<? }
if($theme_type=='17' || $theme_type=='19' ||$theme_type=='20' || $theme_type=='21' ){?>
<tr>
<td class="tl">
<input type="text" name="editor_name" id="editor_name" class="type02" placeholder="에디터" value="<?=$editor_name?>" readonly>
</td>
</tr>
<?}
if($theme_type=='19') {
?>
<tr>
<td class="tl">
<input type="text" name="like_count" id="like_count" class="type03" placeholder="좋아요수" value="<?=$like_count?>">
</td>
</tr>
<?
}
if($theme_type=='21') {
?>
<tr>
<td class="tl">
<input type="text" name="hit_count" id="hit_count" class="type03" placeholder="조회수" value="<?=$hit_count?>">
</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:life_theme_list_reg_proc();">저장하기</a>
<a href="/admin/life/life_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_life_type=<?=$search_life_type?>&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 life_theme_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,316 @@
<?php
include_once ("./static_data/code.php");
$arr_category_add1 = array();
$arr_category_add2 = array();
foreach ($arr_category1 as $key=>$val) {
$arr_category_add1[] = array('category_code'=>$val['idx'], 'category_name'=>$val['category_name']);
}
foreach ($arr_category2 as $key=>$val) {
$arr_category_add2[$val['category_idx']][] = array('category_code'=>$val['idx'], 'category_name'=>$val['channel_name']);
}
$menu_code = '54';
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/life/life_theme_list/5">
<input type="hidden" id="search_theme_type" name="search_theme_type" value="<?=$search_theme_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="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/life/life_theme_list/5" <? if($search_theme_type=='') { echo 'class="on"';}?>>전체</a></li>
<?
foreach($def_arr_life_theme1 as $val) {
$css = '';
if($search_theme_type == $val['code']) {
$css = ' class="on"';
}
?>
<li><a href="/admin/life/life_theme_list/5?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.editor_name" <? if($search_type=='b.editor_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_life_theme2 as $val) {
$css = '';
if($search_theme_type == $val['code']) {
$css = ' class="on"';
}
?>
<li><a href="/admin/life/life_theme_list/5?search_theme_type=<?=$val['code']?>" <?=$css?>><?=$val['name']?></a></li>
<?
}?>
</ul>
</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_life_type" onchange="category_search()">
<option value="">기능</option>
<? if(count($def_arr_life_type) > 0) {
foreach ($def_arr_life_type as $key=>$val) {?>
<option value="<?=$key?>" <? if($search_life_type==$key) { echo 'selected'; }?>><?=$val?></option>
<? }
} ?>
</select>
<select name="search_category_code1" onchange="category_search()">
<option value="">카테고리</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="">채널</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>
</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>
<th>등록일시</br>(예약일시)</th>
<th>관리</th>
</tr>
</thead>
<tbody>
<?
if(count($list)==0) {
?>
<tr>
<td colspan="15">등록된 내용이 없습니다.</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_name2 = $val['category_name2'];
$theme_type = $val['theme_type'];
$editor_name = $val['editor_name'];
$life_type = $val['life_type'];
$reg_date = $val['reg_date'];
$hit_count = $val['hit_count'];
$like_count = $val['like_count'];
$comment_count = $val['comment_count'];
$rank = $val['rank'];
$is_display = $val['is_display'];
$display_date = $val['display_date'];
$content_idx = $val['content_idx'];
$display_date_txt = '';
if($is_display == 'N') {
$display_date_txt = '</br><span class="text_green">('.$display_date.')</span>';
}
$life_type_txt = $def_arr_life_type[$life_type];
$theme_type_txt = $def_arr_life_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"> ';
?>
<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/life/life_category_list/5?search_type=category_name&search_keyword=<?=$category_name1?>"><?=$category_name1?></a></td>
<td><a href="/admin/life/life_channel_list/5?search_type=channel_name&search_keyword=<?=$category_name2?>"><?=$category_name2?></td>
<td><?=$life_type_txt?></td>
<td><?=$theme_type_txt?></td>
<td><a href="/admin/life/life_list/5?search_type=editor_name&search_keyword=<?=$editor_name?>"><?=$editor_name?></a></td>
<td class="title" style="text-align:left;"><a href="/admin/life/life_reg/5?mode=edit&idx=<?=$content_idx?>"><?=$new?><?=$title?></a></td>
<td><?=$rank?></td>
<td><?=$hit_count?></td>
<td><?=$like_count?></td>
<td><?=$comment_count?></td>
<td><?=$reg_date?><?=$display_date_txt?></td>
<td class="tool_btn">
<a href="javascript:life_theme_edit('<?=$idx?>')"><i class="fa fa-pencil"></i>수정</a>
<a href="javascript:life_theme_del_proc('<?=$idx?>')"><i class="fa fa-close"></i>삭제</a>
</td>
</tr>
<?
$dataNumber--;
}
}
?>
</tbody>
</table>
</div>
<div class="write_btn">
<a href="javascript:life_theme_reg_arr_del_proc()">삭제</a>
<a href="javascript:life_theme_list_reg()">송출관리</a>
<a href="/admin/life/life_reg/5?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 click_search(type, id){
$("#"+id).val(type);
$("#input_form").submit();
}
function category_search(){
$("#input_form").submit();
}
function life_theme_list_reg(){
$("#mode").val('add');
$("#input_form").attr("action", "/admin/life/life_theme_list_reg/5");
$("#input_form").submit();
}
// edit
function life_theme_edit(idx){
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/life/life_theme_edit/5");
$("#input_form").submit();
}
// 삭제
function life_theme_del_proc(idx) {
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
$("#idx").val(idx);
$("#input_form").attr("action", "/admin/life/life_theme_reg_del_proc");
$("#input_form").submit();
} else { //취소
return;
}
}
// 복수 삭제
function life_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/life/life_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,274 @@
<?php
include_once ("./static_data/code.php");
if($mode=='edit') {
$title = $result['title'];
$title = htmlspecialchars($title);
$content = $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'];
$share_count = $result['share_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'];
$display_date = $result['display_date'];
$org_main_img = $result['main_img'];
$life_type = $result['life_type'];
$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'];
}
} else {
$head_title = '';
$title = '';
$theme_img = '';
$sub_content = '';
$content_idx = '';
}
$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_title'=>$val['sub_title'], 'sub_content'=>$val['sub_content'], 'editor_name'=>$val['editor_name'], 'theme_img'=>$val['theme_img'], 'like_count'=>$val['like_count'], 'hit_count'=>$val['hit_count']);
}
$menu_code = '54';
require_once (APPPATH.'views/skin/admin/_content_comm.php');
?>
<form name="input_form" id="input_form" action="/admin/life/life_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_life_type" name="search_life_type" value="<?=$search_life_type?>">
<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_life_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_life_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_life_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_life_theme[$search_theme_type]['count'];$i++) {
$head_title = '';
$title = '';
$sub_title = '';
$theme_img = '';
$theme_img_txt = '';
$content_idx = '';
$editor_name = '';
$hit_count = '';
$like_count = '';
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_title = $arr_theme_rank[$i]['sub_title'];
$sub_title = htmlspecialchars($sub_title);
$content_idx= $arr_theme_rank[$i]['content_idx'];
$theme_img = $arr_theme_rank[$i]['theme_img'];
$editor_name= $arr_theme_rank[$i]['editor_name'];
$hit_count = $arr_theme_rank[$i]['hit_count'];
$like_count = $arr_theme_rank[$i]['like_count'];
if($theme_img!='') $theme_img_txt = '<img src="'.$theme_img.'" width=250>';
}
switch($search_theme_type) {
case '11': $rowspan = '4';break;
case '17': $rowspan = '4';break;
case '19': $rowspan = '5';break;
case '20': $rowspan = '4';break;
case '21': $rowspan = '5';break;
default : $rowspan = '3';break;
}
?>
<tr>
<th rowspan="<?=$rowspan?>"><?=$i?>위</th>
<td class="tl">
<input type="hidden" name="content_idx<?=$i?>" id="content_idx<?=$i?>" value="<?=$content_idx?>">
<? if($search_theme_type=='11' || $search_theme_type=='16' || $search_theme_type=='17' || $search_theme_type=='18' || $search_theme_type=='19' || $search_theme_type=='20' || $search_theme_type=='21') {?>
<input type="text" name="head_title<?=$i?>" id="head_title<?=$i?>" class="type02" size="20" placeholder="말머리" value="<?=$head_title?>">
<? }?>
<input type="text" name="title<?=$i?>" id="title<?=$i?>" size="50" class="type00" placeholder="제목을 입력해주세요." value="<?=$title?>">
</td>
</tr>
<? if($search_theme_type=='11'){?>
<tr>
<td class="tl">
<input type="text" name="sub_title<?=$i?>" id="sub_title<?=$i?>" placeholder="부제목" value="<?=$sub_title?>">
</td>
</tr>
<? }
if($search_theme_type=='17' || $search_theme_type=='19' ||$search_theme_type=='20' || $search_theme_type=='21' ){?>
<tr>
<td class="tl">
<input type="text" name="editor_name<?=$i?>" id="editor_name<?=$i?>" class="type02" placeholder="에디터" value="<?=$editor_name?>" readonly>
</td>
</tr>
<?}
if($search_theme_type=='19') {
?>
<tr>
<td class="tl">
<input type="text" name="like_count<?=$i?>" id="like_count<?=$i?>" class="type03" placeholder="좋아요수" value="<?=$like_count?>">
</td>
</tr>
<?
}
if($search_theme_type=='21') {
?>
<tr>
<td class="tl">
<input type="text" name="hit_count<?=$i?>" id="hit_count<?=$i?>" class="type03" placeholder="조회수" value="<?=$hit_count?>">
</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:life_theme_list_reg_proc()">저장하기</a>
<a href="/admin/life/life_theme_list/5/<?=$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_life_type=<?=$search_life_type?>&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/life/life_theme_list_reg/5");
$("#input_form").submit();
}
var theme_count = "<?=$def_arr_life_theme[$search_theme_type]['count']?>";
function life_theme_list_reg_proc(){
for(i=1;i<=theme_count;i++) {
if($("#title"+i).val()!='') {
if($("#content_idx"+i).val()==''){
alert("기사를 선택해주세요.");
return false;
}
if($("#theme_img"+i).val()=='' && $("#img"+i).val()=='' && $("#org_img"+i).val()=='') {
alert("메인이미지를 입력해주세요.");
return false;
}
}
}
$("#input_form").submit();
}
</script>