Advertisement
Guest User

Untitled

a guest
Oct 21st, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.20 KB | None | 0 0
  1. if($_GET['a'] == 'vote') { // Vote Box
  2. //display character list
  3. odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
  4. $chars = odbc_exec($mssql, 'SELECT * FROM [CHARACTER_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\' AND isblock=\'F\'');
  5. echo '<select id="selectvotechar" name="charid">';
  6. while($char = odbc_fetch_array($chars)) {
  7. echo '<option value="'.$char['m_idPlayer'].'">'.$char['m_szName'].'</option>';
  8. }
  9. echo '</select>';
  10.  
  11. odbc_exec($mssql, 'USE [ACCOUNT_DBF]');
  12. $userselect = odbc_exec($mssql, 'SELECT * FROM [ACCOUNT_TBL] WHERE account=\''.mssql_escape_string($_SESSION['user']).'\'');
  13. $user = odbc_fetch_array($userselect);
  14.  
  15. $diff1 = diff($user['lastvote1']);
  16. $diff2 = diff($user['lastvote2']);
  17. $diff3 = diff($user['lastvote3']);
  18. $votedtoday = 0;
  19. if($diff1['hours'] < 12)
  20. $votedtoday = $votedtoday + 1;
  21. if($diff2['hours'] < 12)
  22. $votedtoday = $votedtoday + 1;
  23. if($diff3['hours'] < 12)
  24. $votedtoday = $votedtoday + 1;
  25. echo 'Account: <b>'.$user['account'].'</b><br/><br/>';
  26. echo 'Current Vote Points: <b><span id="vpoints">'.$user['votepoints'].'</span></b><br/><br/>';
  27. echo 'You can still vote<b><span id="vtoday"> '.(3 - $votedtoday).' </span></b> Times Today<br/><br/>';
  28. if($diff1['hours'] >= 12 || $diff2['hours'] >= 12 || $diff3['hours'] >= 12) {
  29. odbc_exec($mssql, 'USE [CHARACTER_01_DBF]');
  30. $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']).'\'');
  31.  
  32. if(odbc_result($charcheck, 'count') == 0) {
  33. echo '<span style="color: #f00;">This isnt your character!</span><br/><br/>';
  34. } else if(empty($_GET['charid']) || !isset($_GET['charid'])) {
  35. echo '<span style="color: #f00;">You need to select a character!</span><br/><br/>';
  36. } else if(isset($_GET['submit'])) {
  37. $itemid = 21;
  38. $itemcount = 1;
  39. if($_GET['submit'] == 1) {
  40. if($diff1['hours'] >= 12) {
  41. send_item($_GET['charid'], $itemid, $itemcount);
  42. 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']).'\'');
  43. }
  44. } elseif($_GET['submit'] == 2) {
  45. if($diff2['hours'] >= 12) {
  46. send_item($_GET['charid'], $itemid, $itemcount);
  47. 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']).'\'');
  48. }
  49. } elseif($_GET['submit'] == 3) {
  50. if($diff3['hours'] >= 12) {
  51. send_item($_GET['charid'], $itemid, $itemcount);
  52. 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']).'\'');
  53. }
  54. }
  55. }
  56. echo ' <b> 1 Vote point for each Vote<br/>After voting, you can pick a gift!<br/>Follow the instructions
  57. and Vote for all 3 Top Sites.<br/><br/><div id="topsite" style="text-align: center;">';
  58. if($diff1['hours'] >= 12) {
  59. // Top of Games
  60. echo '<img src="img/tog.gif" /><br/><br/>';
  61. echo '<span id="votetext"><a onclick="vote(1, '.$diff2['hours'].', \''.$votelist2.'\', \''.$votelist3.'\');" href="'.$votelist1.'" target="_blank"><img src="img/proceed.png" /></a></span>';
  62. } elseif($diff2['hours'] >= 12 ) {
  63. // Xtreme Top 100
  64. echo '<img src="img/xtop100.jpg" /><br/><br/>';
  65. echo '<span id="votetext"><a onclick="vote(2, '.$diff3['hours'].', \''.$votelist2.'\', \''.$votelist3.'\');" href="'.$votelist2.'" target="_blank"><img src="img/proceed.png" /></a></span>';
  66. } elseif($diff3['hours'] >= 12) {
  67. // G Top 100
  68. echo '<img src="img/gtop100.jpg" /><br/><br/>';
  69. echo '<span id="votetext"><a onclick="vote(3, 0, \''.$votelist2.'\', \''.$votelist3.'\');" href="'.$votelist3.'" target="_blank"><img src="img/proceed.png" /></a></span>';
  70. }
  71. echo '</div>';
  72. } else {
  73. echo '<a href="javascript:voteItemTab();"><img src="img/choose.png" /></a>';
  74. }
  75. }
  76. /* VOTE BOX END */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement