From 6367b1593dacebadaec7bae1b5a6d03a614d0a79 Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Fri, 7 Aug 2020 12:18:01 -0500 Subject: [PATCH] changed form to button only and updated web routes --- .../Contracts/SupplyChainController.php | 8 +--- .../supplychain/dashboard/main.blade.php | 45 +------------------ .../includes/opencontracts.blade.php | 5 +-- routes/web.php | 2 +- 4 files changed, 4 insertions(+), 56 deletions(-) diff --git a/app/Http/Controllers/Contracts/SupplyChainController.php b/app/Http/Controllers/Contracts/SupplyChainController.php index eb6b44027..b54287c72 100644 --- a/app/Http/Controllers/Contracts/SupplyChainController.php +++ b/app/Http/Controllers/Contracts/SupplyChainController.php @@ -216,13 +216,7 @@ class SupplyChainController extends Controller /** * Display the new bid on a supply chain contract page */ - public function displaySupplyChainContractBid(Request $request) { - $this->validate($request, [ - 'contract_id' => 'required', - ]); - - $contractId = $request->contract_id; - + public function displaySupplyChainContractBid($contractId) { return view('supplychain.forms.enterbid')->with('contractId', $contractId); } diff --git a/resources/views/supplychain/dashboard/main.blade.php b/resources/views/supplychain/dashboard/main.blade.php index 08ca91e67..e366fd6d2 100644 --- a/resources/views/supplychain/dashboard/main.blade.php +++ b/resources/views/supplychain/dashboard/main.blade.php @@ -21,50 +21,7 @@
@if(count($openContracts)) -@foreach($openContracts as $contract) -
-
-
-
-
-
-
- {{ $contract['title'] }} -
-
- {!! Form::open(['action' => 'Contracts\SupplyChainController@displaySupplyChainContractBid', 'method' => 'POST']) !!} - {{ Form::hidden('contract_id', $contract['contract_id'], ['class' => 'form-control']) }} - {{ Form::submit('Bid', ['class' => 'btn btn-primary']) }} - {!! Form::close() !!} -
-
-
-
-
- Delivery Date: {{ $contract['delivery_by'] }}
- End Date: {{ $contract['end_date'] }}
-
- -
- {!! $contract['body'] !!} -
-
-
- - @if($contract['bid_count'] > 0) - - - {{ $contract['lowest_bid']['name'] }}
- {{ $contract['lowest_bid']['amount'] }}
-
-
- @endif -
-
-
-
-
-@endforeach + @include('supplychain.includes.opencontracts') @else
diff --git a/resources/views/supplychain/includes/opencontracts.blade.php b/resources/views/supplychain/includes/opencontracts.blade.php index 20e68940a..e41c26104 100644 --- a/resources/views/supplychain/includes/opencontracts.blade.php +++ b/resources/views/supplychain/includes/opencontracts.blade.php @@ -9,10 +9,7 @@ {{ $contract['title'] }}
- {!! Form::open(['action' => 'Contracts\SupplyChainController@displaySupplyChainContractBid', 'method' => 'POST']) !!} - {{ Form::hidden('contract_id', $contract['contract_id'], ['class' => 'form-control']) }} - {{ Form::submit('Bid', ['class' => 'btn btn-primary']) }} - {!! Form::close() !!} +
diff --git a/routes/web.php b/routes/web.php index c79905e02..9674fd426 100644 --- a/routes/web.php +++ b/routes/web.php @@ -185,7 +185,7 @@ Route::group(['middleware' => ['auth']], function(){ Route::get('/supplychain/contracts/end', 'Contracts\SupplyChainController@displayEndSupplyChainContract'); Route::post('/supplychain/contracts/end', 'Contracts\SupplyChainController@storeEndSupplyChainContract'); Route::get('/supplychain/display/bids', 'Contracts\SupplyChainController@displaySupplyChainBids'); - Route::post('/supplychain/display/newbid', 'Contracts\SupplyChainController@displaySupplyChainContractBid'); + Route::get('/supplychain/display/newbid/{contractId}', 'Contracts\SupplyChainController@displaySupplyChainContractBid'); Route::post('/supplychain/display/newbid', 'Contracts\SupplyChainController@storeSupplyChainContractBid'); Route::post('/supplychain/delete/bid', 'Contracts\SupplyChainController@deleteSupplyChainContractBid'); Route::get('/supplychain/modify/bid', 'Contracts\SupplyChainController@displayModifySupplyChainContractBid');