-
Posts
35 -
Joined
-
Last visited
Content Type
Profiles
Forums
phpVMS Resources
Downloads
Everything posted by Ademar Andrade
-
These options come from your acars program. Witch do your company use?
-
How to populate route_detais in phpvms_acarsdata table
Ademar Andrade replied to Ademar Andrade's topic in Code Snippets
the file is acars.php located at core/modules/ACARS/ -
How to populate route_detais in phpvms_acarsdata table
Ademar Andrade replied to Ademar Andrade's topic in Code Snippets
ye yes i did! -
How to populate route_detais in phpvms_acarsdata table
Ademar Andrade replied to Ademar Andrade's topic in Code Snippets
Hi FX30HD, Thanks for your attention, i changed ACARMAP.PHP teh code you said. But still not working... Any another idea? Thanks, -
How to populate route_detais in phpvms_acarsdata table
Ademar Andrade replied to Ademar Andrade's topic in Code Snippets
Nothing about how to populate the table... -
I Wanna know the same think... My custom kacars script isn't populating this column and i don't find nothing about that in the forum! #$#$@$%#%&¨*¨(*& Any Help? Thanks!
-
How to populate route_detais in phpvms_acarsdata table
Ademar Andrade replied to Ademar Andrade's topic in Code Snippets
I don't suppose so... "Support Forum Any questions or bug reports go here. Development Help For help and support for the development of addons I'm not with bug or developing an addon... I need a pice of code to populate a table... Please, If you can't help don't aswer...let the admn do this kind of observantion, because they can move this topic if necessary. -
Hey Justairbus, How are you doing? How did you put the points of the route in your acarsmap? Reggards,
-
Thank you very much for sharing! Nice job!
-
Hi guys, My acars map stoped working. I didn't change anything before stop! This code below was working well!! Any idea? I tried to substitute by originals phpvms files but dindn't work too... We use KACAS 1.0.1.1. ACARSMAP.JS /** * phpVMS - Virtual Airline Administration Software * Copyright (c) 2008 Nabeel Shahzad * For more information, visit www.phpvms.net * Forums: http://www.phpvms.net/forum * Documentation: http://www.phpvms.net/docs * * phpVMS is licenced under the following license: * Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) * View license.txt in the root, or visit http://creativecommons.org/licenses/by-nc-sa/3.0/ * * @author Nabeel Shahzad * @copyright Copyright (c) 2008, Nabeel Shahzad * @link http://www.phpvms.net * @license http://creativecommons.org/licenses/by-nc-sa/3.0/ * * Rewritten for Google Maps v3 */ var flightMarkers = []; var routeMarkers = []; var flightPath = null; var depMarker = null, arrMarker = null; var info_window= null; var run_once = false; var defaultOptions = { autozoom: true, zoom: 4, center: new google.maps.LatLng(-25.363882,131.044922), mapTypeId: google.maps.MapTypeId.TERRAIN, refreshTime: 12000, autorefresh: true }; var options = $.extend({}, defaultOptions, acars_map_defaults); var map = new google.maps.Map(document.getElementById("acarsmap"), options); var weatherLayer = new google.maps.weather.WeatherLayer({ temperatureUnits: google.maps.weather.TemperatureUnit.FAHRENHEIT }); weatherLayer.setMap(map); var cloudLayer = new google.maps.weather.CloudLayer(); cloudLayer.setMap(map); // They clicked the map google.maps.event.addListener(map, 'click', function() { //clearPreviousMarkers(); }); liveRefresh(); if(options.autorefresh == true) { setInterval(function () { liveRefresh(); }, options.refreshTime); } function liveRefresh() { $.ajax({ type: "GET", url: url + "/action.php/acars/data", dataType: "json", cache: false, success: function(data) { populateMap(data); } }); }; function populateMap(data) { clearMap(); $("#pilotlist").html(""); if (data.length == 0) { return false; } var lat, lng; var details, row, pilotlink; var bounds = new google.maps.LatLngBounds(); for (var i = 0; i < data.length; i++) { if(data[i] == null || data[i].lat == null || data[i].lng == null || data[i].lat == "" || data[i].lng == "") { continue; } lat = data[i].lat; lng = data[i].lng; if(i%2 == 0) data[i].trclass = "even"; else data[i].trclass = "odd"; // Pull ze templates! var map_row = tmpl("acars_map_row", {flight: data[i]}); var detailed_bubble = tmpl("acars_map_bubble", {flight: data[i]}); $('#pilotlist').append(map_row); var pos = new google.maps.LatLng(lat, lng); flightMarkers[flightMarkers.length] = new google.maps.Marker({ position: pos, map: map, icon: url+"/lib/images/inair/"+data[i].heading+".png", flightdetails: data[i], infowindow_content: detailed_bubble }); bounds.extend(pos); google.maps.event.addListener(flightMarkers[flightMarkers.length - 1], 'click', function() { clearPreviousMarkers(); var focus_bounds = new google.maps.LatLngBounds(); // Flight details info window info_window = new google.maps.InfoWindow({ content: this.infowindow_content, position: this.position }); info_window.open(map, this); // Add polyline, and start/end points var dep_location = new google.maps.LatLng(this.flightdetails.deplat, this.flightdetails.deplng); var arr_location = new google.maps.LatLng(this.flightdetails.arrlat, this.flightdetails.arrlng); depMarker = new google.maps.Marker({ position: dep_location, map: map, icon: depicon, title: this.flightdetails.depname, zIndex: 100 }); arrMarker = new google.maps.Marker({ position: arr_location, map: map, icon: arricon, title: this.flightdetails.arrname, zIndex: 100 }); // Now the flight path, if it exists var path = new Array(); path[path.length] = dep_location; focus_bounds.extend(dep_location); if(this.flightdetails.route_details.length > 0) { $.each(this.flightdetails.route_details, function(i, nav) { var loc = new google.maps.LatLng(nav.lat, nav.lng); if(nav.type == 3) icon = "icon_vor.png"; else icon = "icon_fix.png"; var navpoint_info = tmpl("navpoint_bubble", {nav: nav}); routeMarkers[routeMarkers.length] = new google.maps.Marker({ position: loc, map: map, icon: url + "/lib/images/"+icon, title: nav.title, zIndex: 100, infowindow_content: navpoint_info }); google.maps.event.addListener(routeMarkers[routeMarkers.length - 1], 'click', function() { info_window = new google.maps.InfoWindow({ content: this.infowindow_content, position: this.position }); info_window.open(map, this); }); path[path.length] = loc; focus_bounds.extend(loc); }); } path[path.length] = arr_location; focus_bounds.extend(this.position); focus_bounds.extend(arr_location); flightPath = new google.maps.Polyline({ path: path, strokeColor: "#FF0000", strokeOpacity: 1.0, strokeWeight: 2 }); map.fitBounds(focus_bounds); flightPath.setMap(map); }); } // If they selected autozoom, only do the zoom first time if(options.autozoom == true && run_once == false) { map.fitBounds(bounds); run_once = true; } } function clearPreviousMarkers() { if(info_window) { info_window.close(); info_window = null; } if(depMarker != null) { depMarker.setMap(null); depMarker = null; } if(arrMarker != null) { arrMarker.setMap(null); arrMarker = null; } if(routeMarkers.length > 0) { for(var i = 0; i < routeMarkers.length; i++) { routeMarkers[i].setMap(null); } } routeMarkers.length = 0; if(flightPath != null) { flightPath.setMap(null); flightPath = null; } } function clearMap() { if(flightMarkers.length > 0) { for(var i = 0; i < flightMarkers.length; i++) { flightMarkers[i].setMap(null); } } flightMarkers.length = 0; if(routeMarkers.length > 0) { for(var i = 0; i < routeMarkers.length; i++) { routeMarkers[i].setMap(null); } } routeMarkers.length = 0; } ACARSMAP.TPL <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?libraries=weather&sensor=false"> </script> <?php /** * These are some options for the ACARS map, you can change here * * By default, the zoom level and center are ignored, and the map * will try to fit the all the flights in. If you want to manually set * the zoom level and center, set "autozoom" to false. * * You can use these MapTypeId's: * http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeId * * Change the "TERRAIN" to the "Constant" listed there - they are case-sensitive * * Also, how to style the acars pilot list table. You can use these style selectors: * * table.acarsmap { } * table.acarsmap thead { } * table.acarsmap tbody { } * table.acarsmap tbody tr.even { } * table.acarsmap tbody tr.odd { } */ ?> <script type="text/javascript"> <?php /* These are the settings for the Google map. You can see the Google API reference if you want to add more options. There's two options I've added: autozoom: This will automatically center in on/zoom so all your current flights are visible. If false, then the zoom and center you specify will be used instead refreshTime: Time, in seconds * 1000 to refresh the map. The default is 10000 (10 seconds) */ ?> var acars_map_defaults = { autozoom: true, zoom: 4, center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"), mapTypeId: google.maps.MapTypeId.TERRAIN, refreshTime: 10000 }; </script> <div class="mapcenter" align="center"> <div id="acarsmap" style="width:<?php echo Config::Get('MAP_WIDTH');?>; height: <?php echo Config::Get('MAP_HEIGHT')?>"></div> </div> <?php /* See below for details and columns you can use in this table */ ?> <table border = "0" width="100%" class="acarsmap"> <thead> <tr> <td><b>Pilot</b></td> <td><b>Flight Number</b></td> <td><b>Departure</b></td> <td><b>Arrival</b></td> <td><b>Status</b></td> <td><b>Altitude</b></td> <td><b>Speed</b></td> <td><b>Distance/Time Remain</b></td> </tr> </thead> <tbody id="pilotlist"></tbody> </table> <script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script> <?php /* This is the template which is used in the table above, for each row. Be careful modifying it. You can simply add/remove columns, combine columns too. Keep each "section" (<%=...%>) intact Variables you can use (what they are is pretty obvious) Variable: Notes: <%=flight.pilotid%> <%=flight.firstname%> <%=flight.lastname%> <%=flight.pilotname%> First and last combined <%=flight.flightnum%> <%=flight.depapt%> Gives the airport name <%=flight.depicao%> <%=flight.arrapt%> Gives the airport name <%=flight.arricao%> <%=flight.phasedetail%> <%=flight.heading%> <%=flight.alt%> <%=flight.gs%> <%=flight.disremaining%> <%=flight.timeremaning%> <%=flight.aircraft%> Gives the registration <%=flight.aircraftname%> Gives the full name <%=flight.client%> FSACARS/Xacars/FSFK, etc <%=flight.trclass%> "even" or "odd" You can also use logic in the templating, if you so choose: http://ejohn.org/blog/javascript-micro-templating/ */ ?> <script type="text/html" id="acars_map_row"> <tr class="<%=flight.trclass%>"> <td><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a></td> <td><%=flight.flightnum%></td> <td><%=flight.depicao%></td> <td><%=flight.arricao%></td> <td><%=flight.phasedetail%></td> <td><%=flight.alt%></td> <td><%=flight.gs%></td> <td><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%></td> </tr> </script> <?php /* This is the template for the little map bubble which pops up when you click on a flight Same principle as above, keep the <%=...%> tags intact. The same variables are available to use here as are available above. */ ?> <script type="text/html" id="acars_map_bubble"> <span style="font-size: 10px; text-align:left; width: 100%" align="left"> <a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%> - <%=flight.pilotname%></a><br /> <strong>Flight <%=flight.flightnum%></strong> (<%=flight.depicao%> to <%=flight.arricao%>)<br /> <strong>Status: </strong><%=flight.phasedetail%><br /> <strong>Dist/Time Remain: </strong><%=flight.distremaining%> <?php echo Config::Get('UNITS');?> / <%=flight.timeremaining%><br /> </span> </script> <?php /* This is a small template for information about a navpoint popup Variables available: <%=nav.title%> <%=nav.name%> <%=nav.freq%> <%=nav.lat%> <%=nav.lng%> <%=nav.type%> 2=NDB 3=VOR 4=DME 5=FIX 6=TRACK */ ?> <script type="text/html" id="navpoint_bubble"> <span style="font-size: 10px; text-align:left; width: 100%" align="left"> <strong>Name: </strong><%=nav.title%> (<%=nav.name%>)<br /> <strong>Type: </strong> <?php /* Show the type of point */ ?> <% if(nav.type == 2) { %> NDB <% } %> <% if(nav.type == 3) { %> VOR <% } %> <% if(nav.type == 4) { %> DME <% } %> <% if(nav.type == 5) { %> FIX <% } %> <% if(nav.type == 6) { %> TRACK <% } %> <br /> <?php /* Only show frequency if it's not a 0*/ ?> <% if(nav.freq != 0) { %> <strong>Frequency: </strong><%=nav.freq%> <% } %> </span> </script>
-
Hi, Maybe it can help you! http://forum.phpvms....kin/#entry81507 Bye,
-
localconfig.tpl # Google Map Options Config::Set('MAP_WIDTH', '700px'); Config::Set('MAP_HEIGHT', '600px');
-
CLOUDS http://forum.phpvms.net/topic/8559-acars-map-weather-and-clouds/ % FLIGHT COMPLET http://forum.phpvms.net/topic/5394-complete-flight/ That is it. Reggards,
-
Thanks Fernando! I sent you the association of the tables writen by Kairon. I think it will solve our problem. Kind Regards,
-
hahaha...i did the same question Cor!!!! But im just a VA CEO, so i must do it...
-
Hi guys, Our IVAO division want to see our PIREPS list with IVAO ID of each pilot. We have a custom field (phpvms_customfield) called IVAO. I did the code below. Its working (http://truewings.com.br/all_pireps_tws.php), but i can't see the pilot ivao id of the pirep sent. This part of the code is note ready. anybordy can help me? How canget this data from phpvms_customfield? <?php $servidor = ""; /*maquina a qual o banco de dados está*/ $usuario = ""; /*usuario do banco de dados MySql*/ $senha = ""; /*senha do banco de dados MySql*/ $banco = ""; /*seleciona o banco a ser usado*/ $conexao = mysql_connect($servidor,$usuario,$senha); /*Conecta no bando de dados MySql*/ mysql_select_db($banco); /*seleciona o banco a ser usado*/ $res = mysql_query("select * from phpvms_pireps ORDER BY pirepid DESC"); /*Executa o comando SQL, no caso para pegar todos os usuarios do sistema e retorna o valor da consulta em uma variavel ($res) */ ?> VÔO</td> <td width="12%" bgcolor="#EEEEEE">ORIGEM / DESTINO</td> <td width="7%" bgcolor="#EEEEEE">EET</td> <td width="22%" bgcolor="#EEEEEE">ROTA</td> <td width="23%" bgcolor="#EEEEEE">DATA</td> <td width="29%" bgcolor="#EEEEEE">IVAO</td> </tr> </table> <br /> <?php while($escrever=mysql_fetch_array($res)){ ?> <table width="80%" border="1" align="center" cellpadding="5" cellspacing="0"> <tr> <td width="7%" bgcolor="#EEEEEE"><?php echo $escrever["flightnum"]; ?></td> <td width="12%" bgcolor="#EEEEEE"><?php echo $escrever["depicao"]; ?> / <?php echo $escrever["arricao"]; ?></td> <td width="7%" bgcolor="#EEEEEE" ><?php echo $escrever["flighttime_stamp"]; ?></td> <td width="22%" bgcolor="#EEEEEE" <?php echo $escrever["route"]; ?></td> <td width="23%" bgcolor="#EEEEEE"><?php echo $escrever["submitdate"]; ?></td> <td width="29%" bgcolor="#EEEEEE">???? ivao id ???</td> </tr> </table><?php } ?>
-
Nice job man! Thnks for sharing!
-
this link explane how to do it http://forum.phpvms.net/topic/8559-acars-map-weather-and-clouds/
-
Hi Cor,, Tks! You can use the code as you wish. Im trying to put the googe map ina full size page. Waiting anybody help!
-
Tks Parkho... Always helping us with your knowledge... Full page like this: http://aviancavirtual.net/br/tracking
-
Hi guys, These days our team changed our acars map using some codes below. acarsmap.tpl <head> <script language="javascript" type="text/javascript"> // function to calculate local time // in a different city // given the city's UTC offset function calcTime() { var index = document.getElementById('DropDownTimezone').selectedIndex; var offset = document.getElementById('DropDownTimezone').value; var timeZone = document.getElementById('DropDownTimezone').options[index].text; // create Date object for current location d = new Date(); // convert to msec // add local time zone offset // get UTC time in msec utc = d.getTime() + (d.getTimezoneOffset() * 60000); // create new Date object for different city // using supplied offset nd = new Date(utc + (3600000*offset)); // return time as a string return "" + timeZone + " - " + nd.toLocaleString(); } </script> <style type="text/css"> @font-face { font-family: digital; src: url("http://truewings.com.br/DS-DIGI.eot") /* EOT file for IE */ } @font-face { font-family: digital; src: url("http://truewings.com.br/DS-DIGI.TTF") /* TTF file for CSS3 browsers */ } div.progress-container { border: 1px solid #ffffff; width: 100px; margin: 1px 1px 1px 1px; padding: 1px; float: middle; background: #333; } div.progress-container > div { position: relative; font-family: verdana; font-size: 12px; color: #000; background-color: #FC0; height: 20px; vertical-align:right; } </style> <style type="text/css"> <!-- body { background-color: #f7f9f8; } .dcreui b { color: #FFF; font-size: 18px; text-align: left; } .zz { color: #FFF; } .dcreui { font-size: 24px; color: #FFF; } .ASAS { text-align: left; color: #F00; } .ASAS b b { font-size: 18px; font-weight: bold; color: #FFF; } .ULALALA { text-align: center; font-family: Tahoma, Geneva, sans-serif; font-style: italic; font-size: 16px; } .dcreui b b { text-align: left; } .ASAS b { color: #FFF; font-size: 18px; } --> </style> </head> <h3>Vôos ativos neste momento</h3> <table width="970" border="10" align="center" cellpadding="0" cellspacing="0" bordercolor="#333"> <tr> <td><table width="970" border = "0" bordercolor = "#333" align="center" cellpadding="0" cellspacing="0" > <thead> <tr> <td height="19" colspan="6" align="right" bgcolor="#333333" style="font-size: 14px"><span class="AHOPU" style="text-align: center; color: #FC0; font-weight: bold; font-style: italic;"><font face="digital" size="5">TWS ACARS MAP VER. 1.5 </font></td> </tr> <tr> <td height="19" colspan="6" align="right" bgcolor="#000000"><?php /** * These are some options for the ACARS map, you can change here * * By default, the zoom level and center are ignored, and the map * will try to fit the all the flights in. If you want to manually set * the zoom level and center, set "autozoom" to false. * * You can use these MapTypeId's: * http://code.google.com/apis/maps/documentation/v3/reference.html#MapTypeId * * Change the "TERRAIN" to the "Constant" listed there - they are case-sensitive * * Also, how to style the acars pilot list table. You can use these style selectors: * * table.acarsmap { } * table.acarsmap thead { } * table.acarsmap tbody { } * table.acarsmap tbody tr.even { } * table.acarsmap tbody tr.odd { } */ ?> <script type="text/javascript"> <?php /* These are the settings for the Google map. You can see the Google API reference if you want to add more options. There's two options I've added: autozoom: This will automatically center in on/zoom so all your current flights are visible. If false, then the zoom and center you specify will be used instead refreshTime: Time, in seconds * 1000 to refresh the map. The default is 10000 (10 seconds) */ ?> var acars_map_defaults = { autozoom: false, zoom: 3, center: new google.maps.LatLng("<?php echo Config::Get('MAP_CENTER_LAT'); ?>", "<?php echo Config::Get('MAP_CENTER_LNG'); ?>"), mapTypeId: google.maps.MapTypeId.HYBRID, refreshTime: 10000 }; </script> <style type="text/css"> <!-- aszxc { color: #FFF; } .acarsmap { color: #333; font-size: 12px; } gdfgk { text-align: center; } .AHOPU { color: #333; } .acarsmap thead tr td b { text-align: right; color: #0D64B4; } .dcreui { text-align: right; } .asdf { text-align: left; } .asdf { text-align: left; color: #FFF; } .asdf { color: #890101; text-align: left; } --> </style> <div class="mapcenter" align="center"> <div id="acarsmap" style="width:<?php echo Config::Get('MAP_WIDTH');?>; height: <?php echo Config::Get('MAP_HEIGHT')?>"></div> </div> <?php /* See below for details and columns you can use in this table */ ?></td> </tr> <tr> <td height="19" colspan="6" align="right" bgcolor="#000000"><p align="right"><script type="text/javascript"> data = new Date(); dia = data.getDate(); mes = data.getMonth(); ano = data.getFullYear(); meses = new Array(12); meses[0] = "Janeiro"; meses[1] = "Fevereiro"; meses[2] = "Março"; meses[3] = "Abril"; meses[4] = "Maio"; meses[5] = "Junho"; meses[6] = "Julho"; meses[7] = "Agosto"; meses[8] = "Setembro"; meses[9] = "Outubro"; meses[10] = "Novembro"; meses[11] = "Dezembro"; document.write ("<font color='#FFF' size='5' face='digital'>" + dia + " de " + meses[mes] + " de " + ano + " </font> "); </script><form id="form1" runat="server"> <select name="DropDownTimezone" id="DropDownTimezone" onchange="alert(calcTime());"> <option value="-12.0">(GMT -12:00) Eniwetok, Kwajalein</option> <option value="-11.0">(GMT -11:00) Midway Island, Samoa</option> <option value="-10.0">(GMT -10:00) Hawaii</option> <option value="-9.0">(GMT -9:00) Alaska</option> <option value="-8.0">(GMT -8:00) Pacific Time (US & Canada)</option> <option value="-7.0">(GMT -7:00) Mountain Time (US & Canada)</option> <option value="-6.0">(GMT -6:00) Central Time (US & Canada), Mexico City</option> <option value="-5.0">(GMT -5:00) Eastern Time (US & Canada), Bogota, Lima</option> <option value="-4.0">(GMT -4:00) Atlantic Time (Canada), Caracas, La Paz</option> <option value="-3.5">(GMT -3:30) Newfoundland</option> <option value="-3.0">(GMT -3:00) Brazil, Buenos Aires, Georgetown</option> <option value="-2.0">(GMT -2:00) Mid-Atlantic</option> <option value="-1.0">(GMT -1:00 hour) Azores, Cape Verde Islands</option> <option value="0.0">(GMT) Western Europe Time, London, Lisbon, Casablanca</option> <option value="1.0">(GMT +1:00 hour) Brussels, Copenhagen, Madrid, Paris</option> <option value="2.0">(GMT +2:00) Kaliningrad, South Africa</option> <option value="3.0">(GMT +3:00) Baghdad, Riyadh, Moscow, St. Petersburg</option> <option value="3.5">(GMT +3:30) Tehran</option> <option value="4.0">(GMT +4:00) Abu Dhabi, Muscat, Baku, Tbilisi</option> <option value="4.5">(GMT +4:30) Kabul</option> <option value="5.0">(GMT +5:00) Ekaterinburg, Islamabad, Karachi, Tashkent</option> <option value="5.5">(GMT +5:30) Bombay, Calcutta, Madras, New Delhi</option> <option value="5.75">(GMT +5:45) Kathmandu</option> <option value="6.0">(GMT +6:00) Almaty, Dhaka, Colombo</option> <option value="7.0">(GMT +7:00) Bangkok, Hanoi, Jakarta</option> <option value="8.0">(GMT +8:00) Beijing, Perth, Singapore, Hong Kong</option> <option value="9.0">(GMT +9:00) Tokyo, Seoul, Osaka, Sapporo, Yakutsk</option> <option value="9.5">(GMT +9:30) Adelaide, Darwin</option> <option value="10.0">(GMT +10:00) Eastern Australia, Guam, Vladivostok</option> <option value="11.0">(GMT +11:00) Magadan, Solomon Islands, New Caledonia</option> <option value="12.0">(GMT +12:00) Auckland, Wellington, Fiji, Kamchatka</option> </select> </form></p></td> </tr> <tr> <td width="15%" height="19" align="left" bgcolor="#333333" class="ASAS"> </td> <td align="left" bgcolor="#333333"> </td> <td align="left" bgcolor="#333333"> </td> <td align="left" bgcolor="#333333"> </td> <td align="left" bgcolor="#333333"> </td> <td align="left" bgcolor="#333333"> </td> </tr> <tr> <td height="19" bgcolor="#333333" class="ASAS"> <b><b>N.</b></b></td> <td width="20%" align="left" bgcolor="#333333" class="ASAS"><b><b>PILOTO</b></b></td> <td width="19%" align="left" bgcolor="#333333" class="ASAS"><b>EQUIPAMENTO</b></td> <td width="12%" align="left" bgcolor="#333333"><span class="ASAS"><b>DEP / ARR</b></span><span class="dcreui"></span></td> <td width="20%" align="left" bgcolor="#333333" class="ASAS"><b>STATUS</b></td> <td width="14%" align="left" bgcolor="#333333" class="ASAS"><b>ANDAMENTO</b></td> </tr> <tr> <td height="19" colspan="6" align="left" bgcolor="#333333" class="ASAS"> </td> </tr> </thead> <tbody id="pilotlist"></tbody> </table></td> </tr> </table> <p><span class="ULALALA"> <?php /* This is the template which is used in the table above, for each row. Be careful modifying it. You can simply add/remove columns, combine columns too. Keep each "section" (<%=...%>) intact Variables you can use (what they are is pretty obvious) Variable: Notes: <%=flight.pilotid%> <%=flight.firstname%> <%=flight.lastname%> <%=flight.pilotname%> First and last combined <%=flight.flightnum%> <%=flight.depapt%> Gives the airport name <%=flight.depicao%> <%=flight.arrapt%> Gives the airport name <%=flight.arricao%> <%=flight.phasedetail%> <%=flight.heading%> <%=flight.alt%> <%=flight.gs%> <%=flight.disremaining%> <%=flight.timeremaning%> <%=flight.aircraft%> Gives the registration <%=flight.aircraftname%> Gives the full name <%=flight.client%> FSACARS/Xacars/FSFK, etc <%=flight.trclass%> "even" or "odd" <%=flight.percomplete%> You can also use logic in the templating, if you so choose: http://ejohn.org/blog/javascript-micro-templating/ */ ?> <?php /* This is the template for the little map bubble which pops up when you click on a flight Same principle as above, keep the <%=...%> tags intact. The same variables are available to use here as are available above. */ ?> <?php /* This is a small template for information about a navpoint popup Variables available: <%=nav.title%> <%=nav.name%> <%=nav.freq%> <%=nav.lat%> <%=nav.lng%> <%=nav.type%> 2=NDB 3=VOR 4=DME 5=FIX 6=TRACK */ ?> </span></p> <p class="AHOPU"> <script type="text/javascript" src="<?php echo fileurl('/lib/js/acarsmap.js');?>"></script> <script type="text/html" id="acars_map_row"> <tr border="0"> <td border="0" width="11%" height="38" align="left" bgcolor="#000000" style="color: #FC0; font-weight: normal; font-size: 24px;" ><b class="zz" style="color: #000">.</b><font face="digital"><%=flight.flightnum%></td> <td border="0" width="11%" height="38" align="left" bgcolor="#000000" style="color: #FC0; font-weight: normal; font-size: 24px;" ><font face="digital"><span class="asdf" style="color: #FFFFFF; font-size: 24px;"><%=flight.pilotname%></font></span></td> <td border="0" width="11%" height="38" align="left" bgcolor="#000000" style="color: #FC0; font-weight: normal; font-size: 24px;" ><font face="digital"><span class="asdf" style="color: #FFFFFF; font-size: 24px;"><%=flight.aircraftname%> / <%=flight.aircraft%></span></td> <td border="0" width="11%" height="38" align="left" bgcolor="#000000" style="color: #FC0; font-weight: normal; font-size: 24px;" ><font face="digital"><span class="asdf" style="color: #FFFFFF; font-size: 24px;"><%=flight.depicao%>/<%=flight.arricao%></span></td> <td border="0" width="11%" height="38" align="left" bgcolor="#000000" style="color: #FC0; font-weight: normal; font-size: 24px;" ><font face="digital"><span class="asdf" style="color: #0C0; font-size: 24px;"><%=flight.phasedetail%></span></td> <td border="0" width="11%" height="38" align="left" bgcolor="#000000" style="color: #FC0; font-weight: normal; font-size: 24px;" ><font face="digital"><span class="asdf" style="color: #FFFFF; font-size: 24px;"><div class="progress-container"> <div style="width: <%=flight.percomplete%>%"><%=flight.percomplete%>%</span></div> </div> </td> </tr> </script> <script type="text/html" id="acars_map_bubble"> <div style="width:280px;height:250px;" class="bubble"> <table style="width:100%;" class="bubbletable"> <tr> <td id="bubblelogo" colspan="2"><img src="http://ivao.aero/data/images/online_logo/V/TWS.jpg" alt="ExecAir Flight Info"/><br><br><span><b>N° Vôo:</b></span> <%=flight.flightnum%></td> </tr> <tr> <td style="width:32%" class="bubbleheader"><b>Piloto:</b></td> <td><a href="<?php echo url('/profile/view');?>/<%=flight.pilotid%>"><%=flight.pilotid%></a> - <%=flight.pilotname%></td> <td><img src="<?php echo $pilot->rankimage?>" alt="<?php echo $pilot->rank;?>" /></td> </tr> <tr> <td class="bubbleheader"><b>Rota:</b></td> <td><%=flight.depicao%> to <%=flight.arricao%></td> </tr> <tr> <td class="bubbleheader"><b>Status:</b></td> <td><%=flight.phasedetail%></td> </tr> <tr> <td class="bubbleheader"><b>Dist.Restante:</b></td> <td><%=flight.distremaining%> (<?php echo Config::Get('UNITS');?>)</td> </tr> <tr> <td class="bubbleheader"><b>Temp.Restante:</b></td> <td><%=flight.timeremaining%> (h)</td> </tr> <tr> <td class="bubbleheader"><b>Acars:</b></td> <td><%=flight.client%></td> </tr> </tr> <tr> <td class="bubbleheader"><b>Aeronave:</b></td> <td><%=flight.aircraftname%>( Reg. <%=flight.aircraft%> )</td> </tr> <tr> <td class="bubbleheader"><b>Progresso:</b></td> <td><div class="progress-container"> <div style="width: <%=flight.percomplete%>%"><font color="#fff600"><%=flight.percomplete%>%</div></font> </div></td> </tr> </table> </div> </script> <script type="text/html" id="navpoint_bubble"> <span style="font-size: 10px; text-align:left; width: 100%" align="left"> <strong>Name: </strong><%=nav.title%> (<%=nav.name%>)<br /> <strong>Type: </strong> <?php /* Show the type of point */ ?> <% if(nav.type == 2) { %> NDB <% } %> <% if(nav.type == 3) { %> VOR <% } %> <% if(nav.type == 4) { %> DME <% } %> <% if(nav.type == 5) { %> FIX <% } %> <% if(nav.type == 6) { %> TRACK <% } %> <br /> <?php /* Only show frequency if it's not a 0*/ ?> <% if(nav.freq != 0) { %> <strong>Frequency: </strong><%=nav.freq%> <% } %> </span> </script> </p> <p class="AHOPU"> </p> Now we are trying to put it in full page. Any one have any idea how to do it? Reggards...
-
Nice job Fernando! Thnks for share!!
-
Still not working... Everything i did.... events_new_form.tpl <?php //simpilotgroup addon module for phpVMS virtual airline system // //simpilotgroup addon modules are licenced under the following license: //Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) //To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/ // //@author David Clark (simpilot) //@copyright Copyright (c) 2009-2010, David Clark //@license http://creativecommons.org/licenses/by-nc-sa/3.0/ $this->show('events/events_header.tpl'); if(isset($event)) {echo '<div id="error">All fields must be filled out</div>'; } ?> <h4>Create New Event</h4> <table width="80%"> <form name="eventform" action="<?php echo SITE_URL; ?>/admin/index.php/events_admin" method="post" enctype="multipart/form-data"> <tr> <td>New Event Title</td> <td><input type="text" name="title" <?php if(isset($event)) {echo 'value="'.$event['title'].'"';} ?> /></td> </tr> <tr> <td>New Event Description</td> <td><textarea name="description" rows="4" cols="40"><?php if(isset($event)) {echo $event['description'];} ?></textarea></td> </tr> <tr> <td>Link To Event Banner Image (Optional)<br />ex: http://www.mysite.com/pic.png</td> <td><input type="text" name="image" <?php if(isset($event)) {echo 'value="'.$event['image'].'"';} ?> ></td> </tr> <tr> <td>Scheduled Event Date</td> <td> <?php $months = range(1, 12); $days = range (1, 31); $years = range (date('Y'), 2015); echo "Month: <select name='month'>"; foreach ($months as $value) {echo '<option value="'.$value.'">'.$value.'</option>\n';} echo '</select>'; echo " Day: <select name='day'>"; foreach ($days as $value) {echo '<option value="'.$value.'">'.$value.'</option>\n';} echo '</select>'; echo " Year: <select name='year'>"; foreach ($years as $value) {echo '<option value="'.$value.'">'.$value.'</option>\n';} echo '</select>'; ?> </td> </tr> <tr> <td>Scheduled Event Time</td> <td> <?php $start = strtotime('0:00'); $end = strtotime('23:30'); echo '<select name="time">'; for ($i = $start; $i <= $end; $i += 1800) { echo '<option>' . date('H:i', $i).'</option>'; } echo '</select>'; ?> GMT </td> </tr> <tr> <td>Departure Airfield (icao)</td> <td><input type="text" name="dep" <?php if(isset($event)) {echo 'value="'.$event['dep'].'"';} ?> ></td> </tr> <tr> <td>Arrival Airfield (icao)</td> <td><input type="text" name="arr" <?php if(isset($event)) {echo 'value="'.$event['arr'].'"';} ?> ></td> </tr> <tr> <td>Airline Schedule #</td> <td><input type="text" name="schedule" <?php if(isset($event)) {echo 'value="'.$event['schedule'].'"';} ?> ></td> </tr> <tr> <td>Slot Limit (min 1)</td> <td><input type="text" name="limit" <?php if(isset($event)) {echo 'value="'.$event['limit'].'"';} else {echo 'value="1"';} ?> ></td> </tr> <tr> <td>Category of Event?</td> <td> <select name="category"> <option value="Tour">Tour</option> <option value="Fly-In">Fly-In</option> <option value="Ivao Tour">Ivao Tour</option> </select> </td> </tr> <tr> <td>Slot Interval (1 minute min)</td> <td><input type="text" name="interval" <?php if(isset($event)) {echo 'value="'.$event['interval'].'"';} else {echo 'value="1"';} ?> ></td> </tr> <tr> <td>Post Event as News Item?</td> <td> <select name="postnews"> <option value="1">Yes</option> <option value="2">No</option> </select> </td> </tr> <tr> <td>Active Event?<br />Inactive events will not show in public/pilot listings.</td> <td> <select name="active"> <option value="1">Yes</option> <option value="2">No</option> </select> </td> </tr> <tr> <td colspan="2"><input type="hidden" name="action" value="save_new_event" /><input type="submit" value="Save New Event"></td> </tr> </form> </table> Events.php <?php //simpilotgroup addon module for phpVMS virtual airline system // //simpilotgroup addon modules are licenced under the following license: //Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) //To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/ // //@author David Clark (simpilot) //@copyright Copyright (c) 2009-2010, David Clark //@license http://creativecommons.org/licenses/by-nc-sa/3.0/ class Events extends CodonModule { public function index() { $this->set('events', EventsData::get_upcoming_events()); $this->set('history', EventsData::get_past_events()); $this->show('events/events_index.tpl'); } public function get_event_flyin() { $id= DB::escape ($_GET[id]); $this->set('events', EventsData::get_flyin_events()); $this->set('history', EventsData::get_flyin_past_events()); $this->show('events/events_cat.tpl'); } public function get_event_tour() { $id= DB::escape ($_GET[id]); $this->set('events', EventsData::get_tour_events()); $this->set('history', EventsData::get_tour_past_events()); $this->show('events/events_index.tpl'); } public function get_event() { $id= DB::escape($_GET[id]); $this->set('event', EventsData::get_event($id)); $this->set('signups', EventsData::get_signups($id)); $this->show('events/events_event.tpl'); } public function get_past_event() { $id= DB::escape($_GET[id]); $this->set('event', EventsData::get_event($id)); $this->set('signups', EventsData::get_signups($id)); $this->show('events/events_past_event.tpl'); } public function signup() //admin { $eid = DB::escape($_GET[eid]); $pid = DB::escape($_GET[pid]); $time = DB::escape($_GET[time]); EventsData::event_signup($eid, $pid, $time); EventsData::add_ranking($pid); $this->set('event', EventsData::get_event($eid)); $this->set('signups', EventsData::get_signups($eid)); $this->show('events/events_event.tpl'); } public function remove_signup() //public { $id = $_GET[id]; $event = $_GET[event]; EventsData::remove_pilot_signup($id, $event); EventsData::subtract_ranking($id); $this->set('event', EventsData::get_event($event)); $this->set('signups', EventsData::get_signups($event)); $this->show('events/events_event.tpl'); } public function get_rankings() { $this->set('rankings', EventsData::get_rankings()); $this->show('events/events_rankings.tpl'); } } events_cat.tpl <h3><?php echo SITE_NAME; ?> Upcoming Events - Fly - In</h3> <?php if(!$events) { echo 'No Upcoming Events'; } else { ?> <center> <table border="1px" width="80%"> <tr> <td width="10%"><b>Date:</b></td> <td width="48%"><b>Event:</b></td> <td width="17%"><b>Category:</b></td> <td width="25%"><b>Details/Signups</b></td> </tr> <?php foreach($events as $event) { if($event->active == '2') { continue; } echo '<tr><td>'.date('n/j/Y', strtotime($event->date)).'</td>'; echo '<td>'.$event->title.'</td>'; echo '<td>'.$event->category.'</td>'; echo '<td><a href="'.SITE_URL.'/index.php/events/get_event?id='.$event->id.'">Details/Signups</a></td></tr>'; } ?> </table> </center> <?php } ?> <h3><?php echo SITE_NAME; ?> Past Events</h3> <?php if(!$history) { echo 'No Past Events'; } else { ?> <center> <table border="1px" width="80%"> <tr> <td width="25%"><b>Date:</b></td> <td width="60%"><b>Event:</b></td> <td><b>Details</b></td> </tr> <?php foreach($history as $event) { echo '<tr><td>'.date('n/j/Y', strtotime($event->date)).'</td>'; echo '<td>'.$event->title.'</td>'; echo '<td><a href="'.SITE_URL.'/index.php/events/get_past_event?id='.$event->id.'">Details</a></td></tr>'; } ?> </table> </center> <?php } ?> <hr /> <a href="<?php echo url('/events/get_rankings'); ?>">Show Pilot Rankings For Events</a> EventsData.class.php <?php //simpilotgroup addon module for phpVMS virtual airline system // //simpilotgroup addon modules are licenced under the following license: //Creative Commons Attribution Non-commercial Share Alike (by-nc-sa) //To view full license text visit http://creativecommons.org/licenses/by-nc-sa/3.0/ // //@author David Clark (simpilot) //@copyright Copyright (c) 2009-2010, David Clark //@license http://creativecommons.org/licenses/by-nc-sa/3.0/ class EventsData extends CodonData { public function get_events() { $query = "SELECT * FROM ".TABLE_PREFIX."events ORDER BY date ASC"; return DB::get_results($query); } public function get_upcoming_events() { $query = "SELECT * FROM ".TABLE_PREFIX."events WHERE date >= NOW() ORDER BY date ASC"; return DB::get_results($query); } public function get_past_events() { $query = "SELECT * FROM ".TABLE_PREFIX."events WHERE date < NOW() ORDER BY date DESC"; return DB::get_results($query); } public function get_event($id) { $query = "SELECT * FROM ".TABLE_PREFIX."events WHERE id='$id'"; return DB::get_row($query); } public function get_signups($id)//probably dont need! { $query = "SELECT * FROM ".TABLE_PREFIX."events_signups WHERE event_id='$id' ORDER BY time ASC"; return DB::get_results($query); } public function save_new_event($date, $time, $title, $description, $image, $dep, $arr, $schedule, $slot_limit, $slot_interval, $active) { $query = "INSERT INTO ".TABLE_PREFIX."events (date, time, title, description, image, dep, arr, schedule, slot_limit, slot_interval, active) VALUES ('$date', '$time', '$title', '$description', '$image', '$dep', '$arr', '$schedule', '$slot_limit', '$slot_interval', '$active')"; DB::query($query); } public function save_edit_event($date, $time, $title, $description, $image, $dep, $arr, $schedule, $slot_limit, $slot_interval, $active, $id) { $query = "UPDATE ".TABLE_PREFIX."events SET date='$date', time='$time', title='$title', description='$description', image='$image', dep='$dep', arr='$arr', schedule='$schedule', slot_limit='$slot_limit', slot_interval='$slot_interval', active='$active' WHERE id='$id'"; DB::query($query); } public function event_signup($eid, $pid, $time) { $query = "INSERT INTO ".TABLE_PREFIX."events_signups (event_id, pilot_id, time) VALUES('$eid', '$pid', '$time')"; DB::query($query); } public function signup_time($eid, $time) { $query = "SELECT * FROM ".TABLE_PREFIX."events_signups WHERE event_id='$eid' AND time='$time'"; return DB::get_row($query); } public function check_signup($pid, $eid) { $query = "SELECT COUNT(*) AS total FROM ".TABLE_PREFIX."events_signups WHERE event_id='$eid' AND pilot_id='$pid'"; return DB::get_row($query); } public function remove_signup($id) { $query = "DELETE FROM ".TABLE_PREFIX."events_signups WHERE id='$id'"; DB::query($query); } public function remove_pilot_signup($id, $event) { $query = "DELETE FROM ".TABLE_PREFIX."events_signups WHERE pilot_id='$id' AND event_id='$event'"; DB::query($query); } public function delete_event($id) { $query = "DELETE FROM ".TABLE_PREFIX."events WHERE id='$id'"; DB::query($query); $query2 = "DELETE FROM ".TABLE_PREFIX."events_signups WHERE event_id='$id'"; DB::query($query2); } public function add_ranking($pilot_id) { $query = "SELECT * FROM ".TABLE_PREFIX."events_pilotranks WHERE pilot_id='$pilot_id'"; $data = DB::get_row($query); if(!$data) { $query2 = "INSERT INTO ".TABLE_PREFIX."events_pilotranks (pilot_id, ranking) VALUES ('$pilot_id', '1')"; DB::query($query2); } else { $ranking = $data->ranking + 1; $query3 = "UPDATE ".TABLE_PREFIX."events_pilotranks SET ranking='$ranking' WHERE pilot_id='$pilot_id'"; DB::query($query3); } } public function subtract_ranking($pilot_id) { $query = "SELECT * FROM ".TABLE_PREFIX."events_pilotranks WHERE pilot_id='$pilot_id'"; $data = DB::get_row($query); if($data->ranking <= '1') { $query2 = "DELETE FROM ".TABLE_PREFIX."events_pilotranks WHERE pilot_id='$pilot_id'"; DB::query($query2); } else { $ranking = $data->ranking - 1; $query3 = "UPDATE ".TABLE_PREFIX."events_pilotranks SET ranking='$ranking' WHERE pilot_id='$pilot_id'"; DB::query($query3); } } public function get_rankings() { $query = "SELECT * FROM ".TABLE_PREFIX."events_pilotranks ORDER BY ranking DESC"; return DB::get_results($query); } public function get_flyin_events() { $query = "SELECT * FROM ".TABLE_PREFIX."events WHERE category = 'Fly-In' AND date >= NOW() ORDER BY date ASC"; return DB::get_results($query); } }
-
Hi guys! To add a category in mysql i added this to admin form (events_new_form.tpl) <input type="text" name="category" <?php if(isset($event)) {echo 'value="'.$event['category'].'"';} ?> the problem is when i submit a new event, the category dosent appear in my database. What is wrong? Reggards...