17-08-2005, 12:12 PM
The cargo weight is given in lbs in the flight logs.
But the total cargo weight in FsPlistflight.php is summ of all lbs CargoWeight and then given in kg...
So I made those little alterations in the FsPlistflight.php scripts
///////////////////// THIS IS THE LIST TABLE OUTPUT ///////////////////////////////////////////////////////////
if(!isset($listflight))
{
$CompanyFlightTime="00:00:00";
$TotalPassengers=0;
$TotalCargolbs=0; // renamed from $TotalCargo to specify the unit
-
-
-
-
echo "</td></tr>";
$Line=!$Line;
settype($row["CargoWeight"],"integer");
$TotalCargolbs+=$row["CargoWeight"]; // The summ will be in lbs
}
echo $ListStop;
$TotalCargoShortTon = $TotalCargolbs * 0.0005; //The standard US according to http://www.ilpi.com/msds/ref/massunits.html
$TotalCargoShortTonneMetrique = $TotalCargoShortTon * 0.907; //The metric ton
if ($userlanguage == 33) {
// English speaking users will get results in short tons "," as thousand separator "." as decimal séparator
$TotalCargo = $TotalCargoShortTonneMetrique;
$WeightUnit = " Tonnes métriques";
$sepd = ',';
$sepm = ' ';
} elseif ($userlanguage == 44) {
// French speaking users will get results in metric tons " " as thousand separator "," as decimal séparator
$TotalCargo = $TotalCargoShortTon;
$WeightUnit = " ShortTons";
$sepd = '.';
$sepm = ',';
}
echo "<font face=arial><br><br>".$ListStart.$TDListOdd;
echo $AppliLabel["FlightListTM"] .": <b>" . $NrfFlights."</b><br>";
echo $AppliLabel["FlightListTT"] .": <b>" . $CompanyFlightTime."</b><br>";
echo $AppliLabel["FlightListTP"] .": <b>" . number_format($TotalPassengers,0,$sepd,$sepm) ."</b><br>";
echo $AppliLabel["FlightListTC"] .": <b>" . number_format($TotalCargo,3,$sepd,$sepm) . $WeightUnit . "</b>" . $ListStop;
}
But the total cargo weight in FsPlistflight.php is summ of all lbs CargoWeight and then given in kg...
So I made those little alterations in the FsPlistflight.php scripts
///////////////////// THIS IS THE LIST TABLE OUTPUT ///////////////////////////////////////////////////////////
if(!isset($listflight))
{
$CompanyFlightTime="00:00:00";
$TotalPassengers=0;
$TotalCargolbs=0; // renamed from $TotalCargo to specify the unit
-
-
-
-
echo "</td></tr>";
$Line=!$Line;
settype($row["CargoWeight"],"integer");
$TotalCargolbs+=$row["CargoWeight"]; // The summ will be in lbs
}
echo $ListStop;
$TotalCargoShortTon = $TotalCargolbs * 0.0005; //The standard US according to http://www.ilpi.com/msds/ref/massunits.html
$TotalCargoShortTonneMetrique = $TotalCargoShortTon * 0.907; //The metric ton
if ($userlanguage == 33) {
// English speaking users will get results in short tons "," as thousand separator "." as decimal séparator
$TotalCargo = $TotalCargoShortTonneMetrique;
$WeightUnit = " Tonnes métriques";
$sepd = ',';
$sepm = ' ';
} elseif ($userlanguage == 44) {
// French speaking users will get results in metric tons " " as thousand separator "," as decimal séparator
$TotalCargo = $TotalCargoShortTon;
$WeightUnit = " ShortTons";
$sepd = '.';
$sepm = ',';
}
echo "<font face=arial><br><br>".$ListStart.$TDListOdd;
echo $AppliLabel["FlightListTM"] .": <b>" . $NrfFlights."</b><br>";
echo $AppliLabel["FlightListTT"] .": <b>" . $CompanyFlightTime."</b><br>";
echo $AppliLabel["FlightListTP"] .": <b>" . number_format($TotalPassengers,0,$sepd,$sepm) ."</b><br>";
echo $AppliLabel["FlightListTC"] .": <b>" . number_format($TotalCargo,3,$sepd,$sepm) . $WeightUnit . "</b>" . $ListStop;
}
![[Image: banniere064.png]](http://www.britair-virtual.com/bannieres/banniere064.png)