38 lines
1.9 KiB
PHP
38 lines
1.9 KiB
PHP
@extends('layouts.app')
|
|
@section('title', __('crm::lang.offer_catalog'))
|
|
@section('content')
|
|
@include('crm::layouts.nav')
|
|
<section class="content-header"><h1>@lang('crm::lang.offer_catalog')</h1></section>
|
|
<section class="content">
|
|
@component('components.widget', ['class' => 'box-primary'])
|
|
<table class="table table-bordered" id="offers_table" style="width:100%;">
|
|
<thead><tr><th>@lang('lang_v1.name')</th><th>@lang('sale.status')</th><th>@lang('messages.action')</th></tr></thead>
|
|
</table>
|
|
<hr>
|
|
{!! Form::open(['id' => 'offer_create_form']) !!}
|
|
<div class="row">
|
|
<div class="col-md-3">{!! Form::text('name', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.name'), 'required']) !!}</div>
|
|
<div class="col-md-3">{!! Form::select('offer_type', $offerTypes, null, ['class' => 'form-control']) !!}</div>
|
|
<div class="col-md-4">{!! Form::text('description', null, ['class' => 'form-control', 'placeholder' => __('lang_v1.description')]) !!}</div>
|
|
<div class="col-md-2"><button type="submit" class="btn btn-success">@lang('messages.add')</button></div>
|
|
</div>
|
|
{!! Form::close() !!}
|
|
@endcomponent
|
|
</section>
|
|
@endsection
|
|
@section('javascript')
|
|
<script>
|
|
$('#offers_table').DataTable({
|
|
processing: true, serverSide: true,
|
|
ajax: '{{ action([\Modules\Crm\Http\Controllers\OfferCatalogController::class, "index"]) }}',
|
|
columns: [{data: 'name'}, {data: 'offer_type'}, {data: 'action', orderable: false}]
|
|
});
|
|
$('#offer_create_form').submit(function(e) {
|
|
e.preventDefault();
|
|
$.post('{{ action([\Modules\Crm\Http\Controllers\OfferCatalogController::class, "store"]) }}', $(this).serialize() + '&_token={{ csrf_token() }}', function(r) {
|
|
if (r.success) { toastr.success(r.msg); $('#offers_table').DataTable().ajax.reload(); }
|
|
});
|
|
});
|
|
</script>
|
|
@endsection
|