Offline Payment re-factoring
This commit is contained in:
@ -1,29 +1,29 @@
|
||||
@extends('layouts.admin')
|
||||
|
||||
@section('title', trans('offlinepayment::offlinepayment.offlinepayment'))
|
||||
@section('title', trans('offlinepayment::general.title'))
|
||||
|
||||
@section('content')
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('offlinepayment::offlinepayment.add_new') }}</h3>
|
||||
<h3 class="box-title">{{ trans('offlinepayment::general.add_new') }}</h3>
|
||||
<!-- /.box-tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
|
||||
{!! Form::open(['url' => 'apps/offlinepayment/settings', 'files' => true, 'role' => 'form']) !!}
|
||||
{!! Form::open(['route' => 'offlinepayment.update', 'files' => true, 'role' => 'form', 'class' => 'form-loading-button']) !!}
|
||||
|
||||
<div class="box-body">
|
||||
<div id="install-loading"></div>
|
||||
|
||||
{{ Form::textGroup('name', trans('general.name'), 'id-card-o', ['required' => 'required'], null, 'col-md-12') }}
|
||||
|
||||
{{ Form::textGroup('code', trans('offlinepayment::offlinepayment.code'), 'key', ['required' => 'required'], null, 'col-md-12') }}
|
||||
{{ Form::textGroup('code', trans('offlinepayment::general.form.code'), 'key', ['required' => 'required'], null, 'col-md-12') }}
|
||||
|
||||
{{ Form::radioGroup('customer', trans('offlinepayment::offlinepayment.customer'), '', ['required' => 'required'], 0, 'col-md-12') }}
|
||||
{{ Form::radioGroup('customer', trans('offlinepayment::general.form.customer'), '', ['required' => 'required'], 0, 'col-md-12') }}
|
||||
|
||||
{{ Form::textGroup('order', trans('offlinepayment::offlinepayment.order'), 'sort', [], null, 'col-md-12') }}
|
||||
{{ Form::textGroup('order', trans('offlinepayment::general.form.order'), 'sort', [], null, 'col-md-12') }}
|
||||
|
||||
{{ Form::textareaGroup('description', trans('general.description')) }}
|
||||
</div>
|
||||
@ -38,22 +38,25 @@
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
</div>
|
||||
|
||||
<div class="col-md-8">
|
||||
<!-- Default box -->
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{{ trans('offlinepayment::offlinepayment.payment_gateways') }}</h3>
|
||||
<h3 class="box-title">{{ trans('offlinepayment::general.payment_gateways') }}</h3>
|
||||
<!-- /.box-tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
<div class="box-body">
|
||||
<div id="delete-loading"></div>
|
||||
|
||||
<div class="table table-responsive">
|
||||
<table class="table table-striped table-hover" id="tbl-items">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="col-md-3">{{ trans('general.name') }}</th>
|
||||
<th class="col-md-4">{{ trans('offlinepayment::offlinepayment.code') }}</th>
|
||||
<th class="col-md-2 text-center">{{ trans('offlinepayment::offlinepayment.order') }}</th>
|
||||
<th class="col-md-4">{{ trans('offlinepayment::general.form.code') }}</th>
|
||||
<th class="col-md-2 text-center">{{ trans('offlinepayment::general.form.order') }}</th>
|
||||
<th class="col-md-3">{{ trans('general.actions') }}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@ -86,13 +89,14 @@
|
||||
|
||||
@push('stylesheet')
|
||||
<style type="text/css">
|
||||
.install-loading-bar {
|
||||
#install-loading.active, #delete-loading.active {
|
||||
font-size: 35px;
|
||||
position: absolute;
|
||||
z-index: 500;
|
||||
top: 0px;
|
||||
left: 0px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background: rgb(136, 136, 136);
|
||||
opacity: 0.2;
|
||||
-moz-border-radius-bottomleft: 1px;
|
||||
@ -106,7 +110,11 @@
|
||||
position: absolute;
|
||||
margin: auto;
|
||||
color: #fff;
|
||||
padding: 28% 40%;
|
||||
padding: 45% 40%;
|
||||
}
|
||||
|
||||
#delete-loading .install-loading-spin {
|
||||
padding: 8% 40%;
|
||||
}
|
||||
</style>
|
||||
@endpush
|
||||
@ -115,22 +123,25 @@
|
||||
<script type="text/javascript">
|
||||
var text_yes = '{{ trans('general.yes') }}';
|
||||
var text_no = '{{ trans('general.no') }}';
|
||||
var code = '';
|
||||
var tr = '';
|
||||
|
||||
$(document).ready(function() {
|
||||
$('.method-edit').on('click', function() {
|
||||
var code = $(this).attr('id').replace('edit-', '');
|
||||
code = $(this).attr('id').replace('edit-', '');
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("apps/offlinepayment/settings/get") }}',
|
||||
url: '{{ route("offlinepayment.get") }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {code: code},
|
||||
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
|
||||
beforeSend: function() {
|
||||
$('#install-loading').addClass('active');
|
||||
$('#install-loading').html('<span class="install-loading-bar"><span class="install-loading-spin"><i class="fa fa-spinner fa-spin"></i></span></span>');
|
||||
$('.install-loading-bar').css({"height": $('.col-md-4.no-padding-left').height() - 23});
|
||||
},
|
||||
complete: function() {
|
||||
$('#install-loading').removeClass('active');
|
||||
$('#install-loading .install-loading-bar').remove();
|
||||
},
|
||||
success: function(json) {
|
||||
@ -160,20 +171,30 @@
|
||||
});
|
||||
|
||||
$('.method-delete').on('click', function() {
|
||||
var code = $(this).attr('id').replace('delete-', '');
|
||||
code = $(this).attr('id').replace('delete-', '');
|
||||
tr = $(this).parent().parent();
|
||||
|
||||
$.ajax({
|
||||
url: '{{ url("apps/offlinepayment/settings/delete") }}',
|
||||
url: '{{ route("offlinepayment.delete") }}',
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: {code: code},
|
||||
headers: { 'X-CSRF-TOKEN': '{{ csrf_token() }}' },
|
||||
beforeSend: function() {
|
||||
$('#delete-loading').addClass('active');
|
||||
$('#delete-loading').html('<span class="install-loading-bar"><span class="install-loading-spin"><i class="fa fa-spinner fa-spin"></i></span></span>');
|
||||
},
|
||||
complete: function() {
|
||||
//$('#delete-loading').removeClass('active');
|
||||
//$('#delete-loading .install-loading-bar').remove();
|
||||
},
|
||||
success: function(json) {
|
||||
if (json['error']) {
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#method-' + code).remove();
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
Reference in New Issue
Block a user