' src="<?php 
        echo is_null($row->imgurl) ? $this->themePath('img/') . Flux::config('ImageUploadPath') . '/' . $row->imgname : $row->imgurl;
        ?>
" />
				</button>
			</td>
			<td style="text-align:center"><?php 
        echo number_format($row->votepoints);
        ?>
</td>
			<td style="text-align:center"><?php 
        echo $row->voteinterval . " " . ((int) $row->voteinterval > 1 ? "Hours" : "Hour");
        ?>
</td>
			<td style="text-align:center"><?php 
        echo isVoted($row->id, $server) !== FALSE ? getTimeLeft(isVoted($row->id, $server)) : Flux::message('VoteNow');
        ?>
</td>
		</tr>
		<?php 
    }
    ?>
	</table>
</form>
<script type="text/javascript">
	$(function() {
		$('.vote-button').click(function() {
			var id = $(this).val();
			var vote_sites = new Array();

			<?php 
Esempio n. 2
0
<?php

require_once "../classes/code.php";
if (isset($_GET['type']) && $_GET['type'] == 'choose') {
    $id = (int) $_GET['id'];
    $voted = isVoted($id);
    $_SESSION['user_id'] = $id;
    if ($voted) {
        echo json_encode(array('success' => true, 'value' => 'voted', 'member' => $voted));
    } else {
        echo json_encode(array('success' => true, 'value' => 'not-voted'));
    }
    die;
}
if (isset($_GET['type']) && $_GET['type'] == 'santa') {
    $id = (int) $_REQUEST['id'];
    // print_r($id);
    $santaId = selectSanta($id);
    if ($santaId) {
        echo json_encode(array('success' => true, 'santa_id' => $santaId));
    } else {
        echo json_encode(array('success' => true, 'voted' => true, 'santa_id' => null));
    }
    die;
}