affected_rows > 0) : $rightsLogString .= "DELETED_RIGHTS=YES"; else : $rightsLogString .= "DELETED_RIGHTS=NO"; endif; // Insert new rigths $emp_rights_len = count($emp_rights); for ($i = 0; $i < $emp_rights_len; $i++) : // Get hq_id and rgt_id from the element values of the array (e.g. an element could be "102_7" corresponding with "HTG-HH"_"Export") $tmpArray = split("_", $emp_rights[$i]); $specialHqId = $tmpArray[0]; $specialRgtId = $tmpArray[1]; if ($specialHqId != "" && is_numeric($specialHqId) && $specialRgtId != "" && is_numeric($specialRgtId)) : $res = insertStmt("employeerights", array("emp_id", $emp_id_act, "hq_id", $specialHqId, "rgt_id", $specialRgtId)); if ($db->affected_rows > 0) : $rightsLogString .= "|" . $specialHqId . "_" . $specialRgtId; endif; endif; endfor; TA("C"); TA("E"); // Write logdata into log database writeToLogDB("115",$hq_id,"",$usr_id,"","","",$rightsLogString,"","",$emp_id_act); // Get rights again after changing $empIdHqRgtVector = getEmpHqRights($emp_id); // Rights of the user logged in $empIdActHqRgtVector = getEmpHqRights($emp_id_act); // Rigths of the current user $statusMessage = getLngt("Die Rechte wurden gesetzt!"); endif; endif; // Create hq-rgt-matrix $output = "
| " . defineButtonType10(getLngt("Rechte zuweisen"), "action_set_rights", "finishPage('setRights');", "140", "left") . " | "; // Left top corner // Column headlines for ($i = 0; $i < $hqArrayKeysLen; $i++) : // $output .= "" . $hqVector[$hqArrayKeys[$i]] . " | "; $output .= "";
$output .= "" . $hqVector[$hqArrayKeys[$i]] . " "; $output .= "\n"; $output .= " | ";
endfor;
$output .= "
| " . getLngt($rgtVector[$rgtArrayKeys[$j]]) . " | "; for ($i = 0; $i < $hqArrayKeysLen; $i++) : $output .= ""; $tmpChecked = ""; mcArrIsSet($rgtArrayKeys, $j); mcArrIsSet($hqArrayKeys, $i); $empIdActHqRgtVector[$hqArrayKeys[$i]][$rgtArrayKeys[$j]] = mcArrMultiDimIsSet($empIdActHqRgtVector[$hqArrayKeys[$i]], $rgtArrayKeys[$j]); if ($empIdActHqRgtVector[$hqArrayKeys[$i]][$rgtArrayKeys[$j]] == "1") : $tmpChecked = "checked"; endif; $tmpDisabled = "disabled"; if ($emp_id == $empIdRootAdmin || $empIdHqRgtVector[$hqArrayKeys[$i]][$rgtArrayKeys[$j]] == "1") : $tmpDisabled = ""; endif; $output .= "\n"; $output .= " | "; endfor; $output .= "\n | "; $output .= "