working on bids
This commit is contained in:
@@ -130,10 +130,21 @@ class ContractController extends Controller
|
||||
'bid' => 'required',
|
||||
]);
|
||||
|
||||
$amount = 0.00;
|
||||
|
||||
//Convert the amount to a whole number from abbreviations
|
||||
if($request->suffix == 'B') {
|
||||
$amount = $request->bid * 1000000000.00;
|
||||
} else if($request->suffix == 'M') {
|
||||
$amount = $request->bid * 1000000.00;
|
||||
} else {
|
||||
$amount = $request->bid;
|
||||
}
|
||||
|
||||
//Create the model object to save data to
|
||||
$bid = new Bid;
|
||||
$bid->contract_id = $request->contract_id;
|
||||
$bid->bid = $request->bid;
|
||||
$bid->bid_amount = $amount;
|
||||
$bid->accepted = false;
|
||||
$bid->save();
|
||||
|
||||
|
||||
@@ -19,6 +19,10 @@
|
||||
{{ Form::label('bid', 'Bid') }}
|
||||
{{ Form::text('bid', '', ['class' => 'form-control', 'placeholder' => '1.0B']) }}
|
||||
{{ Form::hidden('contract_id', $contractId) }}
|
||||
{{ Form::label('suffix', 'M') }}
|
||||
{{ Form::radio('suffix', 'M', false) }}
|
||||
{{ Form::label('suffix', 'B') }}
|
||||
{{ Form::radio('suffix', 'B', false) }}
|
||||
</div>
|
||||
{{ Form::submit('Submit', ['class' => 'btn btn-primary']) }}
|
||||
{!! Form::close() !!}
|
||||
|
||||
Reference in New Issue
Block a user