Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/jpope19/GatorAirlines
Browse files Browse the repository at this point in the history
  • Loading branch information
sturosier committed Dec 12, 2012
2 parents efbec41 + ec8871b commit 0abe79c
Show file tree
Hide file tree
Showing 6 changed files with 69 additions and 39 deletions.
6 changes: 4 additions & 2 deletions GatorAirlines2/site/CheckOut.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@
session_start();

}
$seat = $_GET['item'];
$_SESSION['seat_id'] = $seat;
//$num = trim($_SESSION['leave_ids']);
//$id_array = explode("_", $num);
$seat = explode(",",$_GET['item']);
$_SESSION['seat_id'] = $seat;
if(isset($_SESSION['loggedIn'])){
$first_name = $_SESSION['first_name'];
$last_name= $_SESSION['last_name'];
Expand Down
37 changes: 33 additions & 4 deletions GatorAirlines2/site/Receipt.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,7 @@
//$d_date = $_SESSION['d_time'];
//$a_date = $_SESSION['a_time'];
$record = array();
$record['seat_id'] = $seat;

//$record['seat_id'] = $seat;
if(isset($_SESSION['leave_ids'])){
if(isset($_SESSION['loggedIn'])){
$record['cid'] = $_SESSION['cid'];
Expand All @@ -89,7 +88,31 @@
$record['price'] = $price[0]['coach_class_cost'];
$record['flight_id'] = $flight[0]['flight_id'];
//insert
$users->add_tickets($record);
$number = $_SESSION['passengers'];
print_r($number);
print_r(count($seat));
if( $number - 1 > count($seat))
{
for($i = 0; $i < $number; $i++)
{
$record['seat_id'] = $seat[$i];
$users->add_tickets($record);
}
}
else
{
$diff = $number - count($seat) -1;
for($i = 0; $i < count($seat)-1; $i++)
{
$record['seat_id'] = $seat[$i];
$users->add_tickets($record);
}
for($t = 0; $t < $diff; $t++)
{
$record['seat_id'] = 100;
$users->add_tickets($record);
}
}
}
//if(isset($_SESSION['return_ids'])){
// $ids = trim($_SESSION['leave_ids']);
Expand Down Expand Up @@ -154,7 +177,13 @@

<!-- ONLY DOES FOR 1 SEAT SELECTED -->
<strong><td>Your Seat(s) ID: </td></strong>
<? echo $_SESSION['seat_id']; ?>
<?
for($i = 0; $i < $number; $i++)
{
echo $seat[$i] ;
echo " ";
}
?>
</br>

<strong><td>From: </td></strong>
Expand Down
34 changes: 8 additions & 26 deletions GatorAirlines2/site/SeatAssignments.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,32 +74,14 @@

<h2>Baggage Cost</h2>
<FONT FACE="calibri"><p style="font-size:16px">&#160;&#160;Estimate the total cost of your trip, baggage included!</p></FONT>
<form id="Fatass" action="<?php echo $_SERVER['PHP_SELF']?>" method="post">

&nbsp&nbspTotal Number of Bags &nbsp: <select name="bags">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
</select><br></br>



&nbsp&nbspTotal Weight: <input type="text" name="weight">&nbsp Lbs &nbsp <input type="submit" value="Calculate"><br></br>
&nbsp&nbspEstimated Baggage Cost: &nbsp&nbsp$

<?php
$weight = $_POST['weight'];
$bags = $_POST['bags'];
$price = $weight*2.5*$bags;
print "$price";
?>
<form id="Fatass" method="post">

&nbsp&nbspTotal Number of Bags: <input id = "bags" input type="text" name="bags"><br></br>

&nbsp&nbspTotal Weight: <input id = "weight" input type="text" name="weight">&nbsp Lbs &nbsp <input id = "calc" type="submit" value="Calculate"><br></br>
<p id="cost"> &nbsp&nbspEstimated Baggage Cost: </p>




</form>
Expand Down
6 changes: 3 additions & 3 deletions GatorAirlines2/site/home.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,10 @@
<input type="submit" class="button1" value="Submit"> <!-- Creates the submit button -->
<br>
<br>
Advanced
<!--Advanced-->
<br>
<input type="radio" name="advanced" class="advanced" value="Yes">Yes
<input type="radio" name="advanced" class="advanced" value="No">No<br>
<!--<input type="radio" name="advanced" class="advanced" value="Yes">Yes
<input type="radio" name="advanced" class="advanced" value="No">No<br>-->

</form>

Expand Down
9 changes: 8 additions & 1 deletion GatorAirlines2/site/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,14 @@
<td></td>
<td></td>
<td></td>
<td><input type='submit' value='Reserve Flight'></td>
<?php
if( $to_routes != null)
{
?><td><input type='submit' value='Reserve Flight'></td> <?
}
else

?>
</tr>
</table>
</center>
Expand Down
16 changes: 13 additions & 3 deletions GatorAirlines2/site/seat.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,20 @@ $(document).ready(function(){
$.each($('#place li.' + settings.selectingSeatCss + ' a'), function (index, value) {
item = $(this).attr('title');
str.push(item);
//change when going to the real website
window.location.href = "http://ec2-75-101-205-194.compute-1.amazonaws.com/CheckOut.php?item=" + item;
//window.location.href = "http://localhost:8080/GatorAirlines/GatorAirlines2/site/CheckOut.php?item=" + item;

});
var num = str.length;
var urlString = "http://ec2-75-101-205-194.compute-1.amazonaws.com/CheckOut.php?item=";
//var urlString = "http://localhost/GatorAirlines/GatorAirlines2/site/CheckOut.php?item=";
for( var i = 0; i < num; i++)
{
urlString = urlString + str[i] + ",";
}

//change when going to the real website
//window.location.href = "http://localhost/GatorAirlines/GatorAirlines2/site/CheckOut.php?item=" + item;
//window.location.href = "http://ec2-75-101-205-194.compute-1.amazonaws.com/CheckOut.php?item=" + item;
window.location.href = urlString;
//alert(str.join(','));
})

Expand Down

0 comments on commit 0abe79c

Please sign in to comment.