Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if($_GET['a'] == 'vote') { // Vote Box
- //display character list
- odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
- $chars = odbc_exec($mssql, 'SELECT * FROM [CHARACTER_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\' AND isblock=\'F\'');
- echo '<select id="selectvotechar" name="charid">';
- while($char = odbc_fetch_array($chars)) {
- echo '<option value="'.$char['m_idPlayer'].'">'.$char['m_szName'].'</option>';
- }
- echo '</select>';
- odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
- $userselect = odbc_exec($mssql, 'SELECT * FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
- $user = odbc_fetch_array($userselect);
- $diff1 = diff($user['lastvote1']);
- $diff2 = diff($user['lastvote2']);
- $diff3 = diff($user['lastvote3']);
- $votedtoday = 0;
- if($diff1['hours'] < 12)
- $votedtoday = $votedtoday + 1;
- if($diff2['hours'] < 12)
- $votedtoday = $votedtoday + 1;
- if($diff3['hours'] < 12)
- $votedtoday = $votedtoday + 1;
- echo 'Account: <b>'.$user['account'].'</b><br/><br/>';
- echo 'Current Vote Points: <b><span id="vpoints">'.$user['votepoints'].'</span></b><br/><br/>';
- echo 'You can still vote<b><span id="vtoday"> '.(3 - $votedtoday).' </span></b> Times Today<br/><br/>';
- if($diff1['hours'] >= 12 || $diff2['hours'] >= 12 || $diff3['hours'] >= 12) {
- odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
- $charcheck = odbc_exec($mssql, 'SELECT COUNT(*) as count FROM [CHARACTER_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\' and m_idPlayer=\''.mssql_escape_string($_GET['charid']).'\'');
- if(odbc_result($charcheck, 'count') == 0) {
- echo '<span style="color: #f00;">This isnt your character!</span><br/><br/>';
- } else if(empty($_GET['charid']) || !isset($_GET['charid'])) {
- echo '<span style="color: #f00;">You need to select a character!</span><br/><br/>';
- } else if(isset($_GET['submit'])) {
- $itemid = 21;
- $itemcount = 1;
- if($_GET['submit'] == 1) {
- if($diff1['hours'] >= 12) {
- send_item($_GET['charid'], $itemid, $itemcount);
- odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.m.Y H:i:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
- }
- } elseif($_GET['submit'] == 2) {
- if($diff2['hours'] >= 12) {
- send_item($_GET['charid'], $itemid, $itemcount);
- odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.m.Y H:i:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
- }
- } elseif($_GET['submit'] == 3) {
- if($diff3['hours'] >= 12) {
- send_item($_GET['charid'], $itemid, $itemcount);
- odbc_exec($mssql, 'UPDATE [ACCOUNT_TBL] SET votepoints=votepoints+\'1\', lastvote'.mssql_escape_string($_GET['submit']).'=\''.date('d.m.Y H:i:s').'\' WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
- }
- }
- }
- echo ' <b> 1 Vote point for each Vote<br/>After voting, you can pick a gift!<br/>Follow the instructions
- and Vote for all 3 Top Sites.<br/><br/><div id="topsite" style="text-align: center;">';
- if($diff1['hours'] >= 12) {
- // Top of Games
- echo '<img src="img/tog.gif" /><br/><br/>';
- echo '<span id="votetext"><a onclick="vote(1, '.$diff2['hours'].', \''.$votelist2.'\', \''.$votelist3.'\');" href="'.$votelist1.'" target="_blank"><img src="img/proceed.png" /></a></span>';
- } elseif($diff2['hours'] >= 12 ) {
- // Xtreme Top 100
- echo '<img src="img/xtop100.jpg" /><br/><br/>';
- echo '<span id="votetext"><a onclick="vote(2, '.$diff3['hours'].', \''.$votelist2.'\', \''.$votelist3.'\');" href="'.$votelist2.'" target="_blank"><img src="img/proceed.png" /></a></span>';
- } elseif($diff3['hours'] >= 12) {
- // G Top 100
- echo '<img src="img/gtop100.jpg" /><br/><br/>';
- echo '<span id="votetext"><a onclick="vote(3, 0, \''.$votelist2.'\', \''.$votelist3.'\');" href="'.$votelist3.'" target="_blank"><img src="img/proceed.png" /></a></span>';
- }
- echo '</div>';
- } else {
- echo '<a href="javascript:voteItemTab();"><img src="img/choose.png" /></a>';
- }
- }
- /* VOTE BOX END */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement