From c814850d3a947b930ffcb8136fdb809aebdfe559 Mon Sep 17 00:00:00 2001 From: Russ Long Date: Sun, 23 Dec 2018 10:41:29 -0500 Subject: [PATCH] Cleanup --- app/Helpers/BidderSelectList.php | 20 ++++ app/Helpers/CheckoutBidderSelectList.php | 30 ++++++ app/Helpers/ItemSelectList.php | 20 ++++ app/Helpers/PaymentMethodSelectList.php | 24 +++++ app/Helpers/WinningBidSelectList.php | 25 +++++ app/Helpers/WinningBidderSelectList.php | 28 +++++ app/Http/Controllers/PagesController.php | 29 +++-- app/helpers.php | 100 ------------------ .../views/checkout_select_form.blade.php | 2 +- resources/views/editwinners.blade.php | 4 +- .../views/reprint_receipt_form.blade.php | 2 +- resources/views/winners.blade.php | 4 +- resources/views/winnertotalform.blade.php | 2 +- routes/web.php | 6 +- 14 files changed, 180 insertions(+), 116 deletions(-) create mode 100644 app/Helpers/BidderSelectList.php create mode 100644 app/Helpers/CheckoutBidderSelectList.php create mode 100644 app/Helpers/ItemSelectList.php create mode 100644 app/Helpers/PaymentMethodSelectList.php create mode 100644 app/Helpers/WinningBidSelectList.php create mode 100644 app/Helpers/WinningBidderSelectList.php delete mode 100644 app/helpers.php diff --git a/app/Helpers/BidderSelectList.php b/app/Helpers/BidderSelectList.php new file mode 100644 index 0000000..b5f0177 --- /dev/null +++ b/app/Helpers/BidderSelectList.php @@ -0,0 +1,20 @@ +get(); + $bidder_num = ''; + foreach ($bidder_num_results as $bidder_num_result) { + $bidder_num .= ''; + } + return $bidder_num; + } +} diff --git a/app/Helpers/CheckoutBidderSelectList.php b/app/Helpers/CheckoutBidderSelectList.php new file mode 100644 index 0000000..23aa587 --- /dev/null +++ b/app/Helpers/CheckoutBidderSelectList.php @@ -0,0 +1,30 @@ +orderBy('bidders.bidder_assigned_number', 'asc') + ->get(); + + $checkout_bidder_num = ''; + foreach ($checkout_bidder_num_results as $checkout_bidder_num_result) { + $checkout_bidder_num .= ''; + } + return $checkout_bidder_num; + } +} diff --git a/app/Helpers/ItemSelectList.php b/app/Helpers/ItemSelectList.php new file mode 100644 index 0000000..4122e34 --- /dev/null +++ b/app/Helpers/ItemSelectList.php @@ -0,0 +1,20 @@ +get(); + $item_nums = ''; + foreach ($item_num_results as $item_num_result) { + $item_nums .= ''; + } + return $item_nums; + } +} diff --git a/app/Helpers/PaymentMethodSelectList.php b/app/Helpers/PaymentMethodSelectList.php new file mode 100644 index 0000000..6cfbd6d --- /dev/null +++ b/app/Helpers/PaymentMethodSelectList.php @@ -0,0 +1,24 @@ +get(); + $payment_methods = ''; + foreach ($payment_method_results as $payment_method_result) { + $payment_methods .= ''; + } + return $payment_methods; + } +} diff --git a/app/Helpers/WinningBidSelectList.php b/app/Helpers/WinningBidSelectList.php new file mode 100644 index 0000000..f33502c --- /dev/null +++ b/app/Helpers/WinningBidSelectList.php @@ -0,0 +1,25 @@ +orderBy('items.item_assigned_num') + ->get(); + $winning_bid_num = ''; + foreach ($winning_bid_num_results as $winning_bid_num_result) { + $winning_bid_num .= ''; + } + return $winning_bid_num; + } +} diff --git a/app/Helpers/WinningBidderSelectList.php b/app/Helpers/WinningBidderSelectList.php new file mode 100644 index 0000000..fb70919 --- /dev/null +++ b/app/Helpers/WinningBidderSelectList.php @@ -0,0 +1,28 @@ +groupBy('winning_bidder_num') + ->orderBy('bidders.bidder_assigned_number') + ->get(); + + $winning_bidder_num = ''; + foreach ($winning_bidder_num_results as $winning_bidder_num_result) { + $winning_bidder_num .= ''; + } + return $winning_bidder_num; + } +} diff --git a/app/Http/Controllers/PagesController.php b/app/Http/Controllers/PagesController.php index d6f2f3b..7ca178d 100644 --- a/app/Http/Controllers/PagesController.php +++ b/app/Http/Controllers/PagesController.php @@ -20,7 +20,11 @@ class PagesController extends Controller $item_count_result = Items::count(); $bidder_count_result = Bidders::count(); $winner_count_result = WinningBids::count(); - return view('home', ['item_count_result' => $item_count_result, 'bidder_count_result' => $bidder_count_result, 'winner_count_result' => $winner_count_result]); + return view('home', [ + 'item_count_result' => $item_count_result, + 'bidder_count_result' => $bidder_count_result, + 'winner_count_result' => $winner_count_result + ]); } public function bidderlist() @@ -91,7 +95,10 @@ class PagesController extends Controller WHERE winning_bidder_num = $checkout_bidder GROUP BY winning_bids.winning_bidder_num "); - return view('checkout', ['checkout_list_results' => $checkout_list_results, 'checkout_info_results' => $checkout_info_results]); + return view('checkout', [ + 'checkout_list_results' => $checkout_list_results, + 'checkout_info_results' => $checkout_info_results + ]); } else { $winnertotal = $checkout_req->winnertotal; $bidder_num = $checkout_req->checkoutbiddernum; @@ -126,11 +133,18 @@ class PagesController extends Controller 'cc_amount' => $cc_amount, ] ); - return view('checkout_complete', ['checkout_result' => $checkout_result, 'checkout_list_results' => $checkout_list_results, 'checkout_info_results' => $checkout_info_results, 'payment_method' => $payment_method, 'check_number' => $check_number, 'cc_transaction' => $cc_transaction]); + return view('checkout_complete', [ + 'checkout_result' => $checkout_result, + 'checkout_list_results' => $checkout_list_results, + 'checkout_info_results' => $checkout_info_results, + 'payment_method' => $payment_method, + 'check_number' => $check_number, + 'cc_transaction' => $cc_transaction + ]); } } - public function checkout_complete_list() + public function checkoutCompleteList() { $checkout_complete_results = DB::select("SELECT checkout.*, @@ -252,7 +266,7 @@ class PagesController extends Controller return view('receiptpdf', $checkout_data); } - public function reprint_receipt(Request $reprint_receipt_req) + public function reprintReceipt(Request $reprint_receipt_req) { if (!$reprint_receipt_req->reprintbiddernum) { return view('reprint_receipt_form'); @@ -336,7 +350,10 @@ class PagesController extends Controller WHERE winning_bidder_num = $winner_total_bidder GROUP BY winning_bids.winning_bidder_num "); - return view('winnertotal', ['winnertotal_list_results' => $winnertotal_list_results, 'winnertotal_info_results' => $winnertotal_info_results]); + return view('winnertotal', [ + 'winnertotal_list_results' => $winnertotal_list_results, + 'winnertotal_info_results' => $winnertotal_info_results + ]); } public function winningbidderlist() diff --git a/app/helpers.php b/app/helpers.php deleted file mode 100644 index b5fd139..0000000 --- a/app/helpers.php +++ /dev/null @@ -1,100 +0,0 @@ -get(); - $bidder_num = ''; - foreach ($bidder_num_results as $bidder_num_result) { - $bidder_num .= ''; - } - return $bidder_num; - } -} - -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 = ''; - foreach ($checkout_bidder_num_results as $checkout_bidder_num_result) { - $checkout_bidder_num .= ''; - } - return $checkout_bidder_num; - } -} - -class ItemSelectList -{ - public static function ItemShowNumbers() - { - $item_num_results = Items::orderBy('item_assigned_num') - ->get(); - $item_nums = ''; - foreach ($item_num_results as $item_num_result) { - $item_nums .= ''; - } - return $item_nums; - } -} -class PaymentMethodSelectList -{ - public static function PaymentShowMethods() - { - $payment_method_results = PaymentMethods::orderBy('pm_name') - ->get(); - $payment_methods = ''; - foreach ($payment_method_results as $payment_method_result) { - $payment_methods .= ''; - } - return $payment_methods; - } -} - -class WinningBidSelectList -{ - public static function WinningBidShowNumbers() - { - $winning_bid_num_results = WinningBids::join('items', 'winning_bids.winning_item_num', '=', 'items.iditems') - ->orderBy('items.item_assigned_num') - ->get(); - $winning_bid_num = ''; - foreach ($winning_bid_num_results as $winning_bid_num_result) { - $winning_bid_num .= ''; - } - return $winning_bid_num; - } -} - -class WinningBidderSelectList -{ - public static function WinningBidderShowNumbers() - { - - $winning_bidder_num_results = WinningBids::join('bidders', 'winning_bids.winning_bidder_num', '=', 'bidders.idbidders') - ->groupBy('winning_bidder_num') - ->orderBy('bidders.bidder_assigned_number') - ->get(); - - $winning_bidder_num = ''; - foreach ($winning_bidder_num_results as $winning_bidder_num_result) { - $winning_bidder_num .= ''; - } - return $winning_bidder_num; - } -} diff --git a/resources/views/checkout_select_form.blade.php b/resources/views/checkout_select_form.blade.php index 5f4b0ef..2795560 100644 --- a/resources/views/checkout_select_form.blade.php +++ b/resources/views/checkout_select_form.blade.php @@ -16,7 +16,7 @@
diff --git a/resources/views/editwinners.blade.php b/resources/views/editwinners.blade.php index 2cb8994..0d937f8 100644 --- a/resources/views/editwinners.blade.php +++ b/resources/views/editwinners.blade.php @@ -15,7 +15,7 @@
@@ -25,7 +25,7 @@
diff --git a/resources/views/reprint_receipt_form.blade.php b/resources/views/reprint_receipt_form.blade.php index 834230e..342563f 100644 --- a/resources/views/reprint_receipt_form.blade.php +++ b/resources/views/reprint_receipt_form.blade.php @@ -16,7 +16,7 @@
diff --git a/resources/views/winners.blade.php b/resources/views/winners.blade.php index 0f4c0c4..3dd85bd 100644 --- a/resources/views/winners.blade.php +++ b/resources/views/winners.blade.php @@ -16,7 +16,7 @@
@@ -26,7 +26,7 @@
diff --git a/resources/views/winnertotalform.blade.php b/resources/views/winnertotalform.blade.php index 9d13f0f..d0eec12 100644 --- a/resources/views/winnertotalform.blade.php +++ b/resources/views/winnertotalform.blade.php @@ -16,7 +16,7 @@
diff --git a/routes/web.php b/routes/web.php index aa36d50..d2cbabb 100644 --- a/routes/web.php +++ b/routes/web.php @@ -24,7 +24,7 @@ Route::group(['middleware' => 'auth'], function() { Route::post('bidderlist', [ 'uses' => 'PagesController@bidderlist']); Route::get('checkout', [ 'uses' => 'PagesController@checkout']); Route::post('checkout', [ 'uses' => 'PagesController@checkout']); - Route::get('checkout_complete_list', [ 'uses' => 'PagesController@checkout_complete_list' ]); + Route::get('checkout_complete_list', [ 'uses' => 'PagesController@checkoutCompleteList' ]); Route::get('editwinners', [ 'uses' => 'PagesController@editwinners']); Route::post('editwinners', [ 'uses' => 'PagesController@editwinners']); Route::get('finaltally', [ 'uses' => 'PagesController@finaltally']); @@ -32,8 +32,8 @@ Route::group(['middleware' => 'auth'], function() { Route::post('items', [ 'uses' => 'PagesController@items']); Route::get('itemlist', [ 'uses' => 'PagesController@itemlist']); Route::post('itemlist', [ 'uses' => 'PagesController@itemlist']); - Route::get('reprint_receipt', ['uses' => 'PagesController@reprint_receipt']); - Route::post('reprint_receipt', ['uses' => 'PagesController@reprint_receipt']); + Route::get('reprint_receipt', ['uses' => 'PagesController@reprintReceipt']); + Route::post('reprint_receipt', ['uses' => 'PagesController@reprintReceipt']); Route::get('receiptpdf', ['uses' => 'PagesController@receiptpdf'])->name('receiptpdf'); Route::get('winners', [ 'uses' => 'PagesController@winners']); Route::post('winners', [ 'uses' => 'PagesController@winners']);