Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(isset($func) and $func == 'claim_bonus'){
- global $ado;
- $user = escape($_GET['user']);
- $type = escape($_GET['type']);
- $now = date("Y-m-d H:i:s");
- $points = rand(1,20);
- $query = $ado->exec("INSERT INTO `claimed_bonuses` SET `user` = '$user', `date` = '$now', `type` = '$type'");
- $query1 = $ado->exec("INSERT INTO `history` SET `user` = '$user', `date` = '$now', `type` = 'bonus', `amount` = '$points', `title` = 'Bonus Claimed', `description` = '$user claimed bonus $points points'");
- $query2 = $ado->exec("update `balances` SET `actual` = actual+$points, `total` = total+$points");
- if ($query && $query1 && $query2) {
- echo "<img src=\"/img/bonus/add_used.png\" width=\"30%\" height=\"30%\" alt=\"Bonus claimed\" />";
- } else {
- echo "<img src=\"/img/bonus/error.png\" width=\"30%\" height=\"30%\" alt=\"Error\" />";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment