<?php
$must_login            = true ;
$require_path          = '../../../' ;
$require_sub           = '../../' ;
require( $require_sub.'header.php' ) ;

if ( $boolean_login ){
    $status            = '201' ;

    $query             = "SELECT a.sonumber, a.biller_code, a.reference1, a.reference2, a.reference3, a.reference4, a.amount, a.status, a.created_at, b.title, c.file FROM staff_rms_bill_order a
                          LEFT JOIN staff_rms_bill b ON ( a.bill_id = b.bill_id )
                          LEFT JOIN rms_bill_item c ON ( b.item_id = c.item_id )
                          WHERE a.deleted_at IS NULL AND a.staff_id = '".$staff_info['staff_id']."' AND a.order_id = '".$array['id']."'" ;
    $mysqli_query      = $mysqli->query( $query . " LIMIT 1" ) ;

    if ( $mysqli_query->num_rows > 0 ){

        $status        = '200' ;

        $row           = $mysqli_query->fetch_assoc() ; 
        $row['file']   = ( $row['file'] != '' ? PATH.'uploads/RmsBillItem/b/'.$row['file'] : '' ) ;
        $data['list']  = $row ;

    }
}

require( $require_sub.'footer.php' ) ;
?>