md82 Posted June 20, 2010 Report Posted June 20, 2010 basically I want to take information from custom pirep fields and display it in my airline stats. Example: I added a custom dropdown field in the file pirep page to specify if that pilot flew online or not... I want have an "online flights" total number in the airline stats page.. thanks for all the help Quote
md82 Posted June 22, 2010 Author Report Posted June 22, 2010 <dt>Pilot flown with:</dt> <dd> <select name="code" id="code"> <option value="">Select Pilot Code</option> <?php foreach($allpilots as $pilot) { $sel = ($_POST['code'] == $pilot->code || $bid->pilotid == $pilot->pilotid)?'selected':''; echo '<option value="'.$pilot->id.'" '.$sel.'>'.$pilot->code.' - '.$pilot->pilotid.'</option>'; } ?> </select> </dd> attempting a custom dropdown pirep field that loads the pilot numbers example: AAY-1234 I get the dropdown but its not loading any pilot codes, and gives me an error at the top of the page.. thanks Quote
Administrators simpilot Posted June 28, 2010 Administrators Report Posted June 28, 2010 Not sure exactly what you are trying to do but maybe this will work for you: <select name="code" id="code"> <option value="">Select Pilot Code</option> <?php $allpilots = PilotData::getAllPilots(); foreach($allpilots as $pilot) { echo '<option value="'.$pilot->pilotid.'">'.$pilot->firstname.' '.$pilot->lastname.' - '.PilotData::getPilotCode($pilot->code, $pilot->pilotid).'</option>'; } ?> </select> This is pretty rough, you should be setting the variable in the module, not calling it in the template, like this-> $this->set('allpilots', PilotData::getAllPilots()); 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.