diff options
author | community.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000> | 2009-06-18 11:39:01 +0000 |
---|---|---|
committer | community.cacert.org <community.cacert.org@d4452222-2f33-11de-9270-010000000000> | 2009-06-18 11:39:01 +0000 |
commit | 14e2fc8c34f6a49591d7c9d10002e3c23c24be5d (patch) | |
tree | 7d4626b11bee3b42e9871c085a36d1a3fca73b5e | |
parent | c5a7f01be25ac360c5062172049a5750056d6180 (diff) | |
download | cacert-boardvoting-14e2fc8c34f6a49591d7c9d10002e3c23c24be5d.tar.gz cacert-boardvoting-14e2fc8c34f6a49591d7c9d10002e3c23c24be5d.tar.xz cacert-boardvoting-14e2fc8c34f6a49591d7c9d10002e3c23c24be5d.zip |
remove post commit update query
git-svn-id: http://svn.cacert.cl/Software/Voting/vote@63 d4452222-2f33-11de-9270-010000000000
-rw-r--r-- | database.php | 3 | ||||
-rw-r--r-- | motion.php | 1 |
2 files changed, 1 insertions, 3 deletions
diff --git a/database.php b/database.php index 9b80339..932e6a4 100644 --- a/database.php +++ b/database.php @@ -20,8 +20,7 @@ $this->statement['do vote'] = $this->dbh->prepare("INSERT INTO votes (decision, voter, vote, voted, notes) VALUES (:decision, :voter, :vote, datetime('now','utc'), :notes);"); $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') || '.' || (select count(*) as num from decisions where proposed between date('now') and date('now','1 day')) WHERE id=last_insert_rowid();"); + $this->statement['create decision'] = $this->dbh->prepare("INSERT INTO decisions (proposed, proponent, title, content, votetype, status, due, modified,tag) VALUES (datetime('now','utc'), :proponent, :title, :content, :votetype, 0, datetime('now','utc', :due), datetime('now','utc'),'m' || strftime('%Y%m%d','now') || '.' || (select count(*)+1 as num from decisions where proposed between date('now') and date('now','1 day')));"); $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'); @@ -91,7 +91,6 @@ BODY; $stmt->bindParam(":votetype",$_POST['votetype']); $stmt->bindParam(":due",$_POST['due']); if ($stmt->execute()) { - $db->getStatement("post create")->execute(); ?> <b>The motion has been proposed!</b><br/> <a href="motions.php">Back to motions</a><br/> |