misc contract formatting

This commit is contained in:
2019-05-03 00:28:57 -05:00
parent 0110ecf82b
commit 956dbf46ce
5 changed files with 18 additions and 21 deletions

View File

@@ -145,25 +145,19 @@ class ContractAdminController extends Controller
while($mail->SendMail($bid['character_id'], 'character', $subject, $body)) { while($mail->SendMail($bid['character_id'], 'character', $subject, $body)) {
$tries++; $tries++;
if($tries == 5) { if($tries == 5) {
//Update the contract to mark it as finished TidyContract($contract, $bid);
Contract::where(['contract_id' => $request->contract_id])->update([
'finished' => true,
]);
//Create the accepted contract entry into the table
$accepted = new AcceptedBid;
$accepted->contract_id = $contract['contract_id'];
$accepted->bid_id = $bid['id'];
$accepted->bid_amount = $bid['bid_amount'];
$accepted->notes = $bid['notes'];
$accepted->save();
return redirect('/contracts/admin/display')->with('error', 'Could not deliver mail. Please manually send the mail to the winner.'); return redirect('/contracts/admin/display')->with('error', 'Could not deliver mail. Please manually send the mail to the winner.');
} }
} }
//Update the contract to mark it as finished TidyContract($contract, $bid);
Contract::where(['contract_id' => $request->contract_id])->update([
return redirect('/contracts/admin/display')->with('success', 'Contract finalized. Mail took ' . $tries . ' attempt to send to the winner.');
}
private function TidyContract($contract, $bid) {
Contract::where(['contract_id' => $contract['contract_id']])->update([
'finished' => true, 'finished' => true,
]); ]);
@@ -174,8 +168,5 @@ class ContractAdminController extends Controller
$accepted->bid_amount = $bid['bid_amount']; $accepted->bid_amount = $bid['bid_amount'];
$accepted->notes = $bid['notes']; $accepted->notes = $bid['notes'];
$accepted->save(); $accepted->save();
return redirect('/contracts/admin/display')->with('success', 'Contract finalized. Mail took ' . $tries . ' to send to the winner.');
} }
} }

View File

@@ -47,7 +47,7 @@
<td>{{ $bid['bid_amount'] }}</td> <td>{{ $bid['bid_amount'] }}</td>
<td>{{ $bid['character_name'] }}</td> <td>{{ $bid['character_name'] }}</td>
<td>{{ $bid['corporation_name'] }}</td> <td>{{ $bid['corporation_name'] }}</td>
<td>{{ $bid['notes'] }}</td> <td><pre>{{ $bid['notes'] }}</pre></td>
<td>{{ Form::radio('accept', $bid['id'], false, ['class' => 'form-control']) }}</td> <td>{{ Form::radio('accept', $bid['id'], false, ['class' => 'form-control']) }}</td>
</tr> </tr>
@endforeach @endforeach

View File

@@ -22,7 +22,9 @@
</div> </div>
<span class="border-dark"> <span class="border-dark">
<div class="container"> <div class="container">
{{ $contract['body'] }} <pre>
{{ $contract['body'] }}
</pre>
</div> </div>
</span> </span>
<hr> <hr>

View File

@@ -22,7 +22,9 @@
</div> </div>
<hr> <hr>
<div class="container"> <div class="container">
{{ $contract['body'] }} <pre>
{{ $contract['body'] }}
</pre>
</div> </div>
<hr> <hr>
<div class="container"> <div class="container">

View File

@@ -24,7 +24,9 @@
</div> </div>
<hr> <hr>
<div class="container"> <div class="container">
{{ $contract['body'] }} <pre>
{{ $contract['body'] }}
</pre>
</div> </div>
<hr> <hr>
<div class="container"> <div class="container">