-
Notifications
You must be signed in to change notification settings - Fork 1
/
activate_jet_details_form_handler.php
69 lines (67 loc) · 1.54 KB
/
activate_jet_details_form_handler.php
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<?php
session_start();
?>
<html>
<head>
<title>Activate Aircraft</title>
</head>
<body>
<?php
if(isset($_POST['Activate']))
{
$data_missing=array();
if(empty($_POST['jet_id']))
{
$data_missing[]='Jet ID';
}
else
{
$jet_id=trim($_POST['jet_id']);
}
if(empty($data_missing))
{
require_once('Database Connection file/mysqli_connect.php');
// $query="UPDATE jet_details SET active='Yes' WHERE jet_id=?";
$query="UPDATE jet_details SET active='Yes' WHERE jet_id='{$jet_id}'";
// $stmt=mysqli_prepare($dbc,$query);
// mysqli_stmt_bind_param($stmt,"s",$jet_id);
// mysqli_stmt_execute($stmt);
// $affected_rows=mysqli_stmt_affected_rows($stmt);
$affected_rows=mysqli_query($dbc,$query);
//echo $affected_rows."<br>";
// mysqli_stmt_bind_result($stmt,$cnt);
// mysqli_stmt_fetch($stmt);
// echo $cnt;
/*
$response=@mysqli_query($dbc,$query);
*/
if($affected_rows==1)
{
echo "Successfully Activated";
header("location: activate_jet_details.php?msg=success");
}
else
{
echo "Submit Error";
echo ($affected_rows);
echo mysqli_error($dbc);
// header("location: activate_jet_details.php?msg=failed");
}
}
else
{
echo "The following data fields were empty! <br>";
foreach($data_missing as $missing)
{
echo $missing ."<br>";
}
}
}
else
{
echo "Activate request not received";
}
mysqli_close($dbc);
?>
</body>
</html>