getDataArray($strSQL,$arrDataLines,$intDataCount); // // Store data to session // ============================ if ($chkMode == "") { $_SESSION['variabledefinition'] = ""; if ($booReturn && ($intDataCount != 0)) { foreach ($arrDataLines AS $elem) { $arrTemp['id'] = $elem['id']; $arrTemp['definition'] = addslashes($elem['name']); $arrTemp['range'] = addslashes($elem['value']); $arrTemp['status'] = 0; $_SESSION['variabledefinition'][] = $arrTemp; } } } } // // Add mode // ======== if ($chkMode == "add") { if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition'])) { $intCheck = 0; foreach ($_SESSION['variabledefinition'] AS $key => $elem) { if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { $_SESSION['variabledefinition'][$key]['definition'] = $chkDef; $_SESSION['variabledefinition'][$key]['range'] = $chkRange; $intCheck = 1; } } if ($intCheck == 0) { $arrTemp['id'] = 0; $arrTemp['definition'] = $chkDef; $arrTemp['range'] = $chkRange; $arrTemp['status'] = 0; $_SESSION['variabledefinition'][] = $arrTemp; } } else { $arrTemp['id'] = 0; $arrTemp['definition'] = $chkDef; $arrTemp['range'] = $chkRange; $arrTemp['status'] = 0; $_SESSION['variabledefinition'][] = $arrTemp; } } // // Deletion mode // ============= if ($chkMode == "del") { if (isset($_SESSION['variabledefinition']) && is_array($_SESSION['variabledefinition'])) { foreach ($_SESSION['variabledefinition'] AS $key => $elem) { if (($elem['definition'] == $chkDef) && ($elem['status'] == 0)) { $_SESSION['variabledefinition'][$key]['status'] = 1; } } } } ?>