0 ){ $status = '203' ; if ( $mysqli->query( "INSERT INTO formheadcount ( `branch_id`, `staff_id`, `title`, `content`, `remark`, `status` ) VALUES ( '".$array['branch_id']."', '".$staff_info['staff_id']."', '".$array['title']."', '".$array['content']."', '".$array['remark']."', 'pending' )" ) ){ $status = '200' ; $boolean_submit = true ; $formheadcount_id = $mysqli->insert_id ; $formheadcount_so = 'FH'.strPad( 6, $formheadcount_id ) ; $mysqli->query( "UPDATE formheadcount SET formheadcount_so = '".$formheadcount_so."' WHERE formheadcount_id = '".$formheadcount_id."'" ) ; if ( checkExists($photos) ){ foreach ( $photos as $k => $v ){ if ( $v['type'] == 'local' ){ $file_upload = ( $v['file'] ) ; $upload = uploadImage( 'FormHeadCount', $formheadcount_id.'-'.$formheadcount_id, $file_upload ) ; if ( $upload['status'] != '200' ){ $count_upload++ ; }else{ $mysqli->query( "INSERT INTO formheadcount_media ( formheadcount_id, file, filetype ) VALUES ( '".$formheadcount_id."', '".$upload['data']['file_name']."', '".$upload['data']['file_type']."' )" ) ; $status = '200' ; } } } } } } } require( $require_sub.'footer.php' ) ; ?>