FiveStar Posted April 19, 2011 Report Posted April 19, 2011 Hi I have query for problem-solver which is when you go to ACARS Map page there is Option on Acars data table OF AC means Aircraft Name will show up there right so when i am putting variable to show Aircraft name there which is <%=flight.aircraftname%> it wont showing any thing on ACARS MAP table Blank and when i put <%=flight.aircraft%> It shows the result but only Digits Like 1, 15 ,29 ....................... now i have also implemented Live Flight board on my Front Page taken code from this post POST Again here it wont showing Aircraft type on Front Page the Row was blank instead of showing Aircraft name like B737. ATR i hope you understand Come back to me with some suggestion or fix...... I have seen on Forum member: Mark1Million VA on his front page there it was showing Aircraft name Correctly and if i am not wrong he has the same flight board redesigned for his skin.... Help would be much Appreciated need Exact details...... Regards Asmara Quote
Administrators Nabeel Posted April 19, 2011 Administrators Report Posted April 19, 2011 I'd have to look, I think you should use flight.type Quote
FiveStar Posted April 19, 2011 Author Report Posted April 19, 2011 @ Nabeel I will be looking Forward for your Help and Suggestion Soonest Need Exact Fix What and Where? Quote
TAV1702 Posted April 20, 2011 Report Posted April 20, 2011 I believe if you use acars or xacars it is not going to show aircraft. you have to use KACARS. I think it works correctly for fsfk....I could be wrong. And it will not show any details at all for anything on the flight board for fs passengers. So to put it in a blunt manner, use KACARS. It is your best option when testing your code. Well, for that matter, it is probably the best option to use any way you look at it. Quote
FiveStar Posted April 21, 2011 Author Report Posted April 21, 2011 Thanks for your reply and suggestion TAV i have checked it with kACARS and it was showing Aircraft name on my ACARS MAP and on Flight Board also but i also wanted to show Aircraft name while using FSACARS our main Flight Reporting Systems are kACARS and Fsacars so KACARS is Working Fully But FSCARAS is not Showing The AIRCRAFT name or Type so if someone could help me in this i will really appreciate it in any Manners i have seen this working on Many sites under PHPVMS Even i Think mark1million also have it working and maybe TOM and others have the working Flight Board........... Hope some one will come with Suggestion and FIX ? Quote
Moderators joeri Posted April 21, 2011 Moderators Report Posted April 21, 2011 i belive fsacars doenst shor the aircraft u use BTW fsacars is also not supported annymore Quote
Tom Posted April 21, 2011 Report Posted April 21, 2011 FSACARS should still work, it's just become a little outdated, technically still supported by the system though. Quote
Cor Posted April 21, 2011 Report Posted April 21, 2011 I have a few people flying around with FSACARS and it works very good. Made 1 or 2 changes in the config, but for the rest no problems yet Regards, Cor Quote
Moderators joeri Posted April 21, 2011 Moderators Report Posted April 21, 2011 i haven't saied it wouldn't work i just mentiont its not supported annymore bigg differance Quote
FiveStar Posted April 21, 2011 Author Report Posted April 21, 2011 Yea But maybe there is someway to get Aircraft name out of it....... someone here in the forums maybe have done some config with FSACARS Quote
Administrators Nabeel Posted April 23, 2011 Administrators Report Posted April 23, 2011 I'll fix this for the next version, it's a bit of a change Quote
FiveStar Posted April 23, 2011 Author Report Posted April 23, 2011 Oh Nabeel Thank-You Once again for your kind reply i thought maybe you forgot about this issue it was a good idea to FIX in next version but is there any possibility if you can do it now Please just asking Quote
Administrators Nabeel Posted April 23, 2011 Administrators Report Posted April 23, 2011 Oh Nabeel Thank-You Once again for your kind reply i thought maybe you forgot about this issue it was a good idea to FIX in next version but is there any possibility if you can do it now Please just asking I don't think so, when I get a chance to look into it completely. I don't like doing changes in between versions, esp since so much has changed internally for 3.0 Quote
Moderators mark1million Posted April 23, 2011 Moderators Report Posted April 23, 2011 Hi I have query for problem-solver which is when you go to ACARS Map page there is Option on Acars data table OF AC means Aircraft Name will show up there right so when i am putting variable to show Aircraft name there which is <%=flight.aircraftname%> it wont showing any thing on ACARS MAP table Blank and when i put <%=flight.aircraft%> It shows the result but only Digits Like 1, 15 ,29 ....................... now i have also implemented Live Flight board on my Front Page taken code from this post POST Again here it wont showing Aircraft type on Front Page the Row was blank instead of showing Aircraft name like B737. ATR i hope you understand Come back to me with some suggestion or fix...... I have seen on Forum member: Mark1Million VA on his front page there it was showing Aircraft name Correctly and if i am not wrong he has the same flight board redesigned for his skin.... Help would be much Appreciated need Exact details...... Regards Asmara Hi i created this board myself so i cant comment on how other have done it or what code your using in yours. Basically all you need to do is access the api and read the data from your acars table which will translate in to your board. This is the code to access the entries in the table, <?php $flights = ACARSData::GetACARSData(); if ($flights OR $fsfk > 0) { if($flights) { foreach($flights as $flight) { $pid = $flight->pilotid + 100;?> Then all you do is access the table row names with, <?php echo $flight->aircraftname?> Use the $flight->yourtablename?> and it will show. Hope that helps. Quote
FiveStar Posted April 23, 2011 Author Report Posted April 23, 2011 I have checked your code but Still no result BRO i have did little research on this i have noticed when i have gone to phpmyadmin in phpvms_schedules there are some rows and under aircraft row it was just showing text like 1,13,15,12 not showing aircraft names or not either REG number and when i have pasted your given code <td align="center"><font color="#010854"><?php echo $flight->aircraftname;?> <?php echo $flight->aircraft;?></td> it was just showing Digit 1 under Aircraft Row on my front page flight board Awaiting.......... Quote
Moderators mark1million Posted April 23, 2011 Moderators Report Posted April 23, 2011 OK well thats your problem then, go to your site admin and download all your aircraft in the csv format, edit the names and upload again, that should fix your problem. Quote
FiveStar Posted April 23, 2011 Author Report Posted April 23, 2011 (edited) Mark here are the Pics of my database and flight Board where do i change the names in CSV file under Aircraft Row i am putting Aircraft REG numbers attaching my Schedules example file please redit and tell me where to do the changes........... Image Removed Awaiting you...... Edited April 24, 2011 by Asmara Kamran Quote
Administrators simpilot Posted April 24, 2011 Administrators Report Posted April 24, 2011 The acars data only records the db id of the aircraft in flight, no other data. You need to convert that id into the aircraft data using the built in functions of the operations data class. A simple example for a front page flight board would be: Live Flights In Progress <table> <tr> <th>Flight #</th> <th>Pilot</th> <th>Aircraft</th> <th>Departure</th> <th>Arrival</th> <th>Altitude</th> <th>Phase</th> </tr> <?php $flights = ACARSData::GetACARSData(); if ($flights) { foreach ($flights as $flight) { $plane = OperationsData::getAircraftByReg($flight->aircraft); echo '<tr>'; echo '<td>' . $flight->flightnum . '</td>'; echo '<td>' . $flight->pilotname . '</td>'; echo '<td>' . $plane->fullname . '</td>'; echo '<td>' . $flight->depicao . '</td>'; echo '<td>' . $flight->arricao . '</td>'; echo '<td>' . $flight->alt . 'ft</td>'; echo '<td>' . $flight->phasedetail . '</td>'; echo '</tr>'; } } else { echo '<tr><td colspan="7">No Flights At This Time</td></tr>'; } ?> </table> Notice the data extraction on line 16 and how it is used on line 20. You can apply the same concept to the acars map but will need to change the sql function or add the data to the variable within the acars module. Quote
FiveStar Posted April 24, 2011 Author Report Posted April 24, 2011 (edited) Dear Simpilot First of all Thank you so much for your suggestion secondly i have used your given code but again it was not showing Aircraft Name Blank Row here is my code used for flight board please suggest code from it. <h2 style="text-align: center;">Flight Departures Board</h2> <?php if(!$lastbids) { echo '<p align="center">There are currently no booked flights!</p></div>'; return; } ?> <center> <table class="flight" width="100%" style="border:1px solid grey;" cellspacing="0" cellpadding="0" bgcolor="#1F1F1F"> <tr> <th align="center" style="background-color: #171717; width: 5%;"> </th> <th width="10%" align="center" style="background-color: #171717;">Flight</th> <th width="20%" align="center" style="background-color: #171717;">Departure</th> <th width="20%" align="center" style="background-color: #171717;">Arrival</th> <th width="20%" align="center" style="background-color: #171717;">Pilot Name</th> <th width="10%" align="center" style="background-color: #171717;">Aircraft</th> <th width="20%" align="center" style="background-color: #171717;">Status</th> </tr> <?php $params = $$lastbid->pilotid; $pilot = PilotData::GetPilotData($params); $pname = $pilot->firstname; $psurname = $pilot->lastname; ?> <?php $results = ACARSData::GetACARSData(); if (count($results) > 0) { foreach($results as $flight) { $plane = OperationsData::getAircraftByReg($flight->aircraft); ?> <tr> <td align="center"><?php if($flight->phasedetail == "Boarding") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Taxiing to Runway") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Taking Off") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Climbing") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Cruise") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Arrived") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ARRIVED.gif'>"; } elseif($flight->phasedetail == "Descending") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Level Flight") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "On Approach") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Taxiing to Gate") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Arrived") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ARRIVED.gif'>"; }?></td> <td align="center"><?php echo $flight->flightnum;?></td> <td align="center"><?php echo $flight->depname;?></td> <td align="center"><?php echo $flight->arrname;?></td> <td align="center"><?php echo $flight->pilotname;?></td> <td align="center"><?php echo $plane->fullname;?></td> <td align="center"><?php if($flight->phasedetail != 'Paused') { echo $flight->phasedetail; } else { echo "Cruise"; }?></font></td> </tr> <?php } } else { ?> <tr><td width="20%" align="center" colspan="6" style="padding: 5px; font-size: 13px; font-weight: bold; color: #ff961e;">No Flights in Progress!</td></tr> <?php } ?> </table> <p><i>The table will be updated every <?php echo Config::Get('ACARS_LIVE_TIME') ?> minutes.<br /></p> Can we use this command ---> $sql = "SELECT * FROM `phpvms_aircraft` LIMIT 0, 30 "; for your reference this is ow Operation Data class showing aircraft names /** * Get an aircraft according to registration */ public static function getAircraftByReg($registration) { $registration = DB::escape(strtoupper($registration)); $sql = 'SELECT * FROM ' . TABLE_PREFIX .'aircraft WHERE `registration`=\''.$registration.'\''; return DB::get_row($sql); } /** * Get an aircraft by name */ public static function getAircraftByName($name) { $name = DB::escape(strtoupper($name)); $sql = 'SELECT * FROM ' . TABLE_PREFIX .'aircraft WHERE UPPER(`name`)=\''.$name.'\''; return DB::get_row($sql); } Awaiting you.......... Edited April 24, 2011 by Asmara Kamran Quote
Administrators simpilot Posted April 24, 2011 Administrators Report Posted April 24, 2011 Not sure what all you have going on there, looks like a live flight board with remenants of a current bids board.... I changed your code to show the live flight board and it works on my test site. If you are still getting a blank in the "Name" section for the aircraft my guess would be that you have not assigned a full name to the aircraft in your admin panel. <table> <?php $results = ACARSData::GetACARSData(); if (count($results) > 0) { foreach($results as $flight) { $plane = OperationsData::getAircraftByReg($flight->aircraft); ?> <tr> <td align="center"> <?php if($flight->phasedetail == "Boarding") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Taxiing to Runway") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Taking Off") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Climbing") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Cruise") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Arrived") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ARRIVED.gif'>"; } elseif($flight->phasedetail == "Descending") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Level Flight") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "On Approach") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Taxiing to Gate") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/images/Boarding1.gif'>"; } else { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ARRIVED.gif'>"; } ?> </td> <td align="center"><?php echo $flight->flightnum;?></td> <td align="center"><?php echo $flight->depname;?></td> <td align="center"><?php echo $flight->arrname;?></td> <td align="center"><?php echo $flight->pilotname;?></td> <td align="center"><?php echo $plane->fullname;?></td> <td align="center"><?php echo $flight->phasedetail; ?></td> </tr> <?php } } else { ?> <tr><td width="20%" align="center" colspan="6" style="padding: 5px; font-size: 13px; font-weight: bold; color: #ff961e;">No Flights in Progress!</td></tr> <?php } ?> </table> And your reference to me using the wrong code to get the ac name, look at what you have posted - getAircraftBYname - You are wanting the name because you dont have it, so how are you going to find it by name? Nor do you have the registration, you only have the db id of the aircraft from acars data. Quote
FiveStar Posted April 24, 2011 Author Report Posted April 24, 2011 Dear Simpilot i have all the aircraft's full name in the database plus in admin panel here are the pics......... Image Removed maybe we can use select commands to fetch data directly from database dont know about PHP you know better Quote
Administrators simpilot Posted April 24, 2011 Administrators Report Posted April 24, 2011 Is there an aircraft id in your acars data table that is current? 1 Quote
FiveStar Posted April 24, 2011 Author Report Posted April 24, 2011 (edited) Dear sir this table is which you have seen is from phpvms_aircrafts table not phpvms_acars table my latest acars table is this Image Removed When i put $flight->aircraft it shows the same digits in this pic like this Image Removed there is a ID row you can see it? Edited April 24, 2011 by Asmara Kamran Quote
Administrators simpilot Posted April 24, 2011 Administrators Report Posted April 24, 2011 that is your schedules table Quote
FiveStar Posted April 24, 2011 Author Report Posted April 24, 2011 (edited) This is my Aircraft Data table Image Removed and this is my Schedules data Table Image Removed Edited April 24, 2011 by Asmara Kamran Quote
Administrators simpilot Posted April 24, 2011 Administrators Report Posted April 24, 2011 Again, Is there any current data in your acars data table? 1 Quote
FiveStar Posted April 24, 2011 Author Report Posted April 24, 2011 (edited) yes there is current Data in my table here you can see it its showing some flights.............. ACARS DATA TABLE Image Removed Edited April 24, 2011 by Asmara Kamran Quote
Administrators simpilot Posted April 24, 2011 Administrators Report Posted April 24, 2011 Do this then, <table> <?php $results = ACARSData::GetACARSData(); if (count($results) > 0) { foreach($results as $flight) { if($flight->client == 'FSACARS') {$plane = OperationsData::getAircraftInfo($flight->aircraft);} else {$plane = OperationsData::getAircraftByReg($flight->aircraft);} ?> <tr> <td align="center"> <?php if($flight->phasedetail == "Boarding") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Taxiing to Runway") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Taking Off") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Climbing") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Cruise") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Arrived") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ARRIVED.gif'>"; } elseif($flight->phasedetail == "Descending") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "Level Flight") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/Boarding1.gif'>"; } elseif($flight->phasedetail == "On Approach") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ONAPPROCH.gif'>"; } elseif($flight->phasedetail == "Taxiing to Gate") { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/images/Boarding1.gif'>"; } else { echo "<img style='padding-left:3px;' src='http://www.vpia.org/VirtualPIA/lib/skins/brilliancev1/images/ARRIVED.gif'>"; } ?> </td> <td align="center"><?php echo $flight->flightnum;?></td> <td align="center"><?php echo $flight->depname;?></td> <td align="center"><?php echo $flight->arrname;?></td> <td align="center"><?php echo $flight->pilotname;?></td> <td align="center"><?php echo $plane->fullname;?></td> <td align="center"><?php echo $flight->phasedetail; ?></td> </tr> <?php } } else { ?> <tr><td width="20%" align="center" colspan="6" style="padding: 5px; font-size: 13px; font-weight: bold; color: #ff961e;">No Flights in Progress!</td></tr> <?php } ?> </table> 4 Quote
FiveStar Posted April 24, 2011 Author Report Posted April 24, 2011 Oh Man You are a Genius this WORD is also to Small i have just heard your name in PHP Masters but now have seen it from my eyes it was working like a CHARM guys i was looking for this thing from almost 1 month and Simpilot has done it got a success WOW So so so so Happy simpilot thank you so much from bottom of my heart really you are a very special man in phpvms god bless you dear Thanks thanks alot............ guys who wanted now to show Aircraft name on Flight board use this Special code From Simpilot it will show Aircrafts Name VIA FSACARS Client...... SIMPILOT ROCKS +1 Post ***SOLVED** Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.