/WebInterface/index.php

https://github.com/silverwolf897/WebInterface · PHP · 99 lines · 93 code · 6 blank · 0 comment · 6 complexity · 403a3a463bf207b7d7fd54418a91d225 MD5 · raw file

  1. <?php
  2. session_start();
  3. if (!isset($_SESSION['User'])){
  4. header("Location: login.php");
  5. }
  6. $user = $_SESSION['User'];
  7. require 'scripts/config.php';
  8. require 'scripts/itemInfo.php';
  9. require 'scripts/updateTables.php';
  10. $isAdmin = $_SESSION['Admin'];
  11. $canBuy = $_SESSION['canBuy'];
  12. $queryAuctions=mysql_query("SELECT * FROM WA_Auctions");
  13. if ($useMySQLiConomy){
  14. $queryiConomy=mysql_query("SELECT * FROM $iConTableName WHERE username='$user'");
  15. $iConRow = mysql_fetch_row($queryiConomy);
  16. }
  17. $playerQuery = mysql_query("SELECT * FROM WA_Players WHERE name='$user'");
  18. $playerRow = mysql_fetch_row($playerQuery);
  19. $mailQuery = mysql_query("SELECT * FROM WA_Mail WHERE player='$user'");
  20. $mailCount = mysql_num_rows($mailQuery);
  21. ?>
  22. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
  23. <html>
  24. <head>
  25. <meta http-equiv="content-type" content="text/html; charset=utf-8" />
  26. <link rel="shortcut icon" type="image/ico" href="http://www.datatables.net/media/images/favicon.ico" />
  27. <title>WebAuction</title>
  28. <style type="text/css" title="currentStyle">
  29. @import "css/table_jui.css";
  30. @import "css/<?php echo $uiPack?>/jquery-ui-1.8.16.custom.css";
  31. </style>
  32. <link rel="stylesheet" type="text/css" href="css/<?php echo $cssFile?>.css" />
  33. <script type="text/javascript" language="javascript" src="js/jquery.js"></script>
  34. <script type="text/javascript" language="javascript" src="js/jquery.dataTables.js"></script>
  35. <script type="text/javascript" language="javascript" src="js/inputfunc.js"></script>
  36. <script type="text/javascript" charset="utf-8">
  37. $(document).ready(function() {
  38. oTable = $('#example').dataTable({
  39. "bProcessing": true,
  40. "bJQueryUI": true,
  41. "bStateSave": true,
  42. "sPaginationType": "full_numbers",
  43. "sAjaxSource": "scripts/server_processing.php"
  44. });
  45. } );
  46. </script>
  47. </head>
  48. <div id="holder">
  49. <?php include("topBoxes.php"); ?>
  50. <h1>Web Auction</h1>
  51. <br/>
  52. <h2>Current Auctions</h2>
  53. <p style="color:red"><?php
  54. if(isset($_SESSION['error']))
  55. {
  56. echo $_SESSION['error'];
  57. unset($_SESSION['error']);
  58. }
  59. ?></p><p style="color:green"><?php
  60. if(isset($_SESSION['success']))
  61. {
  62. echo $_SESSION['success'];
  63. unset($_SESSION['success']);
  64. }
  65. ?></p>
  66. <div class="demo_jui">
  67. <table cellpadding="0" cellspacing="0" border="0" class="display" id="example">
  68. <thead>
  69. <tr>
  70. <th>Item</th>
  71. <th>Seller</th>
  72. <th>Quantity</th>
  73. <th>Price (Each)</th>
  74. <th>Price (Total)</th>
  75. <th>% of Market Price</th>
  76. <th>Buy (leave blank to buy all)</th>
  77. <?php if ($isAdmin == true){ ?>
  78. <th>Cancel</th>
  79. <?php } ?>
  80. </tr>
  81. </thead>
  82. <tbody>
  83. <tr>
  84. <td colspan="5" class="dataTables_empty">Loading data from server</td>
  85. </tr>
  86. </tbody>
  87. </table>
  88. </div>
  89. <div class="spacer"></div>
  90. <?php include("footer.php"); ?>
  91. </div>
  92. </body>
  93. </html>