Files
cm-web-legacy/application/views/admin/life/life_ranking_edit.php
2020-06-10 06:19:03 +09:00

141 lines
5.3 KiB
PHP
Executable File

<?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>