query( "SELECT * FROM branch WHERE deleted_at IS NULL " . $user_branch_permission_sql_123 ) ; if ( $get_branch->num_rows > 0 ){ while ( $row_branch = $get_branch->fetch_assoc() ){ $branch_all[$row_branch['branch_id']] = $row_branch['branch_name'] ; } } // check query exsits $submit_type = 'new' ; $mysqli_page = $mysqli->query("SELECT * FROM setting_popup WHERE setting_popup_id = '1' 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 setting_popup ( 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 != '' ){ $get_image = pathinfo($image) ; $create_image = reCreateImage('Pop-up', $page, $page, '', $image, $_FILES["image"]["type"], $_FILES['image']['tmp_name']) ; // Image uploads when exists if ($create_image['result'] && is_array($create_image['crop']) && count($create_image['result']) > 0){ $resizeObj = new resize($create_image['original']) ; // Initialise load image foreach($create_image['crop'] as $value){ // Resize image (options: exact, portrait, landscape, auto, crop) $resizeObj -> resizeImage($value['width'], $value['height'], $value['type']) ; $resizeObj -> saveImage($value['source'], 70) ; // Save image } $get_image = pathinfo($create_image['image']) ; $image_query = "file = '".$create_image['image']."'," ; } } $branch = $_POST['branch'] ; $array_branch = [] ; foreach ( $branch as $k_branch => $v_branch ){ $array_branch[] = escapeString( $v_branch ) ; } // update database $mysqli->query( "UPDATE setting_popup SET ".$image_query." branch = '/".implode('/', $array_branch)."/', title_name = '".escapeString($_POST['title_name'])."', status = '".escapeString($_POST['status'])."' WHERE setting_popup_id = '1'" ) ; // refresh page header("Location:app-pop-up.php?page_mode=edit&page=1&success=1") ; $_SESSION['system_result'] = 'success-updated' ; 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']) ; } ?>
Title
/>
* 800px x 1000px
no image
Status