1. Import

This commit is contained in:
2026-03-29 10:34:57 +02:00
parent b0e00c1259
commit a1129565af
4899 changed files with 3007593 additions and 0 deletions

View File

@@ -0,0 +1,366 @@
/*=======================================================================
*
* checkFormTags.js
*
* Autor: Marc Vollmann
*
=======================================================================*/
function trim(TRIM_VALUE){
if (TRIM_VALUE.length < 1) { return ""; }
TRIM_VALUE = rtrim(TRIM_VALUE);
TRIM_VALUE = ltrim(TRIM_VALUE);
if (TRIM_VALUE==""){ return ""; } else { return TRIM_VALUE; }
}
function rtrim(VALUE){
var w_space = String.fromCharCode(32);
var v_length = VALUE.length;
var strTemp = "";
if (v_length < 0){ return""; };
var iTemp = v_length -1;
while (iTemp > -1){
if(VALUE.charAt(iTemp) == w_space){
} else {
strTemp = VALUE.substring(0,iTemp +1);
break;
}
iTemp = iTemp-1;
}
return strTemp;
}
function ltrim(VALUE){
var w_space = String.fromCharCode(32);
if (v_length < 1){ return ""; };
var v_length = VALUE.length;
var strTemp = "";
var iTemp = 0;
while (iTemp < v_length){
if (VALUE.charAt(iTemp) == w_space){
} else {
strTemp = VALUE.substring(iTemp,v_length);
break;
}
iTemp = iTemp + 1;
}
return strTemp;
}
function padl(str,len,fillChar) {
if (fillChar == '') {fillChar = '0';};
var strLength = str.length;
if (strLength < len) {
for (var i = strLength; i < len; i++) {
str = fillChar + str;
}
}
return str;
}
// Checks syntax of the content a single mail-field.
function checkMailAddress(field, msg) {
var mailField = field.value;
var mailAdresses = mailField.split(",");
var numOfMailAdresses = mailAdresses.length;
var checkAddress;
for (var j = 0 ; j < numOfMailAdresses ; j++) {
checkAddress = trim(mailAdresses[j]);
// if (checkAddress.match(/^[A-Za-z\'0-9]+([._-][A-Za-z\'0-9]+)*@([A-Za-z0-9]([-][A-Za-z0-9]+)*)+([.][A-Za-z0-9]+([-][A-Za-z0-9]+)*)+$/)==null) {
if (checkAddress.match(/^([a-zA-Z0-9_\-])+(\.([a-zA-Z0-9_\-])+)*@((\[(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5])))\.(((([0-1])?([0-9])?[0-9])|(2[0-4][0-9])|(2[0-5][0-5]))\]))|((([a-zA-Z0-9])+(([\-])+([a-zA-Z0-9])+)*\.)+([a-zA-Z])+(([\-])+([a-zA-Z0-9])+)*))$/)==null) {
alert(msg);
return false;
}
}
return true;
}
// Checks content of a field being a number.
function checkIsNaN(fieldValue, msg) {
if(isNaN(fieldValue) == true) {
alert(msg);
return false;
} else {
return true;
}
}
// Checks content of a field being a number.
// Blanks will be removed out of the string.
function checkIsNaNIgnoreSpace(fieldValue, msg) {
// Remove spaces in fieldValue
var fieldValueWithoutBlanks = '';
fieldValueLen = fieldValue.length;
for (var j = 0 ; j <= fieldValueLen-1 ; j++) {
if (fieldValue.charAt(j) != ' ') {
fieldValueWithoutBlanks += fieldValue.charAt(j);
}
}
if(isNaN(fieldValueWithoutBlanks) == true) {
alert(msg);
return false;
} else {
return true;
}
}
// Checks the range of a numberfield
function checkNumRanges(checkObj,lowerRange,upperRange,msg) {
if (!checkIsNaN(checkObj.value, msg)) {
checkObj.value = lowerRange;
checkObj.focus();
}
if (checkObj.value > upperRange) {
checkObj.value = upperRange;
alert("Die Obergrenze liegt bei " + upperRange + " Tagen!");
checkObj.focus();
}
if (checkObj.value < lowerRange) {
checkObj.value = lowerRange;
alert("Die Untergrenze liegt bei " + lowerRange + " Tagen!");
checkObj.focus();
}
};
// Gets the selected value for a special select box
function getSelectedValue(nameOfElem) {
var retVal = '';
elem = eval('document.forms[0].' + nameOfElem);
if (elem) {
var len = elem.length;
for(var i=0; i<len; ++i) {
if (elem.options[i].selected == true) {
retVal = elem.options[i].value;
}
}
} else {
alert('Der Wert für ' + nameOfElem + ' wurde nicht gesetzt!');
}
return retVal;
}
// Sets a special value for a special select box
function setSelectedValue(nameOfElem, val) {
elem = eval('document.forms[0].' + nameOfElem);
if (elem) {
var len = elem.length;
for(var i=0; i<len; ++i) {
if (elem.options[i].value == val) {
elem.options[i].selected = true;
}
}
} else {
alert('Der Wert für ' + nameOfElem + ' wurde nicht gesetzt!');
}
}
// Checks for existence of a value of an "option" of a "select" object
function existSelectOptionValue (nameOfElem, optVal) {
elem = eval('document.forms[0].' + nameOfElem);
optExists = false;
var len = elem.length;
for(i=0; i<len; ++i) {
if (elem.options[i].value == optVal) {
optExists = true;
}
}
return optExists;
}
// Inserts a new "option" into an existing "select" object
function insertNewOption (nameOfElem, optVal, optText, optSel, checkExistence) {
elem = eval('document.forms[0].' + nameOfElem);
var len = elem.length;
// First check for existence
if (elem) {
if (checkExistence == '') {checkExistence = false};
optExists = false;
if (checkExistence) {optExists = existSelectOptionValue(nameOfElem, optVal);};
if (!optExists) {
if (optSel == '') {optSel = false};
if (elem && optVal != '' && optText != '') {
newOption = new Option(optText, optVal, false, optSel);
elem.options[len] = newOption;
} else {
alert('Einer der Parameter ist nicht vollständig!');
}
// } else {
// alert('Eine Option mit dem Wert ' + optVal + ' existiert schon!');
}
} else {
alert('Der Wert für ' + nameOfElem + ' wurde nicht gesetzt!');
}
}
// Removes an option from an existing "select" object
function removeExistingOption (nameOfElem, optVal) {
elem = eval('document.forms[0].' + nameOfElem);
elem.options[optVal] = null;
}
function checkDateFields(checkObj,mode) {
var now = new Date();
var currentYear = now.getFullYear();
// var monthNum = now.getMonth();
// var dayNum = now.getDay();
// var monthNames = new Array("Januar","Februar","M&auml;rz","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
// monthNames[monthNum]
// var dayNames = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
// dayNames[monthNum]
var resetObjectValue = false;
var checkObjValue = checkObj.value;
var checkObjName = checkObj.name;
if (checkObjValue != '') {
if (isNaN(checkObjValue) == true) {
alert('Bitte ein Zahl eingeben!');
resetObjectValue = true;
}
if (mode == 'day') {
if (checkObjValue < 1 || checkObjValue > 31) {
alert('Tagesangaben bitte zwischen 1 und 31');
resetObjectValue = true;
}
}
if (mode == 'month') {
if (checkObjValue < 1 || checkObjValue > 12) {
alert('Monatsangaben bitte zwischen 1 und 12');
resetObjectValue = true;
}
}
if (mode == 'year') {
if (checkObjValue < (currentYear-1) || checkObjValue > (currentYear+1)) {
alert('Jahresangaben zwischen ' + (currentYear-1) + ' und ' + (currentYear+1));
resetObjectValue = true;
}
}
if (mode == 'hour') {
if (checkObjValue < 0 || checkObjValue > 23) {
alert('Stundenangaben bitte zwischen 0 und 23');
resetObjectValue = true;
}
}
if (mode == 'minute') {
if (checkObjValue < 0 || checkObjValue > 59) {
alert('Stundenangaben bitte zwischen 0 und 59');
resetObjectValue = true;
}
}
}
return resetObjectValue;
};
function checkTimeFields(mf) {
var frm = document.forms[0];
var f_Y = padl(frm.f_year.value,2,'0'); f_Y_to = padl(frm.f_year_to.value,2,'0');
var f_m = padl(frm.f_month.value,2,'0'); f_m_to = padl(frm.f_month_to.value,2,'0');
var f_d = padl(frm.f_day.value,2,'0'); f_d_to = padl(frm.f_day_to.value,2,'0');
var f_H = padl(frm.f_hour.value,2,'0'); f_H_to = padl(frm.f_hour_to.value,2,'0');
var f_i = padl(frm.f_minute.value,2,'0'); f_i_to = padl(frm.f_minute_to.value,2,'0');
// Behaviour on the same day
if (f_Y == f_Y_to && f_m == f_m_to && f_d == f_d_to) {
if (mf == 'H_to') {
if (f_H_to < f_H) {
if (f_i_to >= f_i) {
setSelectedValue('f_hour', parseInt(f_H_to));
} else {
setSelectedValue('f_hour', (parseInt(f_H_to) - 1));
}
}
if (f_H_to == f_H) {
if (f_i_to < f_i) {
setSelectedValue('f_minute_to', parseInt(f_i));
}
}
};
if (mf == 'H') {
if (f_H_to < f_H) {
if (f_i >= f_i_to) {
setSelectedValue('f_hour_to', parseInt(f_H));
} else {
setSelectedValue('f_hour_to', (parseInt(f_H) + 1));
}
}
if (f_H_to == f_H) {
if (f_i > f_i_to) {
setSelectedValue('f_minute_to', parseInt(f_i));
}
}
};
if (mf == 'i') {
if (f_H_to == f_H) {
if (f_i > f_i_to) {
setSelectedValue('f_minute_to', parseInt(f_i));
}
}
};
if (mf == 'i_to') {
if (f_H_to == f_H) {
if (f_i > f_i_to) {
setSelectedValue('f_minute', parseInt(f_i_to));
}
}
};
}
}
// Shows/Hides display areas [Classic version]
function changeHideShow(areaSwitched,displayState) {
var areaShow = areaSwitched;
var areaShowAction = areaSwitched + 'Action';
var areaReducedAction = areaSwitched + 'ReducedAction';
if (displayState == 'on') {
myshow(areaShow);
myshow(areaShowAction);
myhide(areaReducedAction);
elem = eval('document.forms[0].' + areaShow + 'Switch');
elem.value = '1';
};
if (displayState == 'off') {
myhide(areaShow);
myhide(areaShowAction);
myshow(areaReducedAction);
elem = eval('document.forms[0].' + areaShow + 'Switch');
elem.value = '0';
};
}
// Shows/Hides display areas
function changeHideShow2(areaSwitched,displayState) {
if (displayState == 'on') {
myshow(areaSwitched);
elem = eval('document.forms[0].' + areaSwitched + 'Switch');
elem.value = '1';
};
if (displayState == 'off') {
myhide(areaSwitched);
elem = eval('document.forms[0].' + areaSwitched + 'Switch');
elem.value = '0';
};
}
// Checks equality of two arrays
function arraysEqual(a,b) {
var retVal = true;
var aLen = a.length;
var bLen = b.length;
if (aLen == bLen) {
for(i=0;i<aLen;++i) {
if (a[i] != b[i]) {
retVal = false;
}
};
} else {
retVal = false;
}
return retVal;
}

