Changes to orders to stop existing services being submitted
This commit is contained in:
332
resources/views/theme/frontend/metronic/order/home.blade.php
Normal file
332
resources/views/theme/frontend/metronic/order/home.blade.php
Normal file
@@ -0,0 +1,332 @@
|
||||
@extends('metronic::layouts.app')
|
||||
|
||||
@section('htmlheader_title')
|
||||
Order Service
|
||||
@endsection
|
||||
|
||||
@section('main-content')
|
||||
<div class="main">
|
||||
<div class="container">
|
||||
<div class="col-12">
|
||||
<h1>Order Service</h1>
|
||||
|
||||
<div class="order-page" id="order-page">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<ul class="tabbable faq-tabbable">
|
||||
<li class="active">
|
||||
<a href="#order_1" data-toggle="tab" aria-expanded="true">Order Service</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="col-9">
|
||||
<div class="tab-content" style="padding:0; background: #fff;">
|
||||
<div class="tab-pane active" id="order_1">
|
||||
<div class="panel-group" id="accordion1">
|
||||
<form role="form" method="POST" enctype="multipart/form-data">
|
||||
{{ csrf_field() }}
|
||||
|
||||
<div id="accordion">
|
||||
<!-- Reseller Choose Client -->
|
||||
@if ($user && $user->isReseller())
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">Account</h4>
|
||||
</div>
|
||||
|
||||
<div class="panel-collapse">
|
||||
<div class="panel-body">
|
||||
<div class="col-12 margin-bottom-20">
|
||||
|
||||
<div class="col-6">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active"><a href="#account_exist" data-toggle="tab">Existing Account</a></li>
|
||||
<li><a href="#client_new" data-toggle="tab">New Client</a></li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane row fade in active" id="account_exist">
|
||||
<div class="control-group form-group col-sm-12 {{ $errors->has('account_id') ? 'has-error' : '' }}">
|
||||
<label for="account_id">Client Account</label>
|
||||
<select class="form-control" id="account_id" name="account_id">
|
||||
<option value=""> </option>
|
||||
@foreach ($user->all_accounts()->sortBy('name') as $o)
|
||||
<option value="{{ $o->id }}" @if($o->id == old('account_id')) selected @endif>{{ $o->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="help-block">{{ $errors->first('account_id') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane row fade" id="client_new">
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2"><button class="btn btn-block btn-primary next">Next</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Non-Authed User -->
|
||||
@elseif ($user)
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Account
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="panel-collapse">
|
||||
<div class="panel-body">
|
||||
<div class="col-12 margin-bottom-20">
|
||||
|
||||
<div class="col-6">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#account_exist" data-toggle="tab">Existing Account</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#account_new" data-toggle="tab">New Account</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane row fade in active" id="account_exist">
|
||||
<div class="control-group form-group col-sm-12 {{ $errors->has('account_id') ? 'has-error' : '' }}">
|
||||
<label for="account_id">Existing Account</label>
|
||||
<select class="form-control" id="account_id" name="account_id">
|
||||
<option value=""> </option>
|
||||
@foreach ($user->accounts->sortBy('name') as $o)
|
||||
<option value="{{ $o->id }}" @if($o->id == old('account_id')) selected @endif>{{ $o->name }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<span class="help-block">{{ $errors->first('account_id') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane row fade" id="account_new">
|
||||
<div class="control-group form-group col-sm-12 {{ $errors->has('account_name') ? 'has-error' : '' }}">
|
||||
<label for="account_name">Account Name</label>
|
||||
<input type="text" class="form-control" id="account_name" name="account_name" placeholder="New Account Name" value="{{ old('order_email_manual') }}" disabled>
|
||||
<span class="help-block">{{ $errors->first('account_name') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2"><button class="btn btn-block btn-primary">Previous</button></div>
|
||||
<div class="col-sm-2"><button class="btn btn-block btn-primary next">Next</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Non-Authed User -->
|
||||
@else
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
Account
|
||||
</h4>
|
||||
</div>
|
||||
|
||||
<div class="panel-collapse">
|
||||
<div class="panel-body">
|
||||
<div class="col-12">
|
||||
<div class="row col-6">
|
||||
<div class="control-group form-group col-sm-12 {{ $errors->has('order_email_manual') ? 'has-error' : '' }}">
|
||||
<label for="order_email_manual">Email Address</label>
|
||||
<input type="email" class="form-control" id="order_email_manual" name="order_email_manual" placeholder="Email Address" value="{{ old('order_email_manual') }}">
|
||||
<span class="help-block">{{ $errors->first('order_email_manual') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2"><button class="btn btn-block btn-primary">Previous</button></div>
|
||||
<div class="col-sm-2"><button class="btn btn-block btn-primary next">Next</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<!-- Product -->
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">Product</h4>
|
||||
</div>
|
||||
|
||||
<div class="panel-collapse margin-bottom-20">
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="control-group form-group {{ $errors->has('product_options') ? 'has-error' : '' }}">
|
||||
<span class="help-block">{{ $errors->first('product_options') }}</span>
|
||||
</div>
|
||||
|
||||
<div class="control-group form-group {{ $errors->has('product_id') ? 'has-error' : '' }}">
|
||||
<label for="product_id">Product</label>
|
||||
<select class="form-control" id="product_id" name="product_id">
|
||||
<option value=""> </option>
|
||||
@php
|
||||
$po = $selected = NULL;
|
||||
@endphp
|
||||
@foreach (\App\Models\Product::active()->get()->sortBy('name') as $o)
|
||||
@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>
|
||||
|
||||
<div class="col-sm-6" id="product_info">
|
||||
@if (old('product_id'))
|
||||
@include('order.widget.info',['o'=>$po])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12" id="product_order">
|
||||
@if (old('product_id'))
|
||||
@include('order.widget.order',['o'=>$po])
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2"><button class="btn btn-block btn-primary">Previous</button></div>
|
||||
<div class="col-sm-2"><button class="btn btn-block btn-primary next">Next</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<!-- Additional Notes -->
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">Notes</h4>
|
||||
</div>
|
||||
|
||||
<div class="panel-collapse margin-bottom-20">
|
||||
<div class="panel-body">
|
||||
<div class="col-12">
|
||||
<div class="control-group form-group col-sm-12 {{ $errors->has('options.notes') ? 'has-error' : '' }}">
|
||||
<label for="options.notes">Notes</label>
|
||||
<textarea name="options[notes]" class="form-control" rows="4" placeholder="Enter any special instructions...
|
||||
For new ADSL/VOIP services please include the physical address for the requested service.
|
||||
DO NOT request making changes to an active service here, it will not be processed.">{{ old('options.notes') }}</textarea>
|
||||
<span class="help-block">{{ $errors->first('options.notes') }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-2"><button class="btn btn-block btn-primary">Previous</button></div>
|
||||
<div class="col-sm-2 pull-right"><input type="submit" class="btn btn-block btn-primary" value="Submit Order"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('page-scripts')
|
||||
@js('plugin/jqBootstrapValidation/jqBootstrapValidation.js','jq-validation','jquery')
|
||||
@js('//code.jquery.com/ui/1.12.1/jquery-ui.js','jquery-ui-js','jqery')
|
||||
|
||||
<script>
|
||||
$(function () { $("input,select,textarea").not("[type=submit]").jqBootstrapValidation(); } );
|
||||
|
||||
$(document).ready(function () {
|
||||
$('#accordion').accordion({
|
||||
header: "> div > div",
|
||||
collapsible: false,
|
||||
heightStyle: 'content',
|
||||
disabled: true
|
||||
});
|
||||
|
||||
$('#accordion button').click(function (e) {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
var delta = ($(this).is('.next') ? 2 : -2);
|
||||
$('#accordion').accordion('option', 'active', ($('#accordion').accordion('option', 'active') + delta));
|
||||
});
|
||||
|
||||
$("select[name=product_id]").change(function() {
|
||||
// If we select a blank, then dont continue
|
||||
if (this.value == 0)
|
||||
return false;
|
||||
|
||||
// Send the request and update sub category dropdown
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
dataType: "html",
|
||||
cache: true,
|
||||
url: '{{ url('product_info') }}'+'/'+$(this).val(),
|
||||
timeout: 5000,
|
||||
error: function(x) {
|
||||
alert("Failed to submit");
|
||||
},
|
||||
success: function(data) {
|
||||
$("div[id=product_info]").empty().append(data);
|
||||
}
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
// data: "old=",
|
||||
dataType: "html",
|
||||
cache: true,
|
||||
url: '{{ url('product_order') }}'+'/'+$(this).val(),
|
||||
timeout: 5000,
|
||||
error: function(x) {
|
||||
alert("Failed to submit");
|
||||
},
|
||||
success: function(data) {
|
||||
$("div[id=product_order]").empty().append(data);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
span.help-block > ul {
|
||||
color: #9d0000;
|
||||
padding-left: 5px;
|
||||
list-style-type: none;
|
||||
}
|
||||
</style>
|
||||
@append
|
@@ -0,0 +1,11 @@
|
||||
@if(View::exists('order.widget.info.'.$o->category))
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
{{-- Return Category Requirements --}}
|
||||
@include('order.widget.info.'.$o->category)
|
||||
|
||||
{{-- Return Supplier Requirements --}}
|
||||
{{-- Return Product Requirements --}}
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
@@ -0,0 +1,37 @@
|
||||
<div class="col-md-12">
|
||||
<p>{!! $o->description !!}</p>
|
||||
</div>
|
||||
|
||||
<table class="table table-condensed">
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<td class="text-right">{{ $o->product_type }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>Cost <sup>+</sup></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">{{ 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">{{ $o->contract_term }} mths</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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.<br>
|
||||
+ Additional charges may apply for regional installations.
|
||||
</sup></td></tr>
|
||||
</tfoot>
|
||||
</table>
|
@@ -0,0 +1,30 @@
|
||||
<div class="col-md-12">
|
||||
<p>{!! $o->description !!}</p>
|
||||
</div>
|
||||
|
||||
<table class="table table-condensed">
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<td class="text-right">VOIP</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<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>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">{{ 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">{{ $o->contract_term }} mths</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Minimum Costs</th>
|
||||
<td class="text-right">${{ is_numeric($o->minimum_cost) ? number_format($o->minimum_cost,2) : $o->minimum_cost }}</td>
|
||||
</tr>
|
||||
</table>
|
@@ -0,0 +1,16 @@
|
||||
@if(View::exists('order.widget.order.'.$o->category))
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Order Configuration</h3>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
{{-- Return Category Requirements --}}
|
||||
@include('order.widget.order.'.$o->category)
|
||||
|
||||
{{-- Return Supplier Requirements --}}
|
||||
{{-- Return Product Requirements --}}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endif
|
@@ -0,0 +1,9 @@
|
||||
<fieldset class="form-group col-sm-12">
|
||||
<label>ADSL</label>
|
||||
|
||||
<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>
|
@@ -0,0 +1,21 @@
|
||||
<fieldset class="form-group">
|
||||
<label class="col-md-12">VOIP</label>
|
||||
|
||||
<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('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('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>
|
Reference in New Issue
Block a user