<div class="table-responsive">
<table id="fixedHeader" class="table custom-table">
        <thead>
            <tr>
            <th>Order Number</th>
            <th>Outlet</th>
            <th>Category</th>
            <th>Total Cost</th>
            <th>Order date</th>
            <th>Action</th>
            </tr>
        </thead>
        <tbody>
            @foreach($ordering as $list)
            <tr>
            <td>#{{$list->order_id}}</td>
            <td>{{strtoupper($list->branch)}}</td>
            <td><span class="text-primary">{{strtoupper($list->category)}}</span></td>
            <td>{{empty($app->currency) ? "GHS" : $app->currency}}@convert($list->total_cost_order)</td>
            <td>{{$list->created_at}}</td>
            <td>
                <a class="btn btn-outline-primary btn-sm" href="{{route('orderTransaction', $list -> order_id)}}" title="view Order"><i class="icon-eye1" aria-hidden="true"></i></a>
                @if(auth()->user()->role == "Retention Officer")
                <button class="btn btn-primary btn-sm ms-2"  id="<?php $order = $list->order_id; $cust = $customer-> id; echo $order . " - " . $cust ; ?>"  onclick="getCustomerIds(this.id)" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#exampleModalReview">
                Review</button>
                @endif
            </td>
            </tr>
            @endforeach
        </tbody>
</table>
</div>



<script>
    function getCustomerIds(id) {
        const data = id.split(" - ");
        document.getElementById('ordernu').value = data[0];
        document.getElementById('customer').value = data[1]
    }
</script>