Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?
- require "../config.php";
- include "../includes/func.php";
- $itemid = clean(abs($_GET['itemid']));
- $friendinfo = $_GET['friendinfo'];
- $session = $_SESSION['User'];
- if (strlen($friendinfo) > 0 && strlen($friendinfo) != 7)
- {
- echo fail();
- exit;
- }
- $result=mysql_query("SELECT TOP 1 * FROM items WHERE id = '$itemid' AND forsale = 1");
- $row=mysql_fetch_array($result);
- $cash_query=mysql_query("SELECT balance FROM data WHERE username = '$session'");
- $cash_row_array=mysql_fetch_array($cash_query);
- $cash_count=$cash_row_array['balance'];
- if($row['price_sale']!=null&&$row['price_sale']!=0)
- $item_price=$row['price_sale'];
- else
- $item_price=$row['price'];
- if (isset($itemid)&&mysql_num_rows($result))
- {
- if ($cash_count >= $item_price)
- {
- if (updateCash($cash_count-$item_price))
- {
- if ($send)
- {
- PurchaseCount($itemid);
- }
- else
- {
- updateCash($cash_count);
- echo fail($itemid);
- }
- }
- else
- echo fail($itemid);
- }
- else
- echo fail($itemid);
- }
- else
- echo fail();
- ?>
Add Comment
Please, Sign In to add comment