/admin/admin/notice_list.php
PHP | 242 lines | 191 code | 45 blank | 6 comment | 42 complexity | a19a6be3a23033f929b36a44b86bff5b MD5 | raw file
- <?php
- include_once("./_common.php");
- //$g5['title'] = '';
- $sub_menu = '300101';
- include_once("./admin.head.php");
- ?>
- <div id="container">
- <h1 id="container_title">공지사항</h1>
- <div id="container_wr">
- <?php
- $sql_common = " from app5iu_notice ";
- $sql_search = " where (1) ";
- if ($stx) {
- $sql_search .= " and ( ";
- switch ($sfl) {
- default:
- $sql_search .= " ({$sfl} like '{$stx}%') ";
- break;
- }
- $sql_search .= " ) ";
- }
- if (!$sst) {
- $sst = "n_id";
- $sod = "desc";
- }
- $sql_order = " order by {$sst} {$sod} ";
- $sql = " select count(*) as cnt {$sql_common} {$sql_search} {$sql_order} ";
- $row = sql_fetch($sql);
- $total_count = $row['cnt'];
- $rows = $config['cf_page_rows'];
- $total_page = ceil($total_count / $rows); // 전체 페이지 계산
- if ($page < 1) $page = 1; // 페이지가 없으면 첫 페이지 (1 페이지)
- $from_record = ($page - 1) * $rows; // 시작 열을 구함
- $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall">전체목록</a>';
- $sql = " select * {$sql_common} {$sql_search} {$sql_order} limit {$from_record}, {$rows} ";
- $result = sql_query($sql);
- // echo $sql;
- $colspan = 16;
- //전체
- $sql = " select count(*) as cnt from app5iu_notice ";
- $to_cnt = sql_fetch($sql);
- ?>
- <style>
- .td_mbid,
- .td_name,
- .td_mbname {
- text-align: center !important;
- }
- </style>
- <div class="local_ov01 local_ov">
- <?php echo $listall ?>
- <a href="./notice_list.php">
- <span class="btn_ov01"><span class="ov_txt">전체 </span><span class="ov_num"> <?php echo number_format($to_cnt['cnt']) ?>건 </span></span>
- </a>
- </div>
- <form id="fsearch" name="fsearch" class="local_sch01 local_sch" method="get">
- <label for="sfl" class="sound_only">검색대상</label>
- <select name="sfl" id="sfl">
- <!-- <option value="mb_id"<?php echo get_selected($sfl, "mb_id"); ?>>회원아이디</option> -->
- <option value="n_subject" <?php echo get_selected($sfl, "n_subject"); ?>>제목</option>
- <!-- <option value="mb_name"<?php echo get_selected($sfl, "mb_name"); ?>>이름</option> -->
- </select>
- <label for="stx" class="sound_only">검색어<strong class="sound_only"> 필수</strong></label>
- <input type="text" name="stx" value="<?php echo $stx ?>" id="stx" required class="required frm_input">
- <input type="submit" class="btn_submit" value="검색">
- <!-- <a href="./notice_list.php" class="reset_url">초기화</a> -->
- </form>
- <form name="fmemberlist" id="fmemberlist" action="./notice_list_update.php" onsubmit="return fmemberlist_submit(this);" method="post" enctype="multipart/form-data">
- <input type="hidden" name="sst" value="<?php echo $sst ?>">
- <input type="hidden" name="sod" value="<?php echo $sod ?>">
- <input type="hidden" name="sfl" value="<?php echo $sfl ?>">
- <input type="hidden" name="stx" value="<?php echo $stx ?>">
- <input type="hidden" name="page" value="<?php echo $page ?>">
- <input type="hidden" name="token" value="">
- <div class="tbl_head01 tbl_wrap">
- <h2>
- <!--반려된 신청은 다시 승인되지 않습니다.-->
- </h2>
- <table>
- <caption><?php echo $g5['title']; ?> 목록</caption>
- <thead>
- <tr>
- <th scope="col" id="mb_list_chk" rowspan="2">
- <label for="chkall" class="sound_only">회원 전체</label>
- <input type="checkbox" name="chkall" value"1" id="chkall" onclick="check_all(this.form)">
- </th>
- <th scope="col" id="" style="width:300px">제목</th>
- <!-- <th scope="col" id="" style="width:300px">내용</th> -->
- <th scope="col" id="" style="width:200px">파일</th>
- <th scope="col" id="">작성일</th>
- <th scope="col" id="">조회수</th>
- <th scope="col" id="" style="width:100px">수정</th>
- </tr>
- </thead>
- <tbody>
- <?php
- for ($i = 0; $row = sql_fetch_array($result); $i++) {
- $bg = 'bg' . ($i % 2);
- ?>
- <tr class="<?php echo $bg; ?>">
- <td headers="mb_list_chk" class="td_chk">
- <input type="hidden" name="me_id[<?php echo $i ?>]" value="<?php echo $row['n_id'] ?>" id="me_id_<?php echo $i ?>">
- <label for="chk_<?php echo $i; ?>" class="sound_only"><?php echo get_text($row['mb_name']); ?> </label>
- <input type="checkbox" name="chk[]" value="<?php echo $i ?>" id="chk_<?php echo $i ?>" <?php echo $ch_checkbox ?>>
- </td>
- <td headers="mb_list_id" class="td_name sv_use">
- <?php echo $row['n_subject'] ?>
- </td>
- <!-- <td headers="mb_list_id" class="td_name sv_use">
- <?php echo $row['n_content'] ?>
- </td> -->
- <td headers="mb_list_id" class="td_name sv_use" style="text-align:center;">
- <!-- <?php echo $row['n_file'] ? $row['n_file'] : '-' ?> -->
- <?php
- //$up_file = $row['n_file'];
- // echo $up_file;
- $n_id = $row['n_id'];
- $sql_get_files = "select * from app5iu_notice_file where mf_id = {$n_id};";
- $result2 = sql_query($sql_get_files);
- for ($j = 0; $row2 = sql_fetch_array($result2); $j++) {
- $origin_name = $row2['origin_name'];
- $file_name = $row2['file_name'];
- $file_type = substr($origin_name, -3);
- $icon_type = "";
- if ($file_type == 'jpg' || $file_type == 'png' || $file_type == 'gif' || $file_type == 'peg') {
- $icon_type = "img";
- } else if ($file_type == 'xls' || $file_type == 'lsx') {
- $icon_type = "xsl";
- } else if ($file_type == 'pdf') {
- $icon_type = "pdf";
- } else if ($file_type == 'doc') {
- $icon_type = "doc";
- } else if ($file_type == 'hwp') {
- $icon_type = "hwp";
- } else if ($file_type == 'ppt' || $file_type == 'ptx') {
- $icon_type = "ppt";
- } else {
- $icon_type = "etc";
- }
- // echo "<a href='iium/file_download.php?path=iu_notice&original={$origin_name}&name={$file_name}'><img src='./img/{$icon_type}.png' width='28px' height='32px' alt='{$origin_name}' /></a>";
- echo "<a href='/iium/file_download.php?path=iu_notice&original={$origin_name}&name={$file_name}'><img src='./img/{$icon_type}.png' width='28px' height='32px' alt='{$origin_name}' /></a>";
- }
- ?>
- </td>
- <td headers="mb_list_join" class="td_date"><?php echo substr($row['n_wdate'], 0, 10); ?></td>
- <td headers="mb_list_id" class="td_name sv_use">
- <?php echo $row['n_count'] ?>
- </td>
- <td>
- <a href="./notice_write.php?me_id=<?php echo $row['n_id'] ?>&sfl=<?php echo $sfl ?>&stx=<?php echo $stx ?>&page=<?php echo $page ?>">
- <button type="button" class="btn btn_02"> 수정 </button>
- </a>
- </td>
- </tr>
- <?php
- }
- if ($i == 0)
- echo "<tr><td colspan=\"" . $colspan . "\" class=\"empty_table\">자료가 없습니다.</td></tr>";
- ?>
- </tbody>
- </table>
- </div>
- <div class="btn_fixed_top">
- <input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value" class="btn btn_03">
- <a href="notice_write.php?me_id=&sfl=<?php echo $sfl ?>&stx=<?php echo $stx ?>&page=<?php echo $page ?>">
- <input type="button" name="act_button" value="등록" onclick="document.pressed=this.value" class="btn btn_01">
- </a>
- <!--
- <input type="submit" name="act_button" value="선택취소" onclick="document.pressed=this.value" class="btn btn_02">
- <input type="submit" name="act_button" value="선택삭제" onclick="document.pressed=this.value" class="btn btn_01">
- -->
- </div>
- </form>
- <?php echo get_paging(G5_IS_MOBILE ? $config['cf_mobile_pages'] : $config['cf_write_pages'], $page, $total_page, '?' . $qstr . '&page='); ?>
- <script>
- function fmemberlist_submit(f) {
- if (!is_checked("chk[]")) {
- alert(document.pressed + " 하실 항목을 하나 이상 선택하세요.");
- return false;
- }
- if (document.pressed == "선택삭제") {
- if (!confirm("선택한 신청을 정말 삭제 하시겠습니까?")) {
- return false;
- }
- }
- return true;
- }
- $('.btn_submit').click(function() {
- if ($('#stx').val() == '') {
- location.href = './notice_list.php';
- }
- })
- </script>
- </div>
- </div>
- <?php
- include_once("./admin.tail.php");