diff --git a/app/Http/Controllers/ContractController.php b/app/Http/Controllers/ContractController.php
index 227ffc27b..a451b9b71 100644
--- a/app/Http/Controllers/ContractController.php
+++ b/app/Http/Controllers/ContractController.php
@@ -73,18 +73,16 @@ class ContractController extends Controller
//Get all of the bids for the current contract
$bids = Bid::where(['contract_id' => $contract->id])->get();
//Build the data structure
- $temp = [
- 'contract' => [
- 'con' => $contract,
- 'bids' => $bids,
- ],
- ];
- /*
- $temp = [
- 'contract' => $contract,
- 'bids' => $bids,
- ];
- */
+ if(count($bids)) {
+ $temp = [
+ 'contract' => $contract,
+ 'bids' =>$bids,
+ ];
+ } else {
+ $temp = [
+ 'contract' => $contract,
+ ];
+ }
//Push the new contract onto the stack
array_push($data, $temp);
diff --git a/resources/views/contracts/publiccontracts.blade.php b/resources/views/contracts/publiccontracts.blade.php
index 7638b0053..436ee3a92 100644
--- a/resources/views/contracts/publiccontracts.blade.php
+++ b/resources/views/contracts/publiccontracts.blade.php
@@ -8,7 +8,71 @@
@if(count($data))
@foreach($data as $contract)
- @include('contracts.includes.public')
+
| Corporation | +Amount | + + + @foreach($data['bids'] as $bid) +
|---|---|
| {{ $bid['corporation_name'] }} | +{{ $bid['bid_amount'] }} | + @if(auth()->user()->character_id == $bid['character_id']) + {{ Form::open(['action' => 'ContractController@displayModifyBid', 'method' => 'POST']) }} + {{ Form::hidden('id', $bid['id']) }} + {{ Form::hidden('contract_id', $bid['contract_id']) }} + {{ Form::submit('Modify Bid', ['class' => 'btn btn-primary']) }} + {!! Form::close() !!} + + {{ Form::open(['action' => 'ContractController@deleteBid', 'method' => 'POST']) }} + {{ Form::hidden('id', $bid['id']) }} + {{ Form::hidden('contract_id', $bid['contract_id']) }} + {{ Form::submit('Delete Bid', ['class' => 'btn btn-primary']) }} + {!! Form::close() !!} + @endif +