Guest Posted July 15, 2011 Report Share Posted July 15, 2011 Hello everyone!! Does anyone know the code to put this on the home page!!...I include photos Thanks for the help and best Regards Quote Link to comment Share on other sites More sharing options...
dimitris Posted July 15, 2011 Report Share Posted July 15, 2011 Hi! For the map use this code: change "5" to any number of flights you like <?php $flights = PIREPData::getRecentReportsByCount(5); $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> <img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=650x360&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" /> and for the flight board use this: <?php $count = 5; $pireps = PIREPData::getRecentReportsByCount($count); ?> <table width="100%"> <tdead> <tr> <td>Flight No</td> <td">Departure</td> <td>Arrival</td> <td>Duration</td> <td>Pilot</td> <td>Status</td> </tr> </tdead> <tbody> <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); if($pirep->accepted == '0') $status = 'REJECTED'; if($pirep->accepted == '1') $status = 'ACCEPTED'; else $status = 'PENDING'; } ?> <tr> <td><?php echo $pirep->code.$pirep->flightnum; ?></td> <td><?php echo $pirep->depicao; ?></td> <td><?php echo $pirep->arricao; ?></td> <td><?php echo $pirep->flighttime; ?></td> <td><?php echo $pilotinfo->firstname.' '.$pilotinfo->lastname; ?></td> <td><?php if($pirep->accepted == PIREP_ACCEPTED) echo 'Accepted'; elseif($pirep->accepted == PIREP_REJECTED) echo 'Rejected'; elseif($pirep->accepted == PIREP_PENDING) echo 'Approval Pending'; elseif($pirep->accepted == PIREP_INPROGRESS) echo 'Flight in Progress'; ?> </td> </tr> <?php }} else { echo '<tr><td>There are no recent flights!</td></tr>'; } ?> </tbody> </table> 2 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 16, 2011 Report Share Posted July 16, 2011 thank you very much sir another question how can I put the reject in red words pending approval in yellow and accepted in verde Quote Link to comment Share on other sites More sharing options...
stuartpb Posted July 16, 2011 Report Share Posted July 16, 2011 if($pirep->accepted == PIREP_ACCEPTED) echo '<span style="color:#whatever">Accepted</span>'; elseif($pirep->accepted == PIREP_REJECTED) echo '<span style="color:#whatever">Rejected</span>'; elseif($pirep->accepted == PIREP_PENDING) echo '<span style="color:#whatever">Approval Pending</span>'; elseif($pirep->accepted == PIREP_INPROGRESS) echo '<span style="color:#whatever">Flight in Progress</span>'; That's a quick and dirty way, you would just set the whatever to a valid hex colour value. You would be better applying classes to the spans, and set the attributes in your CSS stylesheet. Something like this: if($pirep->accepted == PIREP_ACCEPTED) echo 'span class="accept">Accepted</span>'; elseif($pirep->accepted == PIREP_REJECTED) echo '<span class="reject">Rejected</span>'; elseif($pirep->accepted == PIREP_PENDING) echo '<span class="pending">Approval Pending</span>'; elseif($pirep->accepted == PIREP_INPROGRESS) echo '<span class="inprog">Flight in Progress</span>'; Then in your CSS: .reject {color:#whatever} .accept {color:#whatever} .pending {color:#whatever} .inprog {color:#whatever} It's always best to use the CSS stylesheet to apply styling, as it makes life much easier. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 16, 2011 Report Share Posted July 16, 2011 Thanks for the help sir!!! Quote Link to comment Share on other sites More sharing options...
dimitris Posted July 16, 2011 Report Share Posted July 16, 2011 mattia You should change the #whatever to what ever you wanna do with CSS. A good reference is here: http://www.w3schools.com/css/css_background.asp Regards, 1 Quote Link to comment Share on other sites More sharing options...
Jeff Posted July 17, 2011 Report Share Posted July 17, 2011 To point out another thing you can also do if you change the background to a darker color, is to change the text color of the text in that box (or whole table if you want) by using this code: <font color="#FFFFFF">Your Text</font> The #FFFFFF is the color white. If you'd like to use any other color, try looking at this link: External Link Quote Link to comment Share on other sites More sharing options...
James142 Posted July 17, 2011 Report Share Posted July 17, 2011 I rather http://www.colorpicker.com/ Quote Link to comment Share on other sites More sharing options...
Jeff Posted July 17, 2011 Report Share Posted July 17, 2011 Well, personally, I use the ColorZilla addon for Firefox. Just hover your mouse over anything on your screen, click and it has the color ready for you to add. Quote Link to comment Share on other sites More sharing options...
Josf Posted April 18, 2012 Report Share Posted April 18, 2012 thanks In the first code <table width="100%"> <tdead> <tr> <td>Flight No</td> <td">Departure</td> <td>Arrival</td> <td>Duration</td> <td>Pilot</td> <td>Status</td> </tr> </tdead> <tbody> have a " Fantastic Worck Quote Link to comment Share on other sites More sharing options...
Curshad Posted July 19, 2012 Report Share Posted July 19, 2012 I got this Error PHP Error Message Warning: Invalid argument supplied for foreach() in /home/a7590429/public_html/lib/skins/brilliancev1/frontpage_main.tpl on line 85 Quote Link to comment Share on other sites More sharing options...
Curshad Posted July 19, 2012 Report Share Posted July 19, 2012 Anybody? Quote Link to comment Share on other sites More sharing options...
SouthwestVA Posted July 22, 2012 Report Share Posted July 22, 2012 post your frontpage_main.tpl file. Quote Link to comment Share on other sites More sharing options...
Curshad Posted July 22, 2012 Report Share Posted July 22, 2012 Am sorry I already got it fixed Sorry if this wasted your time. Quote Link to comment Share on other sites More sharing options...
simonecatalano Posted August 30, 2013 Report Share Posted August 30, 2013 IT possible insert the landing rate and the Aircraft? What the code? Thanks Quote Link to comment Share on other sites More sharing options...
simonecatalano Posted August 30, 2013 Report Share Posted August 30, 2013 (edited) I got this Error PHP Error Message Warning: Invalid argument supplied for foreach() in /home/a7590429/public_html/lib/skins/brilliancev1/frontpage_main.tpl on line 85 Try copy this <?php $flights = PIREPData::getRecentReportsByCount(10); < ---------------------- insert at your choise (10) $string = ""; foreach($flights as $flight) { $string = $string.$flight->depicao.'+-+'.$flight->arricao.',+'; } ?> <style type="text/css"> #tabledlist { color: #7d3200; } </style> <img src="http://www.gcmap.com/map?P=<?php echo $string ?>&MS=bm&MR=240&MX=650x300&PM=pemr:diamond7:red%2b%22%25I%22:red&PC=%230000ff" /> <?php $count = 5; $pireps = PIREPData::getRecentReportsByCount($count); ?> <table id="tabledlist" class="tablesorter" width="100%" border = "1"> <thead> <tr> <th bgcolor="#7d3200"><font color="#FFFFFF">Flight</font></th> <th bgcolor="#7d3200"><font color="#FFFFFF">Departure</font></th> <th bgcolor="#7d3200"><font color="#FFFFFF">Arrival</font></th> <th bgcolor="#7d3200"><font color="#FFFFFF">Duration</font></th> <th bgcolor="#7d3200"><font color="#FFFFFF">Pilot</font></th> <th bgcolor="#7d3200"><font color="#FFFFFF">Status</font></th> </tr> </tdead> <tbody> <?php if(count($pireps) > 0) { foreach ($pireps as $pirep) { { $pilotinfo = PilotData::getPilotData($pirep->pilotid); $pilotid = PilotData::getPilotCode($pilotinfo->code, $pilotinfo->pilotid); if($pirep->accepted == '0') $status = 'REJECTED'; if($pirep->accepted == '1') $status = 'ACCEPTED'; else $status = 'PENDING'; } ?> <tr> <td><?php echo $pirep->code.$pirep->flightnum; ?></td> <td><?php echo $pirep->depicao; ?></td> <td><?php echo $pirep->arricao; ?></td> <td><?php echo $pirep->flighttime; ?></td> <td><?php echo $pilotinfo->firstname.' '.$pilotinfo->lastname; ?></td> <td><?php if($pirep->accepted == PIREP_ACCEPTED) echo 'Accepted'; elseif($pirep->accepted == PIREP_REJECTED) echo 'Rejected'; elseif($pirep->accepted == PIREP_PENDING) echo 'Approval Pending'; elseif($pirep->accepted == PIREP_INPROGRESS) echo 'Flight in Progress'; ?> </td> </tr> <?php }} else { echo '<tr><td>There are no recent flights!</td></tr>'; } ?> </tbody> </table> Bye Edited August 30, 2013 by simonecatalano Quote Link to comment Share on other sites More sharing options...
simonecatalano Posted September 4, 2013 Report Share Posted September 4, 2013 Thanks Quote Link to comment Share on other sites More sharing options...
FlightDeckES Posted August 11, 2019 Report Share Posted August 11, 2019 (edited) thanks Edited August 11, 2019 by FlightDeckES 1 Quote Link to comment Share on other sites More sharing options...
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.