first commit
This commit is contained in:
154
application/views/adm/pageset/main/dailyqt.php
Executable file
154
application/views/adm/pageset/main/dailyqt.php
Executable file
@@ -0,0 +1,154 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<?php $this->load->view('adm/layout/head')?>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<!-- start wrapper -->
|
||||
<div class="wrapper">
|
||||
<!-- start nav -->
|
||||
<?php $this->load->view('adm/layout/nav')?>
|
||||
<!-- end nav -->
|
||||
<!-- start content_wrapper -->
|
||||
<div class="content_wrapper">
|
||||
<!-- start header -->
|
||||
<?php $this->load->view('adm/layout/header')?>
|
||||
<!-- end header -->
|
||||
<div class="contents">
|
||||
<h3 style="font-size:17px;font-weight:bold;color:#aaa">페이지설정 > 데일리큐티</h3>
|
||||
<!-- 여기까지 레이아웃 상단입니다 -->
|
||||
<div class="box">
|
||||
<div class="box-table">
|
||||
<form method="post" action="" enctype="multipart/form-data" class="cm-pageset-form">
|
||||
<input type="hidden" name="redirect" value="<?php echo $this->input->server('REQUEST_URI')?>">
|
||||
<?php foreach($posts as $post) {?>
|
||||
<table class="table table-bordered cm-hometopnews-setbox">
|
||||
<thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>검색</th>
|
||||
<td>
|
||||
<select name="category" class="form-control category" style="width:200px">
|
||||
<option value="">카테고리</option>
|
||||
<?php foreach($lifeCategories as $category) { echo '<option value="'.$category->idx.'" '.(param('category') == $category->idx ? 'selected':'').'>'. $category->category_name. '</option>';}?>
|
||||
</select>
|
||||
<select name="editor" class="form-control editor" style="width:200px">
|
||||
<option value="">에디터</option>
|
||||
<?php foreach($graceEditors as $editor) { echo '<option value="'.$editor->editorId.'" '.(param('editor') == $editor->editorId ? 'selected':'').'>'. $editor->editorName. '</option>';}?>
|
||||
</select>
|
||||
<select name="limit" class="form-control limit" style="width:100px">
|
||||
<option value="">검색결과수</option>
|
||||
<option value="5" selected>5</option>
|
||||
<option value="10">10</option>
|
||||
<option value="30">30</option>
|
||||
<option value="50">50</option>
|
||||
</select>
|
||||
<input type="text" name="keyword" class="form-control term" style="width:200px">
|
||||
<a class="btn btn-info btn-sm cm-pageset-searchbtn">검색</a>
|
||||
<a class="btn btn-warning btn-sm cm-pageset-addsetbox">추가</a>
|
||||
<a class="btn btn-danger btn-sm cm-pageset-rmsetbox">삭제</a>
|
||||
<div class="cm-search-result" style="margin-top:3px">
|
||||
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>아이디</th>
|
||||
<td>
|
||||
<input type="text" name="postid[]" class="form-control postid" value="<?php if(isset($post)) echo $post->idx?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>제목</th>
|
||||
<td>
|
||||
<input type="text" name="title[]" class="form-control title" value="<?php if(isset($post)) echo $post->title?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>메인이미지</th>
|
||||
<td>
|
||||
<img src="<?php if(isset($post)) echo imgSrc($post->main_img)?>" width="150" name="main_img" class="main_img">
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>날짜</th>
|
||||
<td>
|
||||
<input type="text" name="dptime[]" class="form-control datetimepicker" value="<?php if(isset($post->DpTime)) echo $post->DpTime; else echo date('Y-m-d H:i:s');?>">
|
||||
</td>
|
||||
</tr>
|
||||
<tr class="cm-sample" style="display:none">
|
||||
<th>날짜</th>
|
||||
<td>
|
||||
<input type="text" class="form-control">
|
||||
</td>
|
||||
</tr>
|
||||
</tbody><?php }?>
|
||||
</table>
|
||||
<div style="text-align:center">
|
||||
<a class="btn btn-danger" href="<?php echo $this->input->server('HTTP_REFERER')?>">취소</a>
|
||||
<button type="submit" class="btn btn-success">저장</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 여기부터 레이아웃 하단입니다 -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- end content_wrapper -->
|
||||
</div>
|
||||
<!-- end wrapper -->
|
||||
<?php $this->load->view('adm/layout/footer')?>
|
||||
<script src="/assets/adm/js/tinymce/tinymce.min.js"></script>
|
||||
<script>
|
||||
var result;
|
||||
$(function(){
|
||||
$('.datetimepicker').datetimepicker({ format: 'YYYY-MM-DD HH:mm:ss' });
|
||||
|
||||
$('.cm-pageset-addsetbox').on('click', function(){
|
||||
var dd = $('.cm-hometopnews-setbox');
|
||||
var b = dd.eq(0).clone(true);
|
||||
b.find('.datetimepicker').parent().parent().remove();
|
||||
dd.last().after(b);
|
||||
var s = b.find('.cm-sample').clone();
|
||||
b.find('tbody').append(s);
|
||||
s.find('input').attr('name', 'dptime[]')
|
||||
s.find('input').datetimepicker({ format: 'YYYY-MM-DD HH:mm:ss' });
|
||||
s.show();
|
||||
|
||||
})
|
||||
|
||||
$('.cm-pageset-rmsetbox').on('click', function(){
|
||||
$(this).parent().parent().parent().parent().remove();
|
||||
})
|
||||
|
||||
$('.cm-pageset-searchbtn').on('click', function(e){
|
||||
var searchBtn = $(this);
|
||||
var frm = searchBtn.parent()
|
||||
var params = {category: frm.find('.category').val(),editor: frm.find('.editor').val(),
|
||||
term:frm.find('.keyword').val(), pageset: 1, limit: frm.find('.limit').val()}
|
||||
$.get('/adm/content', params, function(res){
|
||||
result = res.data.rows
|
||||
var resultBox = searchBtn.parent().find('.cm-search-result').empty();
|
||||
for(var i=0; i<result.length; i++) {
|
||||
resultBox.append('<a class="btn btn-sm form-control cm-result-item" style="margin-bottom:3px" tabindex="'+i+'">'+result[i].title+'</a>')
|
||||
}
|
||||
$('.cm-result-item').on('click', function(){
|
||||
var item = result[$(this).attr('tabindex')]
|
||||
var frm = searchBtn.parent().parent().parent().next();
|
||||
console.log(frm)
|
||||
frm.find('.postid').val(item.idx)
|
||||
frm.find('.title').val(item.title)
|
||||
frm.find('.main_img').attr('src', item.mainImg)
|
||||
$('.cm-result-item').remove();
|
||||
})
|
||||
}, 'json')
|
||||
})
|
||||
})
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user