Query("SELECT * FROM `team` ORDER BY `sort` ASC"); $response =' '; }else{ $response .= '

We are working on listing all of our team members. Please return soon for updates.

'; } return $response; } #------------- [EO displayTeam] #------------- [listAllLocations] Generates a list of all locations and contact info function listAllLocations() { $SQL = new SQLi; $response = ''; # Get and display the locations $loc_result = $SQL->Query("SELECT * FROM `locations` ORDER BY `sort` ASC"); if($loc_result)( $num_locs = mysqli_num_rows($loc_result)); if($num_locs != 0){ while($rowl = mysqli_fetch_assoc($loc_result)){ # Display location info extract($rowl); $map_link = urlencode($street_address).'+'.urlencode($city).',+'.urlencode($prov_state).'+'.urlencode($postal_zip).'+'.urlencode($country); $response .= '

'.$location_title.'
'.$street_address.'
'.$city.', '.$prov_state.'
'.$postal_zip.'
'.$country.'

View Map

'; # Get and display the Contacts within the location record $contact_result = $SQL->Query("SELECT * FROM `contacts` WHERE `for_location` = '$id' ORDER BY `sort` ASC"); if($contact_result){ $num_contacts = mysqli_num_rows($contact_result); } if($num_contacts != 0){ while($rowc = mysqli_fetch_assoc($contact_result)){ # diplay contact info extract($rowc); if($type == 'email'){ $details = ''.$details.''; } $response .= '

'.$title.': '.$details.'

'; } }else{ $response .= '

We are working on adding all of our contact information for this location. Please return soon for updates.

'; } } }else{ $response .= '

We are working on listing all of our locations. Please return soon for updated information.

'; }# end if num_locs != 0 return $response; } #------------- [EO listAllLocations] #------------- [genMap] Generates map points for use with the Google map. function genMap($opt) { $SQL = new SQLi; $response = ''; # Get and display the locations if($opt == '1st'){ $addQ = " LIMIT 1"; }else{ $addQ = ''; } $loc_result = $SQL->Query("SELECT * FROM `locations` ORDER BY `sort` ASC".$addQ); if($loc_result)( $num_locs = mysqli_num_rows($loc_result)); if($num_locs != 0){ while($rowl = mysqli_fetch_assoc($loc_result)){ # Display location info extract($rowl); if($opt == 'func'){ $top = 'function showLoc'.$id.'(){ var map = new GMap2(document.getElementById("map")); map.setCenter(new GLatLng(49.9, -97.2), 15); map.addControl(new GSmallMapControl()); map.addControl(new GMapTypeControl()); '; $bottom = ' }'; }else{ $top = ''; $bottom = ''; } $address = $street_address.'
'.$city.', '.$prov_state.' '.$country.' '; $response .= $top.' var address'.$id.' = "'.$street_address.' '.$city.', '.$prov_state.' '.$country.' '.$postal_zip.'"; var geocoder'.$id.' = new GClientGeocoder; geocoder'.$id.'.getLatLng(address'.$id.', function(point) { if (point) { map.clearOverlays(); marker'.$id.' = new GMarker(point) map.addOverlay(marker'.$id.'); map.setCenter(point, 15); marker'.$id.'.openInfoWindowHtml("

'.$location_title.'
'.$address.'

"); } }); '.$bottom.' '; } }else{ $response = 0; }# end if num_locs != 0 return $response; } #------------- [EO genMap] # CLASS: Capabilities # Read-only capabilities class class Capabilities { # Set up the class # Sets up the SQL connection and sets the Capability ID if it has been sent function Capabilities(){ $this->SQL = new SQLi; if (func_num_args() == 1) { # If a capability has been set, assign the ID $this->id = func_get_arg(0); $r = $this->SQL->Query("SELECT * FROM `capabilities` WHERE `id` = '".$this->id."' LIMIT 1"); if(mysqli_num_rows($r) == 1){ $row = mysqli_fetch_assoc($r); $this->title = $row['title']; $this->desc = $row['desc']; } } } # Formats the capabilities link to be SEO friendly function friendlyLink($string){ # Link formatting $string = preg_replace("`\[.*\]`U","",$string); $string = preg_replace('`&(amp;)?#?[a-z0-9]+;`i','-',$string); $string = htmlentities($string, ENT_COMPAT, 'utf-8'); $string = preg_replace( "`&([a-z])(acute|uml|circ|grave|ring|cedil|slash|tilde|caron|lig|quot|rsquo);`i","\\1", $string ); $string = preg_replace( array("`[^a-z0-9]`i","`[-]+`") , "-", $string); return $string; } # Returns an associative array with all capabilities pages function getLinksJSON(){ $r = $this->SQL->Query("SELECT * FROM `capabilities` ORDER BY `sort` ASC"); $c = mysqli_num_rows($r); if($c > 0){ # Need a mod rewrite format for the links # e.g. http://aeroav.com/capabilities/24/Structures-Modifications/ $JSON = '['; for($i=0; $i < $c; $i++){ $row = mysqli_fetch_assoc($r); $linkString = $row['title']; $link = $this->friendlyLink($linkString); $JSON .= '{ "linkDisplay" : "'.$row['title'].'", "href" : "capabilities/'.$row['id'].'/'.$link.'/", "title" : "'.$row['title'].'" }'; if($i+1 != $c){ $JSON .= ', '; }else{ $JSON .= ' ]'; } } return $JSON; }else{ return "false"; } } # Display a capability's information function display(){ # If a capability ID has not been set, return if(!isset($this->id)) return false; $r = $this->SQL->Query("SELECT * FROM `capabilities` WHERE `id` = '".$this->id."' LIMIT 1"); if($n = mysqli_num_rows($r)){ $row = mysqli_fetch_assoc($r); extract($row); $response = '

'.stripslashes($title).'

'; $response .= '

'.stripslashes($desc).'

'; if($cert_id != '0'){ $response .= '

View Certification

'; } $response .= '

Contact us now to discuss how we can put our '.stripslashes($title).' capabilities to work for you.

'; $response .= '
'; return $response; }else{ #Capability with this ID does not exist. return false; } } # Get all of the photos linked to this specific capability # Returns an array with all photo information function getPhotos(){ # If a capability ID has not been set, return if(!isset($this->id)) return false; $r = $this->SQL->Query("SELECT * FROM `pics` WHERE `capability_id` = '".$this->id."' AND `active` = 'y'"); if(mysqli_num_rows($r) > 0){ $photos = Array(); while($row = mysqli_fetch_assoc($r)){ $photos[] = $row; } return $photos; }else{ # There are no photos return null; } } } #------------- [displayPhotos] function displayPhotos(){ $SQL = new SQLi; $result = $SQL->Query("SELECT * FROM `pics` WHERE `active` = 'y' ORDER BY `pic_id` ASC"); if(mysqli_num_rows($result) != 0){ $response = ''; $i = 0; while($row = mysqli_fetch_assoc($result)){ extract($row); $response .= ''.$caption.''; if($i&4){ $response .= '
'; } } $response .= ''; }else{ $response = '

We are working on adding photos to the gallery. Please return soon for updates.

'; } return $response; } #------------- [EO displayPhotos] #------------- [displayCert - display certifications for users] function displayCert($option="detail"){ $SQL = new SQLi; $response = ''; $result = $SQL->Query("SELECT * FROM `certification` ORDER BY `sort` ASC"); if($option == "detail"){ if(mysqli_num_rows($result) != 0){ while($row = mysqli_fetch_assoc($result)){ extract($row); $response .= '
'; $response .= '

'.displayHTML($title).'

'; $response .= '

'.displayHTML($desc).'

'; if($file_link != ""){ $response .= '

View Document

'; } $response .= '
'; } }else{ $response = '

We are working on adding our certifications. Please return soon for updates.

'; } }elseif($option == "link"){ if(mysqli_num_rows($result) != 0){ $i = 1; while($row = mysqli_fetch_assoc($result)){ extract($row); $response .= ''.stripslashes($title).''; if($i != mysqli_num_rows($result)){ $response .= ' | '; } $i++; } } } return $response; } #------------- [EO displayCert] #------------- [displayLinks - display all of the links in the db] function displayLinks() { $SQL = new SQLi; $response = ''; $response .= ''; return $response; } #------------- [EO displayLinks] ?> <? if(isset($Title)){ echo $Title." - Aero Aviation"; }else{ echo "Aero Aviation"; } ?> >