avdesigns Posted April 1, 2012 Report Share Posted April 1, 2012 Hello, I have two problems when I phpecho the days the route is flown it says 1 2 3 4 5 6, is there a way to change this and also at the end of the list it always displays a blank schedule <?php if(!$allroutes) { echo '<p align="center">No routes have been found!</p>'; return; } ?> <style type="text/css"> <!-- .style1 {color: #CCCCCC} --> </style> <table border="0" class="tablesorter" id="tabledlist"> <thead> <tr> <th bgcolor="#63003A"><div align="left"><span class="style1">Flight Info</span></div></th> <th bgcolor="#63003A"><span class="style1">Options</span></th> </tr> </thead> <tbody> <?php foreach($allroutes as $route) { /* Uncomment this code if you want only schedules which are from the last PIREP that pilot filed */ /*if(Auth::LoggedIn()) { $search = array( 'p.pilotid' => Auth::$userinfo->pilotid, 'p.accepted' => PIREP_ACCEPTED ); $reports = PIREPData::findPIREPS($search, 1); // return only one if(is_object($reports)) { # IF the arrival airport doesn't match the departure airport if($reports->arricao != $route->depicao) { continue; } } }*/ /* Skip over a route if it's not for this day of week Left this here, so it can be omitted if your VA doesn't use this. Comment out these two lines if you don't want to. */ /* Check if a 7 is being used for Sunday, since PHP thinks 0 is Sunday */ /* END DAY OF WEEK CHECK */ /* This will skip over a schedule if it's been bid on This only runs if the below setting is enabled If you don't want it to skip, then comment out this code below by adding // in front of each line until the END DISABLE SCHEDULE comment below If you do that, and want to show some text when it's been bid on, see the comment below */ if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0) { continue; } /* END DISABLE SCHEDULE ON BID */ /* Skip any schedules which have aircraft that the pilot is not rated to fly (according to RANK), only skip them if they are logged in. */ if(Config::Get('RESTRICT_AIRCRAFT_RANKS') === true && Auth::LoggedIn()) { /* This means the aircraft rank level is higher than what the pilot's ranklevel, so just do "continue" and move onto the next route in the list */ if($route->aircraftlevel > Auth::$userinfo->ranklevel) { continue; } } /* THIS BEGINS ONE TABLE ROW */ ?> <tr> <td> <a href="<?php echo url('/schedules/details/'.$route->id);?>"><?php echo $route->code . $route->flightnum?> <?php echo '('.$route->depicao.' - '.$route->arricao.')'?> </a> <br /> <strong>Departure: </strong><?php echo $route->deptime;?> <strong>Arrival: </strong><?php echo $route->arrtime;?><br /> <strong>Equipment: </strong><?php echo $route->aircraft; ?> (<?php echo $route->registration;?>) <strong>Distance: </strong><?php echo $route->distance . Config::Get('UNITS');?> <br /> <br /> <?php echo ($route->route=='') ? '' : '<strong>Route: </strong>'.$route->route.'<br />' ?> <strong>Day's Flown: </strong><?php echo $route->daysofweek;?> <?php # Note: this will only show if the above code to # skip the schedule is commented out if($route->bidid != 0) { echo 'This route has been bid on'; } ?> </td> <td nowrap> <a href="<?php echo url('/schedules/details/'.$route->id);?>">View Details</a><br /> <a href="<?php echo url('/schedules/brief/'.$route->id);?>">Pilot Brief</a><br /> <?php # Don't allow overlapping bids and a bid exists if(Config::Get('DISABLE_SCHED_ON_BID') == true && $route->bidid != 0) { ?> <a id="<?php echo $route->id; ?>" class="addbid" href="<?php echo actionurl('/schedules/addbid');?>">Add to Bid</a> <?php } else { if(Auth::LoggedIn()) { ?> <a id="<?php echo $route->id; ?>" class="addbid" href="<?php echo url('/schedules/addbid');?>">Add to Bid</a> <?php } } ?> </td> </tr> <tr> <td bgcolor="#63003A"><span class="style1">Flight Info</span></td> <td nowrap bgcolor="#63003A"><span class="style1">Options</span></td> </tr> <?php /* END OF ONE TABLE ROW */ } ?> </tbody> </table> <hr> Thanks Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted April 1, 2012 Moderators Report Share Posted April 1, 2012 You mean changing those numbers to Sun Mon... etc? If yes, I think of using the following: If($route->daysofweek == 1) { <?php echo'Sunday' ;?> } and repeat that for each number. Quote Link to comment Share on other sites More sharing options...
avdesigns Posted April 1, 2012 Author Report Share Posted April 1, 2012 Thats not working for me? Quote Link to comment Share on other sites More sharing options...
Moderators Parkho Posted April 1, 2012 Moderators Report Share Posted April 1, 2012 What's gonna work for you then? Quote Link to comment Share on other sites More sharing options...
avdesigns Posted April 1, 2012 Author Report Share Posted April 1, 2012 Ok where do I put this then? 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.