Advertisement
Sparkster

Untitled

Jul 24th, 2013
319
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.15 KB | None | 0 0
  1. <?php
  2.  
  3. $pdo = new PDO("mysql:host=localhost;dbname=_fantapc", '_fpcroot', '');
  4.  
  5. $query = $pdo->prepare("SELECT * FROM cards WHERE id=:id");
  6. $query->bindValue(":id", $_GET['card_id'], PDO::PARAM_INT);
  7. $query->execute();
  8. $row = $query->fetch();
  9.  
  10. $query = $pdo->prepare("INSERT INTO prices(te_value,pot_value,luna_value, user_id, card_id) VALUES (:te_value,:pot_value,:luna_value,:user_id,:card_id)");
  11. $query->bindValue(":te_value", $te, PDO::PARAM_INT);
  12. $query->bindValue(":pot_value", $pot, PDO::PARAM_INT);
  13. $query->bindValue(":luna_value", $luna, PDO::PARAM_INT);
  14. $query->bindValue(":user_id", $row2['id'], PDO::PARAM_INT);
  15. $query->bindValue(":card_id", $_GET['card_id'], PDO::PARAM_INT);
  16. $query->execute();
  17.  
  18. $query = $pdo->prepare("SELECT * FROM users WHERE username=:username");
  19. $query->bindValue(":username", $_SESSION['username'], PDO::PARAM_STR);
  20. $query->execute();
  21. $row2 = $query->fetch();
  22.  
  23.  
  24. echo "<h1>" . "<img src={$row['img_avatar']} />" . $row['name'] . "</h1>";
  25.  
  26. ?>
  27.  
  28. <table class="table table-striped">
  29.     <tr>
  30.         <td></td><td><strong>TE Value</strong></td><td><strong>Pot Value</strong></td><td><strong>Luna Value</strong></td>
  31.     </tr>
  32.         <tbody>
  33.         <tr><td><strong>Min</strong></td><td><? echo $row['te_value']; ?></td><td><? echo $row['pot_value']; ?></td><td><? echo $row['luna_value']; ?></td></tr>
  34.         <tr><td><strong>Average</strong></td><td><? echo $row['te_value']; ?></td><td><? echo $row['pot_value']; ?></td><td><? echo $row['luna_value']; ?></td></tr>
  35.         <tr><td><strong>Max</strong></td><td><? echo $row['te_value']; ?></td><td><? echo $row['pot_value']; ?></td><td><? echo $row['luna_value']; ?></td></tr>
  36.  
  37. </tbody>
  38. </table>
  39. <br />
  40.  
  41. <?php
  42.  
  43. if(isset($_POST['formsub'])) {
  44.     $te = $_POST['te_value'];
  45.     $pot = $_POST['pot_value'];
  46.     $luna = $_POST['luna_value'];
  47. }
  48.  
  49.  
  50. echo "<form action='index.php?page=card_details&card_id={$_GET['card_id']}' method='post'>";
  51.  
  52. ?>
  53.  
  54.     te value: <input type="text" name="username"><br>
  55.     pot value: <input type="password" name="password"><br>
  56.     luna value: <input type="text" name="email"><br>
  57.     <input type="hidden" name="formsub" value="1">
  58.     <input type="submit">
  59.     </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement