예제 #1
0
파일: rapport-gen.php 프로젝트: jcmwc/fleet
while ($tblconduite = fetch($linkconduite)) {
    //recherche si le jour fait partie du mois
    $tabjour = explode(" ", $tblconduite["time"]);
    if ($lastjour != $tabjour[0]) {
        $first = true;
        $lastspeed = 0;
        $lastlat = 0;
        $lastlon = 0;
        $lastdistance = 0;
        $semaine[$tabjour[0]]["debut"] = 0;
        $lastjour = $tabjour[0];
        $i = 0;
        $trajet = array();
        $debut = 0;
        $fin = 0;
        $semaine[$tabjour[0]]["date"] = affichedateiso($tabjour[0]) . " - " . jourfr(dayOfWeek(strtotime($tabjour[0])) - 1);
    }
    //$semaine[$tabjour[0]]["km"]+=(int)$tblconduite["distance_next"]/1000;
    $distance = 0;
    if ($lastlat != $tblconduite["latitude"] && $lastlon != $tblconduite["longitude"]) {
        if ($lastlat != 0 && $lastlon != 0) {
            //print "ici2";
            $distance = haversineGreatCircleDistance($lastlat, $lastlon, $tblconduite["latitude"], $tblconduite["longitude"]) / 1000;
            $semaine[$tabjour[0]]["km"] += round($distance, 2);
            $totaldistance += $semaine[$tabjour[0]]["km"];
        }
    }
    $semaine[$tabjour[0]]["vitessemax"] = $semaine[$tabjour[0]]["vitessemax"] > vitessekmh($tblconduite["speed"]) ? $semaine[$tabjour[0]]["vitessemax"] : vitessekmh($tblconduite["speed"]);
    // if(($lastspeed!=$tblconduite["speed"]&&$lastspeed==0)||($lastdistance!=$distance&&$lastdistance==0)){
    if ($lastspeed != $tblconduite["speed"] && $lastspeed == 0 || $lastlat != round($tblconduite["latitude"], 4) && $lastlon != round($tblconduite["longitude"], 4) && !$first && $tblconduite["speed"] != 0) {
        $semaine[$tabjour[0]]["debut"] = $semaine[$tabjour[0]]["debut"] == 0 ? $tblconduite["time"] : $semaine[$tabjour[0]]["debut"];
예제 #2
0
파일: form.php 프로젝트: jcmwc/fleet
<?php

if ($_GET["mode"] == "visu" || $_GET["mode"] == "suppr") {
    print value_print(affichedateiso($myvalue));
} else {
    $myvalue = $myvalue == "" ? date("Y") . "/" . date("m") . "/" . date("d") : $myvalue;
    //$myvalue=($tabelem[2]!="yes"&&$_GET["mode"]=="ajout")?"":$myvalue;
    print '<input type="text" id="' . $tabelem[0] . '" name="' . $tabelem[0] . '" size="10" maxlength="10" value="' . affichedateiso($myvalue) . '"><img src="../images/datepopup.gif" id="trigger' . $tabelem[0] . '" style="cursor:pointer; cursor:hand;">';
    print '<script type="text/javascript">
              /*Calendar.setup(
                {
                  inputField  : "' . $tabelem[0] . '",         // ID of the input field
                  ifFormat    : "%d/%m/%Y",    // the date format
                  button      : "trigger' . $tabelem[0] . '"       // ID of the button
                }
              );*/
              top.calendar[top.calendar.length]={
                  inputField  : "' . $tabelem[0] . '",         // ID of the input field
                  ifFormat    : "%d/%m/%Y",    // the date format
                  button      : "trigger' . $tabelem[0] . '"       // ID of the button
                };
            </script>';
}
예제 #3
0
            <p>Catégorie : <span><?php 
        echo $tbl_list_alarme[$i]["listcat"];
        ?>
</span></p>  
            <p>Km compteur : <span><?php 
        echo $tbl_list_alarme[$i]["kmactuel"] + $tbl_list_alarme[$i]["kminit"] + $tbl_list_alarme[$i]["correctifkm"];
        ?>
</span></p>          
          </div>
        </td>
        <td><input type="text" name="km" placeholder="0" value="<?php 
        echo $tbl_list_alarme[$i]["km"];
        ?>
"></td>
        <td><input type="text" name="date" placeholder="jj/mm/aa" value="<?php 
        echo affichedateiso($tbl_list_alarme[$i]["date"]);
        ?>
"></td>
        <td>
        <select name="entretien_compte">
        <?php 
        for ($j = 0; $j < count($tbl_list_type); $j++) {
            ?>
        <option value="<?php 
            echo $tbl_list_type[$j]["entretien_compte_id"];
            ?>
" <?php 
            echo $tbl_list_type[$j]["entretien_compte_id"] == $tbl_list_alarme[$j]["entretien_compte_id"] ? "selected" : "";
            ?>
><?php 
            echo $tbl_list_type[$j]["libelle"];
예제 #4
0
파일: situation.php 프로젝트: jcmwc/fleet
        $debut .= $tbl_info;
    }
    $tbl["adresse"] = $debut;
    $tbl["agence"] = $key_list_agence[$tbl["agence_compte_id"]];
    $tabval = etatvoiturecouleur($tbl["phantom_device_id"]);
    $tbl["couleur"] = $tabval[1];
    if ($tabval[0] == 1) {
        $nbgo++;
        $tbl["moteur"] = "Moteur Allumé";
    } else {
        $nbstay++;
        $tbl["moteur"] = "Moteur Eteint";
    }
    $tbl["time"] = affichedatetime($tbl["time"]);
    //gestion des entretiens
    $sql = "select * from " . __racinebd__ . "alarme_entretien ae inner join " . __racinebd__ . "entretien_compte ec on ae.entretien_compte_id=ec.entretien_compte_id where device_id=" . $tbl["phantom_device_id"] . " and supprimer=0";
    $linkentretien = query($sql);
    $tbl["entretien"] = "";
    while ($tblentretien = fetch($linkentretien)) {
        $tbl["entretien"] .= $tblentretien["libelle"] . " " . ($tblentretien["km"] == 0 ? affichedateiso($tblentretien["date"]) : $tblentretien["km"] . "km") . "<br>";
    }
    //$tbl
    if ($_POST["etat"] != "") {
        if ($_POST["etat"] == $tabval[0]) {
            $tbl_list_vehicule[] = $tbl;
        }
    } else {
        $tbl_list_vehicule[] = $tbl;
    }
}
$tbl_list_export = $tbl_list_vehicule;