Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $profpic = "bg.jpg";
- ?>
- <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>
- </head>
- <?php
- $moziid = $_POST["id"];
- $mozinev = $_POST["nev"];
- $varos = $_POST["city"];
- $utca = $_POST["street"];
- $hazszam = $_POST["number"];
- $uname = $_POST["uname"];
- $pass = $_POST["pass"];
- $felh = "kibfc6";
- $jelszo = "eashobev";
- try
- {
- $dbh = new PDO('mysql:host=localhost;dbname=kibfc6', $felh, $jelszo);
- $sql= "SELECT mozi_id FROM mozi WHERE mozi_id='".$moziid."'";
- $result = $dbh->query($sql);
- $num=$result->rowCount();
- if($num==1)
- {
- if ($mozinev == "")
- {
- $sql2 = "SELECT mozi_id, mozi_nev from mozi";
- $sth = $dbh->query($sql2);
- $sth->setFetchMode(PDO::FETCH_OBJ);
- while($row = $sth->fetch())
- {
- if ($row->mozi_id == $moziid) $mozinev = $row->mozi_nev;
- }
- }
- if ($varos == "")
- {
- $sql2 = "SELECT mozi_id, varos from mozi";
- $sth = $dbh->query($sql2);
- $sth->setFetchMode(PDO::FETCH_OBJ);
- while($row = $sth->fetch())
- {
- if ($row->mozi_id == $moziid) $varos = $row->varos;
- }
- }
- if ($utca == "")
- {
- $sql2 = "SELECT mozi_id, utca from mozi";
- $sth = $dbh->query($sql2);
- $sth->setFetchMode(PDO::FETCH_OBJ);
- while($row = $sth->fetch())
- {
- if ($row->mozi_id == $moziid) $utca = $row->utca;
- }
- }
- if ($hazszam == "")
- {
- $sql2 = "SELECT mozi_id, hazszam from mozi";
- $sth = $dbh->query($sql2);
- $sth->setFetchMode(PDO::FETCH_OBJ);
- while($row = $sth->fetch())
- {
- if ($row->mozi_id == $moziid) $hazszam = $row->hazszam;
- }
- }
- $sth = $dbh->prepare("UPDATE mozi SET mozi_nev = '".$mozinev."', varos = '".$varos."', utca = '".$utca."', hazszam = '".$hazszam."' WHERE mozi_id = '".$moziid."'");
- $sth->execute();
- sikeres($uname, $pass);
- }
- else
- {
- nincsIlyen($uname, $pass);
- }
- }
- catch (PDOException $e)
- {
- print "Hiba!: " . $e->getMessage() . "<br/>";
- die();
- }
- function sikeres($uname, $pass)
- {
- $username = $uname;
- $password = $pass;
- echo '<br></br>';
- echo '<p style="color: yellow; text-align: center"> Mozi adatai sikeresen módosítva </p>';
- echo "<html>";
- echo '<form method="POST" action="mozi_modosit.php">
- <input type="hidden" name="uname" value='.$username.'>
- <input type="hidden" name="pass" value='.$password.'>
- <input style="background: yellow; border: none;" type="submit" value="Vissza">
- </form>;';
- echo "</html>";
- }
- function nincsIlyen($uname, $pass)
- {
- $username = $uname;
- $password = $pass;
- echo '<br></br>';
- echo '<p style="color: yellow; text-align: center"> Nincs ilyen mozi, amit módosítani szeretne </p>';
- echo "<html>";
- echo '<form method="POST" action="mozi_modosit.php">
- <input type="hidden" name="uname" value='.$username.'>
- <input type="hidden" name="pass" value='.$password.'>
- <input style="background: yellow; border: none;" type="submit" value="Vissza">
- </form>;';
- echo "</html>";
- }
- $dbh = null;
- ?>
Add Comment
Please, Sign In to add comment