View File

@@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html lang="de">
<head>
<title>votian</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="description" content="votian"> <meta name="keywords" content="votian">
<meta http-equiv="refresh" content="0; URL=../index.php">
<link rel="stylesheet" type="text/css" href="css/phoenix.css">
</head>
<body bgcolor="#FFFFFA" leftmargin="1" topmargin="1" marginwidth="0" marginheight="0" link="#990000" vlink="#990000" alink="#990000">
<a href="../index.php">Bitte hier klicken, wenn Sie nicht automatisch weitergeleitet werden...</a>
</body>
</html>

View File

@@ -0,0 +1,144 @@
// Status of the event to be checked
var keyDownEventEnabled = true;
var Netscape = new Boolean();
Netscape = false;
if (navigator.appName == "Netscape") Netscape = true;
// Status informations
// document.write(navigator.appName + "<br>" + navigator.appVersion + "<br>" + navigator.appCodeName + "<br><br><br>");
function disableEvent(e) {
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
if (e.preventDefault) {
if (e.cancelable) e.preventDefault();
} else {
e.keyCode = 0;
e.returnValue = 0;
// e.cancelBubble = true;
}
keyDownEventEnabled = false;
}
function actionEvent(task) {
if (task == "admin") {
if (this.top.iname == "job_edit") {
top.opener.top.location.href = "../admin/menu_fs.php?navigationLevel=2&navigationPoint=verwaltung";
// top.opener.top.maincontent.focus();
top.opener.top.closeJobEdit();
} else {
top.location.href = "../admin/menu_fs.php?navigationLevel=2&navigationPoint=verwaltung";
top.maincontent.focus();
}
}
if (task == "job_edit") {
if (this.top.iname == "job_edit") {
this.focus();
} else {
if (!top.job_edit) {
top.jb_edit = window.open("../jobs/job_edit.php","job_edit");
} else {
if (top.job_edit.open) {
top.job_edit.focus();
} else {
top.jb_edit = window.open("../jobs/job_edit.php","job_edit");
}
}
}
}
if (task == "job_edit2") {
if (this.top.iname == "job_edit2") {
this.focus();
} else {
if (!top.job_edit) {
top.jb_edit = window.open("../jobs2/job_edit.php","job_edit");
} else {
if (top.job_edit.open) {
top.job_edit.focus();
} else {
top.jb_edit = window.open("../jobs2/job_edit.php","job_edit");
}
}
}
}
if (task == "job_list") {
if (this.top.iname == "job_edit") {
// top.opener.top.menu.location.href = "../admin/menu.php";
if (!top.opener.top.maincontent.iname || top.opener.top.maincontent.iname != "job_list") {
top.opener.top.maincontent.location.href = "../admin/jb_list.php";
}
// top.opener.top.maincontent.focus();
top.opener.top.closeJobEdit();
} else {
top.menu.location.href = "../admin/menu.php";
// if (top.maincontent.iname != "job_list") {
top.maincontent.location.href = "../admin/jb_list.php";
// }
top.maincontent.focus();
}
}
}
function actionMapEvent(e, eKeyCode) {
// Verwaltung
if (e.altKey && eKeyCode == 49) { // "alt-1"
disableEvent(e);
actionEvent("admin");
}
// Auftragserfassung
if (e.altKey && eKeyCode == 50) { // "alt-2"
disableEvent(e);
actionEvent("job_edit");
}
// Auftragslisten
if (e.altKey && eKeyCode == 51) { // "alt-3"
disableEvent(e);
actionEvent("job_list");
}
}
function eventKeyDownPressed(e) {
if (e.altKey) {
keyDownEventEnabled = true;
}
return true;
}
function eventKeyUpPressed(e) {
// if (e.altKey) {
keyDownEventEnabled = true;
// }
return true;
}
function eventKeyPressed(e) {
if (Netscape) {
// Verwaltung
if (keyDownEventEnabled && e.altKey && e.which == 49) { // "alt-1"
disableEvent(e);
actionEvent("admin");
}
// Auftragserfassung
if (keyDownEventEnabled && e.altKey && e.which == 50) { // "alt-2"
disableEvent(e);
actionEvent("job_edit");
}
// Auftragslisten
if (keyDownEventEnabled && e.altKey && e.which == 51) { // "alt-3"
disableEvent(e);
actionEvent("job_list");
}
}
};
if (Netscape) {
document.addEventListener("keydown", eventKeyDownPressed, true);
document.addEventListener("keyup", eventKeyUpPressed, true);
document.addEventListener("keypress", eventKeyPressed, true);
}

