Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $dbHost = 'localhost';
- $dbUsername = 'root';
- $dbPassword = '';
- $dbName = 'mydb';
- //Create connection and select DB
- $db = new mysqli($dbHost, $dbUsername, $dbPassword, $dbName);
- $db->set_charset("utf8");
- $jaratszam = $_GET['JaratSzam'];
- $jaratszam = "%".$jaratszam."%";
- $stmt = $db->prepare("select * from Jarat where JaratSzam LIKE ?");
- $stmt->bind_param('s',$jaratszam);
- $stmt->execute();
- $result = $stmt->get_result();
- if (isset($_GET['frissites'])) //Ha megnyomták a frissités gombot
- {
- //Adatok kinyerése a formokból
- $geptipus = $_GET['geptipus'];
- $uj_jaratszam = $_GET['jaratszam'];
- $indulashely = $_GET['indulashely'];
- $erkezeshely = $_GET['erkezeshely'];
- $indulasido = $_GET['indulasido'];
- $erkezesido = $_GET['erkezesido'];
- $legitarsasag = $_GET['legitarsasag'];
- //Adatbázisba felvitel
- $stmt = $db->prepare("Update Jarat set Geptipus=? , JaratSzam=?, IndulasHely=?, IndulasIdo=?, ErkezesHely=?, ErkezesIdo=?, Legitarsasag_ID=? where JaratSzam LIKE ?");
- $stmt->bind_param('ssssssis',$geptipus,$uj_jaratszam,$indulashely,$erkezeshely,$indulasido,$erkezesido,$legitarsasag,$jaratszam);
- $stmt->execute();
- }
- ?>
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta charset="UTF-8">
- <link rel="stylesheet" href="css/style.css" type="text/css">
- </head>
- <body>
- <div id="header">
- <div>
- <div class="logo">
- <a href="index.php"></a>
- </div>
- <ul id="navigation">
- <li>
- <a href="index.php">Home</a>
- </li>
- <li class="active">
- <a href="features.php">Search/Update</a>
- </li>
- <li>
- <a href="news.php">Browse</a>
- </li>
- <li>
- <a href="about.php">New line</a>
- </li>
- </ul>
- </div>
- </div>
- <div id="contents">
- <div class="clearfix">
- <style>
- label{display:inline-block;width:100px;margin-bottom:20px;}
- </style>
- <?php $row=$result->fetch_array(MYSQLI_ASSOC)?>
- <h1>Please provide new data for the airline</h1>
- <form method="get" action="updatefeatures.php">
- <label>Aircraft type </label>
- <input type="text" name="geptipus" value= "<?php echo $row['Geptipus']; ?>"/>
- <br />
- <label>Line number </label>
- <input type="text" name="jaratszam" value= "<?php echo $row['JaratSzam']; ?>" />
- <br />
- <label>Airport </label>
- <input type="text" name="indulashely" value ="<?php echo $row['IndulasHely']; ?>" />
- <br />
- <label>Destination </label>
- <input type="text" name="erkezeshely" value="<?php echo $row['ErkezesHely']; ?>" />
- <br />
- <label>Departure </label>
- <input type="text" name="indulasido" value="<?php echo $row['IndulasIdo']; ?>" />
- <br />
- <label>Time of arrival </label>
- <input type="text" name="erkezesido" value ="<?php echo $row['ErkezesIdo']; ?>" />
- <br />
- <label>Airline ID</label>
- <input type="text" name="legitarsasag" value="<?php echo $row['Legitarsasag_ID']; ?>" />
- <br />
- </table>
- <br />
- <input type="submit" name='frissites' value="Submit new line" >
- </form>
- </div>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement