comparison pages/vote.inc.php @ 1085:01783161eeb2

Fix usr and adm ajax and voting.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 25 Jan 2017 22:39:42 +0200
parents 7e497188e4c6
children 4c76b4994414
comparison
equal deleted inserted replaced
1084:e1cfbfb0b64a 1085:01783161eeb2
78 { 78 {
79 ?> 79 ?>
80 <noscript> 80 <noscript>
81 <div class="notice">If your browser supports JavaScript, enable it for smoother voting experience.</div> 81 <div class="notice">If your browser supports JavaScript, enable it for smoother voting experience.</div>
82 </noscript> 82 </noscript>
83 <script type="text/javascript"> 83 <script type="text/javascript" src="usrajax.js.php"></script>
84
85 function updateVote(eid, value)
86 {
87 var msuccess = function(txt)
88 {
89 }
90
91 var mfail = function(txt)
92 {
93 jsMessageBox("<h1>Ooops, an error occured</h2><p>Something went wrong, votes might not be submitted. :(</p>");
94 }
95
96 jsSendPOSTRequest("action=set&entry_id="+eid+"&vote="+value, msuccess, mfail);
97 return false;
98 }
99
100 </script>
101 <?php 84 <?php
102 // Try fetching previously stored votes 85 // Try fetching previously stored votes
103 $sql = stPrepareSQL( 86 $sql = stPrepareSQL(
104 "SELECT entry_id,value FROM votes WHERE key_id=%d", 87 "SELECT entry_id,value FROM votes WHERE key_id=%d",
105 stGetSessionItem("key_id")); 88 stGetSessionItem("key_id"));