Jump to content

orobouros

Members
  • Posts

    39
  • Joined

  • Last visited

Posts posted by orobouros

  1. 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

  2. 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>";
    ?>

     

  3. 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.

  4. 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

  5. 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 :

    553013screenwamp.jpg

     

    Is someone know where is the problem please ?

     

    Best regards

  6. 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 :

    Quote

    Kacars_free Version Error
    VA is requiring version 1.0.1.1. Contact your site administrator!
    You will not be allowed to connect!!

    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 ? :(

     

  7. 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.

  8. 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

  9. 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.

  10. 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.

  11. 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

  12. 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.

×
×
  • Create New...