This commit is contained in:
Russ Long 2018-12-23 10:26:26 -05:00
parent bf1906e215
commit cd8c610d4a
10 changed files with 308 additions and 305 deletions

View File

@ -5,7 +5,7 @@ namespace App\Http\Controllers;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\DB;
use View; use View;
Use App\helpers; use App\helpers;
use PDF; use PDF;
use App\Models\Bidders; use App\Models\Bidders;
use App\Models\Items; use App\Models\Items;
@ -34,7 +34,7 @@ class PagesController extends Controller
public function bidders(Request $bidder_req) public function bidders(Request $bidder_req)
{ {
if(!$bidder_req->bidderlname){ if (!$bidder_req->bidderlname) {
return view('bidders'); return view('bidders');
} }
$bidder_lname = $bidder_req->bidderlname; $bidder_lname = $bidder_req->bidderlname;
@ -59,16 +59,17 @@ class PagesController extends Controller
'bidder_zip' => $bidder_zip , 'bidder_zip' => $bidder_zip ,
'bidder_phone' => $bidder_phone , 'bidder_phone' => $bidder_phone ,
'bidder_email' => $bidder_email 'bidder_email' => $bidder_email
]); ]
);
return redirect('bidders'); return redirect('bidders');
} }
public function checkout(Request $checkout_req) public function checkout(Request $checkout_req)
{ {
if(!$checkout_req->checkoutbiddernum){ if (!$checkout_req->checkoutbiddernum) {
return view('checkout_select_form'); return view('checkout_select_form');
} elseif(!$checkout_req->checkout_payment_method){ } elseif (!$checkout_req->checkout_payment_method) {
$checkout_bidder = $checkout_req->checkoutbiddernum; $checkout_bidder = $checkout_req->checkoutbiddernum;
$checkout_list_results = DB::select("SELECT $checkout_list_results = DB::select("SELECT
*, items.item_assigned_num *, items.item_assigned_num
@ -77,6 +78,9 @@ class PagesController extends Controller
ON winning_bids.winning_item_num=items.iditems ON winning_bids.winning_item_num=items.iditems
WHERE winning_bidder_num = $checkout_bidder WHERE winning_bidder_num = $checkout_bidder
"); ");
WinningBids::with('items')
->where('winning_bidder_num', $checkout_bidder)
->get();
$checkout_info_results = DB::select("SELECT $checkout_info_results = DB::select("SELECT
winning_bids.*, winning_bids.*,
bidders.*, bidders.*,
@ -142,7 +146,7 @@ class PagesController extends Controller
public function editwinners(Request $edit_win_req) public function editwinners(Request $edit_win_req)
{ {
if(!$edit_win_req->winid){ if (!$edit_win_req->winid) {
return view('editwinners'); return view('editwinners');
} }
$winning_bid_id = $edit_win_req->winid; $winning_bid_id = $edit_win_req->winid;
@ -186,7 +190,7 @@ class PagesController extends Controller
public function items(Request $items_req) public function items(Request $items_req)
{ {
if(!$items_req->itemnum){ if (!$items_req->itemnum) {
return view('items'); return view('items');
} }
$item_assigned_num = $items_req->itemnum; $item_assigned_num = $items_req->itemnum;
@ -199,7 +203,8 @@ class PagesController extends Controller
'item_desc' => $item_desc, 'item_desc' => $item_desc,
'item_min_bid' => $item_min_bid, 'item_min_bid' => $item_min_bid,
'item_est_value' => $items_est_value 'item_est_value' => $items_est_value
]); ]
);
return redirect('items'); return redirect('items');
} }
@ -229,27 +234,27 @@ class PagesController extends Controller
WHERE winning_bidder_num = $bidder_num WHERE winning_bidder_num = $bidder_num
GROUP BY winning_bids.winning_bidder_num GROUP BY winning_bids.winning_bidder_num
"); ");
//dd($checkout_final_results); //dd($checkout_final_results);
$checkout_data = [ $checkout_data = [
'checkout_final_results' => $checkout_final_results, 'checkout_final_results' => $checkout_final_results,
'checkout_list_results' => $checkout_list_results, 'checkout_list_results' => $checkout_list_results,
'checkout_info_results' => $checkout_info_results 'checkout_info_results' => $checkout_info_results
]; ];
// dd($checkout_data); // dd($checkout_data);
//$pdf = PDF::loadView('receiptpdf', $checkout_data); //$pdf = PDF::loadView('receiptpdf', $checkout_data);
//dd($pdf); //dd($pdf);
// $receiptcontentview = View::make('receiptpdf', $checkout_data); // $receiptcontentview = View::make('receiptpdf', $checkout_data);
// $receiptcontent = $receiptcontentview->render(); // $receiptcontent = $receiptcontentview->render();
// $pdf = PDF::loadHTML($receiptcontent); // $pdf = PDF::loadHTML($receiptcontent);
// $pdf = PDF::loadView('receiptpdf', $checkout_data); // $pdf = PDF::loadView('receiptpdf', $checkout_data);
// return $pdf->stream('receipt.pdf'); // return $pdf->stream('receipt.pdf');
return view('receiptpdf', $checkout_data); return view('receiptpdf', $checkout_data);
} }
public function reprint_receipt(Request $reprint_receipt_req) public function reprint_receipt(Request $reprint_receipt_req)
{ {
if(!$reprint_receipt_req->reprintbiddernum){ if (!$reprint_receipt_req->reprintbiddernum) {
return view('reprint_receipt_form'); return view('reprint_receipt_form');
} else { } else {
$bidnum=$reprint_receipt_req->reprintbiddernum; $bidnum=$reprint_receipt_req->reprintbiddernum;
@ -278,7 +283,7 @@ class PagesController extends Controller
public function winners(Request $winners_req) public function winners(Request $winners_req)
{ {
if(!$winners_req->winnerbid){ if (!$winners_req->winnerbid) {
return view('winners'); return view('winners');
} }
$winner_item = $winners_req->winneritemnum; $winner_item = $winners_req->winneritemnum;
@ -310,7 +315,7 @@ class PagesController extends Controller
public function winnertotal(Request $winnertotal_req) public function winnertotal(Request $winnertotal_req)
{ {
if(!$winnertotal_req->winnerbiddernum){ if (!$winnertotal_req->winnerbiddernum) {
return view('winnertotalform'); return view('winnertotalform');
} }
$winner_total_bidder = $winnertotal_req->winnerbiddernum; $winner_total_bidder = $winnertotal_req->winnerbiddernum;

View File

@ -13,7 +13,7 @@ class HttpsRedirect
* @param \Closure $next * @param \Closure $next
* @return mixed * @return mixed
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
if (!$request->secure() && env('APP_ENV') === 'prod') { if (!$request->secure() && env('APP_ENV') === 'prod') {
return redirect()->secure($request->getRequestUri()); return redirect()->secure($request->getRequestUri());

View File

@ -22,5 +22,4 @@ class PaymentMethods extends Model
{ {
return $this->belongsTo('App\Models\Checkout', 'payment_method', 'pm_id'); return $this->belongsTo('App\Models\Checkout', 'payment_method', 'pm_id');
} }
} }

View File

@ -16,7 +16,7 @@ class BidderSelectList
$bidder_num_results = Bidders::orderBy('bidder_assigned_number') $bidder_num_results = Bidders::orderBy('bidder_assigned_number')
->get(); ->get();
$bidder_num = '<option disabled selected hidden value="">choose...</option>'; $bidder_num = '<option disabled selected hidden value="">choose...</option>';
foreach($bidder_num_results as $bidder_num_result){ foreach ($bidder_num_results as $bidder_num_result) {
$bidder_num .= '<option value="' . $bidder_num_result->idbidders . '">' . $bidder_num_result->bidder_assigned_number . ' - ' . $bidder_num_result->bidder_fname . ' ' . $bidder_num_result->bidder_lname .'</option>'; $bidder_num .= '<option value="' . $bidder_num_result->idbidders . '">' . $bidder_num_result->bidder_assigned_number . ' - ' . $bidder_num_result->bidder_fname . ' ' . $bidder_num_result->bidder_lname .'</option>';
} }
return $bidder_num; return $bidder_num;
@ -32,7 +32,7 @@ class CheckoutBidderSelectList
->get(); ->get();
$checkout_bidder_num = '<option disabled selected hidden value="">choose...</option>'; $checkout_bidder_num = '<option disabled selected hidden value="">choose...</option>';
foreach($checkout_bidder_num_results as $checkout_bidder_num_result){ 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>'; $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; return $checkout_bidder_num;
@ -46,7 +46,7 @@ class ItemSelectList
$item_num_results = Items::orderBy('item_assigned_num') $item_num_results = Items::orderBy('item_assigned_num')
->get(); ->get();
$item_nums = '<option disabled="disabled" selected="selected" value="0">choose...</option>'; $item_nums = '<option disabled="disabled" selected="selected" value="0">choose...</option>';
foreach($item_num_results as $item_num_result){ foreach ($item_num_results as $item_num_result) {
$item_nums .= '<option value="' . $item_num_result->iditems . '">' . $item_num_result->item_assigned_num . '</option>'; $item_nums .= '<option value="' . $item_num_result->iditems . '">' . $item_num_result->item_assigned_num . '</option>';
} }
return $item_nums; return $item_nums;
@ -59,7 +59,7 @@ class PaymentMethodSelectList
$payment_method_results = PaymentMethods::orderBy('pm_name') $payment_method_results = PaymentMethods::orderBy('pm_name')
->get(); ->get();
$payment_methods = '<option disabled="disabled" selected="selected" value="0">choose...</option>'; $payment_methods = '<option disabled="disabled" selected="selected" value="0">choose...</option>';
foreach($payment_method_results as $payment_method_result){ foreach ($payment_method_results as $payment_method_result) {
$payment_methods .= '<option value="' . $payment_method_result->pm_id . '">' . $payment_method_result->pm_name . '</option>'; $payment_methods .= '<option value="' . $payment_method_result->pm_id . '">' . $payment_method_result->pm_name . '</option>';
} }
return $payment_methods; return $payment_methods;
@ -74,7 +74,7 @@ class WinningBidSelectList
->orderBy('items.item_assigned_num') ->orderBy('items.item_assigned_num')
->get(); ->get();
$winning_bid_num = '<option disabled selected hidden value="">choose...</option>'; $winning_bid_num = '<option disabled selected hidden value="">choose...</option>';
foreach($winning_bid_num_results as $winning_bid_num_result){ foreach ($winning_bid_num_results as $winning_bid_num_result) {
$winning_bid_num .= '<option value="' . $winning_bid_num_result->idwinning_bids . '">' . $winning_bid_num_result->item_assigned_num . ' - ' . $winning_bid_num_result->item_desc .'</option>'; $winning_bid_num .= '<option value="' . $winning_bid_num_result->idwinning_bids . '">' . $winning_bid_num_result->item_assigned_num . ' - ' . $winning_bid_num_result->item_desc .'</option>';
} }
return $winning_bid_num; return $winning_bid_num;
@ -92,10 +92,9 @@ class WinningBidderSelectList
->get(); ->get();
$winning_bidder_num = '<option disabled selected hidden value="">choose...</option>'; $winning_bidder_num = '<option disabled selected hidden value="">choose...</option>';
foreach($winning_bidder_num_results as $winning_bidder_num_result){ foreach ($winning_bidder_num_results as $winning_bidder_num_result) {
$winning_bidder_num .= '<option value="' . $winning_bidder_num_result->idbidders . '">' . $winning_bidder_num_result->bidder_assigned_number . ' - ' . $winning_bidder_num_result->bidder_fname . ' ' . $winning_bidder_num_result->bidder_lname .'</option>'; $winning_bidder_num .= '<option value="' . $winning_bidder_num_result->idbidders . '">' . $winning_bidder_num_result->bidder_assigned_number . ' - ' . $winning_bidder_num_result->bidder_fname . ' ' . $winning_bidder_num_result->bidder_lname .'</option>';
} }
return $winning_bidder_num; return $winning_bidder_num;
} }
} }
?>