示例#1
0
//              2   Valence - Beaune                254.8   295     55      2:50
//              3   Beaune - Auxerre                153.2   188     35      1:40
//          6   Auxerre - Brecht (thuis)
//CreateRoute(1, '2015-12-23 02:30');
//CreateRoute(2, '2016-01-02 12:00');
//CreateRoute(3, '2016-01-02 12:00');
//CreateRoute(4, '2016-01-03 10:00');
//CreateRoute(51, '2016-01-02 10:00');
CreateRoute(52, '2016-01-02 10:00');
exit;
//CreateRoute(6, '2016-01-03 10:00');
echo 'TrpDetail for trip 10 :<br>===============<br> ';
echo json_encode(GetTripDetail(10));
echo '<br><br>';
echo 'TrpDetail for trip 14 :<br>===============<br> ';
echo json_encode(GetTripDetail(14));
//echo CalculateChargeTime(50, 350);
//echo CalculateChargeNeeded(350);
/*
 $startdate = '2015-10-25 10:30';
$uu = substr($startdate, 11,2);
$nn = substr($startdate, 14,2);
$dd = substr($startdate, 8, 2);
$mm = substr($startdate, 5, 2);
$jj = substr($startdate, 0, 4);

echo $jj.'/'.$mm.'/'.$dd.'   '.$uu.'.'.$nn;
*/
/*
for ($x = 10; $x <= 380; $x = $x + 10) {
    echo 'Typical '. $x.' km is '.CalculateEnergy($x) .' kWh <br>';
示例#2
0
        $wp->retrieve($wpId);
        $wp->att('departuredistance', $departuredistance);
        $wp->att('departuretypical', $departuretypical);
        $wp->att('departureconsumption', $departureconsumption);
        $wp->att('departuretime', time());
        $wp->att('statusid', WaypointStatus::STATUS_LEFT);
        $wp->save();
        // change status of Trip for start at first waypont
        if ($wp->att('typeid') == WaypointType::TYPE_STARTPOINT) {
            $trip = new trip();
            $trip->retrieve($tripId);
            $trip->att('statusid', TripStatus::STATUS_STARTED);
            $trip->save();
        }
        // retrieve the data
        echo json_encode(GetTripDetail($tripId));
        break;
    default:
        echo '';
        break;
}
function LogIn($car, $password)
{
    //-----------------------------------------
    $error = '';
    $login = '';
    if ($car != '38855' && $car != '93777' && $car != 'TEST') {
        $error = 'Onbekend VIN, auto niet gekend';
    } else {
        if ($password == '') {
            $login = 'readonly';