query($tmpSqlQuery); $err = ""; if (DB::isError($result)) {$err = "ERR";}; if ($err == "ERR") : // Message to system administrator... // $statusMessage = getLngt("Message to system administrator...!"); endif; endif; endif; else : $statusMessage = getLngt("Datenfehler! Löschen Sie bitte den Mitarbeiter und legen Sie ihn neu an! :-("); endif; else : $statusMessage = getLngt("Der Administratoreintrag kann nicht entfernt werden! ;-)"); endif; endif; // ********************************************************************************************** // * Selection of all employees of the actual costcenter (customer) or headquarter for the list * // ********************************************************************************************** // Check if employee has NO access to other employees $whereClause = ""; if ($empHasNoAccessToEmployees) : $whereClause = " AND emp.emp_id = '" . $emp_id . "'"; endif; if ($userTypeName == "hq") : $sqlquery = "SELECT emp.emp_id, usr.usr_name, usr.usr_firstname, usr.usr_email, usr.usr_phone," . " usr.usr_phone2, usr.usr_account, hq.hq_mnemonic" . " FROM user AS usr, employee AS emp, headquarters AS hq" . " WHERE usr.usr_type = '1' AND emp.usr_id = usr.usr_id AND emp.csc_id = '0' AND usr.hq_id = hq.hq_id AND hq.hq_id IN " . getSQLMandatorArray($f_hq_id) . " " . $whereClause . " ORDER BY $tableSort"; endif; if ($userTypeName == "cs") : if ($treeMode) : $sqlquery = "SELECT emp.emp_id, usr.usr_name, usr.usr_firstname, usr.usr_email, usr.usr_phone," . " usr.usr_phone2, usr.usr_account, csc.csc_name" . " FROM user AS usr, employee AS emp, costcenter AS csc" . " WHERE emp.usr_id = usr.usr_id AND emp.csc_id = csc.csc_id AND csc.cs_id = '$customerId' AND" . " (csc.csc_path LIKE '%//$cscNameActual//%' OR csc.csc_id = '$cscIdActual')" . $whereClause . " ORDER BY $tableSort"; else : $sqlquery = "SELECT emp.emp_id, usr.usr_name, usr.usr_firstname, usr.usr_email," . " usr.usr_phone, usr.usr_phone2, usr.usr_account" . " FROM user AS usr, employee AS emp" . " WHERE emp.usr_id = usr.usr_id AND csc_id = '$cscIdActual'" . $whereClause . " ORDER BY $tableSort"; endif; endif; $result = $db->query($sqlquery); if (DB::isError($result)) die ("$PHP_SELF: " . $result->getMessage()); // Only for output $treeModeOut = ""; $treeModeOut2 = ""; if ($userTypeName == "hq") : $treeModeLinkText = ""; else : $treeModeLinkText = getLngt("Mitarbeiter der aktuellen Kostenstelle"); if ($treeMode) : $treeModeOut2 = "&treeMode=true"; else : $treeModeOut = "&treeMode=true"; $treeModeLinkText = getLngt("Mitarbeiter aller Unterkostenstellen"); endif; endif; // Maintable with header $numOfUser = 0; $tableOfEmployees = "
| " . getLngt("Name") . " | "; $tableOfEmployees .= "" . getLngt("Vorname") . " | "; $tableOfEmployees .= "" . getLngt("Niederlassung") . " | "; $tableOfEmployees .= "" . getLngt("E-Mail") . " | "; $tableOfEmployees .= "" . getLngt("Telefon") . " | "; $tableOfEmployees .= "" . getLngt("Anmeldename") . " | "; $tableOfEmployees .= "" . getLngt("Löschen") . " | "; if ($empHasNoAccessToEmployeeHistory) : $tableOfEmployees .= "" . getLngt("Historie") . " | "; endif; $tableOfEmployees .= "" . getLngt("Bearbeiten") . " | "; else : $tableOfEmployees .= "" . getLngt("Name") . " | "; $tableOfEmployees .= "" . getLngt("Vorname") . " | "; $tableOfEmployees .= "" . getLngt("E-Mail") . " | "; $tableOfEmployees .= "" . getLngt("Telefon") . " | "; $tableOfEmployees .= "" . getLngt("Anmeldename") . " | "; if ($treeMode) : $tableOfEmployees .= "" . getLngt("Kostenstelle") . " | "; endif; $tableOfEmployees .= "" . getLngt("Löschen") . " | "; $tableOfEmployees .= "" . getLngt("Bearbeiten") . " | "; endif; $tableOfEmployees .= "
| " . "" . $row["usr_name"] . "" . " | "; $tableOfEmployees .= "" . $row["usr_firstname"] . " | "; if ($userTypeName == "hq" && authCheckEmployeeRights($emp_id, "10")) : $tableOfEmployees .= "" . $row["hq_mnemonic"] . " | "; endif; $tableOfEmployees .= "" . $row["usr_email"] . " | "; $tableOfEmployees .= "" . $row["usr_phone"] . " | "; $tableOfEmployees .= "" . $row["usr_account"] . " | "; if ($treeMode) : $tableOfEmployees .= "" . $row["csc_name"] . " | "; endif; $tableOfEmployees .= ""
. " "
. "" . " | ";
if ($empHasNoAccessToEmployeeHistory) :
$tableOfEmployees .= "";
if ($emp_id == $empIdRootAdmin || !in_array($row["emp_id"], $empIdRootArr)) :
$tableOfEmployees .= ""
. " "
. "";
endif;
$tableOfEmployees .= " | ";
endif;
$tableOfEmployees .= ""
. " "
. "" . " | ";
$tableOfEmployees .= "