Jump to content

orobouros

Members
  • Posts

    39
  • Joined

  • Last visited

Everything posted by orobouros

  1. With the solution of adding a column, i loose all stats before today. The goal is to have all the scheduled flights to have finance sheets for all months since creation of the phpvms website (2016).
  2. Thanks, but in my opinion there's no need to add column. code='xxx' is already used to check scheduled flight. When i test my request in PHPMyAdmin with values instead of $month->ym (ex: month(submitdate)=3) i have the good result. It's this code wich is wrong, and i don't know how do this
  3. I use a personnal ACARS, created only for my company. But I don't see the relationship between ACARS and finance. In my opinion, it's only a problem of database request and PHP.
  4. Hello, In the finance module, it's the total of flights by month wich is mentionned (scheduled flgihts + free flights). But i want to have just scheduled flights to have the right number. How can i do this please ? Actually it's like this (here $month->total return all the flights.) : <td align="center"> <?php echo $month->total; ?> </td> i try this without success : <td align="center"> <?php $scheduledFlights="SELECT COUNT(pirepid) as totalflights FROM phpvms_pireps WHERE month(submitdate)=".$month->ym." and (code='xxx')"; $resultScheduledFlights=DB::get_results($scheduledFlights); $totalScheduledFlights=$resultScheduledFlights[0]->totalflights; echo $totalScheduledFlights; ?> </td> Regards
  5. Hi all, here's the new skin i've made for my VA. Full screen, responsive, mega menu and many other things : http://arcadair.fr/
  6. i've made this, it works for me : <table class="Table"> <!-- entête du tableau --> <thead> <tr> <th>Division - #ligne</th> <th>Dép. ICAO</th> <th>Arr. ICAO</th> <th>Appareil</th> <th>Distance</th> <th>Prix billet</th> <th>Opérations</th> </tr> </thead> <?php $params = array( 's.code' => array ('xxx') ); $schedules = SchedulesData::findSchedules($params); foreach($schedules as $sched){ echo '<tbody>'; echo '<tr>'; echo '<td>'.$sched->code.' - '.$sched->flightnum.'</td> <td>'.$sched->depicao.'</td> <td>'.$sched->arricao.'</td> <td>'.$sched->aircraft.'</td> <td>'.ceil($sched->distance).' nm</td> <td>'.$sched->price.' €</td> <td><a href="'.SITE_URL.'/index.php/schedules/brief/'.$sched->id.'">Briefing</td>'; echo "</tr>"; } echo "</tbody>"; echo "</table>"; ?>
  7. First I've made a folder in core/modules folder with a file containing a class wich extends codonModule. Then in core/templates folder, i've written the code above in a file called by the file in core/module folder. I want an automatisation of differents lists of schedules sorted by company code, on differents pages.
  8. Hi, I want to list schedules by code, as it is in my sql request ($requete). This code is working, but i think it's not the best way to connect to database. Does another way exist to connect to database safely without writing directly username, host, password and dbname ? <table class="myTable"> <!-- entête du tableau --> <thead> <tr> <th>#ligne</th> <th>Dép. ICAO</th> <th>Arr. ICAO</th> <th>Appareil</th> <th>Distance</th> <th>Prix billet</th> <th>Opérations</th> </tr> </thead> <?php $conn = mysqli_connect('host', 'username', 'password', 'dbname'); $requete = "SELECT p.id, p.code, p.flightnum, p.depicao, p.arricao, fullname, p.distance, p.price FROM phpvms_schedules p INNER JOIN phpvms_aircraft a ON p.aircraft=a.id WHERE code='XXX'"; $res = $conn->query($requete); while ($element = mysqli_fetch_array($res)) { echo '<tbody>'; echo '<tr>'; echo '<td>'.$element['code'].' - '.$element['flightnum'].'</td> <td>'.$element['depicao'].'</td> <td>'.$element['arricao'].'</td> <td>'.$element['fullname'].'</td> <td>'.ceil($element['distance']).' nm</td> <td>'.$element['price'].' €</td> <td><a href="'.SITE_URL.'/index.php/schedules/brief/'.$element['id'].'">Briefing</td>'; echo "</tr>"; } echo "</tbody>"; echo "</table>"; ?> Thanks for helping me, Best regards
  9. Hi, I want to copy my phpvms site locally. To do this, i have proceeded like this : 1 - Export of my database. 2 - Create a new database in WAMP with phpmyadmin and import the database. 3 - Download all folders and files with Filezilla and copy this in wamp/www/phpvms_folder. After that, i've changed the following settings in local.config.php : define('DBASE_USER', 'root'); // default login of WAMP define('DBASE_PASS', ''); // default password of WAMP (no password) define('DBASE_NAME', 'db_phpvms'); // The name of my DB locally in phpMyAdmin define('DBASE_SERVER', 'localhost'); define('DBASE_TYPE', 'mysql'); define('TABLE_PREFIX', 'phpvms_'); define('SITE_URL', 'localhost/phpvms_folder'); But with this, i have this when i go in localhost/phpvms_folder i have the following errors : Is someone know where is the problem please ? Best regards
  10. Ok, thank you for this quick answer. I change the version on my VA website.
  11. Hello, i use kACARS v1.0.1.1 with no problems on the website of my VA (no problems with FS9, FSX, X-Plane and P3D except v4). But some pilots fly with P3D V4 and have this error message : These pilots try to use rhe kACARS version 1.0.1.4 with .NET 4.0 and FSUIPC5 as recommanded, but still have this issue. How can i solve this please ?
  12. Sorry for the late answer. I can't do a cron job because it's not a dedicated server. Auto cancellation seems to have a strange behaviour. I've set 48 in the local config file and it works (48 hours delay). But if i set 24 it doesn't work. So i've set 48 hours and it's ok.
  13. Hello, as we have transfered hours from our old website wich was not a phpvms, i would like to add transfer hours to the total hours. How can i do that please ?
  14. Ok, I answer to myself and for the community. If you want to unlock checkin for PIREP, you must edit the core/modules/pirep/pirep.php and erase the 7 lines after "# Only allow for valid routes to be filed" wich check if the PIREP is a scheduled flight.
  15. Hello, The pilots of my VA do many non scheduled IFR flights, in various places of the world, and a lot of VFR on the same model. It works fine with the KACARS tracker but i would like a real manual PIREP system wich allows pilots to send a PIREP of any kind with the values they choose to enter. The only condition to respect may be that each field must be filled, but i don't want to check if a scheduled flight exists, wich is the case actually. I've tried some solutions by myself but each time when i test it, it doesn't work. How can i do to allows pilot to send all PIREPS they want manually ? Here's the pirep_new.php page i've tried to modify without success : <br /><br /> <?php if(isset($message)) echo '<div id="error">'.$message.'</div>'; ?> <form action="<?php echo url('/pireps/mine');?>" method="post"> <dl> <dt>Pilot:</dt> <dd><strong><?php echo Auth::$userinfo->firstname . ' ' . Auth::$userinfo->lastname;?></strong></dd> <dt>Select Airline:</dt> <dd> <select name="code" id="code"> <option value="">Select your airline</option> <?php foreach($allairlines as $airline) { $sel = ($_POST['code'] == $airline->code || $bid->code == $airline->code)?'selected':''; echo '<option value="'.$airline->code.'" '.$sel.'>'.$airline->code.' - '.$airline->name.'</option>'; } ?> </select> </dd> <dt>Enter Flight Number:</dt> <dd><input type="text" name="flightnum" value="<?php if(isset($bid->flightnum)) { echo $bid->flightnum; }?><?php if(isset($_POST['flightnum'])) { echo $_POST['flightnum'];} ?>" /></dd> <dt>Select Departure Airport:</dt> <dd> <div id="depairport"> <select id="depicao" name="depicao"> <option value="">Select a departure airport</option> <?php foreach($allairports as $airport) { $sel = ($_POST['depicao'] == $airport->icao || $bid->depicao == $airport->icao)?'selected':''; echo '<option value="'.$airport->icao.'" '.$sel.'>'.$airport->icao . ' - '.$airport->name .'</option>'; } ?> </select> </div> </dd> <dt>Select Arrival Airport:</dt> <dd> <div id="arrairport"> <select id="arricao" name="arricao"> <option value="">Select an arrival airport</option> <?php foreach($allairports as $airport) { $sel = ($_POST['arricao'] == $airport->icao || $bid->arricao == $airport->icao)?'selected':''; echo '<option value="'.$airport->icao.'" '.$sel.'>'.$airport->icao . ' - '.$airport->name .'</option>'; } ?> </select> </div> </dd> <dt>Select Aircraft:</dt> <dd> <select name="aircraft" id="aircraft"> <option value="">Select the aircraft of this flight</option> <?php foreach($allaircraft as $aircraft) { /* Skip any aircraft which have aircraft that the pilot is not rated to fly (according to RANK) */ if(Config::Get('RESTRICT_AIRCRAFT_RANKS') === true) { /* 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($aircraft->ranklevel > Auth::$userinfo->ranklevel) { continue; } } $sel = ($_POST['aircraft'] == $aircraft->name || $bid->registration == $aircraft->registration)?'selected':''; echo '<option value="'.$aircraft->id.'" '.$sel.'>'.$aircraft->name.' - '.$aircraft->registration.'</option>'; } ?> </select> </dd> <?php // List all of the custom PIREP fields if(!$pirepfields) $pirepfields = array(); foreach($pirepfields as $field) { ?> <dt><?php echo $field->title ?></dt> <dd> <?php // Determine field by the type if($field->type == '' || $field->type == 'text') { ?> <input type="text" name="<?php echo $field->name ?>" value="<?php echo $_POST[$field->name] ?>" /> <?php } elseif($field->type == 'textarea') { echo '<textarea name="'.$field->name.'">'.$field->values.'</textarea>'; } elseif($field->type == 'dropdown') { $values = explode(',', $field->options); echo '<select name="'.$field->name.'">'; foreach($values as $value) { $value = trim($value); echo '<option value="'.$value.'">'.$value.'</option>'; } echo '</select>'; } ?> </dd> <?php } ?> <dt>Fuel Used</dt> <dd><input type="text" name="fuelused" value="<?php echo $_POST['fuelused']; ?>" /> <p>This is the fuel used on this flight in <?php echo Config::Get('LIQUID_UNIT_NAMES', Config::Get('LiquidUnit'))?></p></dd> <dt>Flight Time</dt> <dd><input type="text" name="flighttime" value="<?php echo $_POST['flighttime'] ?>" /> <p>Enter as hours - "5.30" is five hours and thirty minutes</p></dd> <dt>Route</dt> <dd><textarea name="route"><?php echo (!isset($_POST['route'])) ? $bid->route : $_POST['route']; ?></textarea> <p>Enter the route flown, or default will be from the schedule</p></dd> <dt>Comment</dt> <dd><textarea name="comment"><?php echo $_POST['comment'] ?></textarea></dd> <dt></dt> <dd><?php $bidid = ( isset($bid) )? $bid->bidid:$_POST['bid']; ?> <input type="hidden" name="bid" value="<?php echo $bidid ?>" /> <input type="submit" name="submit_pirep" value="File Flight Report" /></dd> </dl> </form> thank you by advance if you have a solution for my problem
  16. It works fine. I've tested this with 3 flights this morning and all of them are ok. A big thank you for this quick and efficient solution !
  17. I've done this modifications. It seems to work but i wait some flights from my pilots to confirm that this is not reseting number of flights to 1 as before. I give you an answer as soon as possible. Many thanks for your job and spending your time for other people.
  18. I would like the same transfer system for number of flights than for the hours with transfer. So, in the pilot profile in admin, a field to fill with transfer number of flights. Here's the original code in admin/template/pilots_details.php : <tr> <td>Total flights</td> <td><input type="text" name="totalflights" value="<?php echo $pilotinfo->totalflights;?>" /></td> </tr> <tr> <td>Total hours</td> <td><?php echo $pilotinfo->totalhours;?> <input type="hidden" name="totalhours" value="<?php echo $pilotinfo->totalhours;?>" /> </td> </tr> <tr> <td>Transfer hours</td> <td><input type="text" name="transferhours" value="<?php echo $pilotinfo->transferhours;?>" /></td> </tr> and after, the same addition in the pilot_public_profil.php, like it is for hours, where totalhours are added with transferhours : <th width="25%">Hours</font></b></th> <td width="25%"><?php echo Util::AddTime($userinfo->totalhours, $userinfo->transferhours); ?></td> It works fine for Hours, but when i try to do the same thing for flights, it goes wrong.
  19. Hello, for my new VA website, the last big problem for me is the transfer of the number of flights. When i update the number of flights in the pilot profile, this number turns to 1 when a pilot fly for the first time on the new site. It's resetting the number of flights in the database. I've try to do the same thing wich works with the transfer hours. So i've created a new column "transferflights" in the pilots table of the database. In my admin/template/pilots_details.php, i've added this code : <td>Total flights</td> <td><input type="text" name="totalflights" value="<?php echo $pilotinfo->totalflights;?>" /></td> </tr> <tr> <td>Transfer flights</td> <td><input type="text" name="transferflights" value="<?php echo $pilotinfo->transferflights;?>" /></td> </tr> <tr> <td>Total hours</td> <td><?php echo $pilotinfo->totalhours;?> <input type="hidden" name="totalhours" value="<?php echo $pilotinfo->totalhours;?>" /> </td> </tr> <tr> <td>Transfer hours</td> <td><input type="text" name="transferhours" value="<?php echo $pilotinfo->transferhours;?>" /></td> </tr> and after, i suppose i have to change this code in the pilot_public_profil.php to add transferflights and totalflights values. <th width="25%">Flights</font></b></th> <td width="25%"><?php echo $userinfo->totalflights?></td> But i've tried several solutions without success. Anyone has an idea to solve my problem ? Thank you by advance
  20. Excellent ! A big thank you for this solution, it works !
  21. I've tried to adapt this solution to my case, but without success. This the code to replace, but i don't know how : <td width="1%" nowrap><center><a href="<?php echo url('/profile/view/'.$pilot->pilotid);?>"> <?php echo PilotData::GetPilotCode($pilot->code, $pilot->pilotid)?></a></center> </td> The name of the group is "administrators" in the database. I'm not very good in php syntax. I understand your solution, but i've tried some solutions and it gives me all the time different syntax errors.
  22. We only know this by reading the staff page, and i want change the color in pilots list to highlight the staff members. It is just configured in backend, by adding a pilot in the administrator group. Did i missed something in the admin panel, any option ?
  23. Here is our brand new website : http://www.arcadair.fr
  24. Hello, i would like to change the color of the callsign of the staff members in the pilots list. How can i do that ? (example : Turn staff callsign color in red instead of normal pilot color wich is blue in my case). I've search on the forum without success. Anyone has a solution ?
×
×
  • Create New...