-
Notifications
You must be signed in to change notification settings - Fork 4
/
home_jquery_date.php
176 lines (164 loc) · 8.08 KB
/
home_jquery_date.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
session_start();
?>
<html>
<Title>Homepage</title>
<head>
<link rel="stylesheet" href="Front with CSS.css">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://code.getmdl.io/1.3.0/material.teal-orange.min.css" />
<script src="https://storage.googleapis.com/code.getmdl.io/1.0.6/material.min.js"></script>
<script src="gen_validatorv4.js" type="text/javascript"></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<script src="https://code.jquery.com/jquery-1.12.4.js"></script>
<script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script>
<script>//mindate=0, dateFormat: "dd-mm-yy",
$(document).ready(function () {
var d = new Date();
var monthNames = ["January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December"];
today = monthNames[d.getMonth()] + ' ' + d.getDate() + ' ' + d.getFullYear();
$('#to').attr('disabled', 'disabled');
$('#from').datepicker({
defaultDate: "+1d",
minDate: 0,
maxDate: "+3M",
dateFormat: 'dd-mm-yy',
showOtherMonths: true,
changeMonth: true,
selectOtherMonths: true,
required: true,
showOn: "focus",
numberOfMonths: 1,
});
$('#from').change(function () {
var from = $('#from').datepicker('getDate');
var date_diff = Math.ceil((from.getTime() - Date.parse(today)) / 86400000);
var maxDate_d = date_diff+3+'m';
date_diff = date_diff + 'd';
$('#to').val('').removeAttr('disabled').removeClass('hasDatepicker').datepicker({
dateFormat: 'dd-mm-yy',
minDate: date_diff,
maxDate: maxDate_d
});
});
$('#to').keyup(function () {
$(this).val('');
alert('Please select date from Calendar');
});
$('#from').keyup(function () {
$('#from,#to').val('');
$('#to').attr('disabled', 'disabled');
alert('Please select date from Calendar');
});
});
</script>
</head>
<body background="airplane.jpg">
<div class="mdl-layout mdl-js-layout mdl-layout--fixed-header">
<header class="mdl-layout__header">
<div class="mdl-layout__header-row">
<!-- Title -->
<span class="mdl-layout-title">Home</span>
<!-- Add spacer, to align navigation to the right -->
<div class="mdl-layout-spacer"></div>
<!-- Navigation. We hide it in small screens. -->
<nav class="mdl-navigation mdl-layout--large-screen-only">
<a class="mdl-navigation__link" href="home.php">Home</a>
<a class="mdl-navigation__link" href="form.php">Signup</a>
<a class="mdl-navigation__link" href="front.php">Login</a>
<a class="mdl-navigation__link" href="Aboutus.php">About Us</a>
<a class="mdl-navigation__link" href="Admin_login.php">Administrators</a>
</nav>
</div>
</header>
<div class="mdl-layout__drawer">
<span class="mdl-layout-title">Home</span>
<nav class="mdl-navigation">
<a class="mdl-navigation__link" href="home.php">Home</a>
<a class="mdl-navigation__link" href="form.php">Signup</a>
<a class="mdl-navigation__link" href="front.php">Login</a>
<a class="mdl-navigation__link" href="Aboutus.php">About Us</a>
<a class="mdl-navigation__link" href="Admin_login.php">Administrators</a>
</nav>
</div>
<main class="mdl-layout__content">
<div class="page-content">
<!-- Your content goes here -->
<!--ul>
<li><a href="">Home</a></li>
<li><a href="front.html">Login</a></li>
<li><a href="form.html">Sign Up</a></li>
<li><a href="">Contact Us</a></li>
</ul-->
<div align="right">
<div class="demo-card-wide mdl-card mdl-shadow--16dp" style="text-align:center;width:350px;padding:1em 0;height:50px" > <iframe src="https://www.zeitverschiebung.net/clock-widget-iframe-v2?language=en&timezone=Asia%2FKolkata" width="100%" height="150" frameborder="0" seamless></iframe></div>
</div><br><br>
<center>
<div class="demo-card-wide mdl-card mdl-shadow--16dp">
<div class="mdl-shadow--16dp" style="background-color:#000000">
<br>
<div class="mdl-typography--title" style="color:#ffffff">Search for Flights:</div>
<br>
</div>
<hr>
<form action="searchresultsmodified.php" method="POST" id="search">
<br>
<div>
<div class="mdl-typography--subtitle" for="Source">Journey Date:</div>
<input type="text" id="from" name="journey_date" required>
</div>
<div>
<div class="mdl-typography--subtitle" for="Source">Return Date</div>
<input type="text" id="to" name="return_date" required>
</div>
<Br>
<br>
<div class="mdl-typography--subtitle">
Where are you flying to ?
</div>
<br>
<br>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<select class="mdl-textfield__input" id="Source" name="Source" required>
<option value=000><i>Origin City</i></option>
<option value="Delhi">Delhi</option>
<option value="Mumbai">Mumbai</option>
<option value="Chennai">Chennai</option>
<option value="Kolkatta">Kolkatta</option>
<option value="Bangalore">Bangalore</option>
</select>
<label class="mdl-textfield__label" for="Source">Source</label>
</div>
<div class="mdl-textfield mdl-js-textfield mdl-textfield--floating-label">
<select class="mdl-textfield__input" id="Destination" name="Destination" required>
<option value=000><i>Lets Discover Places</i></option>
<option value="Delhi">Delhi</option>
<option value="Mumbai">Mumbai</option>
<option value="Chennai">Chennai</option>
<option value="Kolkatta">Kolkatta</option>
<option value="Bangalore">Bangalore</option>
</select>
<label class="mdl-textfield__label" for="Destination">Destination</label>
</div>
<br>
<br>
<div class="mdl-shadow--16dp" style="background-color:#000000"><br>
<button class="mdl-button mdl-js-button mdl-button--raised mdl-js-ripple-effect mdl-button--accent">
<div class="mdl-typography--subtitle" style="color:black;font-weight:bolder" name="Search">Search for Flights</div>
</button>
<br><br>
</div>
</div>
</form>
<script type="text/javascript">
var frmvalidator = new Validator("search");
frmvalidator.addValidation("Source","dontselect=000","Please enter the Departure City");
frmvalidator.addValidation("Destination","dontselect=000","Please enter the arrival city");
frmvalidator.addValidation("Destination","neelmnt=Source","Source and Destination cannot be the same");
</script>
</center>
</main>
</body>
</html>