query("SELECT * FROM app_support WHERE support_id = '".$page."' LIMIT 1"); if ($mysqli_page->num_rows > 0){ // keep query value in array $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; $submit_type = 'edit' ; } // update database if ( isset($type) && ( $type == 'new' || $type == 'edit' ) && $_POST['hide'] == 1 ){ if ( $page == '' ){ $mysqli->query("INSERT INTO app_support ( created_at ) VALUES ( '".TODAYDATE."' )") ; $page = $mysqli->insert_id ; } // update database $mysqli->query("UPDATE app_support SET mobile = '".escapeString($_POST['mobile'])."', sortable = '".escapeString($_POST['sortable'])."', updated_at = '".TODAYDATE."' WHERE support_id = '".$page."'") ; foreach ( $LANGS as $klang => $vlang ){ $name = escapeString( $_POST['name_'.$klang] ) ; checkLangUpdate( 'app_support_translation', 'support_id', $page, $klang, [ 'name' => [ 'type' => 'input', 'value' => $name ] ] ) ; } // refresh page header("Location:app-support.php?page_mode=edit&page=".$page."&success=1") ; $_SESSION['system_result'] = 'success-updated' ; exit ; } if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-support-new') ) ){ header('Location: index.php') ; exit ; } // start header here include 'requires/page_header.php'; include 'requires/page_top.php'; ?>