-
Notifications
You must be signed in to change notification settings - Fork 249
/
Copy pathfaqlist.php
97 lines (76 loc) · 3.34 KB
/
faqlist.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
<?php
$sub_menu = '300700';
require_once './_common.php';
auth_check_menu($auth, $sub_menu, "r");
$g5['title'] = 'FAQ 상세관리';
if (isset($_REQUEST['fm_subject'])) {
$fm_subject = clean_xss_tags($_REQUEST['fm_subject'], 1, 1, 255);
$g5['title'] .= ' : ' . $fm_subject;
}
$fm_id = isset($fm_id) ? (int) $fm_id : 0;
require_once G5_ADMIN_PATH . '/admin.head.php';
$sql = " select * from {$g5['faq_master_table']} where fm_id = '$fm_id' ";
$fm = sql_fetch($sql);
$sql_common = " from {$g5['faq_table']} where fm_id = '$fm_id' ";
// 테이블의 전체 레코드수만 얻음
$sql = " select count(*) as cnt " . $sql_common;
$row = sql_fetch($sql);
$total_count = $row['cnt'];
$sql = "select * $sql_common order by fa_order , fa_id ";
$result = sql_query($sql);
?>
<div class="local_ov01 local_ov">
<span class="btn_ov01"><span class="ov_txt"> 등록된 FAQ 상세내용</span><span class="ov_num"> <?php echo $total_count; ?>건</span></span>
</div>
<div class="local_desc01 local_desc">
<ol>
<li>FAQ는 무제한으로 등록할 수 있습니다</li>
<li><strong>FAQ 상세내용 추가</strong>를 눌러 자주하는 질문과 답변을 입력합니다.</li>
</ol>
</div>
<div class="btn_fixed_top">
<a href="./faqmasterlist.php" class="btn btn_02">FAQ 관리</a>
<a href="./faqform.php?fm_id=<?php echo $fm['fm_id']; ?>" class="btn btn_01">FAQ 상세내용 추가</a>
</div>
<div class="tbl_head01 tbl_wrap">
<table>
<caption><?php echo $g5['title']; ?> 목록</caption>
<thead>
<tr>
<th scope="col">번호</th>
<th scope="col">제목</th>
<th scope="col">순서</th>
<th scope="col">관리</th>
</tr>
</thead>
<tbody>
<?php
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$row1 = sql_fetch(" select COUNT(*) as cnt from {$g5['faq_table']} where fm_id = '{$row['fm_id']}' ");
$cnt = $row1['cnt'];
$s_mod = icon("수정", "");
$s_del = icon("삭제", "");
$num = $i + 1;
$bg = 'bg' . ($i % 2);
$fa_subject = conv_content($row['fa_subject'], 1);
?>
<tr class="<?php echo $bg; ?>">
<td class="td_num"><?php echo $num; ?></td>
<td class="td_left"><?php echo $fa_subject; ?></td>
<td class="td_num"><?php echo $row['fa_order']; ?></td>
<td class="td_mng td_mng_m">
<a href="./faqform.php?w=u&fm_id=<?php echo $row['fm_id']; ?>&fa_id=<?php echo $row['fa_id']; ?>" class="btn btn_03"><span class="sound_only"><?php echo $fa_subject; ?> </span>수정</a>
<a href="./faqformupdate.php?w=d&fm_id=<?php echo $row['fm_id']; ?>&fa_id=<?php echo $row['fa_id']; ?>" onclick="return delete_confirm(this);" class="btn btn_02"><span class="sound_only"><?php echo $fa_subject; ?> </span>삭제</a>
</td>
</tr>
<?php
}
if ($i == 0) {
echo '<tr><td colspan="4" class="empty_table">자료가 없습니다.</td></tr>';
}
?>
</tbody>
</table>
</div>
<?php
require_once G5_ADMIN_PATH . '/admin.tail.php';