Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $profpic = "bg.jpg";
- ?>
- <html>
- <head>
- <link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
- <style type="text/css">
- body
- {
- background-image:url('<?php echo $profpic ?>');
- }
- </style>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>Cinema</title>
- <br><br>
- <p style="color: yellow; text-align: center"> Kérem adja meg mennyi összeget akar feltölteni, melyik vendég számlájára? </p>
- <table width=350 align=center border=1 cellspacing=0>
- <tr>
- <td align=center> <p style="color: white; text-align: center">Vendeg ID </p> </td>
- <td align=center> <p style="color: white; text-align: center">E-mail cím </p> </td>
- <td align=center> <p style="color: white; text-align: center">Pénz </p> </td>
- </tr>
- <?php
- $felh = "kibfc6";
- $jelszo = "eashobev";
- $uname = $_POST["uname"];
- $pass = $_POST["pass"];
- try
- {
- $dbh = new PDO('mysql:host=localhost;dbname=kibfc6', $felh, $jelszo);
- $sql="SELECT * FROM vendeg";
- $result = $dbh->query($sql);
- $num = $result->rowCount();
- # echo '<p style="color: yellow; text-align: center"> '.$num.' </p>';
- if ($num > 0)
- {
- $sth = $dbh->query('SELECT * FROM vendeg');
- $sth->setFetchMode(PDO::FETCH_OBJ);
- while($row = $sth->fetch())
- {
- echo '<tr>';
- echo '<td align=center><p style="color: yellow; text-align: center"> '.$row->vendeg_id.' </p></td>';
- echo '<td align=center><p style="color: yellow; text-align: center"> '.$row->vendeg_email.' </p></td>';
- if ($row->penz == NULL)
- {
- echo '<td align=center><p style="color: yellow; text-align: center"> 0 Ft </p></td>';
- }
- else
- {
- echo '<td align=center><p style="color: yellow; text-align: center"> '.$row->penz.' Ft </p></td>';
- }
- echo '</tr>';
- }
- }
- else
- {
- hibas();
- }
- }
- catch (PDOException $e)
- {
- print "Hiba!: " . $e->getMessage() . "<br/>";
- die();
- }
- function hibas()
- {
- $username = $uname;
- $password = $pass;
- echo '<br></br>';
- echo '<p style="color: yellow; text-align: center"> Nincs vendeg az adatbázisban </p>';
- echo "<html>";
- echo '<table width=50 align=center border=0 cellspacing=0>';
- echo '<form method="POST" action="admin.php" style="text-align: center">
- <input type="hidden" name="uname" value='.$username.'>
- <input type="hidden" name="pass" value='.$password.'>
- <input style="background: yellow; border: none;" text-align="center" type="submit" value="Vissza">
- </form>';
- echo '</table>';
- echo "</html>";
- }
- $dbh = null;
- ?>
- <table width=350 align=center border=1 cellspacing=1>
- <tr>
- <td align=center>
- <form method="POST" action="ujpenzosszeg.php" style="text-align: center">
- <p style="color: yellow; text-align: center"> Vendeg ID </p>
- <input type="number" name="id" required>
- <p style="color: yellow; text-align: center"> Pénz összeg </p>
- <input type="number" name="penz" required>
- <br><br>
- <input type="hidden" name="uname" value=<?php echo ''.$uname.''?>>
- <input type="hidden" name="pass" value=<?php echo ''.$pass.''?>>
- <input style="background: yellow; border: none;" text-align="center" type="submit" value="Hozzáad">
- </form>
- <form method="POST" action="admin.php" style="text-align: center">
- <input type="hidden" name="uname" value=<?php echo ''.$uname.''?>>
- <input type="hidden" name="pass" value=<?php echo ''.$pass.''?>>
- <input style="background: yellow; border: none;" text-align="center" type="submit" value="Mégse">
- </form>
- </td>
- </tr>
- </table>
- </head>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement