Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $pdo = new PDO("mysql:host=localhost;dbname=_fantapc", '_fpcroot', '');
- $query = $pdo->prepare("SELECT * FROM cards WHERE id=:id");
- $query->bindValue(":id", $_GET['card_id'], PDO::PARAM_INT);
- $query->execute();
- $card = $query->fetch();
- $query = $pdo->prepare("SELECT * FROM users WHERE username=:username");
- $query->bindValue(":username", $_SESSION['username'], PDO::PARAM_STR);
- $query->execute();
- $user = $query->fetch();
- $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)");
- $query->bindValue(":te_value", $te, PDO::PARAM_INT);
- $query->bindValue(":pot_value", $pot, PDO::PARAM_INT);
- $query->bindValue(":luna_value", $luna, PDO::PARAM_INT);
- $query->bindValue(":user_id", $user['id'], PDO::PARAM_INT);
- $query->bindValue(":card_id", $_GET['card_id'], PDO::PARAM_INT);
- $query->execute();
- if(isset($_POST['formsub'])) {
- $te = $_POST['te_value'];
- $pot = $_POST['pot_value'];
- $luna = $_POST['luna_value'];
- }
- echo "<h1>" . "<img src={$card['img_avatar']} />" . $card['name'] . "</h1>";
- ?>
- <table class="table table-striped">
- <tr>
- <td></td><td><strong>TE Value</strong></td><td><strong>Pot Value</strong></td><td><strong>Luna Value</strong></td>
- </tr>
- <tbody>
- <tr><td><strong>Min</strong></td><td><? echo $card['te_value']; ?></td><td><? echo $card['pot_value']; ?></td><td><? echo $card['luna_value']; ?></td></tr>
- <tr><td><strong>Average</strong></td><td><? echo $card['te_value']; ?></td><td><? echo $card['pot_value']; ?></td><td><? echo $card['luna_value']; ?></td></tr>
- <tr><td><strong>Max</strong></td><td><? echo $card['te_value']; ?></td><td><? echo $card['pot_value']; ?></td><td><? echo $card['luna_value']; ?></td></tr>
- </tbody>
- </table>
- <br />
- <?php
- echo "<form action='index.php?page=card_details&card_id={$_GET['card_id']}' method='post'>";
- ?>
- te value: <input type="text" name="te_value"><br>
- pot value: <input type="password" name="por_value"><br>
- luna value: <input type="text" name="luna_value"><br>
- <input type="hidden" name="formsub" value="1">
- <input type="submit">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement