More work on ordering

This commit is contained in:
Deon George
2018-08-11 15:09:41 +10:00
parent 499d44289e
commit 5373e6b246
33 changed files with 730 additions and 163 deletions

View File

@@ -65,30 +65,30 @@
<div class="col-md-6">
<ul class="nav nav-tabs">
<li class="active">
<li>
<a href="#tab_1" data-toggle="tab">New Client</a>
</li>
<li>
<li class="active">
<a href="#tab_2" data-toggle="tab">Existing Client</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane row fade in active" id="tab_1">
<div class="control-group form-group col-sm-12 {{ $errors->has('order_email') ? 'has-error' : '' }}">
<label for="order_email">New Client Email</label>
<input type="email" class="form-control" id="order_email" name="order_email" placeholder="New Client Email" value="{{ old('order_email') }}">
<span class="help-block">{{ $errors->first('order_email') }}</span>
<div class="tab-pane row fade" id="tab_1">
<div class="control-group form-group col-sm-12 {{ $errors->has('order_email_manual') ? 'has-error' : '' }}">
<label for="order_email_manual">New Client Email</label>
<input type="email" class="form-control" id="order_email_manual" name="order_email_manual" placeholder="New Client Email" value="{{ old('order_email_manual') }}">
<span class="help-block">{{ $errors->first('order_email_manual') }}</span>
</div>
</div>
<div class="tab-pane row fade" id="tab_2">
<div class="tab-pane row fade in active" id="tab_2">
<div class="control-group form-group col-sm-12 {{ $errors->has('order_email') ? 'has-error' : '' }}">
<label for="order_email">Client Account</label>
<select class="form-control" id="order_email" name="order_email" value="{{ old('order_email') }}">
<select class="form-control" id="order_email" name="order_email">
<option value="">&nbsp;</option>
@foreach ($user->all_clients()->sortBy('sur_first_name') as $o)
<option value="{{ $o->email }}">{{ $o->sur_first_name }}</option>
<option value="{{ $o->email }}" @if($o->email == old('order_email')) selected @endif>{{ $o->sur_first_name }}</option>
@endforeach
</select>
<span class="help-block">{{ $errors->first('order_email') }}</span>
@@ -124,6 +124,8 @@
</div>
</div>
</div>
@else
<input type="hidden" name="order_email" value="{{ $user->email }}">
@endif
<!-- Product -->
@@ -135,27 +137,48 @@
<div class="panel-collapse margin-bottom-20">
<div class="panel-body">
<div class="col-md-12">
<div class="control-group form-group col-sm-12 {{ $errors->has('product_options') ? 'has-error' : '' }}">
<span class="help-block">{{ $errors->first('product_options') }}</span>
</div>
<div class="control-group form-group col-sm-6 {{ $errors->has('product_id') ? 'has-error' : '' }}">
<label for="order_email">Product</label>
<select class="form-control" id="product_id" name="product_id" value="{{ old('product_id') }}">
<select class="form-control" id="product_id" name="product_id">
<option value="">&nbsp;</option>
@php
$po = $selected = NULL;
@endphp
@foreach (\App\Models\Product::active()->get()->sortBy('name') as $o)
<option value="{{ $o->id }}">{{ $o->name }}</option>
@php
if ($o->id == old('product_id'))
{
$selected = 'selected';
$po = $o;
} else {
$selected = NULL;
}
@endphp
<option value="{{ $o->id }}" {{ $selected }}>{{ $o->name }}</option>
@endforeach
</select>
<span class="help-block">{{ $errors->first('product_id') }}</span>
</div>
<div class="col-sm-6" id="product_info"></div>
<div class="col-sm-6" id="product_info">
@if (old('product_id'))
@include('widgets.product_description',['o'=>$po])
@endif
</div>
</div>
<div class="col-md-12" id="product_order"></div>
<div class="col-md-12" id="product_order">
@if (old('product_id'))
@include('widgets.product_order',['o'=>$po])
@endif
</div>
<div class="row">
<div class="col-sm-2"><button class="btn btn-block btn-primary">Previous</button></div>
</div>
<div class="row">
<div class="col-sm-2"><input type="submit" class="btn btn-block btn-primary" value="Submit Order"></div>
<div class="col-sm-2 pull-right"><input type="submit" class="btn btn-block btn-primary" value="Submit Order"></div>
</div>
</div>
</div>
@@ -205,7 +228,6 @@
// Send the request and update sub category dropdown
$.ajax({
type: "GET",
//data: "key="+$(this).val(),
dataType: "html",
cache: true,
url: '{{ url('product_info') }}'+'/'+$(this).val(),
@@ -220,7 +242,7 @@
$.ajax({
type: "GET",
//data: "key="+$(this).val(),
// data: "old=",
dataType: "html",
cache: true,
url: '{{ url('product_order') }}'+'/'+$(this).val(),
@@ -243,4 +265,4 @@
list-style-type: none;
}
</style>
@append
@append

View File

@@ -0,0 +1,12 @@
@extends('layouts.app')
@section('htmlheader_title')
{{ trans('message.home') }}
@endsection
@section('main-content')
<div class="col-md-12">
<h2>Order Service</h2>
<p>Your order has been received - #{{ $o->id }}. An email will be sent to you with as your order progresses.</p>
</div>
@endsection

View File

@@ -1,9 +1,9 @@
<fieldset class="form-group col-sm-12">
<label>ADSL</label>
<div class="form-group col-sm-12 {{ $errors->has('product_options.address') ? 'has-error' : '' }}">
<label for="product_options.address">Site Address</label>
<input type="text" class="form-control" id="product_options.address" name="product_options[address]" placeholder="Site Address" value="{{ old('product_options.address') }}">
<span class="help-block">{{ $errors->first('product_options.address') }} {{ $errors->first('product_options.address') }}</span>
<div class="form-group col-sm-12 {{ $errors->has('options.address') ? 'has-error' : '' }}">
<label for="options.address">Site Address</label>
<input type="text" class="form-control" id="options.address" name="options[address]" placeholder="Site Address" value="{{ old('options.address') }}">
<span class="help-block">{{ $errors->first('options.address') }}</span>
</div>
</fieldset>

View File

@@ -1,21 +1,21 @@
<fieldset class="form-group">
<label class="col-md-12">VOIP</label>
<div class="form-group col-sm-6 {{ $errors->has('product_options.phonenumber') ? 'has-error' : '' }}">
<label for="product_options.phonenumber">Phone Number</label>
<input type="text" class="form-control" id="product_options.phonenumber" name="product_options[phonenumber]" placeholder="Phone Number with Area Code" value="{{ old('product_options.phonenumber') }}">
<span class="help-block">{{ $errors->first('product_options.phonenumber') }} {{ $errors->first('product_options.phonenumber') }}</span>
<div class="form-group col-sm-6 {{ $errors->has('options.phonenumber') ? 'has-error' : '' }}">
<label for="options.phonenumber">Phone Number</label>
<input type="text" class="form-control" id="options.phonenumber" name="options[phonenumber]" placeholder="Phone Number with Area Code" value="{{ old('options.phonenumber') }}">
<span class="help-block">{{ $errors->first('options.phonenumber') }}</span>
</div>
<div class="form-group col-sm-6 {{ $errors->has('product_options.supplier') ? 'has-error' : '' }}">
<label for="product_order.supplier">Existing Supplier</label>
<input type="text" class="form-control" id="product_options.supplier" name="product_options[supplier]" placeholder="eg: Telstra" value="{{ old('product_options.supplier') }}">
<span class="help-block">{{ $errors->first('product_options.supplier') }} {{ $errors->first('product_options.supplier') }}</span>
<div class="form-group col-sm-6 {{ $errors->has('options.supplier') ? 'has-error' : '' }}">
<label for="options.supplier">Existing Supplier</label>
<input type="text" class="form-control" id="options.supplier" name="options[supplier]" placeholder="eg: Telstra" value="{{ old('options.supplier') }}">
<span class="help-block">{{ $errors->first('options.supplier') }}</span>
</div>
<div class="form-group col-sm-6 {{ $errors->has('product_options.supplieraccnum') ? 'has-error' : '' }}">
<label for="product_options.supplieraccnum">Suppliers Account Number</label>
<input type="text" class="form-control" id="product_options.supplieraccnum" name="product_options[supplieraccnum]" placeholder="Refer to Bill" value="{{ old('product_options.supplieraccnum') }}">
<span class="help-block">{{ $errors->first('product_options.supplieraccnum') }} {{ $errors->first('product_options.supplieraccnum') }}</span>
<div class="form-group col-sm-6 {{ $errors->has('options.supplieraccnum') ? 'has-error' : '' }}">
<label for="options.supplieraccnum">Suppliers Account Number</label>
<input type="text" class="form-control" id="options.supplieraccnum" name="options[supplieraccnum]" placeholder="Refer to Bill" value="{{ old('options.supplieraccnum') }}">
<span class="help-block">{{ $errors->first('options.supplieraccnum') }}</span>
</div>
</fieldset>

View File

@@ -5,26 +5,30 @@
<table class="table table-condensed">
<tr>
<th>Type</th>
<td class="text-right">ADSL</td>
<td class="text-right">{{ $o->product_type }}</td>
</tr>
<tr>
<th>Setup Cost</th>
<td class="text-right">TBA</td>
<th>Setup Charges <sup>*</sup></th>
<td class="text-right">${{ is_numeric($o->setup_cost) ? number_format($o->setup_cost,2) : $o->setup_cost }}</td>
</tr>
<tr>
<th>Monthly Cost</th>
<td class="text-right">TBA</td>
<th>Cost</th>
<td class="text-right">${{ is_numeric($o->default_cost) ? number_format($o->default_cost,2) : $o->default_cost }}</td>
</tr>
<tr>
<th>Default Billing</th>
<td class="text-right">TBA</td>
<td class="text-right">{{ is_numeric($o->default_billing) ? number_format($o->default_billing,2) : $o->default_billing }}</td>
</tr>
<tr>
<th>Contract Term</th>
<td class="text-right">TBA</td>
<td class="text-right">{{ $o->contract_term }} mths</td>
</tr>
<tr>
<th>Minimum Costs</th>
<td class="text-right">TBA</td>
<th>Minimum Costs <sup>*</sup></th>
<td class="text-right">${{ is_numeric($o->minimum_cost) ? number_format($o->minimum_cost,2) : $o->minimum_cost }}</td>
</tr>
<tfoot>
<tr><td colspan="2"><sup>* Additional setup charges may apply for complex installations.</sup></td></tr>
</tfoot>
</table>

View File

@@ -8,23 +8,23 @@
<td class="text-right">VOIP</td>
</tr>
<tr>
<th>Setup Cost</th>
<td class="text-right">TBA</td>
<th>Setup Charges</th>
<td class="text-right">${{ is_numeric($o->setup_cost) ? number_format($o->setup_cost,2) : $o->setup_cost }}</td>
</tr>
<tr>
<th>Monthly Cost</th>
<td class="text-right">TBA</td>
<th>Cost</th>
<td class="text-right">${{ is_numeric($o->default_cost) ? number_format($o->default_cost,2) : $o->default_cost }}</td>
</tr>
<tr>
<th>Default Billing</th>
<td class="text-right">TBA</td>
<td class="text-right">{{ is_numeric($o->default_billing) ? number_format($o->default_billing,2) : $o->default_billing }}</td>
</tr>
<tr>
<th>Contract Term</th>
<td class="text-right">TBA</td>
<td class="text-right">{{ $o->contract_term }} mths</td>
</tr>
<tr>
<th>Minimum Costs</th>
<td class="text-right">TBA</td>
<td class="text-right">${{ is_numeric($o->minimum_cost) ? number_format($o->minimum_cost,2) : $o->minimum_cost }}</td>
</tr>
</table>