first commit
This commit is contained in:
224
application/views/admin/maptoon/cartoonist.php
Executable file
224
application/views/admin/maptoon/cartoonist.php
Executable file
@@ -0,0 +1,224 @@
|
||||
<?php
|
||||
$menu_code = '1050';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<!-- jquery UI -->
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<style>
|
||||
label, input { display:block; }
|
||||
input.text { margin-bottom:12px; width:95%; padding: .4em; }
|
||||
fieldset { padding:0; border:0; margin-top:25px; }
|
||||
h1 { font-size: 1.2em; margin: .6em 0; }
|
||||
div#users-contain { width: 350px; margin: 20px 0; }
|
||||
div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
|
||||
div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
|
||||
.ui-dialog .ui-state-error { padding: .3em; }
|
||||
.validateTips { border: 1px solid transparent; padding: 0.3em; }
|
||||
</style>
|
||||
<!-- //jquery UI -->
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span style="font-weight:bold">Total:</span> <?//=number_format($total_count);?>
|
||||
|
||||
<span style="margin-left:20px">
|
||||
<?/*
|
||||
foreach ($arr_default_member_gendar as $val) {
|
||||
$member_gender_count = 0;
|
||||
if(isset($arr_member_gender[$val['code']])==true) {
|
||||
$member_gender_count = $arr_member_gender[$val['code']];
|
||||
}
|
||||
?>
|
||||
<b><?=$val['txt']?>:</b> <a href="javascript:click_search('search_member_gender', '<?=$val['code']?>');"><?=number_format($member_gender_count)?></a>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<span style="margin-left:20px">
|
||||
<?
|
||||
foreach ($arr_default_member_group as $val) {
|
||||
$member_group_count = 0;
|
||||
if(isset($arr_member_group[$val['code']])==true) {
|
||||
$member_group_count = $arr_member_group[$val['code']];
|
||||
}
|
||||
echo '<b>'.$val['txt'].':</b> '.number_format($member_group_count).' ';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<span style="margin-left:20px"><b>오늘신규가입:</b> <a href="javascript:click_search('search_member_new', 'today');"><?=number_format($member_new_count);?></a></span>
|
||||
</ul>
|
||||
<ul style="text-align:left; padding-top:10px; padding-bottom:10px;">
|
||||
<span>
|
||||
<?
|
||||
foreach ($arr_default_member_age as $val) {
|
||||
$member_age_count = 0;
|
||||
if(isset($arr_member_age[$val['code']])==true) {
|
||||
$member_age_count = $arr_member_age[$val['code']];
|
||||
}
|
||||
?>
|
||||
<b><?=$val['txt']?>:</b> <a href="javascript:click_search('search_member_age', '<?=$val['code']?>');"><?=number_format($member_age_count)?></a>
|
||||
<?
|
||||
}*/
|
||||
?>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 테이블 시작-->
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<th>번호</th>
|
||||
<th>맵툰작가</th>
|
||||
<th>작가 블로그 & 홈페이지 주소</th>
|
||||
<th>관리</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(isset($list)==TRUE) {
|
||||
if(count($list)==0) {
|
||||
echo '<tr><td colspan="4">등록된 내용이 없습니다.</td></tr>';
|
||||
} else {
|
||||
//$dataNumber = ($total_rows + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$name = $val['name'];
|
||||
$website = $val['website'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $idx?></td>
|
||||
<td><?php echo $name?></td>
|
||||
<td><?php echo $website?></td>
|
||||
<td style="width:200px" class="tool_btn">
|
||||
<a href="#" class="btn_modify" value="<?php echo $idx;?>"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="#" class="btn_delete" value="<?php echo $idx;?>"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
//$dataNumber--;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="write_btn">
|
||||
<!--a href="javascript:news_arr_del_proc();">삭제</a-->
|
||||
<a href="#" id="btn_reg">등록</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?//=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- register popup -->
|
||||
<div id="dialog" title="맵툰 작가 등록/수정" style="display:none;">
|
||||
<!--p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p-->
|
||||
<form name="popup" action="" target="ifrm" method="post">
|
||||
<input type="hidden" id="popup_mode" name="mode" value="" />
|
||||
<input type="hidden" id="popup_idx" name="idx" value="" />
|
||||
<fieldset>
|
||||
<label for="name">맵툰 작가명</label>
|
||||
<input type="text" id="name" name="name" value="" class="text ui-widget-content ui-corner-all" maxlength="50">
|
||||
<label for="website">홈페이지 & 블로그 주소</label>
|
||||
<input type="text" id="website" name="website" value="" class="text ui-widget-content ui-corner-all" maxlength="300">
|
||||
|
||||
<input type="button" value=" 등록 " id="btn_register" tabindex="-1" >
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<!-- //register popup -->
|
||||
|
||||
<iframe name="ifrm" frameborder="0" width="0" height="0" style="display:none;"></iframe>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#btn_reg").click(function() {
|
||||
$("#dialog").dialog();
|
||||
return false;
|
||||
});
|
||||
|
||||
function reset_popup_form() {
|
||||
$("#name").val('');
|
||||
$("#website").val('');
|
||||
$( "#dialog" ).dialog();
|
||||
}
|
||||
|
||||
function fill_popup_form(a,b) {
|
||||
if(a!='' && b!='') {
|
||||
reset_popup_form();
|
||||
$("#name, json.website").val(a);
|
||||
$("#website").val(b);
|
||||
$( "#dialog" ).dialog();
|
||||
}
|
||||
}
|
||||
|
||||
$(".btn_delete").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
if(idx>0 && confirm('정말 삭제하시겠습니까?')) {
|
||||
frm = $("form[name='popup']");
|
||||
frm.attr('target','ifrm');
|
||||
$("#popup_idx").val(idx);
|
||||
frm.attr('action','/admin/maptoon/cartoonist_del_proc');
|
||||
frm.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(".btn_modify").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
if(idx>0) {
|
||||
$.ajax({
|
||||
url: '/admin/maptoon/cartoonist/?idx='+idx,
|
||||
data: {
|
||||
format: 'json',
|
||||
idx:idx
|
||||
},
|
||||
//dataType: 'jsonp',
|
||||
type:'get',
|
||||
success: function(msg) {
|
||||
var json = $.parseJSON(msg);
|
||||
console.log(json);
|
||||
if(json.result=='success') {
|
||||
$("#popup_mode").val('upt');
|
||||
$("#popup_idx").val(idx);
|
||||
fill_popup_form(json.name, json.website);
|
||||
}
|
||||
},
|
||||
error: function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_open_popup").click(function() {
|
||||
reset_popup_form();
|
||||
});
|
||||
|
||||
$("#btn_register").click(function() {
|
||||
frm = $("form[name='popup']");
|
||||
|
||||
if($("#name").val()=='') {
|
||||
alert('이름을 등록해 주십시오.');
|
||||
$("#name").focus();
|
||||
return false;
|
||||
}
|
||||
if($("#website").val()=='') {
|
||||
alert('홈페이지 혹은 블로그 주소를 등록해 주십시오.');
|
||||
$("#website").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
frm.attr('target','ifrm');
|
||||
frm.attr('action','/admin/maptoon/cartoonist_proc');
|
||||
frm.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
168
application/views/admin/maptoon/category_detail.php
Executable file
168
application/views/admin/maptoon/category_detail.php
Executable file
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
$menu_code = '1010';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<!-- jquery UI -->
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<!-- //jquery UI -->
|
||||
<style>
|
||||
#sortable { list-style-type: none; margin: 0; padding: 0; width: 60%; }
|
||||
#sortable tr { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; height: 1.5em; }
|
||||
html>body #sortable tr { height: 1.5em; line-height: 1.2em; }
|
||||
.ui-state-highlight { height: 1.5em; line-height: 1.2em; }
|
||||
</style>
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
|
||||
<div style="border:2px red solid;padding:5px;"><b>이곳에 등록된 에피소드들만 웹툰 홈페이지의 위젯에 나오게 됩니다 (예: 슬라이드쇼)</b></div>
|
||||
<span style="font-weight:bold">카테고리 명 : </span> <?php echo $c_name;?>
|
||||
<div class="common_table clearfix type01">
|
||||
<div class="">
|
||||
<input type="text" name="search_keyword" id="search_keyword" value="" placeholder="맵툰이름으로 검색" onkeypress="" class="fw300" style="width:300px;height:30px;line-height: 30px;">
|
||||
<a href="#" class="btn" id="btn_search"><i class="fa moving_all fa-search" style="margin-left:8px;"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<form name="frm" method="post" action="/admin/maptoon/register_episode_in_category">
|
||||
<input type="hidden" name="idx" id="idx" value="<?php if(isset($idx)==TRUE) echo $idx;?>" />
|
||||
<div class="common_table" style="">
|
||||
<table>
|
||||
<thead>
|
||||
<th>썸네일</th>
|
||||
<th>맵툰 제목</th>
|
||||
<th>관리</th>
|
||||
</thead>
|
||||
<tbody id="search_row">
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div> <hr></div>
|
||||
|
||||
<h3>"<?php echo $c_name;?>"으로 등록된 에피소드들</h3>
|
||||
<!-- 등록되어 있는 맵툰목록 -->
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<th>썸네일</th>
|
||||
<th>맵툰 제목</th>
|
||||
<th>관리</th>
|
||||
</thead>
|
||||
<tbody id="episode_list">
|
||||
<?php
|
||||
// use this one : https://jqueryui.com/sortable/
|
||||
if(isset($list)==TRUE && is_array($list)==TRUE) {
|
||||
if(count($list)==0) {
|
||||
echo '<tr><td colspan="3">등록된 내용이 없습니다.</td></tr>';
|
||||
} else {
|
||||
//$dataNumber = ($total_rows + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$main_img = $val['main_img'];
|
||||
$title = $val['title'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php if($main_img!='') echo '<img src="'.$main_img.'" width="150" >';?></td>
|
||||
<td><?php if($title!='') echo $title;?></td>
|
||||
<td style="width:200px" class="tool_btn">
|
||||
<a href="#" class="del_button" value="<?php echo $idx;?>"><i class="fa fa-close"></i>삭제</a>
|
||||
|
||||
<input type="hidden" name="episodes_idx[]" value="<?php echo $idx;?>" />
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
//$dataNumber--;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="write_btn">
|
||||
<!--a href="javascript:news_arr_del_proc();">삭제</a-->
|
||||
<a href="#" id="btn_reg">등록</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
// String.prototype.stripSlashes = function(){
|
||||
// return this.replace(/\\(.)/mg, "$1");
|
||||
// }
|
||||
|
||||
$(document).ready(function() {
|
||||
$("#btn_reg").click(function() {
|
||||
$("form[name=frm]").submit();
|
||||
});
|
||||
|
||||
$( "#episode_list" ).sortable({
|
||||
placeholder: "ui-state-highlight"
|
||||
});
|
||||
$( "#episode_list" ).disableSelection();
|
||||
|
||||
$("#btn_search").click(function() {
|
||||
search_keyword_obj = $("#search_keyword");
|
||||
if(search_keyword_obj.val()=='') {
|
||||
alert('검색어를 입력해 주십시오.');
|
||||
search_keyword_obj.focus();
|
||||
return false;
|
||||
}
|
||||
if(search_keyword_obj.val()!='') {
|
||||
$.ajax({
|
||||
url: '/admin/maptoon/get_episodes_by_search_keyword/',
|
||||
data: {
|
||||
format: 'json',
|
||||
keyword:search_keyword_obj.val()
|
||||
},
|
||||
//dataType: 'jsonp',
|
||||
type:'get',
|
||||
success: function(msg) {
|
||||
var json = $.parseJSON(msg);
|
||||
if(json=='') {
|
||||
alert('검색어에 해당하는 웹툰 에피소드가 없습니다.'); return false;
|
||||
}
|
||||
html = generate_search_result(json);
|
||||
$("#search_row").empty();
|
||||
$("#search_row").append(html);
|
||||
},
|
||||
error: function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(document).on("click", "table .add_button", function() {
|
||||
_idx = $(this).attr('idx');
|
||||
_title = $(this).attr('title');
|
||||
_main_img = $(this).attr('main_img');
|
||||
console.log(_idx);
|
||||
console.log(_title);
|
||||
console.log(_main_img);
|
||||
html = '<tr><td><img src="'+_main_img+'" width="150" /></td><td>'+_title+'</td><td><input class="del_button" type="button" value="삭제하기" idx="'+_idx+'" img="'+_main_img+'" title=""'+_title+' /><input type="hidden" name="episodes_idx[]" value="'+_idx+'" /></td></tr>';
|
||||
$("#episode_list").append(html);
|
||||
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
$(document).on('click','table .del_button', function() {
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
function generate_search_result(json_str) {
|
||||
if(typeof json_str!=='undefined' && json_str.length>0) {
|
||||
html = '';
|
||||
json_str.forEach(function(ele){
|
||||
html += '<tr><td><img src="'+ele.main_img+'" width="150" /></td><td>'+ele.title+'</td><td><input class="add_button" type="button" value="등록하기" idx="'+ele.idx+'" main_img="'+ele.main_img+'" title="'+ele.title+'" /></td></tr>';
|
||||
//console.log(ele.idx);
|
||||
});
|
||||
return html;
|
||||
}
|
||||
}
|
||||
});
|
||||
</script>
|
||||
213
application/views/admin/maptoon/category_list.php
Executable file
213
application/views/admin/maptoon/category_list.php
Executable file
@@ -0,0 +1,213 @@
|
||||
<?php
|
||||
$menu_code = '1010';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<!-- jquery UI -->
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
<style>
|
||||
label, input { display:block; }
|
||||
input.text { margin-bottom:12px; width:95%; padding: .4em; }
|
||||
fieldset { padding:0; border:0; margin-top:25px; }
|
||||
h1 { font-size: 1.2em; margin: .6em 0; }
|
||||
div#users-contain { width: 350px; margin: 20px 0; }
|
||||
div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
|
||||
div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
|
||||
.ui-dialog .ui-state-error { padding: .3em; }
|
||||
.validateTips { border: 1px solid transparent; padding: 0.3em; }
|
||||
</style>
|
||||
<!-- //jquery UI -->
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span style="font-weight:bold">Total:</span> <?//=number_format($total_count);?>
|
||||
|
||||
<span style="margin-left:20px">
|
||||
<?/*
|
||||
foreach ($arr_default_member_gendar as $val) {
|
||||
$member_gender_count = 0;
|
||||
if(isset($arr_member_gender[$val['code']])==true) {
|
||||
$member_gender_count = $arr_member_gender[$val['code']];
|
||||
}
|
||||
?>
|
||||
<b><?=$val['txt']?>:</b> <a href="javascript:click_search('search_member_gender', '<?=$val['code']?>');"><?=number_format($member_gender_count)?></a>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<span style="margin-left:20px">
|
||||
<?
|
||||
foreach ($arr_default_member_group as $val) {
|
||||
$member_group_count = 0;
|
||||
if(isset($arr_member_group[$val['code']])==true) {
|
||||
$member_group_count = $arr_member_group[$val['code']];
|
||||
}
|
||||
echo '<b>'.$val['txt'].':</b> '.number_format($member_group_count).' ';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<span style="margin-left:20px"><b>오늘신규가입:</b> <a href="javascript:click_search('search_member_new', 'today');"><?=number_format($member_new_count);?></a></span>
|
||||
</ul>
|
||||
<ul style="text-align:left; padding-top:10px; padding-bottom:10px;">
|
||||
<span>
|
||||
<?
|
||||
foreach ($arr_default_member_age as $val) {
|
||||
$member_age_count = 0;
|
||||
if(isset($arr_member_age[$val['code']])==true) {
|
||||
$member_age_count = $arr_member_age[$val['code']];
|
||||
}
|
||||
?>
|
||||
<b><?=$val['txt']?>:</b> <a href="javascript:click_search('search_member_age', '<?=$val['code']?>');"><?=number_format($member_age_count)?></a>
|
||||
<?
|
||||
}*/
|
||||
?>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- 테이블 시작-->
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<th>번호</th>
|
||||
<th>카테고리</th>
|
||||
<th>관리</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if(isset($list)==TRUE) {
|
||||
if(count($list)==0) {
|
||||
echo '<tr><td colspan="3">등록된 내용이 없습니다.</td></tr>';
|
||||
} else {
|
||||
//$dataNumber = ($total_rows + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$c_name = $val['c_name'];
|
||||
?>
|
||||
<tr>
|
||||
<td><?php echo $idx?></td>
|
||||
<td><a href="/admin/maptoon/category_detail/10?idx=<?php echo $idx;?>"><?php echo $c_name?></a></td>
|
||||
<td style="width:200px" class="tool_btn">
|
||||
<a href="#" class="btn_modify" value="<?php echo $idx;?>"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="#" class="btn_delete" value="<?php echo $idx;?>"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
//$dataNumber--;
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="write_btn">
|
||||
<!--a href="javascript:news_arr_del_proc();">삭제</a-->
|
||||
<a href="#" id="btn_reg">등록</a>
|
||||
</div>
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?//=$pagination?>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!-- register popup -->
|
||||
<div id="dialog" title="맵툰 카테고리 등록/수정" style="display:none;">
|
||||
<!--p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p-->
|
||||
<form name="popup" action="" target="ifrm" method="post">
|
||||
<input type="hidden" id="popup_mode" name="mode" value="" />
|
||||
<input type="hidden" id="popup_idx" name="idx" value="" />
|
||||
<fieldset>
|
||||
<label for="c_name">맵툰 카테고리 명</label>
|
||||
<input type="text" id="c_name" name="c_name" value="" class="text ui-widget-content ui-corner-all" maxlength="50">
|
||||
<input type="button" value=" 등록 " id="btn_register" tabindex="-1" >
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<!-- //register popup -->
|
||||
|
||||
<iframe name="ifrm" frameborder="0" width="0" height="0"></iframe>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#btn_reg").click(function() {
|
||||
$("#dialog").dialog();
|
||||
$("#popup_mode").val("");
|
||||
$("#c_name").val("");
|
||||
return false;
|
||||
});
|
||||
|
||||
function reset_popup_form() {
|
||||
$("#c_name").val('');
|
||||
$( "#dialog" ).dialog();
|
||||
}
|
||||
|
||||
function fill_popup_form(a) {
|
||||
if(a!='') {
|
||||
reset_popup_form();
|
||||
$("#c_name").val(a);
|
||||
$( "#dialog" ).dialog();
|
||||
}
|
||||
}
|
||||
|
||||
$(".btn_delete").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
if(idx>0 && confirm('정말 삭제하시겠습니까?')) {
|
||||
frm = $("form[name='popup']");
|
||||
frm.attr('target','ifrm');
|
||||
$("#popup_idx").val(idx);
|
||||
frm.attr('action','/admin/maptoon/category_del_proc');
|
||||
frm.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(".btn_modify").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
if(idx>0) {
|
||||
$.ajax({
|
||||
url: '/admin/maptoon/category/?idx='+idx,
|
||||
data: {
|
||||
format: 'json',
|
||||
idx:idx
|
||||
},
|
||||
//dataType: 'jsonp',
|
||||
type:'get',
|
||||
success: function(msg) {
|
||||
var json = $.parseJSON(msg);
|
||||
console.log(json);
|
||||
if(json.result=='success') {
|
||||
$("#popup_mode").val('upt');
|
||||
$("#popup_idx").val(idx);
|
||||
fill_popup_form(json.c_name);
|
||||
}
|
||||
},
|
||||
error: function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_open_popup").click(function() {
|
||||
reset_popup_form();
|
||||
});
|
||||
|
||||
$("#btn_register").click(function() {
|
||||
frm = $("form[name='popup']");
|
||||
|
||||
if($("#c_name").val()=='') {
|
||||
alert('카테고리를 등록해 주십시오.');
|
||||
$("#c_name").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
frm.attr('target','ifrm');
|
||||
frm.attr('action','/admin/maptoon/category_proc');
|
||||
frm.submit();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
443
application/views/admin/maptoon/episode_list.php
Executable file
443
application/views/admin/maptoon/episode_list.php
Executable file
@@ -0,0 +1,443 @@
|
||||
<?php
|
||||
$menu_code = '1030';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||
<link href="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
|
||||
<script src="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js"></script>
|
||||
|
||||
<style>
|
||||
.row {margin-left: 0px; margin-bottom: 15px;}
|
||||
div.sortform{border: 1px solid #d8dcdd;padding: 15px;}
|
||||
label.sort_label{width: 80px;}
|
||||
button{ background:#1AAB8A; color:#fff; border:none; position:relative; height:60px; font-size:1.6em; padding:0 2em; cursor:pointer; transition:800ms ease all; outline:none;}
|
||||
button:hover{background:#fff; color:#1AAB8A;}
|
||||
button:before,button:after{ content:''; position:absolute; top:0; right:0; height:2px; width:0; background: #1AAB8A; transition:400ms ease all;}
|
||||
button:after{ right:inherit; top:inherit; left:0; bottom:0; }
|
||||
button:hover:before,button:hover:after{width:100%; transition:800ms ease all; }
|
||||
.write_btn_1{background: #ebebeb; float: right; border: 1px solid #ccc; margin-right: 15px; padding: 4px 15px;}
|
||||
|
||||
* {box-sizing: border-box;}
|
||||
/*the container must be positioned relative:*/
|
||||
.autocomplete {position: relative; display: inline-block;}
|
||||
.autocomplete-items { position: absolute; border: 1px solid #d4d4d4; border-bottom: none; border-top: none; z-index: 99; /*position the autocomplete items to be the same width as the container:*/
|
||||
top: 100%; left: 0; right: 0; margin: 0px 16px; width: 89%;}
|
||||
.autocomplete-items div { padding: 10px; cursor: pointer; background-color: #fff; border-bottom: 1px solid #d4d4d4; }
|
||||
/*when hovering an item:*/
|
||||
.autocomplete-items div:hover { background-color: #e9e9e9; }
|
||||
/*when navigating through the items using the arrow keys:*/
|
||||
.autocomplete-active { background-color: DodgerBlue !important; color: #ffffff; }
|
||||
#inp_authorautocomplete-list{margin-left: 100px; width: 39%;}
|
||||
#inp_mt_nameautocomplete-list{margin-left: 20%; width: 60%;}
|
||||
</style>
|
||||
<form class="" name="sort_form" id="sort_form" method="get" action="episode">
|
||||
<input type="hidden" name="sort_list" id="sort_list">
|
||||
<div class="common_tep clearfix type01 sortform">
|
||||
<div class="row">
|
||||
<div class="row form-group">
|
||||
<div class="col-md-3">
|
||||
<label for="date_reg" class="sort_label" >등록 날짜별</label>
|
||||
<select name="date_reg" id="select_sort_date">
|
||||
<option value="">선택안함</option>
|
||||
<option value="td">오늘</option>
|
||||
<option value="yd">어제</option>
|
||||
<option value="w">일주일</option>
|
||||
<option value="30d">지난30일</option>
|
||||
<option value="lm">지난달</option>
|
||||
<option value="sel">날짜지정</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<!-- <label for="ca">카테고리</label>
|
||||
<select id="select_cartegory" name="ca">
|
||||
<option value="">선택안함</option>
|
||||
<? foreach($category as $i){?>
|
||||
<option value="<?=$i['idx']?>"><?=$i['c_name']?></option>
|
||||
<?}?>
|
||||
</select> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="datepicker_reg" class="row" style="display:none; margin-left: 85px; margin-bottom: 20px;">
|
||||
<div class='col-md-2'>
|
||||
<label for="sdate" >시작일</label>
|
||||
<div class='input-group date' id='div_s_date'>
|
||||
<input type='text' id="sdate" name="sdate" class="form-control"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class='col-md-2'>
|
||||
<label for="edate">종료일</label>
|
||||
<div class='input-group date' id='div_e_date'>
|
||||
<input type='text' id="edate" name="edate" class="form-control"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<label for="author" class="sort_label">작가</label>
|
||||
<input type="text" id="inp_author" name="author">
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="mt_name">맵툰 이름</label>
|
||||
<input type="text" name="mt_name" id="inp_mt_name">
|
||||
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label for="ep_title" class="sort_label">맵툰 제목</label>
|
||||
<input type="text" name="ep_title" id="inp_ep_name">
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="write_btn a" style="float:right;">검색</button>
|
||||
</div>
|
||||
</form>
|
||||
<div class="searh_area">
|
||||
</div>
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<div class="row">
|
||||
<span style="font-weight:bold">Total:</span> <?=$total_count;?>
|
||||
<span style="margin-left:20px"></span>
|
||||
<span style="margin-left:20px">오늘 신규</span>
|
||||
<span style="margin-left:20px"></span>
|
||||
<span style="margin-left:20px">
|
||||
<input type="radio" id="sort_list_up" name="sort_list" value="up" onclick="change_sort();"> 최신순
|
||||
<input type="radio" id="sort_list_vi" name="sort_list" value="vi" onclick="change_sort();"> 조회순
|
||||
</span>
|
||||
<div class="write_btn_1">
|
||||
<a href="/admin/maptoon/episode_reg" id="btn_reg">등록</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 테이블 시작-->
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<th>번호</th>
|
||||
<th>썸네일</th>
|
||||
<th>맵툰이름</th>
|
||||
<th>작가명</th>
|
||||
<th>제목</th>
|
||||
<th>조회수</th>
|
||||
<th>상태</th>
|
||||
<th>등록일시</th>
|
||||
<th>예약일시</th>
|
||||
<th>관리</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?if(count($list)==0) {
|
||||
echo '<tr><td colspan="10">등록된 내용이 없습니다.</td></tr>';
|
||||
} else {
|
||||
$i=0;
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$main_img = $val['main_img'];
|
||||
// $mt_categories_idx = $val['mt_categories_idx'];
|
||||
$name = $val['name'];
|
||||
$title = $val['title'];
|
||||
$mt_list_idx = $val['mt_list_idx'];
|
||||
$recommend_count = $val['recommend_count'];
|
||||
$view_count = $val['view_count'];
|
||||
$mt_cartoonists_idx = $val['mt_cartoonists_idx'];
|
||||
$is_display = $val['is_display'];
|
||||
$reg_date = $val['reg_date'];
|
||||
$display_date = $val['display_date'];?>
|
||||
<tr>
|
||||
<td><?=$idx?><input type="hidden" id="index_<?=$idx?>" value="<?=$i?>"></td>
|
||||
<td><img id="" style="width: 75px; height: 53px;" class="img" src="<?=$main_img?>"></td>
|
||||
<!-- <td><?if($mt_categories_idx!=0){echo $category_list[$mt_categories_idx];}?></td> -->
|
||||
<td><?=$name?></td>
|
||||
<td><?=$cartoonist_list[$mt_cartoonists_idx]?></td>
|
||||
<td><?=$title ?></td>
|
||||
<td><?=$view_count?></td>
|
||||
<td><?if($is_display==0){echo "N";}else{echo "Y";}?></td>
|
||||
<td><?=$reg_date?></td>
|
||||
<td><?=$display_date ?></td>
|
||||
<td style="width:200px" class="tool_btn">
|
||||
<a href="#" class="btn_modify" value="<?= $idx;?>"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="#" class="btn_delete" value="<?= $idx;?>"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?$i++; }
|
||||
}?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?=$pagination?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
set_sort_option();
|
||||
set_search_area();
|
||||
$("#btn_reg").click(function() {
|
||||
$("#dialog").dialog();
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
//search condition
|
||||
function set_search_area(){
|
||||
var url_string = window.location.href; //window.location.href
|
||||
var url = new URL(url_string);
|
||||
var date_reg = url.searchParams.get("date_reg");
|
||||
var category = url.searchParams.get("ca");
|
||||
var author = url.searchParams.get("author");
|
||||
var mt_name = url.searchParams.get("mt_name");
|
||||
var ep_title = url.searchParams.get("ep_title");
|
||||
var s_date = url.searchParams.get("sdate");
|
||||
var e_date = url.searchParams.get("edate");
|
||||
|
||||
if(date_reg!=''){
|
||||
$("#select_sort_date").val(date_reg);
|
||||
if(date_reg=="sel"){
|
||||
$("#datepicker_reg").show();
|
||||
$("sdate").val(s_date);
|
||||
$("edate").val(e_date);
|
||||
}
|
||||
}
|
||||
if(category!=''){
|
||||
$("#select_cartegory").val(category);
|
||||
}
|
||||
if(author!=''){
|
||||
$("#inp_author").val(author);
|
||||
}
|
||||
if(mt_name!=''){
|
||||
$("inp_mt_name").val(mt_name);
|
||||
}
|
||||
if(ep_title!=''){
|
||||
$("inp_ep_name").val(ep_title);
|
||||
}
|
||||
}
|
||||
|
||||
//show datepickup
|
||||
$("#select_sort_date").on('change',function(){
|
||||
if($(this).val()=="sel"){
|
||||
$("#datepicker_reg").show();
|
||||
}else{
|
||||
$("#datepicker_reg").hide();
|
||||
};
|
||||
})
|
||||
// modify btn event
|
||||
$(".btn_modify").click(function() {
|
||||
var idx = $(this).attr('value');
|
||||
redirectUrl='/admin/maptoon/episode_reg';
|
||||
if(idx>0) {
|
||||
var form = $('<form action="' + redirectUrl + '" method="post">' +
|
||||
'<input type="hidden" name="idx" value="' + idx + '"></input>' + '</form>');
|
||||
$('body').append(form);
|
||||
$(form).submit();
|
||||
}else{
|
||||
alert("값이 존재하지 않습니다 관리자에게 문의주세요");
|
||||
}
|
||||
});
|
||||
|
||||
//delete click event
|
||||
$(".btn_delete").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
redirectUrl='/admin/maptoon/episode_del_proc';
|
||||
if(confirm('정말 삭제하시겠습니까?')) {
|
||||
var form = $('<form action="' + redirectUrl + '" method="post">' +
|
||||
'<input type="hidden" name="idx" value="' + idx + '"></input>' + '</form>');
|
||||
$('body').append(form);
|
||||
$(form).submit();
|
||||
frm.attr('action','/admin/maptoon/announcement_del_proc');
|
||||
frm.submit();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// set checkbox option
|
||||
function set_sort_option(){
|
||||
var url_string = document.URL; //window.location.href
|
||||
var url = new URL(url_string);
|
||||
var sort_list = url.searchParams.get("sort_list");
|
||||
if(sort_list==null){
|
||||
document.getElementById("sort_list_up").checked = true;
|
||||
document.getElementById("sort_list").value="up";
|
||||
}else if(sort_list=="up"){
|
||||
document.getElementById("sort_list").value="up";
|
||||
document.getElementById("sort_list_up").checked = true;
|
||||
}else if(sort_list=="vi"){
|
||||
document.getElementById("sort_list").value="vi";
|
||||
document.getElementById("sort_list_vi").checked = true;
|
||||
}
|
||||
}
|
||||
|
||||
// radio button 조회순 업데이트 순 조회
|
||||
function change_sort(){
|
||||
var url_string = document.URL; //window.location.href
|
||||
var url = new URL(url_string);
|
||||
var sort_list = url.searchParams.get("sort_list");
|
||||
if(location.search!=""){
|
||||
if (document.getElementById('sort_list_up').checked){
|
||||
sort_list==null?window.location.href=url_string+"&sort_list=up":window.location.href=url_string.replace("sort_list=vi", "sort_list=up");
|
||||
} else {
|
||||
sort_list==null?window.location.href=url_string+"&sort_list=vi":window.location.href=url_string.replace("sort_list=up", "sort_list=vi");
|
||||
}
|
||||
}else{
|
||||
if (document.getElementById('sort_list_up').checked){
|
||||
window.location.href=url_string+"?sort_list=up"
|
||||
}else{
|
||||
window.location.href=url_string+"?sort_list=vi"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//dateTime picker
|
||||
$(function () {
|
||||
$('#div_s_date').datetimepicker({
|
||||
locale: 'ko',
|
||||
format : "YYYY-MM-DD HH:mm:ss"
|
||||
});
|
||||
$('#div_e_date').datetimepicker({
|
||||
useCurrent: false, //Important! See issue #1075
|
||||
locale: 'ko',
|
||||
format : "YYYY-MM-DD HH:mm:ss"
|
||||
});
|
||||
$("#div_s_date").on("dp.change", function (e) {
|
||||
$('#div_e_date').data("DateTimePicker").minDate(e.date);
|
||||
});
|
||||
$("#div_e_date").on("dp.change", function (e) {
|
||||
$('#div_s_date').data("DateTimePicker").maxDate(e.date);
|
||||
});
|
||||
});
|
||||
|
||||
//autocomplete
|
||||
function autocomplete(inp, arr) {
|
||||
var currentFocus;
|
||||
/*execute a function when someone writes in the text field:*/
|
||||
inp.addEventListener("input", function(e) {
|
||||
var a, b, i, val = this.value;
|
||||
/*close any already open lists of autocompleted values*/
|
||||
closeAllLists();
|
||||
if (!val) { return false;}
|
||||
currentFocus = -1;
|
||||
/*create a DIV element that will contain the items (values):*/
|
||||
a = document.createElement("DIV");
|
||||
a.setAttribute("id", this.id + "autocomplete-list");
|
||||
a.setAttribute("class", "autocomplete-items");
|
||||
|
||||
/*append the DIV element as a child of the autocomplete container:*/
|
||||
this.parentNode.appendChild(a);
|
||||
/*for each item in the array...*/
|
||||
for (i = 0; i < arr.length; i++) {
|
||||
/*check if the item starts with the same letters as the text field value:*/
|
||||
if (arr[i].substr(0, val.length).toUpperCase() == val.toUpperCase()) {
|
||||
/*create a DIV element for each matching element:*/
|
||||
b = document.createElement("DIV");
|
||||
/*make the matching letters bold:*/
|
||||
b.innerHTML = "<strong>" + arr[i].substr(0, val.length) + "</strong>";
|
||||
b.innerHTML += arr[i].substr(val.length);
|
||||
/*insert a input field that will hold the current array item's value:*/
|
||||
b.innerHTML += "<input type='hidden' value='" + arr[i] + "'>";
|
||||
/*execute a function when someone clicks on the item value (DIV element):*/
|
||||
b.addEventListener("click", function(e) {
|
||||
/*insert the value for the autocomplete text field:*/
|
||||
inp.value = this.getElementsByTagName("input")[0].value;
|
||||
/*close the list of autocompleted values,
|
||||
(or any other open lists of autocompleted values:*/
|
||||
closeAllLists();
|
||||
});
|
||||
a.appendChild(b);
|
||||
}
|
||||
}
|
||||
});
|
||||
/*execute a function presses a key on the keyboard:*/
|
||||
inp.addEventListener("keydown", function(e) {
|
||||
var x = document.getElementById(this.id + "autocomplete-list");
|
||||
if (x) x = x.getElementsByTagName("div");
|
||||
if (e.keyCode == 40) {
|
||||
/*If the arrow DOWN key is pressed,
|
||||
increase the currentFocus variable:*/
|
||||
currentFocus++;
|
||||
/*and and make the current item more visible:*/
|
||||
addActive(x);
|
||||
} else if (e.keyCode == 38) { //up
|
||||
/*If the arrow UP key is pressed,
|
||||
decrease the currentFocus variable:*/
|
||||
currentFocus--;
|
||||
/*and and make the current item more visible:*/
|
||||
addActive(x);
|
||||
} else if (e.keyCode == 13) {
|
||||
/*If the ENTER key is pressed, prevent the form from being submitted,*/
|
||||
e.preventDefault();
|
||||
if (currentFocus > -1) {
|
||||
/*and simulate a click on the "active" item:*/
|
||||
if (x) x[currentFocus].click();
|
||||
}
|
||||
}
|
||||
});
|
||||
function addActive(x) {
|
||||
/*a function to classify an item as "active":*/
|
||||
if (!x) return false;
|
||||
/*start by removing the "active" class on all items:*/
|
||||
removeActive(x);
|
||||
if (currentFocus >= x.length) currentFocus = 0;
|
||||
if (currentFocus < 0) currentFocus = (x.length - 1);
|
||||
/*add class "autocomplete-active":*/
|
||||
x[currentFocus].classList.add("autocomplete-active");
|
||||
}
|
||||
function removeActive(x) {
|
||||
/*a function to remove the "active" class from all autocomplete items:*/
|
||||
for (var i = 0; i < x.length; i++) {
|
||||
x[i].classList.remove("autocomplete-active");
|
||||
}
|
||||
}
|
||||
function closeAllLists(elmnt) {
|
||||
/*close all autocomplete lists in the document,
|
||||
except the one passed as an argument:*/
|
||||
var x = document.getElementsByClassName("autocomplete-items");
|
||||
for (var i = 0; i < x.length; i++) {
|
||||
if (elmnt != x[i] && elmnt != inp) {
|
||||
x[i].parentNode.removeChild(x[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
/*execute a function when someone clicks in the document:*/
|
||||
document.addEventListener("click", function (e) {
|
||||
closeAllLists(e.target);
|
||||
});
|
||||
}
|
||||
|
||||
/*An array containing all the country names in the world:*/
|
||||
var countries = ["atest",'btest',"ctest","dtest","etest","qtest","wtest","rtest","ttest","ytest","utest","itest","otest","ptest","stest","ftest","gtest","htest","jtest","ktest","ltest","ztest","xtest","vtest","ntest","mtest"];
|
||||
|
||||
var cartoonist = <?=json_encode($cartoonist);?>;
|
||||
var auto_cartoonist= new Array();
|
||||
for (var i in cartoonist) {
|
||||
auto_cartoonist[i] = cartoonist[i]['name'];
|
||||
}
|
||||
|
||||
var mt_list = <?=json_encode($mt_title)?>;
|
||||
var auto_mt_list= new Array();
|
||||
var auto_mt_idx= new Array();
|
||||
for (var i in mt_list) {
|
||||
auto_mt_list[i] = mt_list[i]['name'];
|
||||
auto_mt_idx[i] = mt_list[i]['idx'];
|
||||
}
|
||||
|
||||
/*initiate the autocomplete function on the "myInput" element, and pass along the countries array as possible autocomplete values:*/
|
||||
autocomplete(document.getElementById("inp_author"), auto_cartoonist);
|
||||
autocomplete(document.getElementById("inp_mt_name"), auto_mt_list);
|
||||
|
||||
</script>
|
||||
|
||||
<?
|
||||
// print_r($_SERVER['QUERY_STRING']);
|
||||
?>
|
||||
366
application/views/admin/maptoon/episode_reg.php
Executable file
366
application/views/admin/maptoon/episode_reg.php
Executable file
@@ -0,0 +1,366 @@
|
||||
<?php
|
||||
$menu_code = '1030';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||
<link href="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
|
||||
<script src="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js"></script>
|
||||
|
||||
<style>
|
||||
div.sortform{border: 1px solid #d8dcdd; padding: 15px; }
|
||||
label.sort_label{width: 80px;}
|
||||
div.mt_div{width: 43%;float:left;}
|
||||
.w175{width: 175px;}
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="write_btn">
|
||||
<a href="episode" id="">취소</a>
|
||||
</div>
|
||||
|
||||
<div class="inner_content">
|
||||
<?$mode="";
|
||||
if(isset($modify_data)) $mode="edit";?>
|
||||
<form name="input_form" id="input_form" action="/admin/maptoon/episode_reg_proc" method="post" enctype="multipart/form-data">
|
||||
<?if($mode!="edit"){?>
|
||||
<input type="hidden" name="mode" id="mode_txt" value="">
|
||||
<input type="hidden" name="idx" id="idx_txt" value="">
|
||||
<div class="common_table">
|
||||
<table><tbody>
|
||||
<tr>
|
||||
<th class="fw500">카테고리</th>
|
||||
<td class="tl">
|
||||
<SELECT id="page_list" name="mt_categories_idx" SIZE=1>
|
||||
<option value="n">선택없음</option>
|
||||
<? foreach($category as $i){?>
|
||||
<option value="<?=$i['idx']?>"><?=$i['c_name']?></option>
|
||||
<?}?>
|
||||
</SELECT>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">맵툰 이름</th>
|
||||
<td class="tl">
|
||||
<SELECT id="mt_list_idx" name="mt_list_idx" SIZE=1>
|
||||
<? foreach($mt_title as $i){?>
|
||||
<option value="<?=$i['idx']?>"><?=$i['name']?></option>
|
||||
<?}?>
|
||||
</SELECT>
|
||||
<!-- <span id="edit_mt_list_idx"></span> -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">맵툰 회차</th>
|
||||
<td class="tl">
|
||||
<input type="text" id="ep_no" name="ep_no" numberOnly/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">제목</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="title">
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">회차 대표 썸네일<br />(865x486 px)</th>
|
||||
<td class="tl">
|
||||
<input type="file" name="main_img" id="main_img" onchange="change_main_img(this)">
|
||||
<div class="show_img" style="width:600px;height:200px display:none;">
|
||||
<img class="show_img" id="image_section" src="" style="max-height: 100%; max-width: 100%; display:none;"/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">맵툰 이미지 업로드</th>
|
||||
<td class="tl">
|
||||
<div style="row">
|
||||
<div class="mt_div" id="mt_img_1">
|
||||
<input type="file" name="webtoon_images[]" id="webtoon_images" data-width="680" data-height="10000">
|
||||
</div>
|
||||
<div class="mt_div">
|
||||
<div class="write_btn tc">
|
||||
<a onclick="add_img();">업로드 필드 추가</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">노출유무</th>
|
||||
<td class="tl">
|
||||
<select id="" name="is_display">
|
||||
<option value="0" >N</option>
|
||||
<option value="1" >Y</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">노출일</th>
|
||||
<td class="tl">
|
||||
<div class="row">
|
||||
<div class='col-sm-6'>
|
||||
<div class="form-group">
|
||||
<div class='input-group date' id='datetimepicker1'>
|
||||
<input type='text' class="form-control" name="display_date"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">등록일</th>
|
||||
<td class="tl">
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">추천수</th>
|
||||
<td class="tl">
|
||||
<span> </span>
|
||||
</td>
|
||||
</tr>
|
||||
<?}else if($mode=="edit"){?>
|
||||
<input type="hidden" name="mode" id="mode_txt" value="edit">
|
||||
<input type="hidden" name="idx" id="idx_txt" value="<?=$modify_data['idx']?>">
|
||||
<div class="common_table">
|
||||
<table><tbody>
|
||||
<tr>
|
||||
<th class="fw500 w175">카테고리</th>
|
||||
<td class="tl">
|
||||
<?if($mode=="edit"){?>
|
||||
<SELECT id="page_list" name="mt_categories_idx" SIZE=1>
|
||||
<option value="n">선택없음</option>
|
||||
<? foreach($category as $i){
|
||||
if($i['idx']==$modify_data['mt_categories_idx']){?>
|
||||
<option value="<?=$i['idx']?>" selected><?=$i['c_name']?></option>
|
||||
<?}else{?>
|
||||
<option value="<?=$i['idx']?>"><?=$i['c_name']?></option>
|
||||
<?}
|
||||
}
|
||||
}else{?>
|
||||
<SELECT id="page_list" name="mt_categories_idx" SIZE=1>
|
||||
<? foreach($category as $i){?>
|
||||
<option value="<?=$i['idx']?>"><?=$i['c_name']?></option>
|
||||
<?}?>
|
||||
</SELECT>
|
||||
<?}?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">맵툰 이름</th>
|
||||
<td class="tl">
|
||||
<SELECT id="mt_list_idx" name="mt_list_idx" SIZE=1>
|
||||
<? foreach($mt_title as $i){
|
||||
if($modify_data['mt_list_idx']==$i['idx']){?>
|
||||
<option value="<?=$i['idx']?>" selected><?=$i['name']?></option>
|
||||
<?}else{?>
|
||||
<option value="<?=$i['idx']?>"><?=$i['name']?></option>
|
||||
<?}}?>
|
||||
</SELECT>
|
||||
<!-- <span>
|
||||
|
||||
<?//$mt_title[array_search($modify_data['mt_list_idx'],$mt_title)]['name']?>
|
||||
</span>
|
||||
<input type="hidden" value="<?//$modify_data['idx']?>"> -->
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">맵툰 회차</th>
|
||||
<td class="tl">
|
||||
<input type="text" id="ep_no" name="ep_no" numberOnly value="<?= $modify_data['ep_no'];?>"/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">제목</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="title" value="<?if($mode=="edit") echo $modify_data['title'];?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">회차 대표 썸네일</th>
|
||||
<td class="tl">
|
||||
<input type="file" name="main_img" id="main_img" onchange="change_main_img(this)">
|
||||
<div class="show_img" style="width:600px;height:200px">
|
||||
<img class="show_img" id="image_section" src="<?if($mode=="edit") echo $modify_data['main_img'];?>" style="max-height: 100%; max-width: 100%; "/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">맵툰 이미지 업로드</th>
|
||||
<td class="tl">
|
||||
<div style="row">
|
||||
<div class="mt_div" id="mt_img_1">
|
||||
<input type="file" name="webtoon_images[]" id="webtoon_images" data-width="680" data-height="10000">
|
||||
</div>
|
||||
<div class="mt_div">
|
||||
<div class="write_btn tc">
|
||||
<a onclick="add_img();">업로드 필드 추가</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="show_img mt_div">
|
||||
<?$webtoon_images=json_decode($modify_data['webtoon_images']);
|
||||
foreach($webtoon_images as $val){?>
|
||||
<img class="show_img" id="w_image" src="<?if($mode=="edit") echo $val;?>" style="max-height: 20%; max-width: 20%; "/>
|
||||
<?}?>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">노출유무</th>
|
||||
<td class="tl">
|
||||
<select id="" name="is_display">
|
||||
<option value="0" <?if($modify_data['is_display']==0) echo "selected"?>>N</option>
|
||||
<option value="1" <?if($modify_data['is_display']==1) echo "selected"?>>Y</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">노출일</th>
|
||||
<td class="tl">
|
||||
<div class="row">
|
||||
<div class='col-sm-6'>
|
||||
<div class="form-group">
|
||||
<div class='input-group date' id='datetimepicker1'>
|
||||
<input type='text' class="form-control" name="display_date" value="<?=$modify_data['display_date'] ?>"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">등록일</th>
|
||||
<td class="tl">
|
||||
<span><?=$modify_data['reg_date']?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">추천수</th>
|
||||
<td class="tl">
|
||||
<span><?=$modify_data['recommend_count']?></span>
|
||||
</td>
|
||||
</tr>
|
||||
<?}?>
|
||||
</tbody></table>
|
||||
</div>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:submit_episode()">저장하기</a>
|
||||
<?if($mode=="edit"){?>
|
||||
<a href="/admin/maptoon/announcement/10?idx=<?=$modify_data['mt_list_idx']?>">공지보기</a>
|
||||
<?}?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
|
||||
});
|
||||
|
||||
//submit btn event
|
||||
function submit_episode(){
|
||||
$( "#input_form" ).submit();
|
||||
}
|
||||
|
||||
//add file upload btn
|
||||
function add_img(){
|
||||
$("#mt_img_1").append("<input type='file' name='webtoon_images[]' />");
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
//thumbnil img change event
|
||||
function change_main_img(value){
|
||||
if (value.files && value.files[0]) {
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onload = function (e) {
|
||||
$('#image_section').attr('src', e.target.result);
|
||||
}
|
||||
$(".show_img").show();
|
||||
reader.readAsDataURL(value.files[0]);
|
||||
}
|
||||
}
|
||||
|
||||
//dateTime picker
|
||||
$(function () {
|
||||
$('#datetimepicker1').datetimepicker({
|
||||
locale: 'ko',
|
||||
format : "YYYY-MM-DD HH:mm:ss"
|
||||
});
|
||||
});
|
||||
|
||||
//image size 제한
|
||||
$(document).on('change', 'input[name=webtoon_images]', function(){
|
||||
var $width = $(this).attr('data-width');
|
||||
var $height = $(this).attr('data-height');
|
||||
var $target = $(this);
|
||||
if(window.FileReader){ //FileReader를 지원하는 브라우저의 경우 IE 10이상, 크롬..
|
||||
var reader = new FileReader();
|
||||
reader.onload = function (e) {
|
||||
$('body').append('<img src="" id="temp_img" style="display:none;" />'); //보이지 않는 임시 img 태그를 생성.
|
||||
$img = $('#temp_img').attr('src', e.target.result); //파일을 선택했을 경우 정보를 $img 객체에 저장
|
||||
if($img.width() != $width || $img.height() <= $height){ //가로 세로 사이즈 비교 후 반환
|
||||
alert('지정된 크기와 맞지 않습니다.( 선택된 파일의 크기는 '+$width + 'x'+ $height +' 입니다) 가로는 680 이며 세로가 10000 보다 클 경우 분할 해주세요' );
|
||||
$target.val('');
|
||||
$('#temp_img').remove(); //위에서 생성한 임시 img 태그 삭제
|
||||
return;
|
||||
}
|
||||
};
|
||||
|
||||
reader.readAsDataURL($(this)[0].files[0]); //파일을 img 태그에 보여줄 수 있도록 base64로 url을 생성합니다.
|
||||
} else { //FileReader를 지원하지 않는 브라우저의 경우 IE 9 이하
|
||||
$(this)[0].select();
|
||||
var src = document.selection.createRange().text;
|
||||
$('body').append('<img src="" id="temp_img" style="display:none;" />');
|
||||
$img = $('#temp_img').attr('src', src);
|
||||
$('#temp_img').remove();
|
||||
if($img.width() != $width || $img.height() != $height){
|
||||
alert('지정된 크기와 맞지 않습니다.('+$width + 'x'+ $height +')');
|
||||
|
||||
$(this).val('');
|
||||
|
||||
return;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
$('#temp_img').remove();
|
||||
});
|
||||
|
||||
|
||||
$("input:text[numberOnly]").on("focus", function() {
|
||||
var x = $(this).val();
|
||||
x = removeCommas(x);
|
||||
$(this).val(x);
|
||||
}).on("focusout", function() {
|
||||
var x = $(this).val();
|
||||
if(x && x.length > 0) {
|
||||
if(!$.isNumeric(x)) {
|
||||
x = x.replace(/[^0-9]/g,"");
|
||||
}
|
||||
x = addCommas(x);
|
||||
$(this).val(x);
|
||||
}
|
||||
}).on("keyup", function() {
|
||||
$(this).val($(this).val().replace(/[^0-9]/g,""));
|
||||
});
|
||||
|
||||
</script>
|
||||
198
application/views/admin/maptoon/list.php
Executable file
198
application/views/admin/maptoon/list.php
Executable file
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
$menu_code = '1020';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
|
||||
|
||||
<form name="input_form" id="input_form" method="post" action="/admin/member/member_list/4">
|
||||
|
||||
<!-- <div class="common_tep clearfix type01">
|
||||
|
||||
|
||||
<div class="searh_area">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
-->
|
||||
<div class="write_btn">
|
||||
<!--a href="javascript:news_arr_del_proc();">삭제</a-->
|
||||
<a href="#" id="btn_reg">등록</a>
|
||||
</div>
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span style="font-weight:bold">Total:</span> <?php echo number_format($total_count);?>
|
||||
|
||||
<span style="margin-left:20px">
|
||||
<?/*
|
||||
foreach ($arr_default_member_gendar as $val) {
|
||||
$member_gender_count = 0;
|
||||
if(isset($arr_member_gender[$val['code']])==true) {
|
||||
$member_gender_count = $arr_member_gender[$val['code']];
|
||||
}
|
||||
?>
|
||||
<b><?=$val['txt']?>:</b> <a href="javascript:click_search('search_member_gender', '<?=$val['code']?>');"><?=number_format($member_gender_count)?></a>
|
||||
<?
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<span style="margin-left:20px">
|
||||
<?
|
||||
foreach ($arr_default_member_group as $val) {
|
||||
$member_group_count = 0;
|
||||
if(isset($arr_member_group[$val['code']])==true) {
|
||||
$member_group_count = $arr_member_group[$val['code']];
|
||||
}
|
||||
echo '<b>'.$val['txt'].':</b> '.number_format($member_group_count).' ';
|
||||
}
|
||||
?>
|
||||
</span>
|
||||
<span style="margin-left:20px"><b>오늘신규가입:</b> <a href="javascript:click_search('search_member_new', 'today');"><?=number_format($member_new_count);?></a></span>
|
||||
</ul>
|
||||
<ul style="text-align:left; padding-top:10px; padding-bottom:10px;">
|
||||
<span>
|
||||
<?
|
||||
foreach ($arr_default_member_age as $val) {
|
||||
$member_age_count = 0;
|
||||
if(isset($arr_member_age[$val['code']])==true) {
|
||||
$member_age_count = $arr_member_age[$val['code']];
|
||||
}
|
||||
?>
|
||||
<b><?=$val['txt']?>:</b> <a href="javascript:click_search('search_member_age', '<?=$val['code']?>');"><?=number_format($member_age_count)?></a>
|
||||
<?
|
||||
}*/
|
||||
?>
|
||||
</span>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- 테이블 시작-->
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<th>번호</th>
|
||||
<th>썸네일</th>
|
||||
<th>웹툰이름</th>
|
||||
<th>작가명</th>
|
||||
<th>상태</th>
|
||||
<th>관심웹툰 등록수</th>
|
||||
<th>연재일</th>
|
||||
<th>관리</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
|
||||
<?php
|
||||
if(($total_rows=count($list))==0) {
|
||||
?>
|
||||
<tr>
|
||||
<td colspan="13">등록된 내용이 없습니다.</td>
|
||||
</tr>
|
||||
<?php
|
||||
} else {
|
||||
|
||||
$dataNumber = ($total_rows + $limit)-($page*$limit);
|
||||
foreach($list as $val) {
|
||||
$idx = $val['idx'];
|
||||
$main_img = $val['main_img'];
|
||||
$name = $val['name'];
|
||||
if($val['status']==0) {
|
||||
$status = '연재중';
|
||||
} else if($val['status']==1) {
|
||||
$status = '완결';
|
||||
} else if($val['status']==2) {
|
||||
$status = '미완결';
|
||||
} else {
|
||||
$status = '';
|
||||
}
|
||||
$date_sun = ($val['date_sun']==1) ? '일 / ' : '';
|
||||
$date_mon = ($val['date_mon']==1) ? '월 / ' : '';
|
||||
$date_tue = ($val['date_tue']==1) ? '화 / ' : '';
|
||||
$date_wed = ($val['date_wed']==1) ? '수 / ' : '';
|
||||
$date_thu = ($val['date_thu']==1) ? '목 / ' : '';
|
||||
$date_fri = ($val['date_fri']==1) ? '금 / ' : '';
|
||||
$date_sat = ($val['date_sat']==1) ? '토 / ' : '';
|
||||
$interest_count = $val['interest_count'];
|
||||
?>
|
||||
|
||||
<tr>
|
||||
<td><?php echo $dataNumber;?></td>
|
||||
<td><?php if($main_img!='') echo '<img src="'.$main_img.'" width="100" />';?></td>
|
||||
<td><?php echo $name;?></td>
|
||||
<td>
|
||||
<?php
|
||||
foreach($cartoonist as $v) {
|
||||
if($v['idx']==$val['mt_cartoonists_idx']) {
|
||||
echo $v['name'];
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><?php echo $status?></td>
|
||||
<td><?php echo number_format($interest_count);?></td>
|
||||
<td><?php echo $date_sun.$date_mon.$date_tue.$date_wed.$date_thu.$date_fri.$date_sat;?></td>
|
||||
<td style="width:200px" class="tool_btn">
|
||||
<a href="/admin/maptoon/maptoon_detail/10?idx=<?php echo $idx;?>"><i class="fa fa-pencil"></i>수정</a>
|
||||
<?php
|
||||
if($val['num_of_episodes']==0) {
|
||||
echo '<a id="btn_del" attr="'.$idx.'" style="cursor:pointer;"><i class="fa fa-close"></i>삭제</a>';
|
||||
}
|
||||
?>
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$dataNumber--;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="pasing_wrap">
|
||||
<?//=$pagination?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#btn_reg").click(function() {
|
||||
document.location.href = '/admin/maptoon/maptoon_detail/10';
|
||||
});
|
||||
|
||||
$("#btn_del").click(function() {
|
||||
idx = $(this).attr('attr');
|
||||
if(confirm('정말 삭제하시겠습니다. 삭제 후 복구 불가능합니다.') && idx!=undefined && idx>0) {
|
||||
$.ajax({
|
||||
url: '/admin/maptoon/maptoon_list_del',
|
||||
data: {
|
||||
format: 'json',
|
||||
idx:idx
|
||||
},
|
||||
//dataType: 'jsonp',
|
||||
type:'post',
|
||||
success: function(msg) {
|
||||
var json = $.parseJSON(msg);
|
||||
if(json.result=='success') {
|
||||
document.location.reload();
|
||||
} else {
|
||||
alert(json.result);
|
||||
document.location.reload();
|
||||
}
|
||||
},
|
||||
error: function(err) {
|
||||
// console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
180
application/views/admin/maptoon/maptoon_detail.php
Executable file
180
application/views/admin/maptoon/maptoon_detail.php
Executable file
@@ -0,0 +1,180 @@
|
||||
<?php
|
||||
$menu_code = '1010';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<!-- jquery UI -->
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
<!-- //jquery UI -->
|
||||
|
||||
|
||||
<div class="common_table" style="margin-top: 30px">
|
||||
<span style="font-weight:bold">웹툰 등록 및 수정</span>
|
||||
</div>
|
||||
|
||||
<!-- 테이블 시작-->
|
||||
<div class="common_table news">
|
||||
<form name="frm" method="post" action="/admin/maptoon/maptoon_proc" enctype="multipart/form-data">
|
||||
<!--input type="hidden" name="mode" value="<?php if(isset($mode)==TRUE) echo $mode;?>" /-->
|
||||
<input type="hidden" name="idx" value="<?php if(isset($maptoon_idx)==TRUE) echo $maptoon_idx;?>" />
|
||||
<?php if(isset($aaa)==TRUE) echo $aaa;?>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>맵툰 썸네일</th>
|
||||
<td class="tl"><?php if(isset($data['main_img'])==TRUE && $data['main_img']!='') echo '<img src="'.$data['main_img'].'" />';?> <input type="file" name="main_img" /></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>맵툰 작가명</th>
|
||||
<td class="tl">
|
||||
<select name="mt_cartoonists_idx">
|
||||
<option value="">------------</option>
|
||||
<?php
|
||||
if(isset($cartoonist)==TRUE) {
|
||||
foreach($cartoonist as $v) {
|
||||
$selected = (isset($data['mt_cartoonists_idx'])==TRUE && $v['idx']==$data['mt_cartoonists_idx']) ? 'selected' : '';
|
||||
echo '<option value="'.$v['idx'].'" '.$selected.'>'.$v['name'].'</option>\n';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>맵툰 이름</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="name" id="name" class="type01" value="<?php if(isset($data['name'])==TRUE) { echo $data['name']; }?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>상태</th>
|
||||
<td class="tl">
|
||||
<input type="radio" name="status" id="status1" class="" value="0" <?php if(isset($data['status'])==TRUE && $data['status']==0) echo 'checked'; ?>> <label for="status1">연재중</label>
|
||||
<input type="radio" name="status" id="status2" class="" value="1" <?php if(isset($data['status'])==TRUE && $data['status']==1) echo 'checked'; ?>> <label for="status2">완결</label>
|
||||
<input type="radio" name="status" id="status3" class="" value="2" <?php if(isset($data['status'])==TRUE && $data['status']==2) echo 'checked'; ?>> <label for="status3">미완결</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>연재요일</th>
|
||||
<td class="tl">
|
||||
<input type="checkbox" name="date_sun" id="date_sun" class="" value="1" <?php if(isset($data['date_sun'])==TRUE && $data['date_sun']==1) echo 'checked'; ?>> <label for="date_sun">일</label>
|
||||
<input type="checkbox" name="date_mon" id="date_mon" class="" value="1" <?php if(isset($data['date_mon'])==TRUE && $data['date_mon']==1) echo 'checked'; ?>> <label for="date_mon">월</label>
|
||||
<input type="checkbox" name="date_tue" id="date_tue" class="" value="1" <?php if(isset($data['date_tue'])==TRUE && $data['date_tue']==1) echo 'checked'; ?>> <label for="date_tue">화</label>
|
||||
<input type="checkbox" name="date_wed" id="date_wed" class="" value="1" <?php if(isset($data['date_wed'])==TRUE && $data['date_wed']==1) echo 'checked'; ?>> <label for="date_wed">수</label>
|
||||
<input type="checkbox" name="date_thu" id="date_thu" class="" value="1" <?php if(isset($data['date_thu'])==TRUE && $data['date_thu']==1) echo 'checked'; ?>> <label for="date_thu">목</label>
|
||||
<input type="checkbox" name="date_fri" id="date_fri" class="" value="1" <?php if(isset($data['date_fri'])==TRUE && $data['date_fri']==1) echo 'checked'; ?>> <label for="date_fri">금</label>
|
||||
<input type="checkbox" name="date_sat" id="date_sat" class="" value="1" <?php if(isset($data['date_sat'])==TRUE && $data['date_sat']==1) echo 'checked'; ?>> <label for="date_sat">토</label>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>맵툰 설명글</th>
|
||||
<td class="tl">
|
||||
<textarea name="description" rows="10" cols="200"><?php if(isset($data['description'])==TRUE) echo $data['description']?></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>관심 웹툰 등록수</th>
|
||||
<td class="tl"><?php if(isset($data['interest_count'])==TRUE) echo number_format($data['interest_count']);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>등록 편수</th>
|
||||
<td class="tl"><?php if(isset($num_of_episodes)==TRUE) echo number_format($num_of_episodes);?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>등록일</th>
|
||||
<td class="tl"><?php if(isset($data['reg_date'])==TRUE) echo $data['reg_date'];?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
<div class="write_btn tc">
|
||||
<a href="/admin/">공지보기</a>
|
||||
<a href="#" id="btn_reg">저장하기</a>
|
||||
<a href="/admin/maptoon/maptoon_list/10">목록으로</a>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#btn_reg").click(function() {
|
||||
$("form[name=frm]").submit();
|
||||
});
|
||||
|
||||
|
||||
/*
|
||||
$("#btn_reg").click(function() {
|
||||
$("#dialog").dialog();
|
||||
return false;
|
||||
});
|
||||
|
||||
function reset_popup_form() {
|
||||
$("#c_name").val('');
|
||||
$( "#dialog" ).dialog();
|
||||
}
|
||||
|
||||
function fill_popup_form(a) {
|
||||
if(a!='') {
|
||||
reset_popup_form();
|
||||
$("#c_name").val(a);
|
||||
$( "#dialog" ).dialog();
|
||||
}
|
||||
}
|
||||
|
||||
$(".btn_delete").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
if(idx>0 && confirm('정말 삭제하시겠습니까?')) {
|
||||
frm = $("form[name='popup']");
|
||||
frm.attr('target','ifrm');
|
||||
$("#popup_idx").val(idx);
|
||||
frm.attr('action','/admin/maptoon/category_del_proc');
|
||||
frm.submit();
|
||||
}
|
||||
});
|
||||
|
||||
$(".btn_modify").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
if(idx>0) {
|
||||
$.ajax({
|
||||
url: '/admin/maptoon/category/?idx='+idx,
|
||||
data: {
|
||||
format: 'json',
|
||||
idx:idx
|
||||
},
|
||||
//dataType: 'jsonp',
|
||||
type:'get',
|
||||
success: function(msg) {
|
||||
var json = $.parseJSON(msg);
|
||||
console.log(json);
|
||||
if(json.result=='success') {
|
||||
$("#popup_mode").val('upt');
|
||||
$("#popup_idx").val(idx);
|
||||
fill_popup_form(json.c_name);
|
||||
}
|
||||
},
|
||||
error: function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_open_popup").click(function() {
|
||||
reset_popup_form();
|
||||
});
|
||||
|
||||
$("#btn_register").click(function() {
|
||||
frm = $("form[name='popup']");
|
||||
|
||||
if($("#c_name").val()=='') {
|
||||
alert('카테고리를 등록해 주십시오.');
|
||||
$("#c_name").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
frm.attr('target','ifrm');
|
||||
frm.attr('action','/admin/maptoon/category_proc');
|
||||
frm.submit();
|
||||
});*/
|
||||
});
|
||||
</script>
|
||||
261
application/views/admin/maptoon/notice_list.php
Executable file
261
application/views/admin/maptoon/notice_list.php
Executable file
@@ -0,0 +1,261 @@
|
||||
<?php
|
||||
$menu_code = '1010';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<!-- jquery UI -->
|
||||
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.1.min.js"></script>
|
||||
<script type="text/javascript" src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
|
||||
<link rel="stylesheet" type="text/css" media="screen" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" />
|
||||
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css">
|
||||
|
||||
<!--oringin-->
|
||||
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
|
||||
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
|
||||
|
||||
<!-- <link href="./css/prettify-1.0.css" rel="stylesheet"> -->
|
||||
<!-- <link href="./css/base.css" rel="stylesheet"> -->
|
||||
<link href="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/build/css/bootstrap-datetimepicker.css" rel="stylesheet">
|
||||
|
||||
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
|
||||
<script src="//cdnjs.cloudflare.com/ajax/libs/moment.js/2.9.0/moment-with-locales.js"></script>
|
||||
|
||||
<script src="//cdn.rawgit.com/Eonasdan/bootstrap-datetimepicker/e8bddc60e73c1ec2475f827be36e1957af72e2ea/src/js/bootstrap-datetimepicker.js"></script>
|
||||
|
||||
|
||||
|
||||
<style>
|
||||
label, input { display:block; }
|
||||
input.text { margin-bottom:12px; width:95%; padding: .4em; }
|
||||
textarea { margin-bottom:12px; width:95%; padding: .4em; }
|
||||
fieldset { padding:0; border:0; margin-top:25px; }
|
||||
h1 { font-size: 1.2em; margin: .6em 0; }
|
||||
div#users-contain { width: 350px; margin: 20px 0; }
|
||||
div#users-contain table { margin: 1em 0; border-collapse: collapse; width: 100%; }
|
||||
div#users-contain table td, div#users-contain table th { border: 1px solid #eee; padding: .6em 10px; text-align: left; }
|
||||
.ui-dialog .ui-state-error { padding: .3em; }
|
||||
.validateTips { border: 1px solid transparent; padding: 0.3em; }
|
||||
* {box-sizing: border-box;}
|
||||
/*the container must be positioned relative:*/
|
||||
.autocomplete {position: relative; display: inline-block;}
|
||||
.autocomplete-items { position: absolute; border: 1px solid #d4d4d4; border-bottom: none; border-top: none; z-index: 99; /*position the autocomplete items to be the same width as the container:*/
|
||||
top: 15%; left: 0; right: 0; margin: 0px 16px; width: 89%;}
|
||||
.autocomplete-items div { padding: 10px; cursor: pointer; background-color: #fff; border-bottom: 1px solid #d4d4d4; }
|
||||
/*when hovering an item:*/
|
||||
.autocomplete-items div:hover { background-color: #e9e9e9; }
|
||||
/*when navigating through the items using the arrow keys:*/
|
||||
.autocomplete-active { background-color: DodgerBlue !important; color: #ffffff; }
|
||||
</style>
|
||||
<!-- //jquery UI -->
|
||||
<!-- 테이블 시작-->
|
||||
<div class="common_table">
|
||||
<table>
|
||||
<thead>
|
||||
<th>번호</th>
|
||||
<th>맵툰 이름</th>
|
||||
<th>공지 사항 제목</th>
|
||||
<th>등록일</th>
|
||||
<th>공지 기간</th>
|
||||
<th>관리</th>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?if(count($list)==0) {
|
||||
echo '<tr><td colspan="6">등록된 내용이 없습니다.</td></tr>';
|
||||
} else {
|
||||
$i=0;
|
||||
foreach($list as $val) {
|
||||
$idx= $val['idx'];
|
||||
$mt_name=$val['name'];
|
||||
$contents= $val['contents'];
|
||||
$s_date=$val['s_date'];
|
||||
$e_date=$val['e_date'];
|
||||
$reg_date=$val['reg_date'];?>
|
||||
<tr>
|
||||
<td><?=$idx?><input type="hidden" id="index_<?=$idx?>" value="<?=$i?>"></td>
|
||||
<td><?=$mt_name?></td>
|
||||
<td><?=$contents?></td>
|
||||
<td><?=$reg_date?></td>
|
||||
<td><?=$s_date." ~ ".$e_date?></td>
|
||||
<td style="width:200px" class="tool_btn">
|
||||
<a href="#" class="btn_modify" value="<?= $idx;?>"><i class="fa fa-pencil"></i>수정</a>
|
||||
<a href="#" class="btn_delete" value="<?= $idx;?>"><i class="fa fa-close"></i>삭제</a>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?$i++; }
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="write_btn">
|
||||
<a href="#" id="btn_reg">등록</a>
|
||||
</div>
|
||||
<div class="pasing_wrap">
|
||||
<?//=$pagination?>
|
||||
</div>
|
||||
|
||||
<!-- register popup -->
|
||||
<div id="dialog" title="맵툰 카테고리 등록/수정" style="display:none;">
|
||||
<!--p>This is the default dialog which is useful for displaying information. The dialog window can be moved, resized and closed with the 'x' icon.</p-->
|
||||
<form name="popup" action="" target="ifrm" method="post">
|
||||
<input type="hidden" id="popup_mode" name="mode" value="" />
|
||||
<input type="hidden" id="popup_idx" name="idx" value="" />
|
||||
<fieldset>
|
||||
<label for="mt_title">맵툰 선택</label>
|
||||
<select id="mt_title" class="ui-widget-content ui-corner-all" name="mt_title">
|
||||
<?foreach($mt_title as $val){?>
|
||||
<option value="<?=$val["idx"]?>"><?=$val["name"]?></option>
|
||||
<?}?>
|
||||
</select>
|
||||
|
||||
<label for="contents">공지 사항 내용</label>
|
||||
<textarea id="contents" name="contents" value="" class="text ui-widget-content ui-corner-all" maxlength="500"></textarea>
|
||||
<label>공지기간</label>
|
||||
<div style="width: 95%;">
|
||||
<div class="form-group">
|
||||
<div class='input-group date' id='div_s_date'>
|
||||
<input type='text' id="s_date" name="s_date" class="form-control"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 95%;">
|
||||
<div class="form-group">
|
||||
<div class='input-group date' id='div_e_date'>
|
||||
<input type='text' id="e_date" name="e_date" class="form-control"/>
|
||||
<span class="input-group-addon">
|
||||
<span class="glyphicon glyphicon-calendar"></span>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#div_s_date').datetimepicker({
|
||||
locale: 'ko',
|
||||
format : "YYYY-MM-DD HH:mm:ss"
|
||||
});
|
||||
$('#div_e_date').datetimepicker({
|
||||
useCurrent: false, //Important! See issue #1075
|
||||
locale: 'ko',
|
||||
format : "YYYY-MM-DD HH:mm:ss"
|
||||
});
|
||||
$("#div_s_date").on("dp.change", function (e) {
|
||||
$('#div_e_date').data("DateTimePicker").minDate(e.date);
|
||||
});
|
||||
$("#div_e_date").on("dp.change", function (e) {
|
||||
$('#div_s_date').data("DateTimePicker").maxDate(e.date);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<input type="button" value=" 등록 " id="btn_register" tabindex="-1" >
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<!-- //register popup -->
|
||||
|
||||
<iframe name="ifrm" frameborder="0" width="0" height="0"></iframe>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#btn_reg").click(function() {
|
||||
reset_popup_form();
|
||||
$("#dialog").dialog({"width": 500, "height": 650} );
|
||||
return false;
|
||||
});
|
||||
|
||||
//팝업 초기화
|
||||
function reset_popup_form() {
|
||||
$("#popup_mode").val('');
|
||||
$("#popup_idx").val('');
|
||||
$("#contents").val('');
|
||||
$("#s_date").val('');
|
||||
$("#e_date").val('');
|
||||
$( "#dialog" ).dialog({"width": 500, "height": 650});
|
||||
$("#mt_title option").not(":selected").removeAttr("disabled")
|
||||
}
|
||||
|
||||
//delete click event
|
||||
$(".btn_delete").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
if(confirm('정말 삭제하시겠습니까?')) {
|
||||
frm = $("form[name='popup']");
|
||||
frm.attr('target','ifrm');
|
||||
$("#popup_idx").val(idx);
|
||||
frm.attr('action','/admin/maptoon/announcement_del_proc');
|
||||
frm.submit();
|
||||
}
|
||||
});
|
||||
|
||||
//modify click event
|
||||
$(".btn_modify").click(function() {
|
||||
var idx = $(this).attr('value');
|
||||
var list_index=$("#index_"+idx).val();
|
||||
if(idx>0) {
|
||||
reset_popup_form();
|
||||
|
||||
<?if(isset($list)==TRUE) {?>
|
||||
var edit_notice=<?= json_encode($list);?>;
|
||||
var list=edit_notice[list_index];
|
||||
$("#mt_title").val(list.mt_list_idx);
|
||||
$("#mt_title option").not(":selected").attr("disabled", "disabled");
|
||||
$("#mt_title").attr("readonly",true);
|
||||
$("#contents").val(list.contents);
|
||||
$("#s_date").val(list.s_date);
|
||||
$("#e_date").val(list.e_date);
|
||||
$("#popup_mode").val("modify");
|
||||
$("#popup_idx").val(idx);
|
||||
|
||||
<?}else{?> alert("값이 존재하지 않습니다 관리자에게 문의주세요"); <?}?>
|
||||
}else{
|
||||
alert("값이 존재하지 않습니다 관리자에게 문의주세요");
|
||||
}
|
||||
});
|
||||
|
||||
//등록
|
||||
$("#btn_open_popup").click(function() {
|
||||
reset_popup_form();
|
||||
});
|
||||
|
||||
// 등록하기
|
||||
$("#btn_register").click(function() {
|
||||
frm = $("form[name='popup']");
|
||||
|
||||
if($("#mt_title").val()=='') {
|
||||
alert('맵툰을 선택해주세요.');
|
||||
$("#mt_title").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
if($("#s_date").val()=='') {
|
||||
alert('시작일을 등록해 주십시오.');
|
||||
$("#s_date").focus();
|
||||
return false;
|
||||
}
|
||||
if($("#e_date").val()=='') {
|
||||
alert('종료일을 등록해 주십시오.');
|
||||
$("#e_date").focus();
|
||||
return false;
|
||||
}
|
||||
frm.attr('target','ifrm');
|
||||
frm.attr('action','/admin/maptoon/announcement_reg_proc');
|
||||
frm.submit();
|
||||
});
|
||||
});
|
||||
|
||||
//autocomplete
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user