Advertisement
roker41k

trade

Apr 8th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 25.46 KB | None | 0 0
  1. <?php require_once 'templates/_header.php';
  2. include "config.php";
  3. include "cache.php";
  4. ?>
  5. <?php
  6. $conn = new mysqli($servername, $username, $password, $dbname);
  7. if ($conn->connect_error)
  8. {
  9. die("Connection failed: " . $conn-g>connect_error);
  10. }
  11. // check if user is banned
  12. if(userBanned(@$_SESSION['steamid']))
  13. {
  14. ?>
  15. <!-- Display ban message -->
  16. <div class="notice notice-danger">
  17. <strong>
  18. Your account has been banned.
  19. </strong>
  20. <span style="display: block">
  21. <b>Reason:</b> <?php echo getBanReason($_SESSION['steamid']); ?>
  22. </span>
  23. </div>
  24. <?php
  25. }
  26. ?>
  27. <?php
  28. if($site_online==1 && $allowed==1 || $site_online==0 && $allowed==1)
  29. {
  30. ?>
  31.  
  32. <!-- Start: injected by Adguard -->
  33. <link rel="stylesheet" type="text/css" href="//local.adguard.com/adguard-ajax-api/injections/adguard-styles.css?ts=63611264224615&generic=1&domain=server141.hosting.reg.ru"/>
  34. <link rel="stylesheet" type="text/css" href="//local.adguard.com/adguard-ajax-api/injections/adguard-styles.css?ts=63611264224615&offset=0"/>
  35. <script src="//local.adguard.com/adguard-ajax-api/injections/userscripts/Adguard Assistant?ts=63611264241822" type="text/javascript"></script>
  36. <script src="//local.adguard.com/adguard-ajax-api/injections/userscripts/Adguard Popup Blocker?ts=63611264241822" type="text/javascript"></script>
  37. <script src="//local.adguard.com/adguard-ajax-api/injections/userscripts/Web of Trust?ts=63611264241822" type="text/javascript"></script>
  38. <script src="//local.adguard.com/adguard-ajax-api/injections/adguard-script.js?ts=63611264224615&domain=server141.hosting.reg.ru&generic=1&elemhide=1" type="text/javascript"></script>
  39.  
  40.  
  41. <!-- End: injected by Adguard -->
  42.  
  43. <?php
  44. function isTradable($ItemHashName)
  45. {
  46. $quality = "";
  47. if ( // Consumer
  48. preg_match('/Consumer /iu', $ItemHashName)) {
  49. $quality = "Consumer";
  50. } elseif ( // Industrial
  51. preg_match('/Industrial /iu', $ItemHashName)) {
  52. $quality = "Industrial";
  53. } elseif ( // Mil-Spec
  54. preg_match('/Mil-Spec /iu', $ItemHashName)) {
  55. $quality = "Mil-Spec";
  56. } elseif ( // Restricted
  57. preg_match("/Restricted /iu", $ItemHashName)) {
  58. $quality = "Restricted";
  59. } elseif ( // Classified
  60. preg_match('/Classified /iu', $ItemHashName)) {
  61. $quality = "Classified";
  62. } elseif ( // Covert
  63. preg_match('/Covert /iu', $ItemHashName)) {
  64. $quality = "Covert";
  65. } elseif ( // Covert
  66. preg_match('/Contraband /iu', $ItemHashName)) {
  67. $quality = "Contraband";
  68. }
  69.  
  70.  
  71. if ( //Checking if the Weapon is a:
  72. preg_match('/★ StatTrak™ /iu', $ItemHashName)) {
  73. $quality = $quality . " RareStatTrak";
  74. } elseif ( // Rare
  75. preg_match('/★ /iu', $ItemHashName)) {
  76. $quality = $quality . " Rare";
  77. } elseif ( // Souvenir
  78. preg_match('/Souvenir /iu', $ItemHashName)) {
  79. $quality = $quality . " Souvenir";
  80. } elseif ( // Souvenir
  81. preg_match('/StatTrak™ /iu', $ItemHashName)) {
  82. $quality = $quality . " StatTrak";
  83. } else {
  84. $quality = $quality . " Normal";
  85. }
  86. return $quality;
  87. }
  88.  
  89. ?>
  90.  
  91. <script>
  92. var Consumer = 0;
  93. var Industrial = 0;
  94. var MilSpec = 0;
  95. var Restricted = 0;
  96. var Classified = 0;
  97. var Covert = 0;
  98. var Contraband = 0;
  99. var Normal = 0;
  100. var RareStatTrak = 0;
  101. var Rare = 0;
  102. var Souvenir = 0;
  103. var StatTrak = 0;
  104. function showWeapons(elem){
  105. var value = elem.value;
  106. switch(value){
  107. case "Consumer":
  108. if (Consumer==0){
  109. Consumer = 1;
  110. } else {
  111. Consumer = 0;
  112. }
  113. break;
  114. case "Industrial":
  115. if (Industrial==0){
  116. Industrial = 1;
  117. } else {
  118. Industrial = 0;
  119. }
  120. break;
  121. case "Mil-Spec":
  122. if (MilSpec==0){
  123. MilSpec = 1;
  124. } else {
  125. MilSpec = 0;
  126. }
  127. break;
  128. case "Restricted":
  129. if (Restricted==0){
  130. Restricted = 1;
  131. } else {
  132. Restricted = 0;
  133. }
  134. break;
  135. case "Classified":
  136. if (Classified==0){
  137. Classified = 1;
  138. } else {
  139. Classified = 0;
  140. }
  141. break;
  142. case "Covert":
  143. if (Covert==0){
  144. Covert = 1;
  145. } else {
  146. Covert = 0;
  147. }
  148. break;
  149. case "Contraband":
  150. if (Contraband==0){
  151. Contraband = 1;
  152. } else {
  153. Contraband = 0;
  154. }
  155. break;
  156. case "Normal":
  157. if (Normal==0){
  158. Normal = 1;
  159. } else {
  160. Normal = 0;
  161. }
  162. break;
  163. case "Rare":
  164. if (Rare==0){
  165. Rare = 1;
  166. } else {
  167. Rare = 0;
  168. }
  169. break;
  170. case "RareStatTrak":
  171. if (RareStatTrak==0){
  172. RareStatTrak = 1;
  173. } else {
  174. RareStatTrak = 0;
  175. }
  176. break;
  177. case "Souvenir":
  178. if (Souvenir==0){
  179. Souvenir = 1;
  180. } else {
  181. Souvenir = 0;
  182. }
  183. break;
  184. case "StatTrak":
  185. if (StatTrak==0){
  186. StatTrak = 1;
  187. } else {
  188. StatTrak = 0;
  189. }
  190. break;
  191. }
  192.  
  193.  
  194. $(".Normal."+action).hide();
  195. $(".RareStatTrak."+action).hide();
  196. $(".Rare."+action).hide();
  197. $(".Souvenir."+action).hide();
  198. $(".StatTrak."+action).hide();
  199. var categoryselect = 0;
  200. var change = 0;
  201.  
  202. if (Normal==1){
  203. change = 0;
  204. categoryselect = 1;
  205. if (Consumer==1){
  206. $(".Consumer.Normal."+action).show();
  207. change = 1;
  208. }
  209. if (Industrial==1){
  210. $(".Industrial.Normal."+action).show();
  211. change = 1;
  212. }
  213. if (MilSpec==1){
  214. $(".Mil-Spec.Normal."+action).show();
  215. change = 1;
  216. }
  217. if (Restricted==1){
  218. $(".Restricted.Normal."+action).show();
  219. change = 1;
  220. }
  221. if (Classified==1){
  222. $(".Classified.Normal."+action).show();
  223. change = 1;
  224. }
  225. if (Covert==1){
  226. $(".Covert.Normal."+action).show();
  227. change = 1;
  228. }
  229. if (Contraband==1){
  230. $(".Contraband.Normal."+action).show();
  231. change = 1;
  232. }
  233.  
  234. if (change==0){
  235. $(".Normal."+action).show();
  236. }
  237. }
  238.  
  239. if (StatTrak==1){
  240. change = 0;
  241. categoryselect = 1;
  242. if (Consumer==1){
  243. $(".Consumer.StatTrak."+action).show();
  244. change = 1;
  245. }
  246. if (Industrial==1){
  247. $(".Industrial.StatTrak."+action).show();
  248. change = 1;
  249. }
  250. if (MilSpec==1){
  251. $(".Mil-Spec.StatTrak."+action).show();
  252. change = 1;
  253. }
  254. if (Restricted==1){
  255. $(".Restricted.StatTrak."+action).show();
  256. change = 1;
  257. }
  258. if (Classified==1){
  259. $(".Classified.StatTrak."+action).show();
  260. change = 1;
  261. }
  262. if (Covert==1){
  263. $(".Covert.StatTrak."+action).show();
  264. change = 1;
  265. }
  266. if (Contraband==1){
  267. $(".Contraband.StatTrak."+action).show();
  268. change = 1;
  269. }
  270.  
  271. if (change==0){
  272. $(".StatTrak."+action).show();
  273. }
  274. }
  275.  
  276. if (Rare==1){
  277. change = 0;
  278. categoryselect = 1;
  279. if (Consumer==1){
  280. $(".Consumer.Rare."+action).show();
  281. change = 1;
  282. }
  283. if (Industrial==1){
  284. $(".Industrial.Rare."+action).show();
  285. change = 1;
  286. }
  287. if (MilSpec==1){
  288. $(".Mil-Spec.Rare."+action).show();
  289. change = 1;
  290. }
  291. if (Restricted==1){
  292. $(".Restricted.Rare."+action).show();
  293. change = 1;
  294. }
  295. if (Classified==1){
  296. $(".Classified.Rare."+action).show();
  297. change = 1;
  298. }
  299. if (Covert==1){
  300. $(".Covert.Rare."+action).show();
  301. change = 1;
  302. }
  303. if (Contraband==1){
  304. $(".Contraband.Rare."+action).show();
  305. change = 1;
  306. }
  307.  
  308. if (change==0){
  309. $(".Rare."+action).show();
  310.  
  311. }
  312. }
  313.  
  314. if (RareStatTrak==1){
  315. change = 0;
  316. categoryselect = 1;
  317. if (Consumer==1){
  318. $(".Consumer.RareStatTrak."+action).show();
  319. change = 1;
  320. }
  321. if (Industrial==1){
  322. $(".Industrial.RareStatTrak."+action).show();
  323. change = 1;
  324. }
  325. if (MilSpec==1){
  326. $(".Mil-Spec.RareStatTrak."+action).show();
  327. change = 1;
  328. }
  329. if (Restricted==1){
  330. $(".Restricted.RareStatTrak."+action).show();
  331. change = 1;
  332. }
  333. if (Classified==1){
  334. $(".Classified.RareStatTrak."+action).show();
  335. change = 1;
  336. }
  337. if (Covert==1){
  338. $(".Covert.RareStatTrak."+action).show();
  339. change = 1;
  340. }
  341. if (Contraband==1){
  342. $(".Contraband.RareStatTrak."+action).show();
  343. change = 1;
  344. }
  345.  
  346. if (change==0){
  347. $(".RareStatTrak."+action).show();
  348.  
  349. }
  350. }
  351.  
  352.  
  353. if (categoryselect==0){
  354. change = 0;
  355. if (Consumer==1){
  356. $(".Consumer."+action).show();
  357. change = 1;
  358. }
  359. if (Industrial==1){
  360. $(".Industrial."+action).show();
  361. change = 1;
  362. }
  363. if (MilSpec==1){
  364. $(".Mil-Spec."+action).show();
  365. change = 1;
  366. }
  367. if (Restricted==1){
  368. $(".Restricted."+action).show();
  369. change = 1;
  370. }
  371. if (Classified==1){
  372. $(".Classified."+action).show();
  373. change = 1;
  374. }
  375. if (Covert==1){
  376. $(".Covert."+action).show();
  377. change = 1;
  378. }
  379. if (Contraband==1){
  380. $(".Contraband."+action).show();
  381. change = 1;
  382. }
  383.  
  384. if (change==0){
  385. $(".Normal."+action).show();
  386. $(".RareStatTrak."+action).show();
  387. $(".Rare."+action).show();
  388. $(".Souvenir."+action).show();
  389. $(".StatTrak."+action).show();
  390. }
  391. }
  392. }
  393. </script>
  394. <script>
  395. var buyitems = new Array();
  396. var sellitems = new Array();
  397. var buyvalue = 0;
  398. var sellvalue = 0;
  399. function rewritevalue(){
  400.  
  401. if(sellvalue==0 & logged==1){
  402. document.getElementById("checkout_r").style.display = "none";
  403. }
  404. else if(logged==1){
  405. document.getElementById("checkout_r").style.display = "";
  406. }
  407. document.getElementById("sell").innerHTML = "<?php echo $currencyname;?> " + (sellvalue) / 100.00;
  408.  
  409. if(buyvalue==0 & logged==1){
  410. document.getElementById("checkout").style.display = "none";
  411. }
  412. else if(logged==1){
  413. document.getElementById("checkout").style.display = "";
  414. }
  415. document.getElementById("buy").innerHTML = "<?php echo $currencyname;?> " + (buyvalue) / 100.00;
  416. }
  417.  
  418. function submit(){
  419.  
  420. var sellitemids = JSON.stringify(sellitems);
  421. var buyitemids = JSON.stringify(buyitems);
  422.  
  423.  
  424. window.location = "queue.php?action=sell&botid=<?php echo $botsteamid; ?>&steamid=<?php echo $steamid; ?>&sellitems=" + sellitemids;
  425. window.location = "queue.php?action=buy&botid=<?php echo $botsteamid; ?>&steamid=<?php echo $steamid; ?>&buyitems=" + buyitemids;
  426.  
  427. }
  428.  
  429.  
  430. Array.prototype.remove = function(value) {
  431. var idx = this.indexOf(value);
  432. if (idx != -1) {
  433. return this.splice(idx, 1); // The second parameter is the number of elements to remove.
  434. }
  435. return false;
  436. }
  437. </script>
  438.  
  439. </div>
  440. <div class="container">
  441.  
  442. <span id="message"></span>
  443.  
  444. <div class="row">
  445.  
  446. <div class="col-md-5 profileBlock">
  447. <div class="row">
  448. <div class="col-md-12 selectedInventory">
  449. <div class="inventoryHeader def-bg10 right">
  450. <div class="ribbon floatLeft">
  451. <div class="y-offer"><h3>Your offer</h3></div>
  452. </div>
  453. <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true">
  454. <div class="modal-dialog modal-lg">
  455. <div class="modal-content">
  456. <div class="modal-body">
  457. <p class="body-message centered"><strong>Balance delay is 10 minutes</strong></p>
  458. </div>
  459. <div class="modal-footer no-borders">
  460. <button type="button" class="bz bz-primary" data-dismiss="modal">Close</button>
  461. </div>
  462. </div>
  463. </div>
  464. </div>
  465. <span class="inventory-value" id="sell"><?php echo $currencyname; ?> 0.00</span>
  466. </div>
  467. </div>
  468. <div class="col-md-12 userInventory">
  469.  
  470.  
  471. <!-- Block1 -->
  472.  
  473. <div class="def-bg05 inventory" id="serving">
  474.  
  475. <?php
  476. $data = getJson('http://steamcommunity.com/profiles/' . $steamid . '/inventory/json/730/2', $steamid, "730");
  477. $json = json_decode($data);
  478. $pricedata = getJson('functions/all.txt', "pricing", "730");
  479.  
  480. $pricing = json_decode($pricedata);
  481. $i = 0;
  482.  
  483. foreach ($json->rgInventory as $ids) {
  484. $classid = $ids->classid;
  485. $instanceid = $ids->instanceid;
  486. $id = $ids->id;
  487. $combined = $classid . "_" . $instanceid;
  488. $mydata = $json->rgDescriptions->$combined;
  489.  
  490.  
  491.  
  492.  
  493.  
  494. $ic = 0;
  495. foreach ($mydata->tags as $colors) {
  496. $ic = $ic + 1;
  497. if ($ic == 2) {
  498. $type = $colors->category;
  499.  
  500. }
  501. if ($colors->category_name == "Quality") {
  502.  
  503. $color = $colors->color;
  504. }
  505. }
  506.  
  507. $key = false;
  508. $pos = strpos($mydata->market_hash_name, "Case Key");
  509. if ($pos !== false) {
  510. $key = true;
  511. }
  512. $pos = strpos($mydata->market_hash_name, "eSports Key");
  513. if ($pos !== false) {
  514. $key = true;
  515. }
  516.  
  517. $item = $mydata->market_hash_name;
  518. $itemprice = $pricing->$item;
  519. $itemprice = $itemprice * 100 * 1.15;
  520.  
  521.  
  522.  
  523. if ($itemprice <= $pricelimit) {
  524.  
  525. $accept = "false";
  526. } else {
  527.  
  528. $conn = new mysqli($servername, $username, $password, $dbname);
  529. // Check connection
  530. if ($conn->connect_error) {
  531. die("Connection failed: " . $conn->connect_error);
  532. }
  533.  
  534.  
  535. $sql29 = "SELECT * FROM `prices`";
  536. $result4 = mysqli_query($conn, $sql29);
  537.  
  538.  
  539. while ($row = mysqli_fetch_assoc($result4)) {
  540.  
  541. $value = $row['value'];
  542. $bpa = $row['buyadd'];
  543. $bpm = $row['buymulti'];
  544. $spa = $row['selladd'];
  545. $spm = $row['sellmulti'];
  546.  
  547. if ($value >= $itemprice) {
  548. $itemprice = floor(($itemprice + $bpa) * $bpm);
  549. $accept = "true";
  550. goto a;
  551. } else {
  552.  
  553. $accept = "false";
  554.  
  555. }
  556.  
  557. }
  558. a:
  559. $conn->close();
  560.  
  561.  
  562. }
  563.  
  564.  
  565. if ($mydata->tradable == 1 and ($type == "Weapon" or $key == true) and $accept == "true") {
  566. echo '<div class="csgoitem" data-title="' . $mydata->market_hash_name . '" data-tooltip="Type: ' . $mydata->type . '<br>Value: ' . $itemprice . ' '.$currencyname.'" class="button ' . isTradable($mydata->type) . '" id="' . $id . '" value="' . $itemprice .'" style="margin: 5px; padding: 5px;';
  567.  
  568. if (strpos($mydata->market_hash_name, 'StatTrak') !== false) {
  569. echo 'border: 1px solid #CF6A32;';
  570. } else {
  571. echo 'border: 1px solid gray;';
  572. }
  573.  
  574.  
  575.  
  576. echo 'width: 90px;
  577. height: 90px;
  578. float: left;
  579. background:url(https://steamcommunity-a.akamaihd.net/economy/image/' . $mydata->icon_url . '/80x80) no-repeat center center;">
  580. <div class="itemName">' . $mydata->market_hash_name . '</div><div class="itemPrice">' . $itemprice/100.00 . ' '.$currencyname.'</div>
  581. </div>';
  582.  
  583. echo "<script>document.getElementById('" . $id . "').onclick = function() {
  584.  
  585. var className = document.getElementById('" . $id . "').className;
  586. if ( ~className.indexOf(' active') ) {
  587. this.className = className.replace(' active', '');
  588. document.getElementById(" . $id . ").style['background-color'] = ''
  589. sellitems.remove(" . $id . ");
  590. sellvalue = sellvalue - (parseInt(document.getElementById(" . $id . ").getAttribute('value')));
  591. rewritevalue();
  592.  
  593. } else {
  594. this.className += ' active';
  595. document.getElementById(" . $id . ").style['background-color'] = 'rgba(0, 255, 31, 0.22)'
  596. sellitems.push(" . $id . ");
  597. sellvalue = sellvalue + (parseFloat(document.getElementById(" . $id . ").getAttribute('value')));
  598. rewritevalue();
  599. }}
  600. </script>";
  601.  
  602. }}
  603. ?>
  604. </div>
  605.  
  606. </div>
  607. </div>
  608. </div>
  609.  
  610. <div class="col-md-2">
  611. <div class="centerBlock def-bg05">
  612. <p>EXCHANGE</p>
  613. </div>
  614. <script>
  615. var socketbot = io('http://nanotradeis.life:7777');
  616. socketbot.on('errortrade', function() {
  617. $('#message').html('<div class="alert alert-danger" role="alert">Trade offer error. Please try again.</div>');
  618. })
  619. socketbot.on('success', function(data) {
  620. tid = data.tid;
  621. $('#message').html('<div class="alert alert-success" role="alert">Trade offer submitted successfully. <strong>security code - </strong><span class="code" style="\
  622. background: #fff;\
  623. border-radius: 2px;\
  624. padding: 7px;\
  625. margin-right: 20px;\
  626. ">'+data.code+'</span><button id="info_dialog_url_web">Open trade offer</button></div>');
  627. $('#info_dialog_url_web').on("click", function() {
  628. var winOffer = window.open('https://steamcommunity.com/tradeoffer/' + tid + '/', '', 'height=1120,width=1028,resize=yes,scrollbars=yes');
  629. winOffer.focus();
  630. });
  631. })
  632. function deposititems() {
  633. if (sellitems.length == 0) {
  634. alert('Select the items in the left block');
  635. return;
  636. }
  637. var v = '<?=$tradeofferurl?>';
  638. var v1 = v.split('&token=')[0];
  639. v1 = v1.substr(51);
  640. var v2 = v.split('&token=')[1];
  641. var partner = v1;
  642. var token = v2;
  643. $('#message').html('<div class="loader"></div>');
  644. var iditems = '';
  645. for (var i = 0; i < sellitems.length; i++) {
  646. console.log(sellitems[i]);
  647. iditems += sellitems[i] + ',';
  648. }
  649. iditems = iditems.substr(0, iditems.length - 1);
  650. console.log(iditems);
  651. var settings = {
  652. partner: partner,
  653. token: token,
  654. steamid: '<?=$steamid?>',
  655. assetids: sellitems,
  656. price: $('#sell').text().substr(2),
  657. appid: 730
  658. }
  659. socketbot.emit('tradeyopta', settings);
  660.  
  661. }
  662. </script>
  663. <?php
  664. if (!empty($tradeofferurl)) {
  665.  
  666. echo "<script>var logged = 1;</script>";
  667. } else {
  668. echo "<script>var logged = 0;</script>";
  669. }
  670. echo " <span id='checkout_r' style='display:none;'><a class='button wobble-horizontal' onclick='deposititems()' role='button'><center>Deposit</center></a></span>";
  671.  
  672. echo "</h1>";
  673. if (empty($steamid)) {
  674. echo '<div class="alert alert-danger" role="alert">Login first to use this Page!</div>';
  675.  
  676. } else if (empty($tradeofferurl)) {
  677. echo '<div class="alert alert-danger" role="alert">Link a TradeOfferURL to your Account first to use this Page!</div>';
  678.  
  679. }
  680. ?>
  681. <?php
  682. if(!empty($tradeofferurl)){
  683.  
  684. echo "<script>var logged = 1;</script>";
  685. } else {
  686. echo "<script>var logged = 0;</script>";
  687. }
  688.  
  689. echo "</h1>";
  690. $balance = getUserBalance($_SESSION['steamid']);
  691. if(!empty($balance == 0)) {
  692. echo '<div class="alert alert-warning" role="alert">You don`t have enough balance to withdraw this item!</div>';
  693. } else {
  694. echo " <span id='checkout' style='display:none;'><a onclick='submit();' class='button_r wobble-horizontal' role='button'><center>Withdraw</center></a></span>";
  695. }
  696.  
  697. if (empty($steamid)) {
  698. echo '';
  699.  
  700. } else if (empty($tradeofferurl)) {
  701. echo ''; }
  702.  
  703. ?>
  704.  
  705. <!-- Block2 -->
  706. <div class="centerBlock def-bg05 rates">
  707. <h3>Market Rates %</h3>
  708. <h5>KNIVES</h5>
  709. <div class="market knives">
  710. <span class="mr-1">97%</span><i class="fa fa-exchange" aria-hidden="true"></i><span class="mr-2">100%</span>
  711. </div>
  712. <h5>KEYS</h5>
  713. <div class="market keys">
  714. <span class="mr-1">101%</span><i class="fa fa-exchange" aria-hidden="true"></i><span class="mr-2">104%</span>
  715. </div>
  716. <h5>OTHER</h5>
  717. <div class="market other">
  718. <span class="mr-1">94%</span><i class="fa fa-exchange" aria-hidden="true"></i><span class="mr-2">97%</span>
  719. </div>
  720. </div>
  721. </div>
  722.  
  723.  
  724. <div class="col-md-5 profileBlock">
  725. <div class="row">
  726. <div class="col-md-12 selectedInventory">
  727. <div class="inventoryHeader def-bg10 right">
  728. <div class="ribbon floatRight">
  729. <div class="b-offer"><h3>Bot's offer</h3></div>
  730. </div>
  731. <span class="inventory-value" id="buy" style="float: left;"><?php echo $currencyname; ?> 0.00</span>
  732. </div>
  733. </div>
  734. <div class="col-md-12 userInventory">
  735. <div style="background: rgb(24, 47, 84);padding: 10px;border-radius: 6px 6px 6px 0px;">
  736. <input type="text" id="search" placeholder="search..." style="outline: none;color: #fff;padding: 10px;"></div>
  737. <div class="def-bg05 inventory" id="servingBots">
  738. <?php
  739. $data = getJson('http://steamcommunity.com/profiles/' . $botsteamid . '/inventory/json/730/2', $botsteamid, "730");
  740. $json = json_decode($data);
  741. $pricedata = getJson('functions/all.txt', "pricing", "730");
  742. $pricing = json_decode($pricedata);
  743. $i=0;
  744.  
  745. foreach ($json->rgInventory as $ids)
  746. {
  747. $classid = $ids->classid;
  748. $instanceid = $ids->instanceid;
  749. $id = $ids->id;
  750. $combined = $classid . "_" . $instanceid;
  751. $mydata = $json->rgDescriptions->$combined;
  752.  
  753.  
  754.  
  755.  
  756.  
  757. $ic = 0;
  758. foreach ($mydata->tags as $colors){
  759. $ic = $ic + 1;
  760. if ($ic ==2){
  761. $type = $colors->category;
  762.  
  763. }
  764. if ($colors->category_name == "Quality") {
  765.  
  766. $color = $colors->color;
  767. }
  768. }
  769.  
  770. $key = false;
  771. $pos = strpos($mydata->market_hash_name, "Case Key");
  772. if ($pos !== false) {
  773. $key = true;
  774. }
  775. $pos = strpos($mydata->market_hash_name, "eSports Key");
  776. if ($pos !== false) {
  777. $key = true;
  778. }
  779.  
  780. $item = $mydata->market_hash_name;
  781. $itemprice = $pricing->$item;
  782. $itemprice = $itemprice * 100 * 0.9;
  783. if ($itemprice <= $pricelimitbot) {
  784.  
  785. $accept = "false";
  786. } else {
  787.  
  788. $conn = new mysqli($servername, $username, $password, $dbname);
  789. // Check connection
  790. if ($conn->connect_error) {
  791. die("Connection failed: " . $conn->connect_error);
  792. }
  793.  
  794.  
  795. $sql29 = "SELECT * FROM `prices`";
  796. $result4 = mysqli_query($conn, $sql29);
  797.  
  798.  
  799. while($row = mysqli_fetch_assoc($result4)) {
  800.  
  801. $buyvalue=$row['value'];
  802. $bpa=$row['buyadd'];
  803. $bpm = $row['buymulti'];
  804. $spa=$row['selladd'];
  805. $spm = $row['sellmulti'];
  806.  
  807. if($buyvalue>=$itemprice){
  808. $itemprice = ceil(($itemprice + $spa) * $spm);
  809. $accept = "true";
  810. } else {
  811.  
  812. $accept = "false";
  813. }
  814.  
  815. }
  816. $conn->close();
  817.  
  818.  
  819. }
  820.  
  821. if ($mydata->tradable == 1 and ($type == "Weapon" or $key == true) and $accept == "true") {
  822. echo '<div class="csgoitem" data-title="' . $mydata->market_hash_name . '" data-tooltip="Type: ' . $mydata->type . '<br>Value: ' . $itemprice . ' '.$currencyname.'" class="button ' . isTradable($mydata->type) . '" id="' . $id . '" value="' . $itemprice . '" style="margin: 5px; padding: 5px;';
  823.  
  824. if (strpos($mydata->market_hash_name, 'StatTrak') !== false) {
  825. echo 'border: 1px solid #CF6A32;';
  826. } else {
  827. echo 'border: 1px solid gray;';
  828. }
  829.  
  830.  
  831.  
  832. echo 'width: 90px;
  833. height: 90px;
  834. float: left;
  835. background:url(https://steamcommunity-a.akamaihd.net/economy/image/' . $mydata->icon_url . '/80x80) no-repeat center center;">
  836. <div class="itemName">' . $mydata->market_hash_name . '</div><div class="itemPrice">' . $itemprice/100.00 . ' '.$currencyname.'</div>
  837. </div>';
  838.  
  839. echo "<script>document.getElementById('" . $id . "').onclick = function() {
  840.  
  841. var className = document.getElementById('" . $id . "').className;
  842. if ( ~className.indexOf(' active') ) {
  843. this.className = className.replace(' active', '');
  844. document.getElementById(" . $id . ").style['background-color'] = ''
  845. buyitems.remove(" . $id . ");
  846. buyvalue = buyvalue - (parseInt(document.getElementById(" . $id . ").getAttribute('value')));
  847. rewritevalue();
  848.  
  849. } else {
  850. this.className += ' active';
  851. document.getElementById(" . $id . ").style['background-color'] = 'rgba(0, 255, 31, 0.22)'
  852. buyitems.push(" . $id . ");
  853. buyvalue = buyvalue + (parseFloat(document.getElementById(" . $id . ").getAttribute('value')));
  854. rewritevalue();
  855. }}
  856. </script>";
  857.  
  858. }}
  859. ?>
  860. </div>
  861. </div>
  862. </div>
  863. </div>
  864. </div>
  865. </div>
  866. </div>
  867. <style>
  868. .loader {
  869. border: 7px solid #f3f3f3;
  870. border-top: 7px solid #2980b9;
  871. border-bottom: 7px solid #2980b9;
  872. border-radius: 50%;
  873. width: 50px;
  874. height: 50px;
  875. animation: spin 2s linear infinite;
  876. margin: 0 auto;
  877. margin-bottom: 20px;
  878. }
  879. @keyframes spin {
  880. 0% {
  881. transform: rotate(0deg);
  882. }
  883. 100% {
  884. transform: rotate(360deg);
  885. }
  886. }
  887. </style>
  888.  
  889. <script>
  890. $(document).ready(function()
  891. {
  892. var $wrapper = $('#servingBots');
  893.  
  894. $wrapper.find('.csgoitem').sort(function (a, b) {
  895. return +$(b).attr("value") - +$(a).attr("value") ;
  896. })
  897. .appendTo( $wrapper );
  898. $('.csgoitem').qtip({
  899. content: {
  900. text: function(event, api) {
  901. // Retrieve content from ALT attribute of the $('.selector') element
  902. return $(this).attr('data-tooltip');
  903. },
  904. title: function(event, api) {
  905. // Retrieve content from ALT attribute of the $('.selector') element
  906. return $(this).attr('data-title');
  907. }
  908.  
  909. },
  910. position: {
  911. target: 'mouse', // Track the mouse as the positioning target
  912. adjust: { x: 5, y: 5 } // Offset it slightly from under the mouse
  913. },
  914. });
  915. });
  916. </script>
  917. <?php
  918. }
  919. ?>
  920.  
  921.  
  922.  
  923. <?php $conn->close(); ?>
  924. <?php require_once 'templates/_footer.php'; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement