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 permission if ( !permissionCheck($row_user, 'our-nomination-view') ){ header('Location: index.php') ; exit ; } // mode type | all list | new | edit switch($page_mode){ // edit nomination case 'new' : case 'edit' : // check query exsits $submit_type = 'new' ; $mysqli_page = $mysqli->query("SELECT * FROM nomination WHERE nomination_id = '".$nomination_id."' 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 ){ // keep value in variable $page_title = escapeString($_POST['title']) ; $page_title = ($page_title != '' ? $page_title : 'No Title') ; if ( $nomination_id == '' ){ $mysqli->query( "INSERT INTO nomination ( created_at ) VALUES ( '".TODAYDATE."' )" ) ; $nomination_id = $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('Nomination', $nomination_id, $nomination_id, '', $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']."'," ; } } $array_branch = [] ; foreach ( $_POST['branch'] as $k_branch => $v_branch ){ $array_branch[] = escapeString( $v_branch ) ; } // update database $mysqli->query( "UPDATE nomination SET ".$image_query." branch = '/".implode('/', $array_branch)."/', status = '".escapeString($_POST['status'])."' WHERE nomination_id = '".$nomination_id."'" ) ; $title_en = '' ; foreach ( $LANGS as $klang => $vlang ){ $title = escapeString( $_POST['title_'.$klang] ) ; $content = escapeString( $_POST['content_'.$klang] ) ; if ( $klang == 'en' ){ $title_en = $title ; } checkLangUpdate( 'nomination_translation', 'nomination_id', $nomination_id, $klang, [ 'title' => [ 'type' => 'input', 'value' => $title ], 'content' => [ 'type' => 'input', 'value' => $content ] ] ) ; } if ( $submit_type == 'new' ){ pushToBranchUser( $array_branch, [], 'nomination', $nomination_id, 'New Nomination', ( $title_en != '' ? $title_en : 'New nomination has been submitted.' ) ) ; } // refresh page header("Location:app-nomination.php?page_mode=edit&nomination_id=".$nomination_id."&success=1") ; $_SESSION['system_result'] = 'success-updated' ; exit ; } if ( ( $page_mode == 'new' && !permissionCheck($row_user, 'our-nomination-new') ) || ( $page_mode == 'edit' && !permissionCheck($row_user, 'our-nomination-edit') ) ){ header('Location: app-nomination.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'] ], 'content' => [ 'type' => 'textarea', 'title' => $lang['Content'] ] ]) ; ?>
/>
Status
query("SELECT a.nomination_id, b.title, b.content FROM nomination a LEFT JOIN nomination_translation b ON ( a.nomination_id = b.nomination_id ) WHERE a.nomination_id = '".$nomination_id."' LIMIT 1"); if ($mysqli_page->num_rows == 0){ exit ; } $row_page = $mysqli_page->fetch_assoc() ; // update database if ( $_POST['hide'] == 1 ){ $update_status = escapeString( $_POST['update_status'] ) ; foreach ( $_POST['multiple_status'] as $kk => $vv ){ $mysqli->query( "UPDATE staff_nomination SET status = '".$update_status."' WHERE view_id = '".$kk."'" ) ; if ( $update_status == 'rejected' ){ pushToUserCron( 'staff_nomination', $kk, $vv, 'Nomination', 'Nomination has been reject.' ) ; }else{ pushToUserCron( 'staff_nomination', $kk, $vv, 'Nomination', 'Nomination has been update.' ) ; } } header( "Refresh: 0;" ) ; exit ; } // related staff // pagination if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) $start_from = ($product_page - 1) * LIMIT ; //end next and prev page // set search url $search_url = 'page_mode='.$page_mode.'&nomination_id='.$nomination_id.'search='.$search ; // page query $mysqli_query = "SELECT a.view_id, a.nomination_so, a.created_at, a.updated_at, a.status, b.staff_id, b.staff_idno, b.staff_name, b.staff_image FROM staff_nomination a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL AND a.nomination_id = '".$nomination_id."' " . $search_query ; $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC 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'; ?>
Join Staff
num_rows > 0 ){ while ( $row_list = $mysqli_list->fetch_assoc() ){ $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; echo ' '; } } ?>
So Number Profile Staff ID Name Status Created At Updated At
' ; if ( $row_list['status'] == 'pending' || $row_list['status'] == 'approved' ){ echo '
' ; } echo '
'.dataFilter($row_list['nomination_so']).' '.( $staff_image != '' ? '' : '' ).' '.dataFilter($row_list['staff_idno']).' '.dataFilter($row_list['staff_name']).' '.resetStatus($row_list['status']).' '.resetDateFormat($row_list['created_at']).' '.resetDateFormat($row_list['updated_at']).'
Title
Content
Status
= '".$search_date."' " ; } // search query if ($search != ''){ $search_query .= " AND ( title LIKE '%".$search."%' )" ; } if( $search_type != ''){ $search_query .= " AND a.status IN ('".implode("', '",$search_type)."') " ; } // related staff // pagination if (isset($page) && !empty($page)) { $product_page = $page ; } else { $product_page = 1 ; } // next and prev page (5 thing need to change) $start_from = ($product_page - 1) * LIMIT ; //end next and prev page // set search url $search_url = 'search='.$search.'&search_name='.$search_name.'&search_date='.$search_date.'&page_mode='.$page_mode.'&search_idno='.$search_idno.'&search_mobile='.$search_mobile.'&search_mail='.$search_mail; // page query $mysqli_query = "SELECT a.view_id, a.nomination_so, a.created_at, a.updated_at, a.status, b.staff_idno, b.staff_name, b.staff_image FROM staff_nomination a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL " . $search_query ; $mysqli_list = $mysqli->query( $mysqli_query." ORDER BY a.view_id DESC 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'; ?>
Join Staff
num_rows > 0 ){ while ( $row_list = $mysqli_list->fetch_assoc() ){ $staff_image = ( $row_list['staff_image'] != '' ? PATH.'uploads/Staff/'.dataFilter($row_list['staff_image']) : '' ) ; echo ' '; } } ?>
So Number Profile Staff ID Name Status Created At Updated At
' ; if ( $row_list['status'] == 'pending' || $row_list['status'] == 'approved' ){ echo '
' ; } echo '
'.dataFilter($row_list['nomination_so']).' '.( $staff_image != '' ? '' : '' ).' '.dataFilter($row_list['staff_idno']).' '.dataFilter($row_list['staff_name']).' '.resetStatus($row_list['status']).' '.resetDateFormat($row_list['created_at']).' '.resetDateFormat($row_list['updated_at']).'
query( $mysqli_query." ORDER BY a.nomination_id DESC 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_assoc() ){ $staff_nomination = $mysqli->query( "SELECT view_id FROM staff_nomination WHERE deleted_at IS NULL AND nomination_id = '".$row_page['nomination_id']."' AND status IN ( 'pending' )" ) ; $total_nomination = $staff_nomination->num_rows ; echo ' '; } }else{ echo ' ' ; } ?>
Created Date
' ; if ( permissionCheck($row_user, 'our-nomination-edit') ){ echo ' ' ; }else{ echo '-' ; } echo ' | ( '.$total_nomination.' ) '.dataFilter($row_page['title']).' '.resetStatus($row_page['status']).' '.resetDateFormat($row_page['created_at']).'
'.$lang['no_data'].'