first commit
This commit is contained in:
300
application/views/admin/advertisement/ad_code.php
Executable file
300
application/views/admin/advertisement/ad_code.php
Executable file
@@ -0,0 +1,300 @@
|
||||
<?
|
||||
$menu_code = '15';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<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>
|
||||
|
||||
<div class="common_depth3 clearfix">
|
||||
<ul class="clearfix depth3_tep">
|
||||
<li><a href="/admin/advertisement/1">광고 페이지 관리</a></li>
|
||||
<li><a href="/admin/advertisement/ad_code" class="on fw700">개별 광고 관리</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="write_btn">
|
||||
<a href="javascript:ad_page_arr_del_proc();">삭제</a>
|
||||
<a href="#" id="btn_open_popup">등록</a>
|
||||
</div>
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/setting/setting_comment_reg_proc" method="post">
|
||||
<div class="common_table news">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="fw500" style="width:50px;"><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th class="fw500" width="100">번호</th>
|
||||
<th class="fw500">페이지 이름</th>
|
||||
<th class="fw500">광고 위치</th>
|
||||
<th class="fw500">광고 코드</th>
|
||||
<th class="fw500">광고보기</th>
|
||||
<th class="fw500">관리</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
// $len = count($row);
|
||||
// foreach($row as $v) {
|
||||
// ?>
|
||||
<?/*
|
||||
// <tr>
|
||||
// <td><input type="checkbox" name="is_del[]" value="<?php echo $v['idx'];?>"></td>
|
||||
// <td><?php echo $len;?></td>
|
||||
// <td><?php echo $v['page_key'];?></td>
|
||||
// <td><?php echo $v['page_name'];?></td>
|
||||
// <td><?php echo $v['ad_pos_key'];?></td>
|
||||
// <td><?php echo $v['ad_pos_name'];?></td>
|
||||
// <td style="width:200px" class="tool_btn">
|
||||
// <a href="#" class="btn_modify" value="<?php echo $v['idx'];?>"><i class="fa fa-pencil"></i>수정</a>
|
||||
// </td>
|
||||
// </tr>
|
||||
// <?php $len-=1;}?>
|
||||
// </tbody>
|
||||
// </table>
|
||||
// </div>
|
||||
|
||||
// <!--div class="write_btn tc">
|
||||
// <a href="javascript:setting_comment_reg_proc()">저장하기</a>
|
||||
// </div-->
|
||||
|
||||
// </form>
|
||||
|
||||
<!-- 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="page_key">페이지 키 영(대/소)문자만 사용</label>
|
||||
<input type="text" id="page_key" name="page_key" value="" class="text ui-widget-content ui-corner-all" maxlength="20">
|
||||
<label for="page_name">페이지 이름</label>
|
||||
<input type="text" id="page_name" name="page_name" value="" class="text ui-widget-content ui-corner-all" maxlength="100">
|
||||
<label for="ad_pos_key">광고 위치 키 영(대/소)문자만 사용</label>
|
||||
<input type="text" id="ad_pos_key" name="ad_pos_key" value="" class="text ui-widget-content ui-corner-all" maxlength="20">
|
||||
<label for="ad_pos_name">광고 위치 이름</label>
|
||||
<input type="text" id="ad_pos_name" name="ad_pos_name" value="" class="text ui-widget-content ui-corner-all" maxlength="100">
|
||||
|
||||
<!-- Allow form submission with keyboard without duplicating the dialog button -->
|
||||
<input type="button" value=" 등록 " id="btn_register" tabindex="-1" >
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<!-- //register popup -->
|
||||
|
||||
<iframe frameborder="1" width="600" height="300" name="ifrm" style="border:2px ccc solid;"></iframe>
|
||||
|
||||
|
||||
// <script type="text/javascript">
|
||||
// $(document).ready(function() {
|
||||
// function reset_popup_form() {
|
||||
// $("#page_key").val('');
|
||||
// $("#page_name").val('');
|
||||
// $("#ad_pos_key").val('');
|
||||
// $("#ad_pos_name").val('');
|
||||
// $( "#dialog" ).dialog();
|
||||
// }
|
||||
|
||||
// function fill_popup_form(a,b,c,d) {
|
||||
// if(a!='' && b!='' && c!='' && d!='') {
|
||||
// reset_popup_form();
|
||||
// $("#page_key").val(a);
|
||||
// $("#page_name").val(b);
|
||||
// $("#ad_pos_key").val(c);
|
||||
// $("#ad_pos_name").val(d);
|
||||
// $( "#dialog" ).dialog();
|
||||
// }
|
||||
// }
|
||||
|
||||
// $(".btn_modify").click(function() {
|
||||
// idx = $(this).attr('value');
|
||||
// if(idx>0) {
|
||||
// $.ajax({
|
||||
// url: '/admin/advertisement/ad_page_edit',
|
||||
// data: {
|
||||
// format: 'json',
|
||||
// idx:idx
|
||||
// },
|
||||
// //dataType: 'jsonp',
|
||||
// type:'get',
|
||||
// success: function(msg) {
|
||||
// var json = $.parseJSON(msg);
|
||||
// if(json.result=='success') {
|
||||
// $("#popup_mode").val('upt');
|
||||
// $("#popup_idx").val(idx);
|
||||
// fill_popup_form(json.page_key,json.page_name,json.ad_pos_key,json.ad_pos_name);
|
||||
// }
|
||||
// },
|
||||
// error: function(err) {
|
||||
// console.log(err);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
|
||||
// $("#btn_open_popup").click(function() {
|
||||
// reset_popup_form();
|
||||
// });
|
||||
|
||||
// $("#btn_register").click(function() {
|
||||
// frm = $("form[name='popup']");
|
||||
|
||||
// frm.attr('target','ifrm');
|
||||
// frm.attr('action','/admin/advertisement/ad_page_proc');
|
||||
// frm.submit();
|
||||
// });
|
||||
// });
|
||||
|
||||
// function close_popup() {
|
||||
// $("")
|
||||
// }
|
||||
|
||||
// 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 ad_page_arr_del_proc() {
|
||||
// if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
// alert("삭제할 내용이 없습니다.");
|
||||
// return false;
|
||||
// }
|
||||
// if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
// $("#input_form").attr("action", "/admin/advertisement/ad_page_arr_del_proc");
|
||||
// $("#input_form").attr('target','ifrm');
|
||||
// $("#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>
|
||||
|
||||
|
||||
// <script type="text/javascript">
|
||||
// // 컨텐츠 선택
|
||||
// function select_setting_type(){
|
||||
// $("#input_form").attr("action", "/admin/advertisement/ads/1");
|
||||
// $("#input_form").submit();
|
||||
// }
|
||||
|
||||
// // 저장하기
|
||||
// function setting_comment_reg_proc(){
|
||||
// $("#input_form").submit();
|
||||
|
||||
// }
|
||||
|
||||
|
||||
|
||||
// </script> */?>
|
||||
|
||||
<!-- // 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="page_name">페이지 이름 영(대/소)문자만 사용</label>
|
||||
<input type="text" id="page_key" name="page_key" value="" class="text ui-widget-content ui-corner-all" maxlength="20">
|
||||
<label for="page_name">광고 위치 이름</label>
|
||||
<input type="text" id="page_name" name="page_name" value="" class="text ui-widget-content ui-corner-all" maxlength="100">
|
||||
<label for="ad_pos_key">광고 위치 키 영(대/소)문자만 사용</label>
|
||||
<input type="text" id="ad_pos_key" name="ad_pos_key" value="" class="text ui-widget-content ui-corner-all" maxlength="20">
|
||||
<label for="ad_pos_name">광고 위치 이름</label>
|
||||
<input type="text" id="ad_pos_name" name="ad_pos_name" value="" class="text ui-widget-content ui-corner-all" maxlength="100">
|
||||
<!-- Allow form submission with keyboard without duplicating the dialog button -->
|
||||
<input type="button" value=" 등록 " id="btn_register" tabindex="-1" >
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<!-- //register popup -->
|
||||
|
||||
<iframe frameborder="1" width="600" height="300" name="ifrm" style="border:2px ccc solid;"></iframe>
|
||||
134
application/views/admin/advertisement/ad_detail.php
Executable file
134
application/views/admin/advertisement/ad_detail.php
Executable file
@@ -0,0 +1,134 @@
|
||||
<?
|
||||
$menu_code = '15';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<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>
|
||||
|
||||
<div class="common_depth3 clearfix">
|
||||
<ul class="clearfix depth3_tep">
|
||||
<li><a href="/admin/advertisement/1">광고 페이지 관리</a></li>
|
||||
<li><a href="/admin/advertisement/ad_detail" class="on fw700">개별 광고 관리</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="write_btn">
|
||||
<a href="javascript:fn_ad_detail_arr_del_proc();">삭제</a>
|
||||
<a href="ad_register" id="ad_register">등록</a>
|
||||
</div>
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/setting/setting_comment_reg_proc" method="post">
|
||||
<input type="hidden" id="idx" name="idx">
|
||||
<input type="hidden" id="mode" name="mode">
|
||||
<div class="common_table news">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="fw500" style="width:50px;"><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th class="fw500" width="100">번호</th>
|
||||
<th class="fw500">페이지 이름</th>
|
||||
<th class="fw500">광고 위치</th>
|
||||
<th class="fw500">광고 코드</th>
|
||||
<th class="fw500">광고보기</th>
|
||||
<th class="fw500">관리</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$len = count($row);
|
||||
foreach($row as $v) {
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?php echo $v['idx'];?>"></td>
|
||||
<td><?=$len;?></td>
|
||||
<td><?=$v['page_name']?></td>
|
||||
<td><?=$v['ad_pos_name']?></td>
|
||||
<td><?=$v['ad_code']?></td>
|
||||
<td><?
|
||||
if(empty(!$v['ad_file'])){
|
||||
echo '<img id="image_section" src="'.$v['ad_file'].'" style="max-height: 100%; max-width: 100%;"/>';
|
||||
}?></td>
|
||||
<td style="width:200px" class="tool_btn">
|
||||
<a href="javascript:ad_detail_edit('<?=$v['idx']?>')" class="btn_modify" value="<?php echo $v['idx'];?>"><i class="fa fa-pencil"></i>수정</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $len-=1;}?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
<iframe frameborder="1" width="600" height="300" name="ifrm" style="border:2px ccc solid;"></iframe>
|
||||
<script>
|
||||
|
||||
// 복수 삭제
|
||||
function fn_ad_detail_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/advertisement/ad_detail_arr_del_proc");
|
||||
$("#input_form").attr('target','ifrm');
|
||||
$("#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);
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
// modify data
|
||||
function ad_detail_edit(idx){
|
||||
$("#idx").val(idx);
|
||||
$("#mode").val('modify');
|
||||
$("#input_form").attr("action", "ad_register");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
</script>
|
||||
<?
|
||||
// $(".btn_modify").click(function() {
|
||||
// idx = $(this).attr('value');
|
||||
// if(idx>0) {
|
||||
// $.ajax({
|
||||
// url: '/admin/advertisement/ad_page_edit',
|
||||
// data: {
|
||||
// format: 'json',
|
||||
// idx:idx
|
||||
// },
|
||||
// //dataType: 'jsonp',
|
||||
// type:'get',
|
||||
// success: function(msg) {
|
||||
// var json = $.parseJSON(msg);
|
||||
// if(json.result=='success') {
|
||||
// $("#popup_mode").val('upt');
|
||||
// $("#popup_idx").val(idx);
|
||||
// fill_popup_form(json.page_key,json.page_name,json.ad_pos_key,json.ad_pos_name);
|
||||
// }
|
||||
// },
|
||||
// error: function(err) {
|
||||
// console.log(err);
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// });
|
||||
?>
|
||||
232
application/views/admin/advertisement/ad_reg.php
Executable file
232
application/views/admin/advertisement/ad_reg.php
Executable file
@@ -0,0 +1,232 @@
|
||||
<?
|
||||
$menu_code = '15';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<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>
|
||||
|
||||
<div class="common_depth3 clearfix">
|
||||
<ul class="clearfix depth3_tep">
|
||||
<li><a href="/admin/advertisement/1">광고 페이지 관리</a></li>
|
||||
<li><a href="/admin/advertisement/ad_detail" class="on fw700">개별 광고 관리</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="write_btn">
|
||||
<a href="ad_detail" id="ad_detail">취소</a>
|
||||
</div>
|
||||
|
||||
<div class="inner_content">
|
||||
<form name="input_form" id="input_form" action="/admin/advertisement/ad_detail_reg" method="post" enctype="multipart/form-data">
|
||||
<div class="common_table">
|
||||
<table><tbody>
|
||||
<tr>
|
||||
<th class="fw500">페이지 이름</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="page_title" id="page_name" value="" readonly style="display:none">
|
||||
<SELECT id="page_list" NAME="page_name" SIZE=1></SELECT>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">광고 위치 등록</th>
|
||||
<td class="tl">
|
||||
<SELECT id="ad_pos" NAME="ad_pos" SIZE=1></SELECT>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th class="fw500">광고등록 옵션</th>
|
||||
<td class="tl">
|
||||
<input type="radio" name="ad_option" value="0" id="ad_option_0">파일 업로드<br>
|
||||
<input type="radio" name="ad_option" value="1" id="ad_option_1">광고 코드 등록<br>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="option_file" style="display: none;">
|
||||
<th class="fw500">업로드 파일 선택</th>
|
||||
<td class="tl">
|
||||
<input type="file" name="ad_file" id="ad_file" onchange="change_img(this)">
|
||||
<div style="width:600px;height:200px">
|
||||
<img id="image_section" src="#" style="max-height: 100%; max-width: 100%;"/>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="option_file" style="display: none;">
|
||||
<th class="fw500">랜딩 페이지 주소</th>
|
||||
<td class="tl">
|
||||
<input type="text" name="ad_lending" id="ad_lending" value="">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="option_HTML" style="display: none;">
|
||||
<th class="fw500">HTML</th>
|
||||
<td class="tl">
|
||||
<textarea style="width:600px;height:200px" name="ad_code" id="ad_code"></textarea>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody></table>
|
||||
</div>
|
||||
<div class="write_btn tc">
|
||||
<a href="javascript:setting_ad_reg_proc()">저장하기</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript">
|
||||
const page_name=<?=json_encode($page_name)?>;
|
||||
const ad_pos_name =<?=json_encode($ad_pos_name)?>;
|
||||
|
||||
$(document).ready(function(){
|
||||
setting_page_list(page_name)
|
||||
setting_ad_pos_option();
|
||||
<?if($mode=='modify'){?>
|
||||
var edit_data = <?=json_encode($edit_data)?>;
|
||||
setting_edit_data(edit_data);
|
||||
<?}?>
|
||||
ad_option_check();
|
||||
});
|
||||
|
||||
//load 데이터 setting
|
||||
function setting_edit_data(edit_data){
|
||||
console.log(edit_data);
|
||||
if(edit_data){
|
||||
//페이지 이름
|
||||
let page_key=page_name.indexOf(edit_data.page_name);
|
||||
$("#page_list").val(page_key).prop("selected", true);
|
||||
//광고 위치
|
||||
$("#ad_pos option").remove();
|
||||
setting_ad_pos_option();
|
||||
$("#ad_pos").val(edit_data.ad_pos_name).prop("selected", true);
|
||||
//광고 옵션
|
||||
(edit_data.ad_option==0)?$("#ad_option_0").prop("checked", true):$("#ad_option_1").prop("checked", true);
|
||||
ad_option_check();
|
||||
//File
|
||||
$('#image_section').attr('src', edit_data.ad_file);
|
||||
//lending
|
||||
$("#ad_lending").val(edit_data.ad_lending);
|
||||
//HTML
|
||||
$("#ad_code").val(edit_data.ad_code);
|
||||
}else{
|
||||
//image
|
||||
$("#ad_file").val("");
|
||||
$('#image_section').attr('src', "");
|
||||
$('#image_section').css('display', "noen");
|
||||
//lending
|
||||
$("#ad_lending").val("");
|
||||
//HTML
|
||||
$("#ad_code").val("");
|
||||
$("input:radio")[0]['checked']=false;
|
||||
$("input:radio")[1]['checked']=false;
|
||||
ad_option_check();
|
||||
}
|
||||
}
|
||||
|
||||
//page name setting
|
||||
function setting_page_list(page_name){
|
||||
for (var i in page_name) {
|
||||
$("#page_list").append(new Option(page_name[i], i));
|
||||
}
|
||||
}
|
||||
|
||||
//ad_pos option setting
|
||||
function setting_ad_pos_option(){
|
||||
let num =$("#page_list").val();
|
||||
for (var i in ad_pos_name[num]) {
|
||||
$("#ad_pos").append(new Option(ad_pos_name[num][i], ad_pos_name[num][i]));
|
||||
}
|
||||
}
|
||||
|
||||
//페이지 이름 변경 이벤트
|
||||
$("#page_list").change(function(){
|
||||
$("#ad_pos option").remove();
|
||||
setting_ad_pos_option();
|
||||
call_data_ajax();
|
||||
})
|
||||
|
||||
// 광고 등록 옵션 변경 이벤트
|
||||
$('input[name="ad_option"]').change(function(){
|
||||
ad_option_check();
|
||||
})
|
||||
|
||||
// ad_option radio btn check event
|
||||
function ad_option_check(){
|
||||
if($('input[name="ad_option"]:checked').val()==null) {
|
||||
$(".option_file").css("display","none");
|
||||
$(".option_HTML").css("display","none");
|
||||
}else if($('input[name="ad_option"]:checked').val()==0){
|
||||
$(".option_file").css("display","");
|
||||
$(".option_HTML").css("display","none");
|
||||
}else if($('input[name="ad_option"]:checked').val()==1){
|
||||
$(".option_file").css("display","none");
|
||||
$(".option_HTML").css("display","");
|
||||
}
|
||||
}
|
||||
|
||||
//광고 위치등록 변경 이벤트
|
||||
$("#ad_pos").change(function(){
|
||||
call_data_ajax();
|
||||
});
|
||||
|
||||
|
||||
//ad_file 변경 이벤트
|
||||
function change_img(value){
|
||||
if (value.files && value.files[0]) {
|
||||
var reader = new FileReader();
|
||||
|
||||
reader.onload = function (e) {
|
||||
$('#image_section').attr('src', e.target.result);
|
||||
}
|
||||
|
||||
reader.readAsDataURL(value.files[0]);
|
||||
}
|
||||
}
|
||||
|
||||
function call_data_ajax(){
|
||||
var page_name=$("#page_list option:selected").text();
|
||||
var pos_name=$("#ad_pos").val();
|
||||
$.ajax({
|
||||
type : 'POST',
|
||||
url : "/admin/advertisement_ajax/ajax_call_ad_detail_ad_idx",
|
||||
// data : {"pagename" : page_name,
|
||||
// "pos_name" : pos_name},
|
||||
data : {"page_name" : page_name,
|
||||
"pos_name" : pos_name},
|
||||
dataType: 'json',
|
||||
success : function (response) {
|
||||
setting_edit_data(response);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
//validation
|
||||
function setting_ad_reg_proc(){
|
||||
if($('input[name="ad_option"]:checked').val()==null) {
|
||||
alert("광고옵션을 선택해주세요");
|
||||
return false;
|
||||
}else{
|
||||
if($('input[name="ad_option"]:checked').val()=='0') {
|
||||
// if($('#ad_file').val()==''){
|
||||
// alert("file을 선택해주세요");
|
||||
// return false;
|
||||
// }
|
||||
// if($('ad_lending').val()==''){
|
||||
// alert("페이지 주소를 입력해주세요");
|
||||
// }
|
||||
}else if($('input[name="ad_option"]:checked').val()=="1"){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$("#page_name").val(page_name[$("#page_list").val()]);
|
||||
$("#input_form").submit();
|
||||
}
|
||||
</script>
|
||||
|
||||
</div>
|
||||
306
application/views/admin/advertisement/ads.php
Executable file
306
application/views/admin/advertisement/ads.php
Executable file
@@ -0,0 +1,306 @@
|
||||
<?
|
||||
$menu_code = '15';
|
||||
require_once (APPPATH.'views/skin/admin/_content_comm.php');
|
||||
?>
|
||||
<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>
|
||||
|
||||
<div class="common_depth3 clearfix">
|
||||
<ul class="clearfix depth3_tep">
|
||||
<li><a href="/admin/advertisement/1" class="on fw700">광고 페이지 관리</a></li>
|
||||
<li><a href="/admin/advertisement/ad_detail">개별 광고 관리</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="write_btn">
|
||||
<a href="javascript:ad_page_arr_del_proc();">삭제</a>
|
||||
<a href="#" id="btn_open_popup">광고 페이지 등록</a>
|
||||
</div>
|
||||
|
||||
<form name="input_form" id="input_form" action="/admin/setting/setting_comment_reg_proc" method="post">
|
||||
<div class="common_table news">
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="fw500" style="width:50px;"><input type="checkbox" name="allcheck" id="allcheck"></th>
|
||||
<th class="fw500" width="100">번호</th>
|
||||
<th class="fw500">페이지 키</th>
|
||||
<th class="fw500">페이지 이름</th>
|
||||
<th class="fw500">광고 위치 키</th>
|
||||
<th class="fw500">광고 위치 이름</th>
|
||||
<th class="fw500">관리</th>
|
||||
</tr></thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$len = count($row);
|
||||
foreach($row as $v) {
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="checkbox" name="is_del[]" value="<?php echo $v['idx'];?>"></td>
|
||||
<td><?php echo $len;?></td>
|
||||
<td><?php echo $v['page_key'];?></td>
|
||||
<td><?php echo $v['page_name'];?></td>
|
||||
<td><?php echo $v['ad_pos_key'];?></td>
|
||||
<td><?php echo $v['ad_pos_name'];?></td>
|
||||
<td style="width:200px" class="tool_btn">
|
||||
<a href="#" class="btn_modify" value="<?php echo $v['idx'];?>"><i class="fa fa-pencil"></i>수정</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php $len-=1;}?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!--div class="write_btn tc">
|
||||
<a href="javascript:setting_comment_reg_proc()">저장하기</a>
|
||||
</div-->
|
||||
|
||||
</form>
|
||||
|
||||
<!-- 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="page_key">페이지 키 영(대/소)문자만 사용</label>
|
||||
<input type="text" id="page_key" name="page_key" value="" class="text ui-widget-content ui-corner-all" maxlength="20">
|
||||
<label for="page_name">페이지 이름</label>
|
||||
<input type="text" id="page_name" name="page_name" value="" class="text ui-widget-content ui-corner-all" maxlength="100">
|
||||
<label for="ad_pos_key">광고 위치 키 영(대/소)문자만 사용</label>
|
||||
<input type="text" id="ad_pos_key" name="ad_pos_key" value="" class="text ui-widget-content ui-corner-all" maxlength="20">
|
||||
<label for="ad_pos_name">광고 위치 이름</label>
|
||||
<input type="text" id="ad_pos_name" name="ad_pos_name" value="" class="text ui-widget-content ui-corner-all" maxlength="100">
|
||||
|
||||
<!-- Allow form submission with keyboard without duplicating the dialog button -->
|
||||
<input type="button" value=" 등록 " id="btn_register" tabindex="-1" >
|
||||
</fieldset>
|
||||
</form>
|
||||
</div>
|
||||
<!-- //register popup -->
|
||||
|
||||
<iframe frameborder="0" width="0" height="0" name="ifrm"></iframe>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
function reset_popup_form() {
|
||||
$("#page_key").val('');
|
||||
$("#page_name").val('');
|
||||
$("#ad_pos_key").val('');
|
||||
$("#ad_pos_name").val('');
|
||||
$( "#dialog" ).dialog();
|
||||
}
|
||||
|
||||
function fill_popup_form(a,b,c,d) {
|
||||
if(a!='' && b!='' && c!='' && d!='') {
|
||||
reset_popup_form();
|
||||
$("#page_key").val(a);
|
||||
$("#page_name").val(b);
|
||||
$("#ad_pos_key").val(c);
|
||||
$("#ad_pos_name").val(d);
|
||||
$( "#dialog" ).dialog();
|
||||
}
|
||||
}
|
||||
|
||||
$(".btn_modify").click(function() {
|
||||
idx = $(this).attr('value');
|
||||
if(idx>0) {
|
||||
$.ajax({
|
||||
url: '/admin/advertisement/ad_page_edit',
|
||||
data: {
|
||||
format: 'json',
|
||||
idx:idx
|
||||
},
|
||||
//dataType: 'jsonp',
|
||||
type:'get',
|
||||
success: function(msg) {
|
||||
var json = $.parseJSON(msg);
|
||||
if(json.result=='success') {
|
||||
$("#popup_mode").val('upt');
|
||||
$("#popup_idx").val(idx);
|
||||
fill_popup_form(json.page_key,json.page_name,json.ad_pos_key,json.ad_pos_name);
|
||||
}
|
||||
},
|
||||
error: function(err) {
|
||||
console.log(err);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$("#btn_open_popup").click(function() {
|
||||
reset_popup_form();
|
||||
});
|
||||
|
||||
$("#btn_register").click(function() {
|
||||
frm = $("form[name='popup']");
|
||||
|
||||
if($("#page_key").val()=='') {
|
||||
alert('페이지 키를 등록해 주십시오.');
|
||||
$("#page_key").focus();
|
||||
return false;
|
||||
}
|
||||
if($("#page_key").val().search(/[^a-zA-Z]+/)==0) {
|
||||
alert('페이지 키는 영(대/소)문자만 사용가능합니다.');
|
||||
$("#page_key").select();
|
||||
return false;
|
||||
}
|
||||
if($("#page_name").val()=='') {
|
||||
alert('페이지 이름을 등록해 주십시오.');
|
||||
$("#page_name").focus();
|
||||
return false;
|
||||
}
|
||||
if($("#ad_pos_key").val()=='') {
|
||||
alert('광고위치 키를 등록해 주십시오.');
|
||||
$("#ad_pos_key").focus();
|
||||
return false;
|
||||
}
|
||||
if($("#ad_pos_key").val().search(/[^a-zA-Z]+/)==0) {
|
||||
alert('광고위치 키는 영(대/소)문자만 사용가능합니다.');
|
||||
$("#ad_pos_key").select();
|
||||
return false;
|
||||
}
|
||||
if($("#ad_pos_name").val()=='') {
|
||||
alert('광고위치 이름을 등록해 주십시오.');
|
||||
$("#ad_pos_name").focus();
|
||||
return false;
|
||||
}
|
||||
|
||||
frm.attr('target','ifrm');
|
||||
frm.attr('action','/admin/advertisement/ad_page_proc');
|
||||
frm.submit();
|
||||
});
|
||||
});
|
||||
|
||||
function close_popup() {
|
||||
$("")
|
||||
}
|
||||
|
||||
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 ad_page_arr_del_proc() {
|
||||
if($("input:checkbox[name='is_del[]']").is(":checked") == false) {
|
||||
alert("삭제할 내용이 없습니다.");
|
||||
return false;
|
||||
}
|
||||
if(confirm("글이 삭제됩니다. 삭제하시겠습니까?") == true) { //확인
|
||||
$("#input_form").attr("action", "/admin/advertisement/ad_page_arr_del_proc");
|
||||
$("#input_form").attr('target','ifrm');
|
||||
$("#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>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
// 컨텐츠 선택
|
||||
function select_setting_type(){
|
||||
$("#input_form").attr("action", "/admin/advertisement/ads/1");
|
||||
$("#input_form").submit();
|
||||
}
|
||||
|
||||
// 저장하기
|
||||
function setting_comment_reg_proc(){
|
||||
$("#input_form").submit();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user