Пример #1
0
 }
 //debuttxt
 //$tbl_info=adressegps($tmptrajet[$j]["lat1"],$tmptrajet[$j]["lon1"]);
 if ($j == 0) {
     $tbl_info = adressegps($tmptrajet[$j]["lat1"], $tmptrajet[$j]["lon1"]);
 } else {
     $tbl_info = adressegps($tmptrajet[$j - 1]["lat2"], $tmptrajet[$j - 1]["lon2"]);
 }
 if (is_array($tbl_info)) {
     $debut = $tbl_info["adresse"] . "<br><img src=\"" . __racineweb__ . "/tpl/img/lieux/" . $tbl_info["icon"] . "\"> <span>" . $tbl_info["libelle"] . "</span>";
 } else {
     $debut = $tbl_info;
 }
 $tmptrajet[$j]["debuttxt"] = "<span>" . affichedatetime($tmptrajet[$j]["debut"]) . "</span><br>" . $debut;
 //fintxt
 $tbl_info = adressegps($tmptrajet[$j]["lat2"], $tmptrajet[$j]["lon2"]);
 if (is_array($tbl_info)) {
     $fin = $tbl_info["adresse"] . "<br><img src=\"" . __racineweb__ . "/tpl/img/lieux/" . $tbl_info["icon"] . "\"> <span>" . $tbl_info["libelle"] . "</span>";
 } else {
     $fin = $tbl_info;
 }
 //$tmptrajet[$j]["fintxt"]=$fin;
 $tmptrajet[$j]["fintxt"] = "<span>" . affichedatetime($tmptrajet[$j]["fin"]) . "</span><br>" . $fin;
 $tmptrajet[$j]["km"] = round($tmptrajet[$j]["km"], 2);
 $totaldistance += $tmptrajet[$j]["km"];
 if ($tmptrajet[$j]["lat2"] == "" && $tmptrajet[$j]["lon2"] == "") {
     $tmptrajet[$j]["lat2"] = $tmptrajet[$j]["lat1"];
     $tmptrajet[$j]["lon1"] = $tmptrajet[$j]["lon1"];
     $tmptrajet[$j]["fin"] = "";
     $tmptrajet[$j]["fintxt"] = $tmptrajet[$j]["debuttxt"];
     $tmptrajet[$j]["datediff"] = "-";
Пример #2
0
//print $sql."<br>";
$link = query($sql);
$nbgo = 0;
$nbstay = 0;
while ($tbl = fetch($link)) {
    //recherche catégorie
    $sql = "select * from " . __racinebd__ . "categorie_compte_device ccd\r\n        inner join " . __racinebd__ . "categorie_compte cc on ccd.categorie_compte_id=cc.categorie_compte_id where device_id=" . $tbl["phantom_device_id"];
    //print $sql;
    $link2 = query($sql);
    $tbl_list_cat = array();
    while ($tbl2 = fetch($link2)) {
        $tbl_list_cat[] = $tbl2["libelle"];
    }
    $tbl["listcat"] = implode(", ", $tbl_list_cat);
    $debut = "";
    $tbl_info = adressegps($tbl["latitude"], $tbl["longitude"]);
    if (is_array($tbl_info)) {
        $debut .= "<img src=\"" . __racineweb__ . "/tpl/img/lieux/" . $tbl_info["icon"] . "\"> <span>" . $tbl_info["libelle"] . "</span>";
    } else {
        $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";