Jump to content

FSX30HD

Members
  • Posts

    83
  • Joined

  • Last visited

Profile Information

  • Gender
    Male
  • Location
    Grenoble, FRANCE
  • Interests
    PPL Aviation Plane and coding

Recent Profile Visitors

7064 profile views

FSX30HD's Achievements

Newbie

Newbie (1/14)

8

Reputation

  1. In the same case like Masmas Hope I can have an answer Regards Fred
  2. Hey, I need a real website done too!
  3. <script type="text/javascript"> var myMarkers = new Array(); var lines = new Array(); $.getJSON( "<?php echo actionurl("Destinations/getAirports"); ?>", function( data ) { var items = []; $.each( data, function( key, val ) { var icontype = "default"; if(val.hub == 1){ var icontype = "hub"; $("#info_icao").html(val.icao); $("#info_name").html(val.name); $("#info_country").html(val.country); } addMarker(val.lat, val.lng,icontype, val); }); }); function addMarker(lat, lng, icontype, info){ if(icontype == "default"){ var image = "<?php echo fileurl('lib/images/mapassets/airport_icon.png'); ?>"; }else if(icontype == "hub"){ var image = "<?php echo fileurl('lib/images/mapassets/hub_icon.png'); ?>"; } var marker = new google.maps.Marker({ position: CreateLatLngObject(lat, lng), map: map, icon: image }); // Polyline google.maps.event.addListener(marker, 'click', function() { for (i=0; i<lines.length; i++) { lines[i].setMap(null); //or line[i].setVisible(false); } $.getJSON("<?php echo actionurl("Destinations/getAirportsByArpt"); ?>/" + info.icao, function (data) { $.each( data, function( key, val ) { var line = new google.maps.Polyline({ path: [CreateLatLngObject(lat, lng), new google.maps.LatLng(val.lat, val.lng)], geodesic: true, strokeColor: '#7CFC00', strokeOpacity: 0.6, strokeWeight: 1 }); line.setMap(map); lines.push(line); }); }); }); // Polyline google.maps.event.addListener(marker, 'mouseover', function() { $("#info_icao").html(info.icao); $("#info_name").html(info.name); $("#info_country").html(info.country); }); myMarkers.push(marker); } function CreateLatLngObject(Latitude, Longitude) { var latlng = new google.maps.LatLng(parseFloat(Latitude), parseFloat(Longitude)); return latlng; } var styles = [ { "featureType": "landscape", "stylers": [ { "color": "#01356a" } ] }, { "featureType": "administrative", "stylers": [ { "visibility": "off" } ] } , { "featureType": "transit", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road", "stylers": [ { "visibility": "off" } ] }, { "featureType": "water", "stylers": [ { "color": "#0b508e" } ] }, { "featureType": "poi", "stylers": [ { "visibility": "off" } ] },{ featureType: "all", elementType: "labels", stylers: [ { visibility: "off" } ] } ]; var acars_map_defaults = { mapTypeControl: false, mapTypeControlOptions: { style: google.maps.MapTypeControlStyle.HORIZONTAL_BAR, position: google.maps.ControlPosition.BOTTOM_CENTER }, zoomControl: true, zoomControlOptions: { style: google.maps.ZoomControlStyle.SMALL, position: google.maps.ControlPosition.TOP_RIGHT }, scaleControl: false, streetViewControl: false, autozoom: true, zoom: 2, center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"), mapTypeId: google.maps.MapTypeId.ROADMAP, refreshTime: 10000, styles:_styles }; </script> http://www.skydream-airlines.com/index.php/destinations
  4. The API KEY doesn't match with the domain
  5. You need to include in your header <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr"> <head> <meta http-equiv="X-UA-Compatible" content="IE=10" charset=utf-8> <title><?php echo $page_title; ?></title> <?php Template::Show('core_htmlhead.tpl'); ?> </head> <body> <?php Template::Show('core_htmlreq.tpl'); ?>
  6. This is the code you need to put to index.php in the same time you need to create a new header_something.tpl $BaseTemplate->Set('title', MainController::$page_title .' - '.SITE_NAME); $BaseTemplate->Set('page_title', MainController::$page_title .' - '.SITE_NAME); if(file_exists(SKINS_PATH.'/layout.tpl')) { $BaseTemplate->Set('page_htmlhead', Template::Get('core_htmlhead.tpl', true)); $BaseTemplate->Set('page_htmlreq', Template::Get('core_htmlreq.tpl', true)); $BaseTemplate->Set('page_content', $page_content); # It's a template sammich! if (strpos($page_content,'html { height: 100% } body { height: 100%; margin: 0; padding: 0 }') !== false) { $BaseTemplate->ShowTemplate('header_map.tpl'); echo $page_content;} elseif (strpos($page_content,'html { height: 100% } body { height: 100%; margin: 0; padding: 0 }') !== false) { $BaseTemplate->ShowTemplate('header_vrs.tpl'); echo $page_content;} else { $BaseTemplate->ShowTemplate('layout.tpl'); } } You need also touch ACARS.php module to declare an new *.tpl render in this new file you copy paste the acarsmap.tpl inside public function viewmapbig() { $this->set('acarsdata', ACARSData::GetACARSData()); $this->render('acarsmapbig.tpl'); } Inside the new.tpl put this in the top of your tpl: <style> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } body { padding: 0; margin: 0; } html, body, #acarsmap{ height: 100%; } </style> http://www.skydream-airlines.com/index.php/acars/viewmapbig
  7. Missing else in your condition and more easy to change just the icon value: /* inair images for different airlines */if (data[i].flightnum.substring(0, 3) == "AIO") { var icon = url+"/lib/images/inair"+data[i].flightnum.substring(0, 3)+"/"+data[i].heading+".png"; } elseif (data[i].flightnum.substring(0, 3) == "PAG") { var icon = url+"/lib/images/inair"+data[i].flightnum.substring(0, 3)+"/"+data[i].heading+".png"; } else { var icon = ..... ; } /* inair images for different airlines */
  8. Maybe this code for phpvms_5.5.x <tr> <td width="1%" nowrap><strong>Captcha</strong></td> <td> <?php if(isset($captcha_error)){echo '<p class="error">'.$captcha_error.'</p>';} ?> <div class="g-recaptcha" data-sitekey="<?php echo $sitekey;?>"></div> <script type="text/javascript" src="https://www.google.com/recaptcha/api.js?hl=<?php echo $lang;?>"> </script> </td> </tr>
  9. The good code is icon: url+"/lib/images/inair/"+data[i].code+"/"+data[i].heading+".png" instead icon: url+"/lib/images/inair/"+data[i].heading+".png"
  10. I already post for that copy/paste this in your admin/modules/LoA/LoA.php <?php /** * Leave of Absence (LoA) v.1.0 Module * * phpVMS Module for pilots to submit a LoA request that is stored in a database * and an option for staff to view all the LoA requests through the admin panel * This module is released under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License * You are free to redistribute and alter this work as you wish but you must keep the original 'copyright' information on all the places it comes in the original work. * You are not allowed to delete the copyright information and/or gain any profit by adopting or using this module. * * @author Sava Markovic - savamarkovic.com * @copyright Copyright (c) 2012, Sava Markovic * @link http://www.savamarkovic.com * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ */ class LoA extends CodonModule { public $title = "Leave of Absence Admin"; public function HTMLHead() { $this->set('sidebar', 'loa/loa_admin_sidebar.tpl'); } public function NavBar () { echo '<li><a href="'.SITE_URL.'/admin/index.php/LoA">LoA Admin</a></li>'; } public function index () { $version = '1.0'; $leaves = LoAData::GetAllRequests(array()); $this->set('all_leaves', $leaves); $this->render('loa/loa_admin_index.tpl'); $this->check($version); } public function viewLOA() { $id = $this->get->id; $getinfo = LoAData::GetInfoByID($id); $this->set('info', $getinfo); $this->render('loa/loa_admin_view_request.tpl'); } public function confirmDeleteLOA() { $id = $this->get->id; $getinfo = LoAData::GetInfoById($id); $this->set('info', $getinfo); $this->render('loa/loa_admin_confirm_delete_request.tpl'); } public function deleteLOA() { $id = $this->get->id; $getinfo = LoAData::DeleteLoA($id); if (mysql_affected_rows() == -1) { $this->set('message', 'The LoA Reqest hasn\'t been deleted from the database for some reason. This isn\'t suppose to happen. Check the phpVMS forums for support.'); $this->render('loa/loa_admin_delete_request.tpl'); } else { $this->set('message', 'The LoA Reqest has been successfuly deleted from the database.'); $this->render('loa/loa_admin_delete_request.tpl'); } } protected function check ($version) { $version_to_check = $version; // make the cURL request $url = 'http://www.savamarkovic.com/loa.csv'; $file = new CodonWebService(); $read = @$file->get($url); if ($read[0] > $version_to_check && $read[2] == "1") { $critical = TRUE; } // If its 1, set ciritcal to true if ($read[0] > $version_to_check) { $update = TRUE; } // Anything other than 1 set update to true if ($read[0] == $version_to_check) { echo '<p id="success">Your version of this module is up to date. Wohooooo! )</p>'; }else if ($critical) { echo '<h4>CRITICAL UPDATE FOUND!</h4>'; echo '<p id="error">There is a critical update available! Here is the information associated with the update. <br/><b>Version: '.$read[0].' - '. $read[1].' <br /></b>Please send an email to ceo@airserbiavirtual.com to receive the updated version.</p>'; }else if ($update){ echo '<h4>NON CRITICAL UPDATE FOUND!</h4>'; echo '<p id="error" style="background:#fffca7;border-color:orange">There is NON critical update available! Here is the information associated with the update. <br/><b>Version: '.$read[0].' - '. $read[1].' <br /></b>Please send an email to ceo@airserbiavirtual.com to receive the updated version.</p>'; } } }
  11. Click on http://www.savamarkovic.com/loa.csv It's ok now all is right now
  12. FSX30HD

    XML path

    Thanks for your reply, the map draws from json format and the link is: /action.php/acars/data I have found howto output in xml format. I have just make a php file echo rows in xml format. But maybe in ACARS module instead of use json_encode switch to saveXML() like this: //Creates XML string and XML document using the DOM $dom = new DomDocument('1.0', 'UTF-8'); //add root == jukebox $jukebox = $dom->appendChild($dom->createElement('jukebox')); for ($i = 0; $i < count($arrayWithTracks); $i++) { //add track element to jukebox $track = $dom->createElement('track'); $jukebox->appendChild($track); // Appending attributes to track $attr = $dom->createAttribute('source'); $attr->appendChild($dom->createTextNode($arrayWithTracks[$i]['source'])); $track->appendChild($attr); $attr = $dom->createAttribute('artist'); $attr->appendChild($dom->createTextNode($arrayWithTracks[$i]['artist'])); $track->appendChild($attr); $attr = $dom->createAttribute('album'); $attr->appendChild($dom->createTextNode($arrayWithTracks[$i]['album'])); $track->appendChild($attr); $attr = $dom->createAttribute('title'); $attr->appendChild($dom->createTextNode($arrayWithTracks[$i]['title'])); $track->appendChild($attr); } $dom->formatOutput = true; // set the formatOutput attribute of domDocument to true // save XML as string or file $test1 = $dom->saveXML(); // put string in test1 $dom->save('test1.xml'); // save as file
  13. FSX30HD

    XML path

    Hello everybody, Now I work to a new ACARS MAP, so I need to know where the xml file is,to parse it. Have you an idea please ?
×
×
  • Create New...