-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathedit_airport_func.php
More file actions
35 lines (34 loc) · 881 Bytes
/
edit_airport_func.php
File metadata and controls
35 lines (34 loc) · 881 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php require_once('check_exist.php'); ?>
<?
session_save_path("./session/");
session_start();
if(isset($_SESSION['isAuth']) && $_SESSION['isAdmin'])
{
$id = $_POST['id'];
$name = $_POST['name'];
$country = $_POST['country'];
$longitude = $_POST['longitude'];
$latitude = $_POST['latitude'];
$timezone = $_POST['timezone'];
require_once('db.php');
$sql = "SELECT * FROM Airport WHERE id = ? ";
$sth = $db->prepare($sql);
$sth->execute(array($id));
if($airport = $sth->fetchObject())
{
$sql = "UPDATE Airport SET name = ?,"
." country = ?,"
." longitude = ?,"
." latitude = ?,"
." timezone = ?"
." WHERE id = ?";
$sth = $db->prepare($sql);
$sth->execute(array($name, $country, $longitude, $latitude, $timezone, $id));
header('Location: airport_management.php');
}
else
{
echo "hardly error";
}
}
?>