array('default' => 0))); $chkVersion = filter_input(INPUT_GET, 'version', FILTER_VALIDATE_INT, array('options' => array('default' => 0))); $chkMode = filter_input(INPUT_GET, 'mode', FILTER_SANITIZE_STRING); $chkDef = filter_input(INPUT_GET, 'def', FILTER_SANITIZE_STRING); $chkRange = filter_input(INPUT_GET, 'range', FILTER_SANITIZE_STRING); $chkId = filter_input(INPUT_GET, 'id', FILTER_SANITIZE_STRING); if (get_magic_quotes_gpc() == 0) { $chkDef = addslashes($chkDef); $chkRange = addslashes($chkRange); } // // Get data // ======== $strSQL = "SELECT * FROM `tbl_timedefinition` WHERE `tipId`=$chkTipId ORDER BY `definition`"; $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); // // Store data to session // ============================ if ($chkMode == '') { $_SESSION['timedefinition'] = array(); 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' && 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; } } } ?> None
<?php
                    echo translate('Modify'); ?> <?php
                    echo translate('Delete'); ?>