query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); while ($row = $result->fetch_assoc()): $crvhRpAssocDoesExist[$row["crvh_sid"]] = "1"; $mtfvTime = $row["rp_createtime"]; if ($mtfvTime == "") : $triggerArray[] = array("66CCFF", $row["rp_id"], $row["rp_createtime"], $row["crvh_sid"], $row["crvh_vh_sign"], $row["cs_eid"], $row["cs_cmp_id"], $row["cr_id"], $row["cr_eid"], $row["usr_name"], $row["usr_firstname"], $row["crvh_id"], $row["cr_cmp_id"]); elseif ($mtfvTime <= $checkTime2) : $triggerArray[] = array("FF0000", $row["rp_id"], $row["rp_createtime"], $row["crvh_sid"], $row["crvh_vh_sign"], $row["cs_eid"], $row["cs_cmp_id"], $row["cr_id"], $row["cr_eid"], $row["usr_name"], $row["usr_firstname"], $row["crvh_id"], $row["cr_cmp_id"]); elseif ($mtfvTime <= $checkTime) : $triggerArray[] = array("FFFF33", $row["rp_id"], $row["rp_createtime"], $row["crvh_sid"], $row["crvh_vh_sign"], $row["cs_eid"], $row["cs_cmp_id"], $row["cr_id"], $row["cr_eid"], $row["usr_name"], $row["usr_firstname"], $row["crvh_id"], $row["cr_cmp_id"]); else : $triggerArray[] = array("00FF00", $row["rp_id"], $row["rp_createtime"], $row["crvh_sid"], $row["crvh_vh_sign"], $row["cs_eid"], $row["cs_cmp_id"], $row["cr_id"], $row["cr_eid"], $row["usr_name"], $row["usr_firstname"], $row["crvh_id"], $row["cr_cmp_id"]); endif; endwhile; $result->free(); // GET ALL vehicle (of the selected courier) $sqlquery = "SELECT '' AS rp_id, '' AS rp_createtime, '' AS rp_objid, cr.cr_id, cr.cr_eid, crvh.crvh_id, crvh.crvh_sid, crvh.crvh_vh_sign, '' AS cs_eid, '' AS cs_cmp_id, cr.cmp_id AS cr_cmp_id, usr.usr_name, usr.usr_firstname" . " FROM courier AS cr, couriervehicle AS crvh, user AS usr, headquarters AS hq, company AS cr_cmp" . " WHERE crvh.cr_id = cr.cr_id AND" . " cr.hq_id = hq.hq_id AND" . $whereClauseCrId . " cr.hq_id = '" . $hq_id . "' AND" . " cr.cmp_id = cr_cmp.cmp_id AND" . " cr_cmp.cmp_authenticated = '1' AND" . " cr_cmp.cmp_visible = '1' AND" . " cr.hq_id = hq.hq_id AND" . " cr.usr_id = usr.usr_id" . " ORDER BY usr.usr_name, usr.usr_firstname, crvh.crvh_sid"; $result = $db->query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); while ($row = $result->fetch_assoc()): if ($crvhRpAssocDoesExist[$row["crvh_sid"]] == "") : $triggerArray[] = array("66CCFF", $row["rp_id"], $row["rp_createtime"], $row["crvh_sid"], $row["crvh_vh_sign"], $row["cs_eid"], $row["cs_cmp_id"], $row["cr_id"], $row["cr_eid"], $row["usr_name"], $row["usr_firstname"], $row["crvh_id"], $row["cr_cmp_id"]); endif; endwhile; $result->free(); $triggerArrayLen = count($triggerArray); $triggerOut = ""; if ($triggerArrayLen > 0) : $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; for ($i = 0; $i < $triggerArrayLen; $i++) : $tmpArray = $triggerArray[$i]; $tmpArrayLen = count($tmpArray); $rowColor = $tmpArray[0]; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; endfor; $triggerOut .= "
" . getLngt("Fahrzeug") . "   " . getLngt("Kennzeichen") . "   " . getLngt("EID") . "   " . getLngt("Name") . "   " . getLngt("Vorname") . "   " . getLngt("Bericht") . "   " . getLngt("Kunde") . "   " . getLngt("Datum") . "   
" . $tmpArray[3] . "   " . $tmpArray[4] . "   " . $tmpArray[8] . "   " . $tmpArray[9] . "   " . $tmpArray[10] . "   " . $tmpArray[1] . "   " . $tmpArray[5] . "   " . substr($tmpArray[2],8,2) . "." . substr($tmpArray[2],5,2) . "." . substr($tmpArray[2],0,4) . "
\n"; $triggerOut .= "

"; $triggerOut .= "\n"; $triggerOut .= "\n"; $triggerOut .= ""; $triggerOut .= ""; $triggerOut .= ""; $triggerOut .= ""; $triggerOut .= "\n"; $triggerOut .= "
  KEIN EINTRAG     <4 Monate      4-6 Monate      >6 Monate    
\n"; $triggerOut .= "\n"; $triggerOut .= "\n"; endif; ?>