Ejemplo n.º 1
0
                 $linkalerte = query($sql);
                 if ($linkalerte) {
                     //recherche des vehicules du compte géré par cet utilisateur qui ont des alarmes de vitesse
                     $sql = getsqllistvehicule() . " and vitessemax!='0.00'";
                     //print $sql."<br>";
                     $link_vehicule = query($sql);
                     while ($tbl_list_vehicule = fetch($link_vehicule)) {
                         //on liste des enregistrement de la table position pendant l'interval d'alerte
                         $sql = "select * from positions where device_id=" . $tbl_list_vehicule["traccar_device_id"] . " and time>='" . $dernierdatedebut . "' and time<'" . $nouveldatedebut . "' and speed>'" . inversevitessekmh($tbl_list_vehicule["vitessemax"]) . "'";
                         //print $sql."<br>";
                         $linkvitesse = query($sql);
                         if (num_rows($linkvitesse) > 0) {
                             $html = "Bonjour,<br> le véhicule " . $tbl_list_vehicule["nomvehicule"] . " \r\n                  (" . $tbl_list_vehicule["immatriculation"] . ") à été controlé à une vitesse de :";
                             while ($tbl_vitesse = fetch($linkvitesse)) {
                                 $adresse = str_replace(", France", "", getAddess($tbl_vitesse["latitude"], $tbl_vitesse["longitude"]));
                                 $datelieu = "<br>" . affichedatetime($tbl_vitesse["time"]) . "<br>" . $adresse;
                                 $html .= "<br>" . vitessekmh($tbl_vitesse["speed"]) . " km/h à " . $datelieu . "<br>";
                             }
                             $html .= "Sa vitesse maximale autorisée est de " . $tbl_list_vehicule["vitessemax"] . " km/h";
                             //print $html;
                             sendmailmister('', '', 'Alarme vitesse véhicule ' . $tbl_list_vehicule["nomvehicule"], $html, $_SESSION["email"]);
                         }
                     }
                 }
                 //a decommenter
                 $sql = "update " . __racinebd__ . "preference_compte set lastenvoi=now() where compte_id=" . $_SESSION["compte_id"];
                 query($sql);
             }
         }
     }
 }
Ejemplo n.º 2
0
Archivo: form.php Proyecto: jcmwc/fleet
<?php

if ($_GET["mode"] == "visu" || $_GET["mode"] == "suppr") {
    print value_print(affichedatetime($myvalue));
} else {
    $myvalue = $myvalue == "" ? date("Y") . "/" . date("m") . "/" . date("d") . " " . date("H") . ":" . date("i") : $myvalue;
    $myvalue = $tabelem[2] != "yes" && $_GET["mode"] == "ajout" ? "" : $myvalue;
    print '<input type="text" id="' . $tabelem[0] . '" name="' . $tabelem[0] . '" size="16" maxlength="16" value="' . affichedatetime($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 %H:%M",    // the date format
									showsTime      :    true,
                  timeFormat     :    "24",
                  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 %H:%M",    // the date format
                  showsTime      :    true,
                  timeFormat     :    "24",
                  button      : "trigger' . $tabelem[0] . '"       // ID of the button
                };
            </script>';
}
Ejemplo n.º 3
0
/tpl/img/tableau_time.png"></a></div></th> -->
      </tr>
      <?php 
foreach ($semaine as $key => $val) {
    ?>
      <tr>
        <td class=""><?php 
    echo $val["date"];
    ?>
</td>
        <td><?php 
    echo affichedatetime($val["debut"]);
    ?>
</td>
        <td><?php 
    echo affichedatetime($val["fin"]);
    ?>
</td>
        <td><?php 
    echo $val["datediff"];
    ?>
</td>
        <td><?php 
    echo $val["conduite"];
    ?>
</td>
        <td><?php 
    echo $val["arret"];
    ?>
</td>
        <!-- <td><span>00 </span> min</td>  -->
Ejemplo n.º 4
0
    }
    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"] = "-";
    } else {
        //datediff
        $tmptrajet[$j]["datediff"] = dateDifference($tmptrajet[$j]["fin"], $tmptrajet[$j]["debut"], '%h H %i Min');
        $totalconduite += (int) ((strtotime($tmptrajet[$j]["fin"]) - strtotime($tmptrajet[$j]["debut"])) / 60);
    }
}
$trajet = $tmptrajet;
Ejemplo n.º 5
0
$i = 0;
while ($tbl_result = fetch($resultat)) {
    if ($i++ % 2 == 1) {
        ?>
              <tr bgcolor="#d5d5d5" onmouseover="fondtr(this)" onmouseout="nofondtr_2(this)">
              <?php 
    } else {
        ?>
              <tr bgcolor="#e3e3e3" onmouseover="fondtr(this)" onmouseout="nofondtr_1(this)">
              <?php 
    }
    reset($tabcolonne);
    while (list($key, $val) = each($tabcolonne)) {
        //if(preg_match("/[0-9]{4}\-[0-9]{2}\-[0-9]{2}/",$tbl_result[$val])){
        if (preg_match("/[0-9]{4}\\-[0-9]{2}\\-[0-9]{2}/", $tbl_result[$val]) && strpos($tbl_result[$val], "REF-") === false) {
            $myval = affichedatetime($tbl_result[$val]);
        } else {
            if (is_array($tradchamps) && in_array($val, $tradchamps)) {
                if ($trad[$tbl_result[$val]] != "") {
                    $myval = cutWord($trad[$tbl_result[$val]]);
                } else {
                    $myval = cutWord($tbl_result[$val]);
                }
            } else {
                $myval = cutWord($tbl_result[$val]);
            }
        }
        $valcouleur1 = $valcouleur1 != "" ? $valcouleur1 : 0;
        if ($couleur == "" || $tbl_result[$couleur] == $valcouleur1) {
            ?>
              <td class="firstCell"><a href="<?php 
Ejemplo n.º 6
0
        echo $_SERVER["PHP_SELF"];
        ?>
?arbre_id=<?php 
        echo $_GET["arbre_id"];
        ?>
&pere=<?php 
        echo $_GET["pere"];
        ?>
" method="post">
  <input type="hidden" name="mode" value="save" />
  <center>
    <?php 
        echo $trad["Date de publication"];
        ?>
<br><input type="texte" id="datepublication" name="datepublication" value="<?php 
        echo affichedatetime($tbl["datepublication"]);
        ?>
"/><img src="../images/datepopup.gif" id="triggerdatepublication" style="cursor:pointer; cursor:hand;"><br><input type="submit" name="valider" value="<?php 
        echo $trad["valider"];
        ?>
" />
  </center>
  <script type="text/javascript">
      top.calendar[top.calendar.length]={
        inputField  : "datepublication",         // ID of the input field
        ifFormat    : "%d/%m/%Y %H:%M",    // the date format
        showsTime      :    true,
        timeFormat     :    "24",
        button      : "triggerdatepublication"       // ID of the button
      };
  </script>
Ejemplo n.º 7
0
     $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";
 }
 $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;
 }