alert("Sorry You Don\'t Have The Permission.")'; header('Location: index.php') ; exit ; } // keep parameter in value $staff_id = escapeString($_GET['staff_id']) ; $branch_transaction = escapeString($_GET['branch_transaction']) ; $hide = escapeString($_GET['hide']) ; $name = escapeString($_GET['name']) ; $confirm = escapeString($_GET['confirm']) ; // include the class include 'requires/class_resize.php' ; // get all branch $branch = [] ; $get_branch = $mysqli->query("SELECT * FROM branch WHERE deleted_at IS NULL") ; if ( $get_branch->num_rows > 0 ){ while ( $row_branch = $get_branch->fetch_assoc() ){ $branch[$row_branch['branch_id']] = $row_branch['branch_name'] ; } } $mysqli_page = $mysqli->query("SELECT * FROM staff WHERE staff_id = '".$staff_id."' LIMIT 1"); if ($mysqli_page->num_rows > 0){ $row_page = $mysqli_page->fetch_array(MYSQLI_ASSOC) ; if( $confirm == 1 ){ if ( $row_page['branch_id'] != $branch_transaction ){ $mysqli->query("UPDATE staff SET branch_id = '".$branch_transaction."' WHERE staff_id = '".$staff_id."'") ; $mysqli->query("DELETE FROM staff_token WHERE staff_id = '".$staff_id."'") ; } header("Location:hr-staff-transaction.php?staff_id=".$staff_id) ; exit ; } } $active_main_menu = 'hr' ; $active_sub_menu = 'hr-staff' ; $active_menu = 'hr-staff-list' ; // start header here include 'requires/page_header.php' ; include 'requires/page_top.php' ; if($hide == 1){ echo ''; } ?>