query("SELECT * FROM app_service WHERE service_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_service ( created_at ) VALUES ( '".TODAYDATE."' )") ; $page = $mysqli->insert_id ; } // resize image // set image in variable $image = $_FILES["image"]["name"] ; $image_query = '' ; $remove_photo = $_POST['remove_photo'] ; if ($remove_photo == 1){ $image = '' ; $image_query = "file = ''," ; } if ( $image != '' ){ $file_name = $page.'.png' ; move_uploaded_file( $_FILES["image"]["tmp_name"], $_SERVER['DOCUMENT_ROOT'].'/uploads/AppService/'.$file_name ) ; $image_query = "file = '".$file_name."'," ; } // update database $mysqli->query("UPDATE app_service SET ".$image_query." module = '".escapeString($_POST['module'])."', on_off = '".escapeString($_POST['on_off'])."', colour = '".escapeString($_POST['colour'])."' WHERE service_id = '".$page."'") ; foreach ( $LANGS as $klang => $vlang ){ $title = escapeString( $_POST['title_'.$klang] ) ; checkLangUpdate( 'app_service_translation', 'service_id', $page, $klang, [ 'title' => [ 'type' => 'input', 'value' => $title ] ] ) ; } // refresh page header("Location:app-service.php?page_mode=edit&page=".$page."&success=1") ; $_SESSION['system_result'] = 'success-updated' ; exit ; } if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'app-service-new') ) ){ header('Location: index.php') ; exit ; } // start header here include 'requires/page_header.php'; include 'requires/page_top.php'; ?>
'.$lang['Thank you details has been updated'].'
' ; break ; } unset($_SESSION['system_result']) ; } ?>
[ 'type' => 'input', 'title' => $lang['title'] ] ]) ; ?>
Module
On / Off
Colour
/>
query($mysqli_query." ORDER BY a.service_id LIMIT $start_from, " . LIMIT) ; // load pagination $page_pagination = nextPrevious($product_page, LIMIT, $search_url, $mysqli_query) ; // start header here include 'requires/page_header.php' ; include 'requires/page_top.php' ; ?>
num_rows > 0){ while ($row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC)){ // default variable $id = $row_page['service_id'] ; $title = dataFilter($row_page['title']) ; echo ' '; } }else{ echo ' ' ; } ?>
On / Off
'.$title.' '.ucwords($row_page['on_off']).' '.resetDateFormat($row_page['created_at']).'
'.$lang['no_data'].'