PHP game server for TerranQuest. https://terranquest.net

shopitems.php 418B

123456789101112131415161718192021
  1. <?php
  2. require 'required.php';
  3. $shop = $database->select('shopitems', '*');
  4. $coins = $database->select('shopcoins', '*');
  5. if ($_SESSION['loggedin']) {
  6. $balance = $database->select('players', ['credits'], ['uuid' => $_SESSION['uuid']])[0]['credits'];
  7. } else {
  8. $balance = null;
  9. }
  10. $out = [
  11. "status" => "OK",
  12. "items" => $shop,
  13. "coins" => $coins,
  14. "balance" => $balance
  15. ];
  16. echo json_encode($out);