Jump to content

Parkho

Moderators
  • Posts

    1375
  • Joined

  • Last visited

  • Days Won

    5

Everything posted by Parkho

  1. $allactivities should read the data from a class file. Something like : $allactivities = ActivityData::getActivity();
  2. Yeah, I have to get that part fixed when I get a chance. Thanks for bringing that to my attention.
  3. Small modification: <?php class GetSchedules extends CodonData { public function getscheds() { $sql = "SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC"; return DB::get_results($sql); } } ?> The .tpl: <?php $list = GetSchedules::getscheds(); ?> Upcoming Arrivals - Current Time is <?php echo date('G:i') ;?></h3> <table width="100%" border="1"> <tr> <td>Departure</td> <td>Arrival</td> <td>Arrival Time</td> <td>Aircraft</td> <td>Status</td> </tr> <?php $count = 0; foreach($list as $flight) { if(($flight->arrtime + 0) > date('G:i')) { if($count < 5) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); ?> <tr> <td><?php echo $flight->depicao ;?></td> <td><?php echo $flight->arricao ;?></td> <td><?php echo $flight->arrtime ;?></td> <td><?php echo $aircraft->fullname ;?></td> <td> <?php if(($flight->arrtime - date('G:i')) <= 1) { echo 'Arriving Soon'; } else { echo 'In Flight'; } $count++; ?> </td> </tr> <?php } } } ?> </table> Screen Shot:
  4. Here is how it works my way: 1. Create a class file like GetSchedules.class.php and paste the following in there and save it. Then upload into your core/common folder: <?php class GetSchedules extends CodonData { publicfunction getscheds() { $sql = SELECT * FROM phpvms_schedules ORDER BY arrtime + 0 ASC"; return DB::get_results($sql); } } ?> 2. Use a table where you want to show the pulled out data like this: <?php $list = GetSchedules::getscheds(); ?> Upcoming Arrivals - Current Time is <?php echo date('G:i') ;?></h3> <table width="100%" border="1"> <tr> <td>Departure</td> <td>Arrival</td> <td>Arrival Time</td> <td>Aircraft</td> <td>Status</td> </tr> <?php $count = 0; foreach($list as $flight) { if(($flight->arrtime + 0) > date('G:i')) { if($count < 5) { $aircraft = OperationsData::getAircraftInfo($flight->aircraft); ?> <tr> <td><?php echo $flight->depicao ;?></td> <td><?php echo $flight->arricao ;?></td> <td><?php echo $flight->arrtime ;?></td> <td><?php echo $aircraft->fullname ;?></td> </tr> <tr> <td> <?php if(($flight->arrtime - date('G:i')) <= 1) { echo 'Arriving Soon'; } else { echo 'In Flight'; } $count++; ?> </td> </tr> } } } </table>
  5. Bellow is your code with errors: <?php foreach($allaircraft as $aircraft) { if($aircraft->registration == $schedule->registration)//($schedule->registration) doesn't exist so this part wouldn't work. $sel = 'selected';//This is totally useless in the code so you can remove it. else //The same as above. $sel = '';//The same as above. echo ''.$aircraft->fullname.'';// when you want to echo the raw data from Data Base you don't need "." and "'", so remove them. } ?> So with corrections the code would be like this: <?php $allaircraft = OperationsData::getAllAircraft();//This would be the main feed of your code. foreach($allaircraft as $aircraft) { echo $aircraft->fullname; } ?>
  6. You're very welcome. Glad I could help.
  7. Change it to this: $sql='SELECT * FROM phpvms_pilots ORDER BY pilotid DESC LIMIT 4, '.intval($limit);
  8. In the following code: <?php class GetPilotData extends CodonData { public function getallpilots($limit) { $sql='SELECT * FROM phpvms_pilots ORDER BY pilotid DESC LIMIT '.intval($limit); return DB::get_results($sql); } } ?> Change " ORDER BY pilotid DESC " to " ORDER BY pilotid ASC" and you should be home safe.
  9. Try this: $dep_airport->country Hope this works.
  10. You could also create an index.html and upload it in your www folder and rename the index.php but keep in mind your website might not function correctly. What I did was I created a folder and uploaded the phpvms files in there then I installed the software. This way, I could create my own index.html and basically link to phpvms from there using <iframe>.
  11. If you take 180 out of 205 that's gonna be 3 hours and the remaining is 25 minutes, so 3.25 is correct
  12. So you have aircraft positioning as an add-on?
  13. You can't lock aircraft as the PIREPS are not based on aircraft positioning. In fact phpvms has no aircraft positioning, so what you can do is to disable the schedules which have the same aircraft registration.
  14. You need to create a second airline in phpvms and name it "6K". Then change the code at registration point to show only "INX" so that your pilots have only this option when they register. Then create your routes with "6K".
  15. The button is in fact inside a form and basically triggers the form to be submitted, so inside your tpl you'll have it like this: <form action="<?php echo url('/yourmodule') ;?>" method="post"> <input type="submit" name="submit" value="submit"> </form> $data is a variable. You would use that the get data for one row of records for example: $result = YourData::getdata($data); echo $result->column_name;
  16. Okay here is how you'll do: 1. create a module for you form. 2. create a class for you module. 3. create a tpl to show the form. The module is pretty much the heart where you will get the data and pass it on to the class and there the data will be processed and returns the results back to the module. Now the module shows the results in a tpl or like message. I assume you know how to create a module, so I go to class file, the sample function to insert data into the table would be something like this: public function insertdata($data) { $sql = "INSERT INTO phpvms_data (column_name)VALUES($data)"; DB::query($sql); } To get the data from the table you would write something like this: public function getdata($data) { $sql = "SELECT * FROM phpvms_data WHERE column_name ='$data'"; return DB::get_results($sql); }
  17. Did you check the local.config.php for that line of code to see if it's already not there before you paste the one from app.config.php? make sure you didn't double entry.
  18. That's because of the aircraft id. It happens if the aircraft id is not the same as the pirep's aircraft and it could be the same situation if the schedule's aircraft is changed or deleted but that does not affect the PIREPS and Pilot's hours and number of flights.
  19. Open pireps_list.tpl in admin/templates and look for the following button: <?php # If there was an error, don't allow the PIREP to go through if($error == false) { ?> <button href="<?php echo SITE_URL?>/admin/action.php/pirepadmin/<?php echo $load; ?>?pilotid=<?php echo $pirep->pilotid?>" action="approvepirep" id="<?php echo $pirep->pirepid;?>" class="pirepaction {button:{icons:{primary:'ui-icon-check'}}}">Accept</button> <?php } ?> Now you need to add an if statement to it like this: <?php # If there was an error, don't allow the PIREP to go through if($error == false) { if($pirep->pilotid != Auth::$userinfo->pilotid) { ?> <button href="<?php echo SITE_URL?>/admin/action.php/pirepadmin/<?php echo $load; ?>?pilotid=<?php echo $pirep->pilotid?>" action="approvepirep" id="<?php echo $pirep->pirepid;?>" class="pirepaction {button:{icons:{primary:'ui-icon-check'}}}">Accept</button> <?php } } ?> This will remove the "accept" button if the pirep belongs to the staff.
  20. I think you can change the units frm kg to lbs in local config.php at the following line but I never tried it myself: Config::Set('LiquidUnit', '2'); # 0=liter 1=gal 2=kg 3=lbs
×
×
  • Create New...