query("SELECT post_id, post_title, post_content FROM system_post WHERE post_type = 'page-dashboard' AND post_categories = 'page-dashboard' AND post_trash = '0' LIMIT 1") ; // check if page exists if ($mysqli_page->num_rows == 0){ // insert into database $mysqli->query("INSERT INTO system_post (post_type, post_categories, post_date, post_modified, post_trash) VALUES ('page-dashboard', 'page-dashboard', '".TODAYDATE."', '".TODAYDATE."', '0')") ; // set page id in variable s $page = $mysqli->insert_id ; // refresh page header("Location:page-dashboard.php?page=".$page."") ; exit ; }else{ // set query as array $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; // set page id in variable $page = $row_page['post_id'] ; // update database if ( $boolean_admin && isset($type) && $type == 'edit' && $_POST['hide'] == 1 ){ // keep value in variable $page_title = escapeString($_POST['title']) ; $page_title = ($page_title != '' ? $page_title : '') ; $page_content = resetString(escapeString($_POST['content'])) ; // check if name already exists. $check_status = checkTitle($page_title, $page) ; $title = $check_status['title'] ; $status = $check_status['status'] ; // update database $mysqli->query("UPDATE system_post SET post_title = '".$page_title."', post_content = '".$page_content."', post_status = '".$status."', post_link = '".$title."', post_modified = '".TODAYDATE."', post_trash = '0' WHERE post_id = '".$page."'") ; // refresh page $_SESSION['system_result'] = 'success-updated' ; header("Location:page-dashboard.php?page_mode=edit&page=".$page."&success=1") ; exit ; } } // start header here include 'requires/page_header.php' ; include 'requires/page_top.php' ; ?>
'.$lang['thank_you_your_dashboard_has_been_updated'].'
' ; break ; } unset($_SESSION['system_result']) ; } ?> query( "SELECT COUNT(staff_id) as total FROM staff WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL AND branch_id = '0'" ) ; $row_staff_noassigned = $mysqli_staff_noassigned->fetch_assoc() ; $total_staff_noassigned = $row_staff_noassigned['total'] ; // all active staff $mysqli_staff = $mysqli->query( "SELECT COUNT(staff_id) as total FROM staff WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL AND branch_id != '0'" ) ; $row_staff = $mysqli_staff->fetch_assoc() ; $total_staff = $row_staff['total'] ; // total branch $mysqli_branch = $mysqli->query( "SELECT COUNT(branch_id) as total FROM branch WHERE deleted_at IS NULL " ) ; $row_staff_noassigned = $mysqli_staff_noassigned->fetch_assoc() ; $row_branch = $mysqli_branch->fetch_assoc() ; $total_branch = $row_branch['total'] ; // passport / permit expiry within 2 months $date_startmonth = TODAYDAY . ' 00:00:00' ; $date_endmonth = date( "Y-m-d", strtotime("+2 months") ) . ' 23:59:59' ; $mysqli_passport = $mysqli->query( "SELECT COUNT(staff_id) as total FROM staff WHERE ( staff_date_resigned IS NULL || staff_date_resigned = '0000-00-00' || staff_date_resigned >= '".TODAYDATE."' ) AND deleted_at IS NULL AND branch_id != '0' AND country_id != '1' AND ( staff_permit_end BETWEEN '".$date_startmonth."' AND '".$date_endmonth."' OR staff_passportexpired BETWEEN '".$date_startmonth."' AND '".$date_endmonth."' )" ) ; $row_passport = $mysqli_passport->fetch_assoc() ; $total_passport = $row_passport['total'] ; $dashboards = [ [ 'title' => 'Not Yet Assign Staff', 'value' => $total_staff_noassigned ], [ 'title' => 'Active Staff', 'value' => $total_staff ], [ 'title' => 'Total Branch', 'value' => $total_branch ], [ 'title' => 'Permit & Passport Within 2 Months', 'value' => $total_passport ] ] ; ?>
Monthly Achievement
'TASK', 'query' => "SELECT task_id FROM task a WHERE a.deleted_at IS NULL and a.status in ('pending', 'assigned', 'resubmit', 'progress') " . $user_branch_permission_sql_task, 'url' => "task.php?search_type%5B%5D=pending&search_type%5B%5D=assigned&search_type%5B%5D=resubmit&search_type%5B%5D=progress&page_mode=list" ], [ 'title' => 'SUGGESTION', 'query' => "SELECT a.suggestion_id FROM suggestion a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL and a.status IN ( 'pending' ) " . $user_branch_permission_sql_b, 'url' => "app-suggestion.php?page_mode=list&search_type=pending" ], [ 'title' => 'REQUEST', 'query' => "SELECT a.request_id FROM request a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL and a.status IN ('pending', 'awaiting-arrival', 'awaiting-collection') " . $user_branch_permission_sql_b, 'url' => "app-request.php?page_mode=list&search_type%5B%5D=pending&search_type%5B%5D=awaiting-arrival&search_type%5B%5D=awaiting-collection" ], [ 'title' => 'GRIEVANCE', 'query' => "SELECT a.grievance_id FROM grievance a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL and a.status IN ( 'pending' ) " . $user_branch_permission_sql_b, 'url' => "app-grievance.php?page_mode=list&search_type=pending" ], [ 'title' => 'Redeem', 'query' => "SELECT a.redeem_id as item_file FROM staff_redeem a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL and a.status IN ('pending', 'awaiting-arrival', 'awaiting-collection') " . $user_branch_permission_sql_b, 'url' => "app-redeem.php?page_mode=all&search_type%5B%5D=pending&search_type%5B%5D=awaiting-arrival&search_type%5B%5D=awaiting-collection" ], [ 'title' => 'ASSOCIATION', 'query' => "SELECT a.view_id FROM staff_association a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL and a.status IN ( 'pending' ) " . $user_branch_permission_sql_b, 'url' => "app-association.php?page_mode=view_all&search_type[]=pending" ], [ 'title' => 'TRAINING', 'query' => "SELECT a.view_id FROM staff_training a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL AND a.status IN ( 'pending' ) " .$user_branch_permission_sql_b, 'url' => "app-training.php?page_mode=view_all&search_type[]=pending" ], [ 'title' => 'HEADCOUNT', 'query' => "SELECT a.formheadcount_id FROM formheadcount a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL AND a.status IN ( 'pending' ) " . $user_branch_permission_sql_b, 'url' => "app-form-headcount.php?page_mode=list&search_type=pending" ], [ 'title' => 'NOMINATION', 'query' => "SELECT a.formnomination_id FROM formnomination a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL AND a.status IN ( 'pending' ) ".$user_branch_permission_sql_b, 'url' => "app-form-nomination.php?page_mode=list&search_type=pending" ], [ 'title' => 'RESIGNATION', 'query' => "SELECT a.formresignation_id FROM formresignation a LEFT JOIN staff b ON ( a.staff_id = b.staff_id ) WHERE a.deleted_at IS NULL AND a.status IN ( 'pending' ) ".$user_branch_permission_sql_b, 'url' => "app-form-resignation.php?page_mode=list&search_type=pending" ] ] ; ?>
Current Pending List
$v_table ) { $select_table = $mysqli->query( $v_table['query'] ) ; $count_table = $select_table->num_rows ; ?>

Weekly Chart Report
Title
placeholder="Title" />