Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require ('steamauth/steamauth.php');
- # You would uncomment the line beneath to make it refresh the data every time the page is loaded
- // unset($_SESSION['steam_uptodate']);
- ?>
- <div id="page-wrap">
- <?php
- error_reporting(0);
- ini_set("display_errors", 0);
- //if we got something through $_POST
- if (isset($_POST['search'])) {//load database connection
- $host = "vweb18.nitrado.net";
- $user = "XXXXXX";
- $password = "XXXXXX";
- $database_name = "ni15790_1sql1";
- $pdo = new PDO("mysql:host=$host;dbname=$database_name", $user, $password, array(
- PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION
- ));
- // Search from MySQL database table
- $search=$_POST['search'];
- $stat=$_POST['stat'];
- $query = $pdo->prepare("SELECT itemname, itemprice, itemupdate, itemstat FROM pricedata WHERE itemname Like ? AND itemstat=? ORDER BY itemprice DESC LIMIT 15");
- $query->bindValue(1, "%$search%", PDO::PARAM_STR);
- $query->bindValue(2, $stat);
- $query->execute();
- // Display search result
- if (!$query->rowCount() == 0) {
- echo $stat;
- echo $search;
- echo "<table class=\"table-fill\">";
- echo "<thead>";
- echo "<tr>";
- echo "<th class=\"text-left\">StatTrak</th>";
- echo "<th class=\"text-left\">Name and wear</th>";
- echo "<th class=\"text-left\">Price</th>";
- echo "<th class=\"text-left\">Update</th>";
- echo "</tr>";
- echo "</thead>";
- while ($results = $query->fetch()) {
- echo "<tbody class=\"table-hover\">";
- echo "<tr><td align=\"right\">";
- echo $results['itemstat'];
- echo "</td><td align=\"left\">";
- echo $results['itemname'];
- echo "</td><td align=\"center\">";
- echo $results['itemprice'];
- echo "</td><td align=\"center\">";
- echo $results['itemupdate'];
- echo "</td></tr>";
- }
- echo "</tbody>";
- echo "</table>";
- } else {
- echo $stat;
- echo $search;
- echo 'Nothing found';
- }
- }
- if(isset($_SESSION['steamid'])) {
- include ('steamauth/userInfo.php');
- echo "<div class=\"rightbar\">";
- echo '<h2>'.$steamprofile['personaname'].'</h2>';
- echo '<center><a href="'.$steamprofile['profileurl'].'"><img id="profile" src="'.$steamprofile['avatarfull'].'" alt="profilepicture"></img></a></center>';
- echo '<br>';
- echo '<center>';
- logoutbutton();
- echo '<br><br><br>';
- echo 'Changelog';
- echo '<div id="news">';
- include 'changelog.php';
- echo '</div>';
- echo '</center>';
- echo "</div>";
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement