투표에 사용, 미사용 기능 추가 (크레이티브님,210910) merge
This commit is contained in:
@ -447,6 +447,7 @@ tfoot th {}
|
|||||||
.td_delino {width:130px}
|
.td_delino {width:130px}
|
||||||
.td_device {width:70px;text-align:center}
|
.td_device {width:70px;text-align:center}
|
||||||
.td_etc {width:80px;text-align:center}
|
.td_etc {width:80px;text-align:center}
|
||||||
|
.td_use {width:80px;text-align:center}
|
||||||
.td_extra label {display:inline-block;width:100px}
|
.td_extra label {display:inline-block;width:100px}
|
||||||
.td_extra input {margin-right:5px;width:130px}
|
.td_extra input {margin-right:5px;width:130px}
|
||||||
.td_grid {width:60px;text-align:center}
|
.td_grid {width:60px;text-align:center}
|
||||||
|
|||||||
@ -23,6 +23,10 @@ if ($w == '') {
|
|||||||
alert('w 값이 제대로 넘어오지 않았습니다.');
|
alert('w 값이 제대로 넘어오지 않았습니다.');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!isset($po['po_use'])) {
|
||||||
|
sql_query(" alter table `{$g5['poll_table']}` add `po_use` tinyint not null default '0' after `mb_ids` ", false);
|
||||||
|
}
|
||||||
|
|
||||||
$g5['title'] = $html_title;
|
$g5['title'] = $html_title;
|
||||||
require_once './admin.head.php';
|
require_once './admin.head.php';
|
||||||
?>
|
?>
|
||||||
@ -94,6 +98,10 @@ require_once './admin.head.php';
|
|||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
<?php if ($w == 'u') { ?>
|
<?php if ($w == 'u') { ?>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">투표사용</th>
|
||||||
|
<td><input type="checkbox" name="po_use" id="po_use" value="1" <?php if ($po['po_use']) { echo 'checked="checked"'; } ?>> <label for="po_use">사용</label></td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">투표등록일</th>
|
<th scope="row">투표등록일</th>
|
||||||
<td><?php echo $po['po_date']; ?></td>
|
<td><?php echo $po['po_date']; ?></td>
|
||||||
|
|||||||
@ -51,8 +51,8 @@ $po_id = isset($_POST['po_id']) ? $_POST['po_id'] : '';
|
|||||||
|
|
||||||
if ($w == '') {
|
if ($w == '') {
|
||||||
$sql = " insert {$g5['poll_table']}
|
$sql = " insert {$g5['poll_table']}
|
||||||
( po_subject, po_poll1, po_poll2, po_poll3, po_poll4, po_poll5, po_poll6, po_poll7, po_poll8, po_poll9, po_cnt1, po_cnt2, po_cnt3, po_cnt4, po_cnt5, po_cnt6, po_cnt7, po_cnt8, po_cnt9, po_etc, po_level, po_point, po_date )
|
( po_subject, po_poll1, po_poll2, po_poll3, po_poll4, po_poll5, po_poll6, po_poll7, po_poll8, po_poll9, po_cnt1, po_cnt2, po_cnt3, po_cnt4, po_cnt5, po_cnt6, po_cnt7, po_cnt8, po_cnt9, po_etc, po_level, po_point, po_date, po_use )
|
||||||
values ( '{$_POST['po_subject']}', '{$_POST['po_poll1']}', '{$_POST['po_poll2']}', '{$_POST['po_poll3']}', '{$_POST['po_poll4']}', '{$_POST['po_poll5']}', '{$_POST['po_poll6']}', '{$_POST['po_poll7']}', '{$_POST['po_poll8']}', '{$_POST['po_poll9']}', '{$_POST['po_cnt1']}', '{$_POST['po_cnt2']}', '{$_POST['po_cnt3']}', '{$_POST['po_cnt4']}', '{$_POST['po_cnt5']}', '{$_POST['po_cnt6']}', '{$_POST['po_cnt7']}', '{$_POST['po_cnt8']}', '{$_POST['po_cnt9']}', '{$_POST['po_etc']}', '{$_POST['po_level']}', '{$_POST['po_point']}', '" . G5_TIME_YMD . "' ) ";
|
values ( '{$_POST['po_subject']}', '{$_POST['po_poll1']}', '{$_POST['po_poll2']}', '{$_POST['po_poll3']}', '{$_POST['po_poll4']}', '{$_POST['po_poll5']}', '{$_POST['po_poll6']}', '{$_POST['po_poll7']}', '{$_POST['po_poll8']}', '{$_POST['po_poll9']}', '{$_POST['po_cnt1']}', '{$_POST['po_cnt2']}', '{$_POST['po_cnt3']}', '{$_POST['po_cnt4']}', '{$_POST['po_cnt5']}', '{$_POST['po_cnt6']}', '{$_POST['po_cnt7']}', '{$_POST['po_cnt8']}', '{$_POST['po_cnt9']}', '{$_POST['po_etc']}', '{$_POST['po_level']}', '{$_POST['po_point']}', '" . G5_TIME_YMD . "', 1 ) ";
|
||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
|
|
||||||
$po_id = sql_insert_id();
|
$po_id = sql_insert_id();
|
||||||
@ -79,7 +79,8 @@ if ($w == '') {
|
|||||||
po_cnt9 = '{$_POST['po_cnt9']}',
|
po_cnt9 = '{$_POST['po_cnt9']}',
|
||||||
po_etc = '{$_POST['po_etc']}',
|
po_etc = '{$_POST['po_etc']}',
|
||||||
po_level = '{$_POST['po_level']}',
|
po_level = '{$_POST['po_level']}',
|
||||||
po_point = '{$_POST['po_point']}'
|
po_point = '{$_POST['po_point']}',
|
||||||
|
po_use = '{$_POST['po_use']}'
|
||||||
where po_id = '{$_POST['po_id']}' ";
|
where po_id = '{$_POST['po_id']}' ";
|
||||||
sql_query($sql);
|
sql_query($sql);
|
||||||
} elseif ($w == 'd') {
|
} elseif ($w == 'd') {
|
||||||
|
|||||||
@ -49,7 +49,7 @@ $listall = '<a href="' . $_SERVER['SCRIPT_NAME'] . '" class="ov_listall">전체
|
|||||||
$g5['title'] = '투표관리';
|
$g5['title'] = '투표관리';
|
||||||
require_once './admin.head.php';
|
require_once './admin.head.php';
|
||||||
|
|
||||||
$colspan = 7;
|
$colspan = 8;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="local_ov01 local_ov">
|
<div class="local_ov01 local_ov">
|
||||||
@ -92,6 +92,7 @@ $colspan = 7;
|
|||||||
<th scope="col">투표권한</th>
|
<th scope="col">투표권한</th>
|
||||||
<th scope="col">투표수</th>
|
<th scope="col">투표수</th>
|
||||||
<th scope="col">기타의견</th>
|
<th scope="col">기타의견</th>
|
||||||
|
<th scope="col">사용</th>
|
||||||
<th scope="col">관리</th>
|
<th scope="col">관리</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@ -101,6 +102,7 @@ $colspan = 7;
|
|||||||
$sql2 = " select sum(po_cnt1+po_cnt2+po_cnt3+po_cnt4+po_cnt5+po_cnt6+po_cnt7+po_cnt8+po_cnt9) as sum_po_cnt from {$g5['poll_table']} where po_id = '{$row['po_id']}' ";
|
$sql2 = " select sum(po_cnt1+po_cnt2+po_cnt3+po_cnt4+po_cnt5+po_cnt6+po_cnt7+po_cnt8+po_cnt9) as sum_po_cnt from {$g5['poll_table']} where po_id = '{$row['po_id']}' ";
|
||||||
$row2 = sql_fetch($sql2);
|
$row2 = sql_fetch($sql2);
|
||||||
$po_etc = ($row['po_etc']) ? "사용" : "미사용";
|
$po_etc = ($row['po_etc']) ? "사용" : "미사용";
|
||||||
|
$po_use = ($row['po_use']) ? "사용" : "미사용";
|
||||||
|
|
||||||
$s_mod = '<a href="./poll_form.php?' . $qstr . '&w=u&po_id=' . $row['po_id'] . '" class="btn btn_03">수정</a>';
|
$s_mod = '<a href="./poll_form.php?' . $qstr . '&w=u&po_id=' . $row['po_id'] . '" class="btn btn_03">수정</a>';
|
||||||
|
|
||||||
@ -117,6 +119,7 @@ $colspan = 7;
|
|||||||
<td class="td_num"><?php echo $row['po_level'] ?></td>
|
<td class="td_num"><?php echo $row['po_level'] ?></td>
|
||||||
<td class="td_num"><?php echo $row2['sum_po_cnt'] ?></td>
|
<td class="td_num"><?php echo $row2['sum_po_cnt'] ?></td>
|
||||||
<td class="td_etc"><?php echo $po_etc ?></td>
|
<td class="td_etc"><?php echo $po_etc ?></td>
|
||||||
|
<td class="td_use"><?php echo $po_use ?></td>
|
||||||
<td class="td_mng td_mng_s"><?php echo $s_mod ?></td>
|
<td class="td_mng td_mng_s"><?php echo $s_mod ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
|||||||
@ -617,6 +617,7 @@ CREATE TABLE IF NOT EXISTS `g5_poll` (
|
|||||||
`po_date` date NOT NULL default '0000-00-00',
|
`po_date` date NOT NULL default '0000-00-00',
|
||||||
`po_ips` mediumtext NOT NULL,
|
`po_ips` mediumtext NOT NULL,
|
||||||
`mb_ids` text NOT NULL,
|
`mb_ids` text NOT NULL,
|
||||||
|
`po_use` tinyint(4) NOT NULL default '0',
|
||||||
PRIMARY KEY (`po_id`)
|
PRIMARY KEY (`po_id`)
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
|
||||||
|
|
||||||
|
|||||||
@ -8,8 +8,8 @@ function poll($skin_dir='basic', $po_id=false)
|
|||||||
|
|
||||||
// 투표번호가 넘어오지 않았다면 가장 큰(최근에 등록한) 투표번호를 얻는다
|
// 투표번호가 넘어오지 않았다면 가장 큰(최근에 등록한) 투표번호를 얻는다
|
||||||
if (!$po_id) {
|
if (!$po_id) {
|
||||||
$row = sql_fetch(" select MAX(po_id) as max_po_id from {$g5['poll_table']} ");
|
$row = sql_fetch(" select MAX(po_id) as max_po_id from {$g5['poll_table']} where po_use = 1 ", false);
|
||||||
$po_id = $row['max_po_id'];
|
$po_id = isset($row['max_po_id']) ? $row['max_po_id'] : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!$po_id)
|
if(!$po_id)
|
||||||
@ -36,7 +36,7 @@ function poll($skin_dir='basic', $po_id=false)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '$po_id' ");
|
$po = sql_fetch(" select * from {$g5['poll_table']} where po_id = '$po_id' and po_use = 1 ");
|
||||||
|
|
||||||
ob_start();
|
ob_start();
|
||||||
include_once ($poll_skin_path.'/poll.skin.php');
|
include_once ($poll_skin_path.'/poll.skin.php');
|
||||||
|
|||||||
Reference in New Issue
Block a user