Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.57 KB | None | 0 0
  1. <div id="main">
  2. <div class="sidebartop">Vote</div>
  3. <div class="sidebarbox">
  4.  
  5. <!-- VOTE -->
  6. <?php
  7. function getVoteErr($err) {
  8. if($err == "1") {
  9. echo '<p class="error">Please fill in the correct account credentials.</p>';
  10. } elseif($err == "2") {
  11. echo '<p class="error">You must be logged out to vote for rewards.</p>';
  12. } elseif($err == "3") {
  13. echo '<p class="error">You\'ve already voted with this account in the past 12 hours!<br />Last time you voted was on: '.$_SESSION['vote_date'].'!</p>';
  14. }
  15. }
  16. if(isset($_POST['doVote'])) {
  17. $earnednx = false;
  18. $account = $_POST['name'];
  19. $account = mysql_real_escape_string($account);
  20. mysql_select_db($host['database']);
  21. $query=mysql_query("SELECT * FROM accounts WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  22. $info=mysql_fetch_assoc($query);
  23. if($_POST["name"] == "") {
  24. $_SESSION['vote_err'] = "1";
  25. echo '<meta http-equiv="refresh" content="0;url=?page=vote">';
  26. } elseif($_POST["password"] == "") {
  27. $_SESSION['vote_err'] = "1";
  28. echo '<meta http-equiv="refresh" content="0;url=?page=vote">';
  29. } elseif(mysql_num_rows($query) < 1) {
  30. $_SESSION['vote_err'] = "1";
  31. echo '<meta http-equiv="refresh" content="0;url=?page=vote">';
  32. } elseif(($info["password"] != hash('sha512',$_POST["password"].$info["salt"]) && sha1($_POST["password"])) && $info["password"] != sha1($_POST["password"])) {
  33. $_SESSION['vote_err'] = "1";
  34. echo '<meta http-equiv="refresh" content="0;url=?page=vote">';
  35. } elseif($info["loggedin"] > 0) {
  36. $_SESSION['vote_err'] = "2";
  37. echo '<meta http-equiv="refresh" content="0;url=?page=vote">';
  38. } else {
  39. $ip = $_SERVER['REMOTE_ADDR'];
  40. $time = time();
  41. $query = mysql_query("SELECT *, SUM(`times`) as amount FROM voterecords WHERE account='$account'");
  42. $lasttime = mysql_fetch_array($query);
  43. $amount = $lasttime['amount'];
  44. $insertnew = false;
  45. if ($amount == "") {
  46. $insertnew = true;
  47. }
  48. $timecalc = $time - $lasttime['date'];
  49. if (!$insertnew) {
  50. if ($timecalc < 43200) { // 43200 ms is 12 hours
  51. date_default_timezone_set(''.$timezone.'');
  52. $_SESSION['vote_err'] = "3";
  53. $_SESSION['vote_date'] = date('M d\, h:i:s A', $lasttime['date']);
  54. echo '<meta http-equiv="refresh" content="0;url=?page=vote">';
  55. } else {
  56. $update = mysql_query("SELECT * from voterecords WHERE ip='$ip' AND account = '$account'");
  57. if ($update) {
  58. mysql_query("UPDATE voterecords SET account='$account', date='$time', times=times+1 WHERE account='$account'");
  59. mysql_query("UPDATE voterecords SET account='$account', date='$time', times=times+1 WHERE ip='$ip'");
  60. $earnednx = true;
  61. } elseif (!$update) {
  62. $ipinsert = mysql_query("INSERT INTO voterecords (`account`, `ip`, `date`, `times`) VALUES ('$account', '$ip', '$time', 1)");
  63. if (!$ipinsert) {
  64. $message = 'Invalid query: ' . mysql_error() . "\n";
  65. $message .= 'Whole query: ' . $ipinsert;
  66. die($message);
  67. } else {
  68. $earnednx = true;
  69. }
  70. } else {
  71. $message = 'Invalid query: ' . mysql_error() . "\n";
  72. $message .= 'Whole query: ' . $update;
  73. die($message);
  74. }
  75. }
  76. } else {
  77. $success = mysql_query("INSERT INTO voterecords (`account`, `ip`, `date`, `times`) VALUES ('$account', '$ip', '$time', 1)");
  78. if (!$success) {
  79. $message = 'Invalid query: ' . mysql_error() . "\n";
  80. $message .= 'Whole query: ' . $success;
  81. die($message);
  82. } else {
  83. $earnednx = true;
  84. }
  85. }
  86. // Insert the NX into the db now
  87. if ($earnednx) {
  88. mysql_query("UPDATE accounts SET votePoints = votePoints + '1' WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  89. mysql_query("UPDATE accounts SET maplePoint = maplePoint + '5000' WHERE name='" .mysql_real_escape_string($_POST["name"]) . "'");
  90. mysql_query("UPDATE accounts SET lastvote='" .time(). "' WHERE name='" . mysql_real_escape_string($_POST["name"]) . "'");
  91. mysql_close($conn);
  92. echo '<html>';
  93. echo '<head>';
  94. unset($_SESSION['vote_err']);
  95. echo '<meta HTTP-EQUIV="REFRESH" content="0; url='.$votelink.'">';
  96. echo '</head>';
  97. echo '</html>';
  98. }
  99. }
  100. }
  101. ?><!-- END VOTE PHP SCRIPT -->
  102.  
  103. <!-- BEGIN VOTE -->
  104. <div align="center">
  105. <div id="message-yellow">Not interested in any rewards, but still wanna vote? <a href="<?php echo $votelink; ?>" target="_blank">Click Here</a></div>
  106. <br />
  107. <div id="vote">
  108. <fieldset class="normal">
  109. <legend>Vote</legend>
  110. <b>Welcome to the Vote Page!</b><br />
  111. You can vote for us every 12 hours, and get rewards for voting.<br /><br />
  112. <b>Attention: Once transferred to vote page, please type the word you read in the captcha image and click "Submit".</b><br /><br />
  113. Also, once you click submit, your Account and IP Address will be logged.<br />Please don't try to fool us with fake votes, bypasses, ect.<br>You may get suspended/banned.<br /><br />
  114. <b>Below, please fill in your login credentials.</b><br />Click submit once filled out to get confirmed.<br />
  115. 5k NX and 1 Vote Point will be added to your account
  116. <form action="?page=vote" method="POST"><br>
  117. <div style="width:70px; float:left;">Username:</div><input type="text" name="name" maxlength="15" class="input" ><br />
  118. <div style="width:70px; float:left;">Password:</div><input type="password" name="password" maxlength="15" class="input" ><br />
  119.  
  120. <input type="hidden" name="submit_check" value="1">
  121. <input type="submit" name="doVote" value="Submit" class="doVote"><br />
  122. </form>
  123. </div>
  124. </div>
  125. </div>
  126. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement