<?php
namespace App\Helpers;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use App\Models\Checkout;

class CheckoutBidderSelectList
{
    public static function checkoutBidderShowNumbers()
    {
        $checkout_bidder_num_results = Checkout::join('bidders', 'checkout.bidder_num', '=', 'bidders.idbidders')
                                              ->orderBy('bidders.bidder_assigned_number', 'asc')
                                              ->get();

        $checkout_bidder_num = '<option disabled selected hidden value="">choose...</option>';
        foreach ($checkout_bidder_num_results as $checkout_bidder_num_result) {
            $checkout_bidder_num .= '<option value="' .
            $checkout_bidder_num_result->bidders->idbidders .
            '">' .
            $checkout_bidder_num_result->bidders->bidder_assigned_number .
            ' - ' .
            $checkout_bidder_num_result->bidders->bidder_fname .
            ' ' .
            $checkout_bidder_num_result->bidders->bidder_lname .
            '</option>';
        }
        return $checkout_bidder_num;
    }
}
