-
Notifications
You must be signed in to change notification settings - Fork 2
/
travel_val.php
51 lines (50 loc) · 1.52 KB
/
travel_val.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
<html>
<body>
<link rel="stylesheet" type="text/css" href="innerstyle.css">
<center> <img class="image" src="logo1.jpg" height=200 width=200 style="border-radius:100px; transform:scale(0.7);" > </center>
<h1>SHARECARE SOLUTIONS INDIA</h1>
<hr>
<center><font size= "6"><b><span> REQUEST DETAILS </span></font size></b></center>
<hr>
</body>
</html>
<?php
include "connection.php";
if(empty($_SESSION))
{
session_start();
if(!isset($_SESSION['username']))
header("location:login.php");
}
else if(!isset($_SESSION['username']))
{
header("location:login.php");
exit;
}
if(isset($_POST['plan']))
{
$des=$_POST['des'];
$dat=$_POST['dat'];
$en=$_SESSION['userid'];
$check="SELECT ENROLLMENT,DESTINATION, DATE FROM TRAVEL WHERE DESTINATION='$des' AND ENROLLMENT='$en' AND DATE='$dat'";
$check1=mysqli_query($con,$check);
if(mysqli_num_rows($check1)>0)
{
echo "<b><center>YOU HAVE ALREADY MENTIONED THIS PLAN</b></center>";
}
else
{
$quer="INSERT INTO TRAVEL VALUES ('$en','$des','$dat')";
$s=mysqli_query($con,$quer);
if(!$s)
echo "<b><center>AN ERROR OCCURED <br> PLEASE TRY AGAIN <br>WE REGRET THE INCONVENIENCE CAUSED</b></center>";
else
{
echo "<b><center>TRIP SUCCESSFULLY PLANNED FOR ".$en."</b></center>";
echo "<b><center>ON ".$dat."</b></center>";
echo"<center><b>PLEASE WAIT FOR THE CONFIRMATION FROM OTHER SIDE</b></center>";
}
}
}
echo "<p><center> <a href='login_home.php'><input type='button' class='but' value='back'></a></center></p>";
?>