Guest User

Untitled

a guest
May 20th, 2013
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. if(isset($func) and $func == 'claim_bonus'){
  2.     global $ado;
  3.     $user = escape($_GET['user']);
  4.     $type = escape($_GET['type']);
  5.     $now = date("Y-m-d H:i:s");
  6.     $points = rand(1,20);
  7.    
  8.     $query = $ado->exec("INSERT INTO `claimed_bonuses` SET `user` = '$user', `date` = '$now', `type` = '$type'");
  9.     $query1 = $ado->exec("INSERT INTO `history` SET `user` = '$user', `date` = '$now', `type` = 'bonus', `amount` = '$points', `title` = 'Bonus Claimed', `description` = '$user claimed bonus $points points'");
  10.     $query2 = $ado->exec("update `balances` SET `actual` = actual+$points, `total` = total+$points");
  11.    
  12.    
  13.     if ($query && $query1 && $query2) {
  14.     echo "<img src=\"/img/bonus/add_used.png\" width=\"30%\" height=\"30%\" alt=\"Bonus claimed\" />";
  15.         } else {
  16.         echo "<img src=\"/img/bonus/error.png\" width=\"30%\" height=\"30%\" alt=\"Error\" />";
  17.         }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment