Jump to content

Parkho

Moderators
  • Posts

    1381
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Parkho

  1. you're missing a function in your PIREPData.class.php if you see the function in the class file then the function has a bug.
  2. I see that you've added the call inside the foreach loop with a counter. Try calling it out side the loop. I have tested the function and it worked correctly on my side.
  3. Try this: <?php echo date("Y-m-d", $pilot->joindate);?>
  4. Put this in any class file like OperationsData at the end: public static function pilot_pay($pilotid) { #Get the flight time from last submitted pirep by the pilot $ft = "SELECT flighttime FROM phpvms_pireps WHERE pilotid = '$pilotid' ORDER BY submitdate DESC"; $flttme = DB::get_row($ft); #Extract the hour from it $hr = intval($flttme->flighttime); #Now the minutes $mn = ($flttme->flighttime - $hr) * 100; #Put everything together as minutes $min = ($hr * 60) + $mn; #How much the pilotpay is $fr = "SELECT pilotpay FROM phpvms_pireps WHERE pilotid = '$pilotid' ORDER BY submitdate DESC"; $payrate = DB::get_row($fr); #pilot pay per minute $pay = $payrate->pilotpay / 60; #We need total money for the pilot $pp = "SELECT totalpay FROM phpvms_pilots WHERE pilotid = '$pilotid'"; $ppay = DB::get_row($pp); $pipay = $payrate->totalpay; #Multiply it by the minutes $ftupdt = $min * $pay; #Add it to pilot money $ttalpay = $ftupdt + $pipay; $totalpay = ROUND($ttalpay, 2); #Update the table $updt = "UPDATE phpvms_pilots SET totalpay = '$totalpay' + totalpay WHERE pilotid = '$pilotid'"; DB::query($updt); } Then call it like this: OperationsData::pilot_pay(Auth::$userinfo->pilotid); Remember if you call the function inside pilot profile, pilotpay column will get updated with the last pirep submitted on each page load, so I suggest u call it inside filereport function and as soon as you hit the accept button it will update the profile.
  5. Absolutely nothing!
  6. You can create a function to get the pay rate from PIREPS and multiply it by the hours of the PREP and update the pilot pay in pilots table then call the function in pilot profile giving it the pilot ID. I think this is much faster solution than actually fixing the bug. I can write the code for it if you want.
  7. You need to change your DB query to fetch data ordered by pilot ID. Try this: $sql = "SELECT * FROM phpvms_pilots ORDER BY pilotid"
  8. Can u try it with google chrome or firefox?
  9. Would you like to give me access to your cpanel so that I can look thorough and find the problem?
  10. There is a restriction on the results page on pilot's rank. If the pilot's rank is lower than the aircraft's rank used in the schedule then the system will not show that schedule. Try transferring to different locations to see if this is the case.
  11. I do have a custom CSS but that shouldn't be a problem since it can be modified.
  12. Are you logged in when you open the module? Do you see your current location at the first page?
  13. When you open the module what do you see as the current location? If it's empty then you're missing something in the installation process.
  14. Attached, I'm sending you my pilots_list.php which is working as we have this conversation. Put this file inside your skin folder and if it doesn't work then I think you better reinstall phpvms. pilots_list.php
  15. Did you replace the whole pilots_list.php with my code?
  16. The code I provided is for the whole page. replace all content with mine.
  17. Can copy your whole codes?
  18. What's in line 66?
  19. yw.
  20. ok then you need to add it like this: Config::Set('SIGNATURE_FONT_PATH', SITE_ROOT.'/lib/fonts/ARLRDBD.TTF'); You need to add this first. : Config::Set('SIGNATURE_USE_CUSTOM_FONT', true);
  21. Open local.config.php and look for '# Options for the signature that's generated' and see what the font path is.
  22. Try this: <table> <?php $sql1 = "SELECT * FROM phpvms_pilots"; $pilots = DB::get_results($sql1); $sql2 = "SELECT * FROM phpvms_airports"; $airps = DB::get_results($sql2); foreach($airps as $airp) { if($airp->hub > 0) { $h = $airp->icao; $p = "SELECT * FROM phpvms_pilots WHERE hub = '$h'"; $pi = DB::get_results($p); ?> <thead> <tr><td align="center" colspan="6" ><font size="4"><?php echo $airp->icao;?> (<?php echo $airp->name;?>)</font></td></tr> <tr><th style="text-align: center;" bgcolor="#00405e" colspan="6"> </th></tr> <tr> <td>Pilot ID</td> <td>Pilot Location</td> <td>Pilot Name</td> <td>Pilot Rank</td> <td>Pilot Total Flights</td> <td>Pilot Total Hours</td> </tr> </thead> <?php foreach($pi as $p) { if(!$pi) { ?> <tr><td colspan="6">No Pilots At This HUB</td></tr> <?php } else { $rank = "SELECT * FROM phpvms_ranks WHERE rank = '$p->rank'"; $ran = DB::get_row($rank); ?> <tr> <td><a href="<?php echo url('/profile/view/'.$p->pilotid);?>"><?php echo $p->code.$p->pilotid;?></a></td> <td><img src="<?php echo Countries::getCountryImage($p->location);?>" alt="<?php echo Countries::getCountryName($p->location);?>" ></td> <td><?php echo $p->firstname.' '.$p->lastname?></td> <td><img src="<?php echo $ran->rankimage?>" alt="<?php echo $p->rank;?>" ></td> <td><?php echo $p->totalflights;?></td> <td align="center"><?php echo Util::AddTime($p->totalhours, $p->transferhours); ?></td> </tr> <?php } } } } ?> </table
  23. Are they all used under the same skin?
  24. Not that I know of!!
  25. For date joined, inside the foreach loop add a table row like this: <tr><td>Date Joined:</td></tr> . . . . <tr><td><?php echo $pilot->joindate ;?></td></tr> For the last arrival location inside foreach loop: <?php $pid = $pilot->pilotid; $sql = "SELECT * FROM phpvms_pireps WHERE pilotid = '$pid' ORDER BY submitdate DESC"; $pirep = DB::get_row($sql); ?> <tr><td>Last Location:</td></tr> . . . . <tr><td><?php echo $pirep->arricao ;?></td></tr>
×
×
  • Create New...