Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once 'config.php';
- require 'steamauth/steamauth.php';
- $info = $db->query("SELECT * FROM `clients` WHERE `clientid` = '" .$clientid . "'")->fetch_object();
- if(isset($_SESSION['steamid'])) {
- $prices = file_get_contents('price.txt');
- //$prices = file_get_contents('https://api.csgofast.com/price/all');
- $parsedPrices = json_decode($prices);
- $get_content = file_get_contents("https://steamcommunity.com/profiles/".$_SESSION['steamid']."/inventory/json/730/2/");
- $parsedInv = json_decode($get_content);
- $parsedInvT = $parsedInv;
- $counter = 0;
- $mindeposit = $info->min;
- foreach($parsedInv->rgInventory as $k => $v){
- $id = $v->id;
- $iid = $v->instanceid;
- $cid = $v->classid;
- $key = $cid."_".$iid;
- $t = $parsedInvT->rgDescriptions->$key->tradable;
- $name = $parsedInvT->rgDescriptions->$key->market_hash_name;
- $price = $parsedPrices->$name*1.2;
- $price = round($price,2);
- $img = $parsedInvT->rgDescriptions->$key->icon_url;
- if($t && $price && $price >= $mindeposit) {
- $counter++;
- // echo '<div class="item" id="'.$id.'-i"><span class="points" id="'.$id.'-p">'.$price.'pts</span>
- // <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>
- // </div>';
- 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;
- height: 90px;
- float: left;
- background:url(https://steamcommunity-a.akamaihd.net/economy/image/'.$img.'/80x80) no-repeat center center;">
- <div class="itemName">'.$name.'</div><div class="itemPrice">'.$price.' $</div>
- </div>';
- }
- }
- if($counter == 0){
- 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>';
- }
- } else{
- echo 'Login in';
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement