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)) {
$tries++;
if($tries == 5) {
//Update the contract to mark it as finished
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();
TidyContract($contract, $bid);
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
Contract::where(['contract_id' => $request->contract_id])->update([
TidyContract($contract, $bid);
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,
]);
@@ -174,8 +168,5 @@ class ContractAdminController extends Controller
$accepted->bid_amount = $bid['bid_amount'];
$accepted->notes = $bid['notes'];
$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['character_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>
</tr>
@endforeach

View File

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

View File

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

View File

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