Advertisement
Guest User

Untitled

a guest
Dec 10th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.27 KB | None | 0 0
  1. <?php
  2.  
  3. require_once 'config.php';
  4. require 'steamauth/steamauth.php';
  5. $info = $db->query("SELECT * FROM `clients` WHERE `clientid` = '" .$clientid . "'")->fetch_object();
  6. if(isset($_SESSION['steamid'])) {
  7. $prices = file_get_contents('price.txt');
  8. //$prices = file_get_contents('https://api.csgofast.com/price/all');
  9. $parsedPrices = json_decode($prices);
  10. $get_content = file_get_contents("https://steamcommunity.com/profiles/".$_SESSION['steamid']."/inventory/json/730/2/");
  11. $parsedInv = json_decode($get_content);
  12. $parsedInvT = $parsedInv;
  13. $counter = 0;
  14. $mindeposit = $info->min;
  15. foreach($parsedInv->rgInventory as $k => $v){
  16. $id = $v->id;
  17. $iid = $v->instanceid;
  18. $cid = $v->classid;
  19. $key = $cid."_".$iid;
  20. $t = $parsedInvT->rgDescriptions->$key->tradable;
  21. $name = $parsedInvT->rgDescriptions->$key->market_hash_name;
  22. $price = $parsedPrices->$name*1.2;
  23. $price = round($price,2);
  24. $img = $parsedInvT->rgDescriptions->$key->icon_url;
  25. if($t && $price && $price >= $mindeposit) {
  26. $counter++;
  27. // echo '<div class="item" id="'.$id.'-i"><span class="points" id="'.$id.'-p">'.$price.'pts</span>
  28. // <div id="'.$id.'" onclick="selectItem('.$id.')" class="img-holder"><img src="https://steamcommunity-a.akamaihd.net/economy/image/'.$img.'/360fx360f"></div><span class="name">'.$name.'</span>
  29. // </div>';
  30. echo '<div class="csgoitem invitem" data-title="'.$name.'" data-tooltip="Type: gun<br>Value: '.$price.' $" id="'.$id.'" value="'. $price*10*10 .'" style="margin: 5px; padding: 5px;border: 1px solid gray;width: 90px;
  31. height: 90px;
  32. float: left;
  33. background:url(https://steamcommunity-a.akamaihd.net/economy/image/'.$img.'/80x80) no-repeat center center;">
  34. <div class="itemName">'.$name.'</div><div class="itemPrice">'.$price.' $</div>
  35. </div>';
  36. }
  37.  
  38. }
  39. if($counter == 0){
  40. echo '<br><center><h4>Either your inventory is empty, you dont have any items cost higher than '.$mindeposit.'$ or steam might lagging. </h4></center><br>';
  41. }
  42. } else{
  43. echo 'Login in';
  44. }
  45. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement