summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcommunity.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000>2009-06-15 04:28:18 +0000
committercommunity.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000>2009-06-15 04:28:18 +0000
commitc5a7f01be25ac360c5062172049a5750056d6180 (patch)
treeec6f21491710b908fff0fe8c896b8630695fc542
parent720d6b0a8b8a01f78f9f12da863a88b9a61fdab6 (diff)
downloadcacert-boardvoting-c5a7f01be25ac360c5062172049a5750056d6180.tar.gz
cacert-boardvoting-c5a7f01be25ac360c5062172049a5750056d6180.tar.xz
cacert-boardvoting-c5a7f01be25ac360c5062172049a5750056d6180.zip
fix numbering
git-svn-id: http://svn.cacert.cl/Software/Voting/vote@62 d4452222-2f33-11de-9270-010000000000
-rw-r--r--database.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/database.php b/database.php
index a4063f8..9b80339 100644
--- a/database.php
+++ b/database.php
@@ -21,7 +21,7 @@
$this->statement['stats'] = $this->dbh->prepare("SELECT COUNT(*) AS voters FROM voters WHERE enabled=1;");
$this->statement['list votes'] = $this->dbh->prepare("SELECT voters.name AS name, votes.vote AS vote FROM voters,votes WHERE voters.id=votes.voter AND votes.decision=:id;");
$this->statement['create decision'] = $this->dbh->prepare("INSERT INTO decisions (proposed, proponent, title, content, votetype, status, due, modified) VALUES (datetime('now','utc'), :proponent, :title, :content, :votetype, 0, datetime('now','utc', :due), datetime('now','utc'));");
- $this->statement['post create'] = $this->dbh->prepare(" UPDATE decisions SET tag='m' || strftime('%Y%m%d','now') || '.' || id WHERE id=last_insert_rowid();");
+ $this->statement['post create'] = $this->dbh->prepare(" UPDATE decisions SET tag='m' || strftime('%Y%m%d','now') || '.' || (select count(*) as num from decisions where proposed between date('now') and date('now','1 day')) WHERE id=last_insert_rowid();");
$this->statement['update decision'] = $this->dbh->prepare("UPDATE decisions SET proposed=datetime('now','utc'), proponent=:proponent, title=:title, content=:content, votetype=:votetype, status=0, due=datetime('now','utc',:due), modified=datetime('now','utc') WHERE id=:id;");
$this->statement['close decision'] = $this->dbh->prepare("UPDATE decisions SET status=:status, modified=datetime('now','utc') WHERE id=:decision");
ini_set('mbstring.internal_encoding', 'UTF-8');