This repository has been archived by the owner on Oct 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
/
acco-travel-form-continue.php
68 lines (58 loc) · 2.28 KB
/
acco-travel-form-continue.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
<?php
session_start();
if ($_SESSION["email"] == "" || empty($_POST['button'])) {
header('Location:acco-travel-form.php');
}
include 'connection.php';
$email=$_SESSION['email'];
$arrDate=$_POST['arrDate'];
$arrTime=$_POST['arrTime'];
$arrSt=$_POST['arrSt'];
$trainName=$_POST['trainName'];
$trainNo=$_POST['trainNo'];
$accNo=$_POST['accNo'];
$secPhone=$_POST['secPhone'];
$iscab=$_POST['iscab'];
$cabWhere=$_POST['cabWhere'];
$cabWhen=$_POST['cabWhen'];
$cabDate=$_POST['cabDate'];
$cabPpl=$_POST['cabPpl']; //To be added in database column
$depDate=$_POST['depDate'];
$depTime=$_POST['depTime'];
$depSt=$_POST['depSt'];
$dtrainName=$_POST['dtrainName'];
$dtrainNo=$_POST['dtrainNo'];
$iscab2=$_POST['iscab2'];
$acabPref=$_POST['acabPref'];
$dcabPref=$_POST['dcabPref'];
$accNo2=$_POST['accNo2'];
$accName1=$_POST['accName1'];
$accRel1=$_POST['accRel1'];
$accAge1=$_POST['accAge1'];
$accName2=$_POST['accName2'];
$accRel2=$_POST['accRel2'];
$accAge2=$_POST['accAge2'];
$accName3=$_POST['accName3'];
$accRel3=$_POST['accRel3'];
$accAge3=$_POST['accAge3'];
$prefName=$_POST['prefName'];
$prefYear=$_POST['prefYear'];
$prefDep=$_POST['prefDep'];
$prefHall=$_POST['prefHall'];
$query1="INSERT INTO travel set email='$email', arrivaldate='$arrDate', arrivalstation='$arrSt', trainname='$trainName', trainno='$trainNo', accompanyno='$accNo',
secondaryphone='$secPhone' , cabreq='$iscab', cabfrom='$cabWhere', cabat='$cabWhen',arrivaltime='$arrTime' , cabdate='$cabDate' , arrivalcabpref='$acabPref' , departdate='$depDate' ,
departtime='$depTime' , departtrain='$dtrainName' , departtrainno='$dtrainNo' , departstation='$depSt' , depcabreq='$iscab2' , depcabpref='$dcabPref', cabpeople='$cabPpl' ";
$result1=$connection->query($query1);
$query2="INSERT INTO accommodation SET email='$email', accompanyno='$accNo2', accname1='$accName1', accrel1='$accRel1', accage1='$accAge1', accname2='$accName2',
accrel2='$accRel2', accage2='$accAge2', accname3='$accName3', accrel3='$accRel3', accage3='$accAge3', prefname='$prefName', prefyear='$prefYear', prefdep='$prefDep',
prefhall='$prefHall' ";
$result2=$connection->query($query2);
if($result1!=FALSE && $result2!=FALSE) {
$_SESSION['form_submit']=TRUE;
header('Location:welcome.php');
}
else {
$_SESSION['form_submit']='fail';
header('Location:acco-travel-form.php');
}
?>