View File

@@ -0,0 +1,138 @@
<script language="JavaScript1.2" type="text/javascript">
<!--
// General functionality for all browsers in this section
// Status of the event to be checked
var keyDownEventEnabled = true;
var Netscape = new Boolean();
Netscape = false;
if (navigator.appName == "Netscape") Netscape = true;
// Status informations
// document.write(navigator.appName + "<br>" + navigator.appVersion + "<br>" + navigator.appCodeName + "<br><br><br>");
function disableEvent(e) {
if (!e) var e = window.event;
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();
if (e.preventDefault) {
if (e.cancelable) e.preventDefault();
} else {
e.keyCode = 0;
e.returnValue = 0;
// e.cancelBubble = true;
}
keyDownEventEnabled = false;
}
function actionEvent(task) {
if (task == "admin") {
top.location.href = "../admin/menu_fs.php?navigationLevel=2&navigationPoint=verwaltung";
}
if (task == "job_edit") {
top.jb_edit = window.open("../jobs/job_edit.php","job_edit");
}
if (task == "job_edit2") {
top.jb_edit = window.open("../jobs2/job_edit.php","job_edit");
}
if (task == "job_list") {
top.menu.location.href = "../admin/menu.php";
top.maincontent.location.href = "../admin/jb_list.php";
}
}
//-->
</script>
<script language="JavaScript1.2" type="text/javascript">
<!--
function eventKeyDownPressed(e) {
if (e.altKey) {
keyDownEventEnabled = true;
}
return true;
}
function eventKeyUpPressed(e) {
// if (e.altKey) {
keyDownEventEnabled = true;
// }
return true;
}
function eventKeyPressed(e) {
if (Netscape) {
// Verwaltung
if (keyDownEventEnabled && e.altKey && e.which == 49) { // "alt-1"
disableEvent(e);
actionEvent("admin");
}
// Auftragserfassung
if (keyDownEventEnabled && e.altKey && e.which == 50) { // "alt-2"
disableEvent(e);
if (!top.job_edit) {
actionEvent("job_edit");
} else {
if (top.job_edit.open) {
top.job_edit.focus();
} else {
actionEvent("job_edit");
}
}
}
// Auftragslisten
if (keyDownEventEnabled && e.altKey && e.which == 51) { // "alt-3"
disableEvent(e);
actionEvent("job_list");
}
}
};
if (Netscape) {
document.addEventListener("keydown", eventKeyDownPressed, true);
document.addEventListener("keyup", eventKeyUpPressed, true);
document.addEventListener("keypress", eventKeyPressed, true);
}
//-->
</script>
<!-- JScript-Bereiche fuer MS Internet Explorer -->
<script for="document" event="onkeydown()" language="JScript" type="text/jscript">
<!--
{
// Verwaltung
if (window.event.altKey && event.keyCode == 49) { // "alt-1"
disableEvent(window.event);
actionEvent("admin");
}
// Auftragserfassung
if (window.event.altKey && event.keyCode == 50) { // "alt-2"
disableEvent(window.event);
if (!top.job_edit) {
actionEvent("job_edit");
} else {
if (top.job_edit.open) {
top.job_edit.focus();
} else {
actionEvent("job_edit");
}
}
}
// Auftragslisten
if (window.event.altKey && event.keyCode == 51) { // "alt-3"
disableEvent(window.event);
actionEvent("job_list");
}
}
//-->
</script>

View File

