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); $chkLinkTab = filter_input(INPUT_GET, 'linktab', FILTER_SANITIZE_STRING); if (get_magic_quotes_gpc() == 0) { $chkDef = addslashes($chkDef); $chkRange = addslashes($chkRange); } // // Get data // ======== if ($chkLinkTab != '') { $strSQL = 'SELECT * FROM `tbl_variabledefinition` LEFT JOIN `' .$chkLinkTab. '` ON `id`=`idSlave` ' . "WHERE `idMaster`=$chkDataId ORDER BY `name`"; $booReturn = $myDBClass->hasDataArray($strSQL, $arrDataLines, $intDataCount); // // Store data to session // ============================ if ($chkMode == '') { $arrTemp = array(); $_SESSION['variabledefinition'] = array(); 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') { $arrTemp = array(); 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' && 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; } } } ?> None
<?php
                echo translate('Modify'); ?> <?php
                echo translate('Delete'); ?>