diff --git a/adm/css/admin.css b/adm/css/admin.css
index 3e8c2b0c4..044197fba 100644
--- a/adm/css/admin.css
+++ b/adm/css/admin.css
@@ -447,6 +447,7 @@ tfoot th {}
.td_delino {width:130px}
.td_device {width:70px;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 input {margin-right:5px;width:130px}
.td_grid {width:60px;text-align:center}
diff --git a/adm/poll_form.php b/adm/poll_form.php
index b5194c5cd..337f9ba46 100644
--- a/adm/poll_form.php
+++ b/adm/poll_form.php
@@ -23,6 +23,10 @@ if ($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;
require_once './admin.head.php';
?>
@@ -94,6 +98,10 @@ require_once './admin.head.php';
+
+ | 투표사용 |
+ > |
+
| 투표등록일 |
|
diff --git a/adm/poll_form_update.php b/adm/poll_form_update.php
index 510ea725a..cde80252f 100644
--- a/adm/poll_form_update.php
+++ b/adm/poll_form_update.php
@@ -51,8 +51,8 @@ $po_id = isset($_POST['po_id']) ? $_POST['po_id'] : '';
if ($w == '') {
$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 )
- 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 . "' ) ";
+ ( 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 . "', 1 ) ";
sql_query($sql);
$po_id = sql_insert_id();
@@ -79,7 +79,8 @@ if ($w == '') {
po_cnt9 = '{$_POST['po_cnt9']}',
po_etc = '{$_POST['po_etc']}',
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']}' ";
sql_query($sql);
} elseif ($w == 'd') {
diff --git a/adm/poll_list.php b/adm/poll_list.php
index 383c7a4e7..b277c2db6 100644
--- a/adm/poll_list.php
+++ b/adm/poll_list.php
@@ -49,7 +49,7 @@ $listall = '전체
$g5['title'] = '투표관리';
require_once './admin.head.php';
-$colspan = 7;
+$colspan = 8;
?>
@@ -92,6 +92,7 @@ $colspan = 7;
투표권한 |
투표수 |
기타의견 |
+ 사용 |
관리 |
@@ -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']}' ";
$row2 = sql_fetch($sql2);
$po_etc = ($row['po_etc']) ? "사용" : "미사용";
+ $po_use = ($row['po_use']) ? "사용" : "미사용";
$s_mod = '수정';
@@ -117,6 +119,7 @@ $colspan = 7;
|
|
|
+ |
|
diff --git a/install/gnuboard5.sql b/install/gnuboard5.sql
index 15509446c..749e9f796 100644
--- a/install/gnuboard5.sql
+++ b/install/gnuboard5.sql
@@ -617,6 +617,7 @@ CREATE TABLE IF NOT EXISTS `g5_poll` (
`po_date` date NOT NULL default '0000-00-00',
`po_ips` mediumtext NOT NULL,
`mb_ids` text NOT NULL,
+ `po_use` tinyint(4) NOT NULL default '0',
PRIMARY KEY (`po_id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;
diff --git a/lib/poll.lib.php b/lib/poll.lib.php
index 27491a14c..a5ac86bd0 100644
--- a/lib/poll.lib.php
+++ b/lib/poll.lib.php
@@ -8,8 +8,8 @@ function poll($skin_dir='basic', $po_id=false)
// 투표번호가 넘어오지 않았다면 가장 큰(최근에 등록한) 투표번호를 얻는다
if (!$po_id) {
- $row = sql_fetch(" select MAX(po_id) as max_po_id from {$g5['poll_table']} ");
- $po_id = $row['max_po_id'];
+ $row = sql_fetch(" select MAX(po_id) as max_po_id from {$g5['poll_table']} where po_use = 1 ", false);
+ $po_id = isset($row['max_po_id']) ? $row['max_po_id'] : 0;
}
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();
include_once ($poll_skin_path.'/poll.skin.php');