@@ -0,0 +1,561 @@
// **************
// * Navigation *
// **************
// *** Core menu code (BEGIN) **********************************************
// Shows a container
function myshow(elem_id) {
if (elem_id != undefined && elem_id != '') {
elem_id = '#' + elem_id;
$(elem_id).show();
};
}
// Hides a container
function myhide(elem_id) {
if (elem_id != undefined && elem_id != '') {
elem_id = '#' + elem_id;
$(elem_id).hide();
};
}
// Hides or shows the menu by clicking the page title container
function activateMenusByPageTitle() {
if (menuActiveByPageTitel) {
menuActiveByPageTitel = false;
$('#menu').hide();
$('#menu_reduced').hide();
} else {
menuActiveByPageTitel = true;
$('#menu').show();
}
}
// Switch activation status of the menu
function activateMenu(activateId, deactivateId) {
activateId = '#' + activateId;
deactivateId = '#' + deactivateId;
// if (deactivateId != '' && document.getElementById(deactivateId)) {
if (deactivateId != '' && $(deactivateId)) {
$(deactivateId).hide();
};
// if (activateId != '' && document.getElementById(activateId)) {
if (activateId != '' && $(activateId)) {
$(activateId).show();
};
}
// Call for loading one image
function changeContent(objectName,mode,navLevel) {
if (navLevel == "") {navLevel = 0};
navLevel = parseInt(navLevel);
objName = '#' + objectName;
useCascade = true;
if (navLevel < 0) {
useCascade = false;
navLevel = 0;
};
tmpIndex = 0; // "off"
if (mode == "over") {tmpIndex = 1;};
if (mode == "active") {tmpIndex = 2;};
if (mode == "deactive") {tmpIndex = 0;};
if (objectName != activeElement[navLevel] || mode == "active" || mode == "deactive") {
$(objName).css('background', 'url(' + navBgImg[navLevel][tmpIndex] + ')');
};
if (useCascade) {
if (objectName != activeElement[navLevel]) {
if (mode == "off") {
if (activeElement[navLevel] == "") {
// Hide elements of sub-navigation
for (i = navLevel; i <= menuNavigationDeep; i++) {
len = menuStruct[i].length;
for (j = 0; j < len; j++) {
if (subMenu[menuStruct[i][j]]) {
len2 = subMenu[menuStruct[i][j]].length;
for (k = 0; k < len2; k++) {
myhide(subMenu[menuStruct[i][j]][k]);
};
};
};
};
};
};
if (mode == "over") {
if (activeElement[navLevel] == "") {
// Show element of sub-navigation
if (subMenu[objectName]) {
len = subMenu[objectName].length;
for (i = 0; i < len; i++) {
myshow(subMenu[objectName][i]);
};
};
};
};
};
};
}
// Call for enable a sub menu as active and disable the old active element
function setMenu(objectName,navLevel) {
if (navLevel == "") {navLevel = "0"};
// Disable current displayed sub menus
for (i = navLevel; i <= menuNavigationDeep; i++) {
// Reset menu
len = menuStruct[i].length;
for (j = 0; j < len; j++) {
if (document.getElementById(menuStruct[i][j])) {
changeContent(menuStruct[i][j],'deactive',i);
};
// Hide sub menus if exist
if (subMenu[menuStruct[i][j]]) {
len2 = subMenu[menuStruct[i][j]].length;
for (k = 0; k < len2; k++) {
myhide(subMenu[menuStruct[i][j]][k]);
};
};
};
};
if (objectName != activeElement[navLevel] || activeElement[navLevel] == "") {
// Enable new submenu
if (subMenu[objectName]) {
len = subMenu[objectName].length;
for (i = 0; i < len; i++) {
myshow(subMenu[objectName][i]);
};
};
// Define active element and delete cascade
for (i = (navLevel + 1); i <= menuNavigationDeep; i++) {
activeElement[i] = "";
};
activeElement[navLevel] = objectName;
changeContent(activeElement[navLevel],'active',navLevel);
} else {
for (i = navLevel; i <= menuNavigationDeep; i++) {
activeElement[i] = "";
};
};
}
// Gets the id of the parent element
// if parentLevel==0 then take parent, if parentLevel==1 then take parent of the parent, etc.
function getParentId(objectId, parentLevel) {
if (parentLevel == '') {parentLevel = 0};
parentLevel = parseInt(parentLevel);
objId = '#' + objectId;
parentId = $(objId).parents()[parentLevel].id;
return parentId;
}
// Displays (hides and shows) sub menus (if does exist) according to an item
// E.g. it shows all elements (menu containers) like subMenu["preise"] => "menu_01_02_01
function displaySubmenu(itemId, mode) {
if (mode == '') {mode = 'show'};
if (itemId) {
len = subMenu[itemId].length;
for (i = 0; i < len; i++) {
if (mode == 'show') {
myshow(subMenu[itemId][i]);
} else {
myhide(subMenu[itemId][i]);
};
};
};
}
// Initiates the menu
function setMenuOnLoad(objectName,navLevel) {
if ($(objectName)) {
navLevel = parseInt(navLevel);
// alert('objectName=' + objectName + ' navLevel=' + navLevel + ' activeElement[' + navLevel + ']=' + activeElement[navLevel]);
// Activate current item
changeContent(objectName,'active',navLevel);
activeElement[navLevel] = objectName;
// Get id of the parent element
// E.g. objectName == "servicepreise" => parentId = "menu_01_02_01"
parentId = getParentId(objectName,0);
// Lookup for item of next parent navigation level having "parentId" in associated Array
// E.g. "menu_01_02_01" is element of subMenu["preise"] => Get all elements of subMenu["preise"]
for (tmpNavLevel = (navLevel - 1); tmpNavLevel >= 0; tmpNavLevel--) {
// Iterate all items of the navigation level in menuStruct[tmpNavLevel]
len = menuStruct[tmpNavLevel].length;
for (j = 0; j < len; j++) {
if (subMenu[menuStruct[tmpNavLevel][j]]) {
len2 = subMenu[menuStruct[tmpNavLevel][j]].length;
tmpActivateSubmenu = false;
for (k = 0; k < len2; k++) {
if (subMenu[menuStruct[tmpNavLevel][j]][k] == parentId) {
tmpActivateSubmenu = true;
};
};
if (tmpActivateSubmenu) {
// E.g. show all containers of subMenu["preise"]
displaySubmenu(menuStruct[tmpNavLevel][j], 'show');
// Activate parent item e.g. "preise" (= menuStruct[tmpNavLevel][j])
changeContent(menuStruct[tmpNavLevel][j],'active',tmpNavLevel);
activeElement[tmpNavLevel] = menuStruct[tmpNavLevel][j];
parentId = getParentId(menuStruct[tmpNavLevel][j],0);
};
};
};
};
};
}
// Sets all links of a special link class to "hidefocus"
function hideFocusOfLinkClass() {
// $$('#a_menu').each(function(i) {i.hideFocus = "true";});
}
// C9E9FE hellgrün
// 47B868 grün
// 2091C9 blau
var menuActive = true;
// var menuActiveByPageTitel = true;
<?php if ($menuActiveByPageTitel) : ?>
var menuActiveByPageTitel = true;
<?php else : ?>
var menuActiveByPageTitel = false;
<?php endif; ?>
var menuNavigationDeep = <?php if ($jsMenuNavigationDeep == "") : $jsMenuNavigationDeep = "0"; endif; echo $jsMenuNavigationDeep ?>;
// Init parameter for current displayed submenus
var activeElement = new Array();
<?php
for ($j = 0; $j <= $jsMenuNavigationDeep; $j++) :
echo "activeElement[" . $j . "] = '';";
endfor;
?>
var activeElementLen = activeElement.length;
var navBgColor = new Array();
navBgColor[0] = "#1b12b9"; // menu_01 blau (27, 18, 185)
navBgColor[1] = "#4e45ec"; // menu_02 blau (78, 69, 236)
navBgColor[2] = "#97bcFF"; // menu_03 blau (151, 188, 255)
navBgColor[3] = "#97bcFF";
var navBgImg = new Array();
navBgImg[0] = new Array("../images/navItemBgOffMenu01.jpg", "../images/navItemBgOverMenu01.jpg", "../images/navItemBgActiveMenu01.jpg");
navBgImg[1] = new Array("../images/navItemBgOffMenu02.jpg", "../images/navItemBgOverMenu02.jpg", "../images/navItemBgActiveMenu02.jpg");
navBgImg[2] = new Array("../images/navItemBgOffMenu03.jpg", "../images/navItemBgOverMenu03.jpg", "../images/navItemBgActiveMenu03.jpg");
navBgImg[3] = new Array("../images/navItemBgOffMenu03.jpg", "../images/navItemBgOverMenu03.jpg", "../images/navItemBgActiveMenu03.jpg");
// Array of the menu structure
var menuStruct = new Array();
// menuStruct[0] = new Array("verwaltung","auftraege", ...);
// menuStruct[1] = new Array("kunden","transporteure",... ,"uebersicht","pdf_ausgabe");
// ...
<?php
for ($j = 1; $j < $menuLevels; $j++) :
echo "menuStruct[" . ($j - 1) . "] = new Array(" . $jsMenuStruct[$j] . ");\n";
endfor;
?>
// Array of containers be visible by hovering and click
var subMenu = new Array();
// subMenu["verwaltung"] = new Array("menu_01_01","menu_01_02","menu_01_03");
// subMenu["rechnungen"] = new Array("menu_02_01");
// ...
<?php
$jsMenuOut = "";
$tmpLen = count($jsSubMenu);
for ($j = 0; $j < $tmpLen; $j++) :
$jsMenuOut .= "subMenu[\"" . $jsSubMenu[$j][0] . "\"] = new Array(";
$tmpLen2 = count($jsSubMenu[$j][1]);
for ($k = 0; $k < $tmpLen2; $k++) :
$jsMenuOut .= "\"" . $jsSubMenu[$j][1][$k] . "\"";
if ($k < ($tmpLen2 - 1)) :
$jsMenuOut .= ",";
endif;
endfor;
$jsMenuOut .= ");\n";
endfor;
echo $jsMenuOut;
?>
// *** Core menu code (END) **********************************************
// *** Framework Wrapper (BEGIN) ***************************************
function vShow(selector) {
myshow(selector);
};
function vHide(selector) {
myhide(selector);
};
function vSetCss(selector, cssStyles) {
selector = '#' + selector;
$(selector).css(cssStyles);
};
function vSetElementContent(selector, content) {
selector = '#' + selector;
$(selector).html(content);
};
function vGetElementContent(selector) {
selector = '#' + selector;
return $(selector).html();
};
function vConfirmFunc(msg, fn, height, selector) {
if (height == "" || height == undefined) { height = '160'; };
if (selector == "" || selector == undefined) { selector = 'dialog-confirm'; };
selector = '#' + selector;
genConfirm(msg);
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( selector ).dialog({
resizable: false, height:160, modal: true,
buttons: {
"Ja": function() { fn(); },
"Nein": function() { $( this ).dialog( "close" ); }
}
});
});
};
function vConfirmFuncPar(msg, fn, height, selector, par1, par2, par3, par4, par5, par6, par7, par8, par9) {
if (height == "" || height == undefined) { height = '160'; };
if (selector == "" || selector == undefined) { selector = 'dialog-confirm'; };
selector = '#' + selector;
genConfirm(msg);
$(function() {
$( "#dialog:ui-dialog" ).dialog( "destroy" );
$( selector ).dialog({
resizable: false, height:160, modal: true,
buttons: {
"Ja": function() {
if (par9 != '') {
fn(par1, par2, par3, par4, par5, par6, par7, par8, par9);
} else if (par8 != '') {
fn(par1, par2, par3, par4, par5, par6, par7, par8);
} else if (par7 != '') {
fn(par1, par2, par3, par4, par5, par6, par7);
} else if (par6 != '') {
fn(par1, par2, par3, par4, par5, par6);
} else if (par5 != '') {
fn(par1, par2, par3, par4, par5);
} else if (par4 != '') {
fn(par1, par2, par3, par4);
} else if (par3 != '') {
fn(par1, par2, par3);
} else if (par2 != '') {
fn(par1, par2);
} else if (par1 != '') {
fn(par1);
}
},
"Nein": function() { $( this ).dialog( "close" ); }
}
});
});
};
// *** Framework Wrapper (END) ******************************************
// *** DHTML (BEGIN) ****************************************************
var activeButton = '';
var disabledButtons = new Array(); // E.g. for export to disable all buttons after selecting one of them
function checkButtonIsDisabled(buttonName) {
notDisabled = true;
disabledButtonsLen = disabledButtons.length;
for (i = 0; i < disabledButtonsLen; i++) {
if (buttonName == disabledButtons[i]) {notDisabled = false;};
};
return notDisabled;
}
function changeButton(mode,buttonName,content,paddingLeft,paddingTop) {
elem = '#' + buttonName;
// elem = $(buttonName);
notDisabled = checkButtonIsDisabled(buttonName);
if (buttonName != activeButton && notDisabled) {
if (mode == "off") {
// elem.setStyle({color: '#FFFFFF'});
$(elem).css('color', '#FFFFFF');
// elem.innerHTML = '<div style="margin-left:' + paddingLeft + '; margin-top:' + paddingTop + ';">' + content + '</div>\n';
};
if (mode == "over") {
// buttonWidth = elem.getStyle('width');
buttonWidth = $(elem).css('width');
buttonWidth = parseInt(buttonWidth.substring(0, (buttonWidth.length - 2))) - 2;
// buttonHeight = elem.getStyle('height');
buttonHeight = $(elem).css('height');
buttonHeight = parseInt(buttonHeight.substring(0, (buttonHeight.length - 2))) - 2;
// elem.setStyle({color: '#97bcFF'});
$(elem).css('color', '#97bcFF');
// elem.innerHTML = '<div style="margin-left:' + paddingLeft + '; margin-top:' + paddingTop + '; color:#FFFFFF;">' + 'x' + content + '</div>\n';
/*
tmpInnerHTLM = eval('<div style="height:1px; background:#FFFFFF;"></div>\n' +
'<div style="height:' + buttonHeight + 'px;">\n' +
' <div style="width:1px; height:100%; background:#FFFFFF;"></div>\n' +
' <div style="width:' + buttonWidth + 'px; height:' + buttonHeight + 'px;">' + content + '</div>\n' +
' <div style="width:1px; height:100%; background:#000000;"></div>\n' +
'</div>\n' +
'<div style="height:1px; background:#000000;"></div>\n');
// elem.innerHTML = tmpInnerHTLM;
$(elem).text(tmpInnerHTLM);
*/
};
};
}
// *** DHTML (END) ****************************************************
// JQuery.Request (POST)
function ajax_request(url, data) {
$.ajax({
type: "POST",
url: url,
data: data,
success: function(msg){ajax_response(msg);}
});
}
// JQuery.Response (POST)
function ajax_response(msg) {
if(!bHasRedirect) {
$('maincontent').innerHTML = msg;
}
else {
bHasRedirect = false;
ajax_request(msg, "");
}
}
// JQuery.Request (GET)
function ajaxRequestGet(url, data) {
$.ajax({
type: "GET",
url: url,
data: data,
async: false,
cache: false,
success: function(msg){eval(msg);}
});
}
var statusMessage = "<?php echo $statusMessage ?>";
function displayStatusMessage() {
if (statusMessage != "") {
alert(statusMessage);
}
};
function hqCheckAll(numOfHq) {
for (i = 0; i < numOfHq; i++) {
document.getElementsByName('f_hq_id[]')[i].checked = true;
}
}
function hqUncheckAll(numOfHq) {
for (i = 0; i < numOfHq; i++) {
document.getElementsByName('f_hq_id[]')[i].checked = false;
}
}
function mkImpressumPopupWin() {
var widthPopupWin = 250;
var heightPopupWin = 310;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin=window.open("../admin/impressum.html", "","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin);
};
function mkLanguagePopupWin() {
var widthPopupWin = 250;
var heightPopupWin = 310;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin=window.open("../admin/language.php", "","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin);
};
function submitPage(navItem) {
if (document.forms[0].currentNavigationItem) {
document.forms[0].currentNavigationItem.value = navItem;
}
if (document.forms[0].menuActiveByPageTitel) {
if (menuActiveByPageTitel) {
document.forms[0].menuActiveByPageTitel.value = '0';
} else {
document.forms[0].menuActiveByPageTitel.value = '1';
}
}
document.forms[0].submit();
};
function genConfirm(text, headline, appendSelector) {
if (headline == '' || headline == undefined) {headline = '<?php echo getLngt("Bestätigung") ?>';};
if (text == '' || text == undefined) {text = '<?php echo getLngt("Wirklich?") ?>';};
if (appendSelector == '' || appendSelector == undefined) {appendSelector = '#maincontent';};
$(appendSelector).append('<div id="dialog-confirm" title="' + headline + '"><p><span class="ui-icon ui-icon-alert" style="float:left; margin:0 7px 20px 0;"></span>' + text + '</p></div>');
}
function logout() {
if (confirm('<?php echo getLngt("Möchten Sie sich wirklich abmelden?") ?>')) {
document.location.href = "../admin/logout.php";
};
};
function openMfHistory() {
var widthPopupWin = 900;
var heightPopupWin = 700;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/mf_history.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openJobInvoiceAssoc() {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../jobs/jb_inv_assoc.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openVehicleDisposition() {
var widthPopupWin = 1800;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/vehicle_disposition.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};

View File

@@ -0,0 +1,505 @@
// **************
// * Navigation *
// **************
// *** Core menu code (BEGIN) **********************************************
// Shows a container
function myshow(id) {
if (id != undefined && id != '') {
$(id).style.display = "inline";
};
}
// Hides a container
function myhide(id) {
if (id != undefined && id != '') {
$(id).style.display = "none";
};
}
// Hides or shows the menu by clicking the page title container
function activateMenusByPageTitle() {
if (menuActiveByPageTitel) {
menuActiveByPageTitel = false;
$('menu').hide();
$('menu_reduced').hide();
} else {
menuActiveByPageTitel = true;
$('menu').show();
}
}
// Switch activation status of the menu
function activateMenu(activateId, deactivateId) {
// if (deactivateId != '' && document.getElementById(deactivateId)) {
if (deactivateId != '' && $(deactivateId)) {
$(deactivateId).hide();
};
// if (activateId != '' && document.getElementById(activateId)) {
if (activateId != '' && $(activateId)) {
$(activateId).show();
};
}
// Call for loading one image
function changeContent(objectName,mode,navLevel) {
if (navLevel == "") {navLevel = 0};
navLevel = parseInt(navLevel);
useCascade = true;
if (navLevel < 0) {
useCascade = false;
navLevel = 0;
};
// alert(navLevel + ' ' + objectName + ' ' + mode );
tmpIndex = 0; // "off"
if (mode == "over") {tmpIndex = 1;};
if (mode == "active") {tmpIndex = 2;};
if (mode == "deactive") {tmpIndex = 0;};
if (objectName != activeElement[navLevel] || mode == "active" || mode == "deactive") {
$(objectName).style.background = 'url(' + navBgImg[navLevel][tmpIndex] + ')';
};
if (useCascade) {
if (objectName != activeElement[navLevel]) {
if (mode == "off") {
if (activeElement[navLevel] == "") {
// Hide elements of sub-navigation
for (i = navLevel; i <= menuNavigationDeep; i++) {
len = menuStruct[i].length;
for (j = 0; j < len; j++) {
if (subMenu[menuStruct[i][j]]) {
len2 = subMenu[menuStruct[i][j]].length;
for (k = 0; k < len2; k++) {
myhide(subMenu[menuStruct[i][j]][k]);
};
};
};
};
};
};
if (mode == "over") {
if (activeElement[navLevel] == "") {
// Show element of sub-navigation
if (subMenu[objectName]) {
len = subMenu[objectName].length;
for (i = 0; i < len; i++) {
myshow(subMenu[objectName][i]);
};
};
};
};
};
};
}
// Call for enable a sub menu as active and disable the old active element
function setMenu(objectName,navLevel) {
if (navLevel == "") {navLevel = "0"};
// Disable current displayed sub menus
for (i = navLevel; i <= menuNavigationDeep; i++) {
// Reset menu
len = menuStruct[i].length;
for (j = 0; j < len; j++) {
if (document.getElementById(menuStruct[i][j])) {
changeContent(menuStruct[i][j],'deactive',i);
};
// Hide sub menus if exist
if (subMenu[menuStruct[i][j]]) {
len2 = subMenu[menuStruct[i][j]].length;
for (k = 0; k < len2; k++) {
myhide(subMenu[menuStruct[i][j]][k]);
};
};
};
};
if (objectName != activeElement[navLevel] || activeElement[navLevel] == "") {
// Enable new submenu
if (subMenu[objectName]) {
len = subMenu[objectName].length;
for (i = 0; i < len; i++) {
myshow(subMenu[objectName][i]);
};
};
// Define active element and delete cascade
for (i = (navLevel + 1); i <= menuNavigationDeep; i++) {
activeElement[i] = "";
};
activeElement[navLevel] = objectName;
changeContent(activeElement[navLevel],'active',navLevel);
} else {
for (i = navLevel; i <= menuNavigationDeep; i++) {
activeElement[i] = "";
};
};
}
// Gets the id of the parent element
// if parentLevel==0 then take parent, if parentLevel==1 then take parent of the parent, etc.
function getParentId(objectId, parentLevel) {
if (parentLevel == '') {parentLevel = 0};
parentLevel = parseInt(parentLevel);
tmp = $(objectId).ancestors();
tmp = tmp[parentLevel];
parentId = tmp.id;
return parentId;
}
// Displays (hides and shows) sub menus (if does exist) according to an item
// E.g. it shows all elements (menu containers) like subMenu["preise"] => "menu_01_02_01
function displaySubmenu(itemId, mode) {
if (mode == '') {mode = 'show'};
if (itemId) {
len = subMenu[itemId].length;
for (i = 0; i < len; i++) {
if (mode == 'show') {
myshow(subMenu[itemId][i]);
} else {
myhide(subMenu[itemId][i]);
};
};
};
}
// Initiates the menu
function setMenuOnLoad(objectName,navLevel) {
if ($(objectName)) {
navLevel = parseInt(navLevel);
// alert('objectName=' + objectName + ' navLevel=' + navLevel + ' activeElement[' + navLevel + ']=' + activeElement[navLevel]);
// Activate current item
changeContent(objectName,'active',navLevel);
activeElement[navLevel] = objectName;
// Get id of the parent element
// E.g. objectName == "servicepreise" => parentId = "menu_01_02_01"
parentId = getParentId(objectName,0);
// Lookup for item of next parent navigation level having "parentId" in associated Array
// E.g. "menu_01_02_01" is element of subMenu["preise"] => Get all elements of subMenu["preise"]
for (tmpNavLevel = (navLevel - 1); tmpNavLevel >= 0; tmpNavLevel--) {
// Iterate all items of the navigation level in menuStruct[tmpNavLevel]
len = menuStruct[tmpNavLevel].length;
for (j = 0; j < len; j++) {
if (subMenu[menuStruct[tmpNavLevel][j]]) {
len2 = subMenu[menuStruct[tmpNavLevel][j]].length;
tmpActivateSubmenu = false;
for (k = 0; k < len2; k++) {
if (subMenu[menuStruct[tmpNavLevel][j]][k] == parentId) {
tmpActivateSubmenu = true;
};
};
if (tmpActivateSubmenu) {
// E.g. show all containers of subMenu["preise"]
displaySubmenu(menuStruct[tmpNavLevel][j], 'show');
// Activate parent item e.g. "preise" (= menuStruct[tmpNavLevel][j])
changeContent(menuStruct[tmpNavLevel][j],'active',tmpNavLevel);
activeElement[tmpNavLevel] = menuStruct[tmpNavLevel][j];
parentId = getParentId(menuStruct[tmpNavLevel][j],0);
};
};
};
};
};
}
// Sets all links of a special link class to "hidefocus"
function hideFocusOfLinkClass() {
$$('#a_menu').each(function(i) {i.hideFocus = "true";});
}
// C9E9FE hellgrün
// 47B868 grün
// 2091C9 blau
var menuActive = true;
// var menuActiveByPageTitel = true;
<?php if ($menuActiveByPageTitel) : ?>
var menuActiveByPageTitel = true;
<?php else : ?>
var menuActiveByPageTitel = false;
<?php endif; ?>
var menuNavigationDeep = <?php echo $jsMenuNavigationDeep ?>;
// Init parameter for current displayed submenus
var activeElement = new Array();
<?php
for ($j = 0; $j <= $jsMenuNavigationDeep; $j++) :
echo "activeElement[" . $j . "] = '';";
endfor;
?>
var activeElementLen = activeElement.length;
var navBgColor = new Array();
navBgColor[0] = "#1b12b9"; // menu_01 blau (27, 18, 185)
navBgColor[1] = "#4e45ec"; // menu_02 blau (78, 69, 236)
navBgColor[2] = "#97bcFF"; // menu_03 blau (151, 188, 255)
navBgColor[3] = "#97bcFF";
var navBgImg = new Array();
navBgImg[0] = new Array("../images/navItemBgOffMenu01.jpg", "../images/navItemBgOverMenu01.jpg", "../images/navItemBgActiveMenu01.jpg");
navBgImg[1] = new Array("../images/navItemBgOffMenu02.jpg", "../images/navItemBgOverMenu02.jpg", "../images/navItemBgActiveMenu02.jpg");
navBgImg[2] = new Array("../images/navItemBgOffMenu03.jpg", "../images/navItemBgOverMenu03.jpg", "../images/navItemBgActiveMenu03.jpg");
navBgImg[3] = new Array("../images/navItemBgOffMenu03.jpg", "../images/navItemBgOverMenu03.jpg", "../images/navItemBgActiveMenu03.jpg");
// Array of the menu structure
var menuStruct = new Array();
// menuStruct[0] = new Array("verwaltung","auftraege", ...);
// menuStruct[1] = new Array("kunden","transporteure",... ,"uebersicht","pdf_ausgabe");
// ...
<?php
for ($j = 1; $j < $menuLevels; $j++) :
echo "menuStruct[" . ($j - 1) . "] = new Array(" . $jsMenuStruct[$j] . ");\n";
endfor;
?>
// Array of containers be visible by hovering and click
var subMenu = new Array();
// subMenu["verwaltung"] = new Array("menu_01_01","menu_01_02","menu_01_03");
// subMenu["rechnungen"] = new Array("menu_02_01");
// ...
<?php
$jsMenuOut = "";
$tmpLen = count($jsSubMenu);
for ($j = 0; $j < $tmpLen; $j++) :
$jsMenuOut .= "subMenu[\"" . $jsSubMenu[$j][0] . "\"] = new Array(";
$tmpLen2 = count($jsSubMenu[$j][1]);
for ($k = 0; $k < $tmpLen2; $k++) :
$jsMenuOut .= "\"" . $jsSubMenu[$j][1][$k] . "\"";
if ($k < ($tmpLen2 - 1)) :
$jsMenuOut .= ",";
endif;
endfor;
$jsMenuOut .= ");\n";
endfor;
echo $jsMenuOut;
?>
// *** Core menu code (END) **********************************************
// *** Framework Wrapper (BEGIN) ***************************************
function vShow(selector) {
myshow(selector);
};
function vHide(selector) {
myhide(selector);
};
function vSetCss(selector, cssStyles) {
$(selector).setStyle(cssStyles);
};
function vSetElementContent(selector, content) {
$(selector).innerHTML = content;
};
function vGetElementContent(selector) {
return $(selector).innerHTML;
};
function vConfirmFunc(msg, fn, height, selector) {
if (confirm(msg)) { fn(); };
};
function vConfirmFuncPar(msg, fn, height, selector) {
if (confirm(msg)) { fn(); };
};
// *** Framework Wrapper (END) ******************************************
// *** DHTML (BEGIN) ****************************************************
var activeButton = '';
var disabledButtons = new Array(); // E.g. for export to disable all buttons after selecting one of them
function checkButtonIsDisabled(buttonName) {
notDisabled = true;
disabledButtonsLen = disabledButtons.length;
for (i = 0; i < disabledButtonsLen; i++) {
if (buttonName == disabledButtons[i]) {notDisabled = false;};
};
return notDisabled;
}
function changeButton(mode,buttonName,content,paddingLeft,paddingTop) {
elem = $(buttonName);
notDisabled = checkButtonIsDisabled(buttonName);
if (buttonName != activeButton && notDisabled) {
if (mode == "off") {
elem.setStyle({color: '#FFFFFF'});
// elem.innerHTML = '<div style="margin-left:' + paddingLeft + '; margin-top:' + paddingTop + ';">' + content + '</div>\n';
};
if (mode == "over") {
buttonWidth = elem.getStyle('width');
buttonWidth = parseInt(buttonWidth.substring(0, (buttonWidth.length - 2))) - 2;
buttonHeight = elem.getStyle('height');
buttonHeight = parseInt(buttonHeight.substring(0, (buttonHeight.length - 2))) - 2;
elem.setStyle({color: '#97bcFF'});
// elem.innerHTML = '<div style="margin-left:' + paddingLeft + '; margin-top:' + paddingTop + '; color:#FFFFFF;">' + 'x' + content + '</div>\n';
/*
tmpInnerHTLM = eval('<div style="height:1px; background:#FFFFFF;"></div>\n' +
'<div style="height:' + buttonHeight + 'px;">\n' +
' <div style="width:1px; height:100%; background:#FFFFFF;"></div>\n' +
' <div style="width:' + buttonWidth + 'px; height:' + buttonHeight + 'px;">' + content + '</div>\n' +
' <div style="width:1px; height:100%; background:#000000;"></div>\n' +
'</div>\n' +
'<div style="height:1px; background:#000000;"></div>\n');
elem.innerHTML = tmpInnerHTLM;
*/
};
};
}
// *** DHTML (END) ****************************************************
// Prototype.Request (POST)
function ajax_request(url, data) {
var myAjax = new Ajax.Request(
url,
{method: 'post', parameters: data, onComplete: ajax_response}
);
}
// Prototype.Response (POST)
function ajax_response(originalRequest) {
if(!bHasRedirect) {
//process originalRequest.responseText;
// e.g.:
$('maincontent').innerHTML = responseText;
}
else {
bHasRedirect = false;
ajax_request(originalRequest.responseText, "");
}
}
// Prototype.Request (GET)
function ajaxRequestGet(specificURL, parms) {
var myAjax = new Ajax.Request(
specificURL,
{method: 'get', asynchronous: false, parameters: parms, cache: false}
);
eval(myAjax.transport.responseText);
}
var statusMessage = "<?php echo $statusMessage ?>";
function displayStatusMessage() {
if (statusMessage != "") {
alert(statusMessage);
}
};
function hqCheckAll(numOfHq) {
for (i = 0; i < numOfHq; i++) {
document.getElementsByName('f_hq_id[]')[i].checked = true;
}
}
function hqUncheckAll(numOfHq) {
for (i = 0; i < numOfHq; i++) {
document.getElementsByName('f_hq_id[]')[i].checked = false;
}
}
function mkImpressumPopupWin() {
var widthPopupWin = 250;
var heightPopupWin = 310;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin=window.open("../admin/impressum.html", "","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin);
};
function mkLanguagePopupWin() {
var widthPopupWin = 250;
var heightPopupWin = 310;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin=window.open("../admin/language.php", "","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin);
};
function submitPage(navItem) {
if (document.forms[0].currentNavigationItem) {
document.forms[0].currentNavigationItem.value = navItem;
}
if (document.forms[0].menuActiveByPageTitel) {
if (menuActiveByPageTitel) {
document.forms[0].menuActiveByPageTitel.value = '0';
} else {
document.forms[0].menuActiveByPageTitel.value = '1';
}
}
document.forms[0].submit();
};
function logout() {
if (confirm('<?php echo getLngt("Möchten Sie sich wirklich abmelden?") ?>')) {
document.location.href = "../admin/logout.php";
};
};
function genAlert (text) {
alert(text);
};
function genConfirm (text) {
if (confirm(text)) {
return true;
};
return false;
};
function openMfHistory() {
var widthPopupWin = 900;
var heightPopupWin = 700;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/mf_history.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openJobInvoiceAssoc() {
var widthPopupWin = 1200;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../jobs/jb_inv_assoc.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};
function openVehicleDisposition() {
var widthPopupWin = 1800;
var heightPopupWin = 1024;
var leftPopupWin = (screen.width / 2) - (widthPopupWin / 2) - 12;
var topPopupWin = (screen.height / 2) - (heightPopupWin / 2) - 50;
var popupWin;
popupWin = window.open("../admin/vehicle_disposition.php","","dependent=yes,width=" + widthPopupWin + ",height=" + heightPopupWin +",left=" + leftPopupWin + ",top=" + topPopupWin + ",scrollbars=yes");
};

View File

@@ -0,0 +1,99 @@
// *** Ticker (BEGIN) ****************************************************
var tickerActive = false;
var max = 0;
function textlist() {
max = textlist.arguments.length;
for (i=0; i<max; i++) {
this[i] = textlist.arguments[i];
};
}
<?php if ($usedFramework == "2") : ?>
// Prototype.Request
function ticker_request(url, data) {
var myAjax = new Ajax.Request(
url,
{method: 'post', parameters: data, onSuccess: ticker_response}
);
}
// Prototype.Response
function ticker_response(originalRequest) {
eval(originalRequest.responseText);
}
<?php else : ?>
// JQuery.Request
function ticker_request(url, data) {
$.ajax({
type: "POST",
url: url,
data: data,
success: function(msg){ticker_response(msg);}
});
}
// JQuery.Response
function ticker_response(msg) {
eval(msg);
}
<?php endif; ?>
<?php
include_once ("../include/ajaxReqTickerMsgs.php");
?>
var x = 0; pos = 0;
var msgLen = tl[0].length;
var initInterval = 0;
function ticker(elem_id) {
if (tickerActive) {
content = '&nbsp;&nbsp;&nbsp;' + tl[x].substring(0,pos);
if (elem_id == '' || elem_id == undefined) {elem_id = 'tickerOut';};
vSetElementContent(elem_id, content);
if (pos++ == msgLen) {
pos = 0;
// setTimeout("ticker()",5000);
setTimeout("ticker('"+elem_id+"')",5000);
x++;
if (x == max) {
x = 0;
initInterval++;
if (initInterval == 5) {
ticker_request('../include/ajaxReqTickerMsgs.php', 'tickerHeader=1');
initInterval = 0;
};
};
msgLen = tl[x].length;
} else {
// setTimeout("ticker()",50);
setTimeout("ticker('"+elem_id+"')",50);
};
};
}
function switchTicker(mode) {
if (mode == 'on') {tickerActive = false;};
if (mode == 'off') {tickerActive = true;};
if (tickerActive) {
tickerActive = false;
myhide('tickerOut');
} else {
tickerActive = true;
myshow('tickerOut');
ticker('tickerOut');
};
}
// *** Ticker (END) ****************************************************