misc contract formatting
This commit is contained in:
@@ -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.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TidyContract($contract, $bid);
|
||||||
|
|
||||||
|
return redirect('/contracts/admin/display')->with('success', 'Contract finalized. Mail took ' . $tries . ' attempt to send to the winner.');
|
||||||
|
}
|
||||||
|
|
||||||
//Update the contract to mark it as finished
|
private function TidyContract($contract, $bid) {
|
||||||
Contract::where(['contract_id' => $request->contract_id])->update([
|
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.');
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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>
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
@@ -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">
|
||||||
|
|||||||
Reference in New Issue
Block a user