tried to implement javascript to vote.tpl

This commit is contained in:
Nael 2013-06-20 18:41:20 +02:00
parent 99612ce729
commit 1c5e934818
2 changed files with 19 additions and 1 deletions

View File

@ -21,6 +21,8 @@ class votes {
// die();
if ($res->next()){
throw new ERROR('You already voted!'); }
$poll_ID = $_GET["poll_ID"];
$vote = $_GET["vote"];
$res = $con->prepare( 'insertVote',
'INSERT INTO uvote_data
VALUES (?, ?, ?);',

View File

@ -8,7 +8,23 @@
<div class="span5" style="">
<h2>Abstimmung</h2>
<a class="btn btn-large btn-green" style="width: 110px;" href="#">Pro &raquo;</a>
<a class="btn btn-large btn-green" style="width: 110px;">Pro &raquo;
<script language="javascript">
$(function(){
$('#btn btn-large btn-green').on('click', function (e) {
var poll_ID = "15";
var vote = "4";
document.write('href="mojotrollz.eu/web/uVote/api.php?call=vote&action=vote&poll_ID=' + poll_ID + '&vote=' + vote + '"');
});
});
</script>
</a>
<a class="btn btn-large btn-red" style="width: 110px; background-color: red;" href="#">Contra &raquo;</a>
<a class="btn btn-large btn-grey" style="width: 110px; background-color: grey;" href="#">Enthaltung &raquo;</a>