Jump to content

Aaron

Members
  • Posts

    184
  • Joined

  • Last visited

Everything posted by Aaron

  1. this was solved, I guess I double posted, I added aircraft regs and its fine now
  2. I'm trying to make a booking module, and I don't get any errors, but it doesn't update the flight schedules. I think it has something to do with the mySQL update. Here's the booking.php I havn't made any .tpl and dont think I need to, this is my first module and still figuring it out. <?php class Booking extends CodonModule { public function index() { $this->set('pilotcode', PilotData::GetPilotCode(Auth::$userinfo->code, Auth::$userinfo->pilotid)); ?> <p><span style="color: rgb(128,0,0)"><strong><span style="font-size: 36px">Book a Flight</span></strong></span></p> <form action="http://www.canforce.org/index.php/booking/results" method="post"> <?php if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { ?> <input type="hidden" name="flightnum" value="00<?php echo $pilotid?>" /> <?php } else { ?> <input type="hidden" name="flightnum" value="<?php echo $pilotid?>" />; <?php } ?> <b>Departure Airport ICAO:</b> <input name="depicao" /><br /> <b>Arrival Airport ICAO:</b> <input name="arricao" /><br /> <b>Aircraft:</b> <select id="aircraft" name="aircraft"> <option selected="selected" value="12">CC-130</option> <option value="13">CC-130J</option> <option value="17">CC-150</option> <option value="4">CC-144</option> <option value="7">CT-142</option> <option value="1">CP-140</option> <option value="20">CC-138</option> <option value="22">CU-170</option> <option value="10">CT-156</option> <option value="8">CC-177</option> <option value="3">CC-115</option> <option value="2">CP-140A</option> <option value="19">CT-114</option> <option value="11">CT-155</option> <option value="14">CF-18</option> <option value="16">F-35</option> <option value="18">CH-124</option> <option value="9">CH-146</option> <option value="6">CH-149</option> <option value="15">CH-139</option> <option value="21">CH-148</option> <option value="5">CH-147D</option></select> <br /> <b>Route:</b> <input name="route" /><br /> <b>Altitude:</b> <input name="flightlevel" /><br /> <input type="submit" value="Submit" /></form> <?php } public function Results() { ?> <?php $con = mysql_connect("xxxx","xxxx","xxxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("canforce_phpvmsinstall", $con); mysql_query(" UPDATE phpvms_schedules SET depicao = '$_POST[depicao]' arricao = '$_POST[arricao]' route = '$_POST[route]' aircraft = '$_POST[aircraft]' flightlevel = '$_POST[flightlevel]' WHERE flightnum = '$_POST[flightnum]' "); mysql_close($con) ?> <?php } } ?>
  3. Can anybody tell me how to add a training notes field somewhere. The field is just to add a record of training sessions and general notes etc. Any ideas are appreciated.
  4. Ya, it shows the rank properly on the pilot profile, but in the admin center it always shows the lowest rank in the dropdown
  5. Anybody have any ideas to fix the one for the rank
  6. Is there a way to see which questions the pilot got right/wrong and not just the overall mark? I knoow the pilot can see which ones they got after they submit it, but they cant ever see it again and neither can the admins. Is there a way to fix this?
  7. It's not hard to add that, just add a text field in the admin panel, make sure the box show in profile is checked, and if you go in Edit Profile then you can edit it in there. Also there was a problem saving the stuff in edit profile, here's link to a topic that solves it: http://forum.phpvms.net/topic/6719-edit-profile-fix/
  8. Correction, it's the profile_edit.tpl you need to replace it in
  9. I fixed it Replace the code at the very bottom of editprofile.tpl with this code. It looks very similar, just an extra line at the top. <input type="hidden" name="pilotid" value="<?php echo $pilotinfo->pilotid;?>" /> <input type="hidden" name="action" value="saveprofile" /> <input type="submit" name="submit" value="Save Changes" />
  10. I fixed the code for this one, just the formatting messed up now. All the custom field are inline with each other, I tryed adding some </br>'s but none of the worked. Heres the code: <tr> <?php if($customfields) { foreach($customfields as $field) { echo '<td>'.$field->title.'</td> <td>'; if($field->type == 'dropdown') { $field_values = SettingsData::GetField($field->fieldid); $values = explode(',', $field_values->value); echo "<select name=\"{$field->fieldname}\">"; if(is_array($values)) { foreach($values as $val) { $val = trim($val); if($val == $field->value) $sel = " selected "; else $sel = ''; echo "<option value=\"{$val}\" {$sel}>{$val}</option>"; } } echo '</select>'; } elseif($field->type == 'textarea') { echo '<textarea class="customfield_textarea"></textarea>'; } else { echo '<input type="text" name="'.$field->fieldname.'" value="'.$field->value.'" />'; } echo '</td>'; } } ?> </tr>
  11. I configured the edit profile with the fields I want, but when you hit the submit button, It brings you to the pilotcenter and it says profile saved, but the profile didn't acctualy save. Can someone help me please, I searched and found similar topics, but they weren't answered. I think it's the form action, not sure though. <h3>Edit Profile</h3> <form action="<?php echo url('/profile');?>" method="post" enctype="multipart/form-data"> <dl> <dt>Name</dt> ;... form part looks fine <dt></dt> <dd><input type="hidden" name="action" value="saveprofile" /> <input type="submit" name="submit" value="Save Changes" /></dd> </dl> </form>
  12. In the admin panel, my rank auto-calculate is set to false, so there is a dropdown box to select the pilots rank. This dropdown box always shows the lowest rank "officer cadet". The same thing happens for the custom field dropdowns. I think I've identified the problem codes but cant figure out why they're wrong. Rank code: <tr> <td>Current Rank</td> <td> <?php if(Config::Get('RANKS_AUTOCALCULATE') == false) { $allranks = RanksData::GetAllRanks(); echo '<select name="rank">'; foreach($allranks as $rank) { echo "<option value=\"{$rank->rankid}\">{$rank->rank}</option>"; } echo '</select>'; } else { echo $pilotinfo->rank; } ?></td> </tr> Custom Field code: <?php if($customfields) { foreach($customfields as $field) { ?> <tr> <td><?php echo $field->title;?></td> <td> <?php if($field->type == 'dropdown') { echo "<select name=\"{$field->fieldname}\">"; $values = explode(',', $field->fieldvalues); if(is_array($values)) { foreach($values as $val) { $sel = ($field->value === $val) ? 'sel="selected"' : ''; $val = trim($val); echo "<option value=\"{$val}\" {$sel} >{$val}</option>"; } } echo '</select>'; } elseif($field->type == 'textarea') ;... rest doesnt apply because text areas show up fine What I'm thinking is wrong is that it it loads the options, but it doesn't load the current value. Any suggestions? Thanks
  13. Aaron

    Module

    I made a module so pilots can add flights to the database. I cleared the errors, but it sid it can't find the class "Auth" or "PilotGroups". Help me please. Here's the relevant code (.php) It is the action for a form that u put the departure and arrival airports etc. I only put the relevant part, below it connects to the database and updates the table where flightnum=$pilotid. Help is appreciated, I searched and fund out the code changes depending on location of the file or something so thats what I'm guessing happened. <?php $pilotid = Auth::$userinfo->pilotid; echo $pilotid; ?> <?php if(PilotGroups::group_has_perm(Auth::$usergroups, ACCESS_ADMIN)) { ?> <input type="hidden" name="flightnum" value="00<?php echo $pilotid?>" />; <?php } else { ?> <input type="hidden" name="flightnum" value="<?php echo $pilotid?>" />; <?php } ?>
  14. I have the same problem. It's not just the avatar, it's all of the settings in there that don't get saved, can anyone help us please.
  15. I want to change the order on the my PIREPS so that oldest are at the top. I found a setting in appdata but cant find it in localconfig, so I changed it from I think ASC to DEC, there was a note on what it does. It doesn't seem to work, anybody know how to do this?
  16. Thanks it worked and Jeff I searched n couldn't find it.
  17. How can I change the update time for the live map? It updates properly during the flight and shows me landed, but after I submit the PIREP and finish, it still shows me on the live map for the rest of the day maybe longer. Help plz
  18. It worked, I assigned a reg and they all good.
  19. Figured it out sorta. I had no registrations set on all of the aircraft so the aircraft registration was submitted by KAcars as ' ' and every single aircraft had nothing there so every aircraft came up because they all have that reg. I'll make regs and hope.
  20. There's something wrong with the aircraft, it's making a copy for every aircraft. I added the an aircraft section on the live flight maps and it shows blank aircraft for XAcars and an entry for every aircraft for KAcars
  21. It doesn't seem to affect the flight map or anything, is there a way I can make an if..then statement to not display doubles?
  22. not work, it looks like a problem with KAcars, these two guys are usign KAcars n it doesn't work properly, I'm using XAcars and it works fine. Current Flights CFC001 - Aaron Schpitzer CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC002 - Josh Gheron CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang CFC003 - Stephen Yang Recent Reports
×
×
  • Create New...