- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 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
function getItinerary($IID){
$connection = initDB();
$query;
if($IID == 0){
$query = "SELECT * FROM Itinerary";
}
else{
$query = "SELECT * FROM Itinerary WHERE IID='".$IID."'";
}
$result = mysql_query($query);
//or die ("Query Failed ".mysql_error());
$itineraryID = 0;
$itineraryData;
while($row = mysql_fetch_array($result)){
$GID = $row['GID'];
$FID = $row['FID'];
$SID = $row['SID'];
//Retrieve Guest Information
$query2 = "SELECT * FROM Guest WHERE GID='".$GID."'";
$result2 = mysql_query($query2);
$row2 = mysql_fetch_array($result2);
$firstName = $row2['FirstName'];
$lastName = $row2['LastName'];
//Retrieve Travel Schedule Information
$query3 = "SELECT * FROM Schedule WHERE SID='".$SID."'";
$result3 = mysql_query($query3);
$row3 = mysql_fetch_array($result3);
$travelDate = $row3['Date'];
//Retrieve Sector Information
$query3 = "SELECT * FROM Flights WHERE FID='".$FID."'";
$result3 = mysql_query($query3);
$row3 = mysql_fetch_array($result3);
$sourceSID = $row3['SourceSID'];
$destSID = $row3['DestSID'];
$fName = $row3['FName'];
$query4 = "SELECT Sector FROM Sectors WHERE SID='".$sourceSID."'";
$result4 = mysql_query($query4);
$row4 = mysql_fetch_array($result4);
$source = $row4['Sector'];
$query4 = "SELECT Sector FROM Sectors WHERE SID='".$destSID."'";
$result4 = mysql_query($query4);
$row4 = mysql_fetch_array($result4);
$dest = $row4['Sector'];
//Build GuestItinerary object
$guestItinerary = new GuestItinerary();
$guestItinerary->set_FID($FID);
$guestItinerary->set_FName($fName);
$guestItinerary->set_SID($SID);
$guestItinerary->set_source($source);
$guestItinerary->set_dest($dest);
$guestItinerary->set_travelDate($travelDate);
$guestItinerary->set_GID($GID);
$guestItinerary->set_firstName($firstName);
$guestItinerary->set_lastName($lastName);
$itineraryData[$itineraryID]=$guestItinerary;
$itineraryID = $itineraryID + 1;
}
closeDB($connection);
return $itineraryData;
}
Из демонстрационного приложения к NetBeans. Для обучения новичков, ага.
telnet 25.10.2010 08:02 # 0
http://govnokod.ru/4409
seonull 25.10.2010 08:39 # 0
Lure Of Chaos 25.10.2010 16:08 # +1
guest 15.04.2017 02:29 # 0