Files
cm-web-legacy/application/views/adm/news.php
2020-06-10 06:19:03 +09:00

156 lines
10 KiB
PHP
Executable File

<!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 action="" method="get" name="flist" id="flist">
<input type="hidden" name="list">
<input type="hidden" name="acttype">
<div class="col-md-12" style="margin-bottom:10px;">
<select name="category" class="form-control" data-width="200">
<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" data-width="200">
<option value="">에디터</option>
<?php foreach($graceEditors as $editor) { echo '<option value="'.$editor->editorId.'" '.(param('editor') == $editor->editorId ? 'selected':'').'>'. $editor->editorName. '</option>';}?>
</select>
<div class="input-group" style="display:inline-block;width:350px;vertical-align: middle;">
<input type="text" class="form-control" name="term" value="<?php echo param('term')?>" placeholder="검색어를 입력하세요" style="display:inline-block;width:300px;" />
<span class="input-group-btn">
<button class="btn btn-default btn-sm" type="submit">검색!</button>
</span>
</div>
<div class="btn-group pull-right" role="group" aria-label="...">
<button type="button" class="btn btn-outline btn-default btn-sm btn-list-reserve btn-list-selected disabled"
data-list-reserve-url="/adm/content/reserve?">선택예약</button>
<button type="button" class="btn btn-outline btn-default btn-sm btn-list-delete btn-list-selected disabled" data-list-delete-url="/adm/news/delete?">선택삭제</button>
<a href="<?php echo explode('?', get_instance()->input->server('REQUEST_URI'))[0]?>" class="btn btn-outline btn-default btn-sm">전체목록</a>
</div>
</div>
<div class="box-table-header cm-bottom-control">
<div class="col-md-6 cm-top-pagination"><?php echo $paging ?></div>
</div>
</form>
<div class="row">전체 : <?php echo $table['total']?>건</div>
<div class="table-responsive">
<table class="table table-hover table-striped table-bordered">
<thead>
<tr>
<th>번호</th>
<th>카테고리</th>
<th>제목</th>
<th>이미지</th>
<th>제휴처</th>
<th>기자</th>
<th>공개여부</th>
<th>등록일</th>
<th><input type="checkbox" name="chkall" id="chkall" /></th>
</tr>
</thead>
<tbody><?php foreach ($table['rows'] as $r) {?>
<tr>
<td><?php echo $r->idx?></td>
<td><?php echo $r->category_code?></td>
<td><?php echo $r->title. '<br />'. $r->sub_title?></td>
<td><?php echo ($r->main_img ? '<img src="'.imgSrc($r->main_img). '" width="90"><br />':''). ($r->video_url ? '<iframe src="'.$r->video_url.'" frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen></iframe>':'')?></td>
<td><?php echo $r->press_name?></td>
<td><?php echo $r->reporter_name?></td>
<td><select <?php if(strtotime($r->display_date) > time()) echo 'disabled';?> class="cm-display-select" data-width="80">
<?php if($r->is_del == 'Y') {?>
<option value="D" selected>삭제</option>
<option value="N">비공개</option>
<option value="Y">공개</option>
<?php } else {?>
<option value="N" <?php if($r->is_display == 'N') echo ' selected';?>>비공개</option>
<option value="Y" <?php if($r->is_display == 'Y') echo ' selected';?>>공개</option>
<?php }?>
</select></td>
<td><?php echo $r->reg_date?></td>
<td><input type="checkbox" name="chk[]" class="list-chkbox" value="<?php echo $r->idx?>" /></td>
</tr> <?php }?>
</tbody>
</table>
</div>
<div class="box-info row cm-bottom-control">
<div class="col-md-6"><?php echo $paging ?></div>
<div class="col-md-4">
<div class="pull-right">
<form action="" method="get">
<select name="category" class="form-control" style="width:100px">
<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" style="width:100px">
<option value="">에디터</option>
<?php foreach($graceEditors as $editor) { echo '<option value="'.$editor->editorId.'" '.(param('editor') == $editor->editorId ? 'selected':'').'>'. $editor->editorName. '</option>';}?>
</select>
<div class="input-group">
<input type="text" class="form-control" name="term" value="<?php echo param('term')?>" placeholder="검색어를 입력하세요" />
<span class="input-group-btn">
<button class="btn btn-default btn-sm" type="submit">검색!</button>
</span>
</div>
</form>
</div>
</div>
<div class="btn-group pull-right" role="group" aria-label="...">
<a href="<?php echo explode('?', get_instance()->input->server('REQUEST_URI'))[0]?>" class="btn btn-outline btn-default btn-sm">전체목록</a>
<button type="button" class="btn btn-outline btn-default btn-sm btn-list-delete btn-list-selected disabled" data-list-delete-url="/adm/news/delete?">선택삭제</button>
</div>
</div>
</div>
</div>
<!-- 여기부터 레이아웃 하단입니다 -->
</div>
</div>
<!-- end content_wrapper -->
</div>
<!-- end wrapper -->
<?php $this->load->view('adm/layout/footer')?>
<script>
$(function() {
$('.cm-display-select').on('change', function() {
if (confirm('공개여부를 ' + this.options[this.selectedIndex].text + '로 변경할까요?')) {
var postid = $(this).parent().parent().find('td:first').text();
var selectVal = this.value;
var is_display = selectVal == 'R' ? 'N' : selectVal;
$.post('/adm/news/display', {
'is_display': is_display,
'postid': postid
}, function(res) {
selectVal == 'R' ? location.href = '/adm/content/reserve?list=' + postid : location.reload();
})
} else {
location.reload();
}
})
})
</script>
</body>
</html>