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