1. Import
This commit is contained in:
153
html/tools/checkStateCI.php
Normal file
153
html/tools/checkStateCI.php
Normal file
@@ -0,0 +1,153 @@
|
||||
<?php
|
||||
/*=======================================================================
|
||||
*
|
||||
* checkStateCI.php
|
||||
*
|
||||
* Autor: Marc Vollmann
|
||||
*
|
||||
=======================================================================*/
|
||||
|
||||
include_once ("../include/mcglobal.inc.php");
|
||||
|
||||
$autoMode = false;
|
||||
if (!isset($argv[1]) || $argv[1] == "") :
|
||||
include_once ("../include/auth.inc.php");
|
||||
getSecHttpVars("1", array("f_act", "objId", "objType"));
|
||||
$autoMode = false;
|
||||
$hqIdMail = $hq_id;
|
||||
// Check for authentication access and granted rights
|
||||
$usrAccessArray["hq"] = "1";
|
||||
$accessOK = authCheckForAccess($hq_id, $usr_id, $emp_id, "", $customerId, $cscIdRoot, $cscIdActual);
|
||||
else :
|
||||
if ($argv[1] == "acapella7890") :
|
||||
$autoMode = true;
|
||||
$hqIdMail = trim($argv[2]);
|
||||
else :
|
||||
die();
|
||||
endif;
|
||||
endif;
|
||||
|
||||
// Get the rights of the employee logged in and check the accessibility
|
||||
if (!authCheckEmployeeRights($emp_id, "1")) : die ("$PHP_SELF: Access denied!"); endif;
|
||||
|
||||
getSecHttpVars("1", array("f_act", "dbConnection", "hqId", "pageType"));
|
||||
|
||||
|
||||
getLanguage(__FILE__);
|
||||
include_once ("../include/html.inc.php");
|
||||
// include_once ("../include/inc_dbinspector.inc.php");
|
||||
getCurrentScript(__FILE__);
|
||||
|
||||
|
||||
// INIT
|
||||
$debug = false;
|
||||
$output = array();
|
||||
|
||||
$mapArrayCI = array("Kein Eintrag", "HT-CI", "Neutral", "Kunden-CI", "Fremd-CI");
|
||||
|
||||
|
||||
// Get export templates from "exportparameters" from "template customer"
|
||||
$sqlquery = "SELECT hq.hq_mnemonic, crvh.crvh_sid, crvh.crvh_corporate_identity, cr.cr_eid, usr.usr_name, usr.usr_firstname"
|
||||
. " FROM couriervehicle AS crvh, courier AS cr, user AS usr, headquarters AS hq"
|
||||
. " WHERE crvh.cr_id = cr.cr_id AND
|
||||
cr.usr_id = usr.usr_id AND
|
||||
cr.hq_id = hq.hq_id"
|
||||
. " ORDER BY hq.hq_mnemonic, cr.cr_eid";
|
||||
// echo $sqlquery . "<br><br>";
|
||||
$result = $db->query($sqlquery);
|
||||
if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage());
|
||||
$outArray = array();
|
||||
$colorArray = array();
|
||||
$count = 0;
|
||||
while ($row = $result->fetch_assoc()):
|
||||
$outArray[$count] = $row;
|
||||
$colorArray[$count] = "FF0000";
|
||||
if (((int)$row["crvh_corporate_identity"] & 15) >= 1 && (((int)$row["crvh_corporate_identity"] / 16) & 15) >= 1) :
|
||||
$colorArray[$count] = "00FF00";
|
||||
endif;
|
||||
$count++;
|
||||
endwhile;
|
||||
$result->free();
|
||||
$outArrayLen = count($outArray);
|
||||
if ($debug) : print_r($outArray); echo "<br><br><br><br>"; endif;
|
||||
|
||||
if ($outArrayLen > 0) :
|
||||
|
||||
$tableOut .= "<table>\n";
|
||||
$tableOut .= "<tr>\n";
|
||||
$tableOut .= "<td class=\"f12bp1_blue\">" . getLngt("ÜBERSICHT CORPORATE IDENTITY") . "</td>";
|
||||
$tableOut .= "</tr>\n";
|
||||
$tableOut .= "</table>\n";
|
||||
$tableOut .= "<br><br>";
|
||||
|
||||
$tableOut .= "<table>\n";
|
||||
$tableOut .= "<tr>\n";
|
||||
$tableOut .= "<td style=\"background-color: #FF0000;\"> Mindestens ein Eintrag fehlt </td>";
|
||||
$tableOut .= "<td style=\"background-color: #00FF00;\"> Beide Einträge sind gesetzt </td>";
|
||||
$tableOut .= "</tr>\n";
|
||||
$tableOut .= "</table>\n";
|
||||
$tableOut .= "<br><br>";
|
||||
|
||||
$tableOut .= "<table>\n";
|
||||
$tableOut .= "<tr>\n";
|
||||
$tableOut .= "<td style=\"text-align:center;\">" . getLngt("NL") . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center;\">" . getLngt("Fzg.") . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center;\">" . getLngt("CI-Fzg.") . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center;\">" . getLngt("CI-Kleidung") . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center;\">" . getLngt("EID") . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center;\">" . getLngt("Name") . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center;\">" . getLngt("Vorname") . " </td>\n";
|
||||
$tableOut .= "</tr>\n";
|
||||
|
||||
// Iterate all items
|
||||
for ($i = 0; $i < $outArrayLen; $i++) :
|
||||
$tmpArr = $outArray[$i];
|
||||
|
||||
$rowColor = $colorArray[$i];
|
||||
$tableOut .= "<tr>\n";
|
||||
$tableOut .= "<td style=\"text-align:center; background-color: #" . $rowColor . ";\">" . $tmpArr["hq_mnemonic"] . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center; background-color: #" . $rowColor . ";\">" . $tmpArr["crvh_sid"] . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center; background-color: #" . $rowColor . ";\">" . $mapArrayCI[((int)$tmpArr["crvh_corporate_identity"] & 15)] . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center; background-color: #" . $rowColor . ";\">" . $mapArrayCI[(((int)$tmpArr["crvh_corporate_identity"] / 16) & 15)] . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center; background-color: #" . $rowColor . ";\">" . $tmpArr["cr_eid"] . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center; background-color: #" . $rowColor . ";\">" . $tmpArr["usr_name"] . " </td>\n";
|
||||
$tableOut .= "<td style=\"text-align:center; background-color: #" . $rowColor . ";\">" . $tmpArr["usr_firstname"] . " </td>\n";
|
||||
$tableOut .= "</tr>\n";
|
||||
endfor;
|
||||
|
||||
$tableOut .= "</table>\n";
|
||||
else :
|
||||
$output[] = "Keine Daten aufgefunden!";
|
||||
endif;
|
||||
|
||||
|
||||
// Output
|
||||
$outputLen = count($output);
|
||||
for ($i = 0; $i < $outputLen; $i++) :
|
||||
echo $output[$i] . "<br>";
|
||||
endfor;
|
||||
?>
|
||||
|
||||
<?php if (!$autoMode) : ?>
|
||||
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="../css/phoenix.css">
|
||||
</head>
|
||||
|
||||
<body class="menu_bgcol" >
|
||||
|
||||
<center>
|
||||
|
||||
<br><br><br>
|
||||
|
||||
<b><?php echo $tableOut ?></b>
|
||||
|
||||
</center>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
||||
<?php endif; ?>
|
||||
Reference in New Issue
Block a user