Application preview ticket creating almost ready

This commit is contained in:
Mahri Ilmedova 2022-10-04 02:27:17 +05:00
parent 370243933c
commit 2daf706eb1
8 changed files with 256 additions and 390 deletions

View File

@ -41,7 +41,7 @@ public function previewAccountAdmin($id)
}
public function previewApplicationAdmin($id){
$application = Application::with(['account', 'attachments'])->find($id);
$application = Application::with(['account', 'attachments', 'ticket'])->find($id);
return view('admin.application_preview',[
'application' => $application
]);

View File

@ -108,7 +108,9 @@ public function postTicket(TicketRequest $request)
//create ticket inside application preview - admin panel
public function createAppTicket(Request $request){
$ticket = new Ticket($request->only('content', 'title','category_id', 'application_id'));
$ticket = new Ticket($request->only('content', 'title','category_id', 'client_id', 'account_id'));
$ticket->save();
return redirect()->to('/admin/chat?ticket_id=' . $ticket->id);
}
}

View File

@ -94,7 +94,7 @@ protected function setupCreateOperation()
],
[
'name' => 'content',
'type' => 'summernote',
'type' => 'textarea',
'label' => 'Content'
],
[ // SelectMultiple = n-n relationship (with pivot table)

View File

@ -4,6 +4,7 @@
use Backpack\CRUD\app\Models\Traits\CrudTrait;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Relations\HasOne;
class Application extends Model
{
@ -55,6 +56,10 @@ public function attachments(){
->orderBy('documents.order');
}
public function ticket():HasOne{
return $this->hasOne(Ticket::class);
}
/*
|--------------------------------------------------------------------------
| SCOPES

View File

@ -3,149 +3,233 @@
@section('content')
<style>
.btn.focus, .btn:focus, .dataTables_wrapper .dataTables_paginate .focus.paginate_button, .dataTables_wrapper .dataTables_paginate .paginate_button:focus{
.btn.focus,
.btn:focus,
.dataTables_wrapper .dataTables_paginate .focus.paginate_button,
.dataTables_wrapper .dataTables_paginate .paginate_button:focus {
box-shadow: none;
}
.modal-backdrop{
.modal-backdrop {
display: none;
}
</style>
<nav aria-label="breadcrumb" class="d-none d-lg-block">
<ol class="breadcrumb m-0 mb-3">
<li class="breadcrumb-item"><a href="/admin">Admin</a></li>
<li class="breadcrumb-item"><a href="/admin/application">Application</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ $application->id }}</li>
<li class="breadcrumb-item"><a href="/admin">Admin</a></li>
<li class="breadcrumb-item"><a href="/admin/application">Application</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ $application->id }}</li>
</ol>
</nav>
<div class="row">
<div class="row">
<div class="col-lg-4">
<div class="card">
<div class="card-body">
@if ($application->state == 'applied')
<button class="btn btn-primary mb-4" type="button" data-toggle="modal" data-target="#successModal">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
<path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
<path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
</svg> &nbsp;
Approve
</button>
<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="card-body">
@if ($application->state == 'applied')
<button class="btn btn-primary mb-4" type="button" data-toggle="modal" data-target="#successModal">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
class="bi bi-check2-square" viewBox="0 0 16 16">
<path
d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z" />
<path
d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z" />
</svg> &nbsp;
Approve
</button>
<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
aria-hidden="true">
<div class="modal-dialog modal-primary" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Fill the form</h4>
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<form class="form-horizontal" action="/admin/approve-application/{{ $application->id }}" method="post">
@csrf
<div class="modal-body">
<div class="card-body">
<input type="hidden" name="id" value="{{ $application->id }}">
<div class="form-group row">
<label class="col-sm-5 col-form-label" for="input-normal">Legalizatnio number</label>
<div class="col-sm-6">
<input name="legalization_number" class="form-control" id="input-normal" type="text" name="input-normal" placeholder="Normal">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Fill the form</h4>
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
</div>
<form class="form-horizontal" action="/admin/approve-application/{{ $application->id }}"
method="post">
@csrf
<div class="modal-body">
<div class="card-body">
<input type="hidden" name="id" value="{{ $application->id }}">
<div class="form-group row">
<label class="col-sm-5 col-form-label" for="input-normal">Legalizatnio
number</label>
<div class="col-sm-6">
<input name="legalization_number" class="form-control" id="input-normal"
type="text" name="input-normal" placeholder="Normal">
</div>
</div>
</div>
<div class="form-group row">
<label class="col-sm-5 col-form-label" for="input-normal">Expiration date</label>
<div class="col-sm-6">
<input name="expires_at" class="form-control" id="input-normal" type="date" name="input-normal" placeholder="Normal">
<div class="form-group row">
<label class="col-sm-5 col-form-label" for="input-normal">Expiration
date</label>
<div class="col-sm-6">
<input name="expires_at" class="form-control" id="input-normal"
type="date" name="input-normal" placeholder="Normal">
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button>
<button class="btn btn-success" type="submit">Save</button>
</div>
</form>
</div>
<!-- /.modal-content-->
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button>
<button class="btn btn-success" type="submit">Save</button>
</div>
</form>
</div>
<!-- /.modal-content-->
</div>
<!-- /.modal-dialog-->
</div>
@else
<button class="btn btn-secondary mb-4" type="button">Approved</button>
@endif
<a href="/admin/ticket/create" class="btn btn-success mb-4">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-ticket-perforated" viewBox="0 0 16 16">
<path d="M4 4.85v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Z"/>
<path d="M1.5 3A1.5 1.5 0 0 0 0 4.5V6a.5.5 0 0 0 .5.5 1.5 1.5 0 1 1 0 3 .5.5 0 0 0-.5.5v1.5A1.5 1.5 0 0 0 1.5 13h13a1.5 1.5 0 0 0 1.5-1.5V10a.5.5 0 0 0-.5-.5 1.5 1.5 0 0 1 0-3A.5.5 0 0 0 16 6V4.5A1.5 1.5 0 0 0 14.5 3h-13ZM1 4.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 .5.5v1.05a2.5 2.5 0 0 0 0 4.9v1.05a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-1.05a2.5 2.5 0 0 0 0-4.9V4.5Z"/>
</svg> &nbsp;
Create ticket
</a>
@if ($application->account->type == 'business')
<div class="form-group">
<label for="company"><small>Profile type</small></label>
<h6><strong>Entreprenuer</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Country</small></label>
<h6><strong>{{ $application->account->country->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Name</small></label>
<h6><strong>{{ $application->account->profile->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Surname</small></label>
<h6><strong>{{ $application->account->profile->surname ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Patronomic</small></label>
<h6><strong>{{ $application->account->profile->patronomic_name ?? null }}</strong></h6>
</div>
@if (isset($application->account->profile->date_of_birth))
<div class="form-group">
<label for="company"><small>Date of birth</small></label>
<h6><strong>{{ Carbon\Carbon::parse($application->account->profile->date_of_birth)->format('d.m.Y') }}</strong></h6>
@else
<button class="btn btn-secondary mb-4" style="text-transform: capitalize"
type="button">{{ $application->state }}</button>
@endif
@if($application->ticket)
<a class="btn btn-success mb-4" href="/admin/chat?ticket_id={{ $application->ticket->id }}">Go to ticket</a>
@else
<button class="btn btn-success mb-4" type="button" data-toggle="modal" data-target="#ticketModal">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor"
class="bi bi-ticket-perforated" viewBox="0 0 16 16">
<path
d="M4 4.85v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Z" />
<path
d="M1.5 3A1.5 1.5 0 0 0 0 4.5V6a.5.5 0 0 0 .5.5 1.5 1.5 0 1 1 0 3 .5.5 0 0 0-.5.5v1.5A1.5 1.5 0 0 0 1.5 13h13a1.5 1.5 0 0 0 1.5-1.5V10a.5.5 0 0 0-.5-.5 1.5 1.5 0 0 1 0-3A.5.5 0 0 0 16 6V4.5A1.5 1.5 0 0 0 14.5 3h-13ZM1 4.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 .5.5v1.05a2.5 2.5 0 0 0 0 4.9v1.05a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-1.05a2.5 2.5 0 0 0 0-4.9V4.5Z" />
</svg> &nbsp;
Create ticket
</button>
<div class="modal fade" id="ticketModal" tabindex="-1" aria-labelledby="myModalLabel"
style="display: none;" aria-hidden="true">
<div class="modal-dialog modal-lg modal-success" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Create ticket for the application</h4>
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span
aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<form method="post" action="/admin/create-application-ticket" method="POST">
@csrf
<input type="hidden" name="application_id" value="{{ $application->id }}">
<input type="hidden" name="client_id" value={{ $application->account_id }}>
<input type="hidden" name="status_id" value="1" class="form-control">
<input type="hidden" name="last_sender" value="admin" class="form-control">
<div class="card">
<div class="card-body row">
<!-- text input -->
<div class="form-group col-sm-12" element="div" bp-field-wrapper="true"
bp-field-name="title" bp-field-type="text">
<label>Title</label>
<input type="text" name="title" value="" class="form-control">
</div>
<div class="form-group col-sm-12" element="div" bp-field-wrapper="true"
bp-field-name="title" bp-field-type="text">
<label>Content</label>
<textarea name="content" value="" class="form-control"></textarea>
</div>
</div>
</div>
<div id="saveActions" class="form-group">
<div class="btn-group" role="group">
<button type="submit" class="btn btn-success">
<span class="la la-save" role="presentation" aria-hidden="true"></span>
&nbsp;
<span data-value="save_and_back">Save</span>
</button>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button>
</div>
</div>
<!-- /.modal-content-->
</div>
<!-- /.modal-dialog-->
</div>
@endif
@if ($application->account->type == 'business')
<div class="form-group">
<label for="company"><small>Profile type</small></label>
<h6><strong>Entreprenuer</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Country</small></label>
<h6><strong>{{ $application->account->country->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Name</small></label>
<h6><strong>{{ $application->account->profile->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Surname</small></label>
<h6><strong>{{ $application->account->profile->surname ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Patronomic</small></label>
<h6><strong>{{ $application->account->profile->patronomic_name ?? null }}</strong></h6>
</div>
@if (isset($application->account->profile->date_of_birth))
<div class="form-group">
<label for="company"><small>Date of birth</small></label>
<h6><strong>{{ Carbon\Carbon::parse($application->account->profile->date_of_birth)->format('d.m.Y') }}</strong>
</h6>
</div>
@endif
<div class="form-group">
<label for="company"><small>Birthplace</small></label>
<h6><strong>{{ $application->account->profile->birth_place ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration address</small></label>
<h6><strong>{{ $application->account->profile->registration_address ?? null }}</strong></h6>
</div>
@endif
<div class="form-group">
<label for="company"><small>Birthplace</small></label>
<h6><strong>{{ $application->account->profile->birth_place ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration address</small></label>
<h6><strong>{{ $application->account->profile->registration_address ?? null }}</strong></h6>
</div>
@else
@else
<div class="form-group">
<label for="company"><small>Profile type</small></label>
<h6><strong>Company</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Name</small></label>
<h6><strong>{{ $application->account->profile->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Short name</small></label>
<h6><strong>{{ $application->account->profile->short_name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration number</small></label>
<h6><strong>{{ $application->account->profile->registration_number ?? null }}</strong></h6>
</div>
@if (isset($application->account->profile->registration_date))
<div class="form-group">
<label for="company"><small>Profile type</small></label>
<h6><strong>Company</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Name</small></label>
<h6><strong>{{ $application->account->profile->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Short name</small></label>
<h6><strong>{{ $application->account->profile->short_name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration number</small></label>
<h6><strong>{{ $application->account->profile->registration_number ?? null }}</strong></h6>
</div>
@if (isset($application->account->profile->registration_date))
<div class="form-group">
<label for="company"><small>Registration date</small></label>
<h6><strong>{{ Carbon\Carbon::parse($application->account->profile->registration_date)->format('d.m.Y') }}</strong></h6>
<h6><strong>{{ Carbon\Carbon::parse($application->account->profile->registration_date)->format('d.m.Y') }}</strong>
</h6>
</div>
@endif
<div class="form-group">
<label for="company"><small>Registration agency</small></label>
<h6><strong>{{ $application->account->profile->state_registration_agency ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration place</small></label>
<h6><strong>{{ $application->account->profile->registration_place ?? null }}</strong></h6>
</div>
<div class="form-group">
@endif
<div class="form-group">
<label for="company"><small>Registration agency</small></label>
<h6><strong>{{ $application->account->profile->state_registration_agency ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration place</small></label>
<h6><strong>{{ $application->account->profile->registration_place ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration address</small></label>
<h6><strong>{{ $application->account->profile->registration_address ?? null }}</strong></h6>
</div>
@ -174,58 +258,61 @@
<h6><strong>{{ $application->account->profile->is_agent ?? false }}</strong></h6>
</div>
@endif
@endif
</div>
</div>
</div>
</div>
<div class="col-md-8 mb-4">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#attachments" role="tab" aria-controls="applications" aria-selected="true">
<svg style="width: 18px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
</svg>&nbsp;
Attachments
<span class="badge badge-pill badge-secondary">{{ count($application->attachments) }}</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#attachments" role="tab" aria-controls="applications"
aria-selected="true">
<svg style="width: 18px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"
stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round"
d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
</svg>&nbsp;
Attachments
<span class="badge badge-pill badge-secondary">{{ count($application->attachments) }}</span>
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="attachments" role="tabpanel">
<table class="table table-responsive-sm table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Name</th>
<th>Size (Kb)</th>
<th>Type</th>
</tr>
</thead>
<tbody>
@foreach ($application->attachments as $attachment)
<div class="tab-pane active" id="attachments" role="tabpanel">
<table class="table table-responsive-sm table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Name</th>
<th>Size (Kb)</th>
<th>Type</th>
</tr>
</thead>
<tbody>
@foreach ($application->attachments as $attachment)
@if ($attachment->file)
<tr>
<td>
<a class="nav-link" href="/storage/{{ $attachment->file }}" target="_blank">
{{ $attachment->name }}
</a>
</td>
<td>
{{ $attachment->size }} Kb
</td>
<td>
{{ $application->type }}
</td>
</tr>
<tr>
<td>
<a class="nav-link" href="/storage/{{ $attachment->file }}" target="_blank">
{{ $attachment->name }}
</a>
</td>
<td>
{{ $attachment->size }} Kb
</td>
<td>
{{ $application->type }}
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>

View File

@ -1,228 +0,0 @@
@extends(backpack_view('blank'))
@section('content')
<style>
.btn.focus, .btn:focus, .dataTables_wrapper .dataTables_paginate .focus.paginate_button, .dataTables_wrapper .dataTables_paginate .paginate_button:focus{
box-shadow: none;
}
.modal-backdrop{
display: none;
}
</style>
<nav aria-label="breadcrumb" class="d-none d-lg-block">
<ol class="breadcrumb m-0 mb-3">
<li class="breadcrumb-item"><a href="/admin">Admin</a></li>
<li class="breadcrumb-item"><a href="/admin/application">Application</a></li>
<li class="breadcrumb-item active" aria-current="page">{{ $application->id }}</li>
</ol>
</nav>
<div class="row">
<div class="col-lg-4">
<div class="card">
<div class="card-body">
@if($application->state == 'applied')
<button class="btn btn-primary mb-4" type="button" data-toggle="modal" data-target="#successModal">
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check2-square" viewBox="0 0 16 16">
<path d="M3 14.5A1.5 1.5 0 0 1 1.5 13V3A1.5 1.5 0 0 1 3 1.5h8a.5.5 0 0 1 0 1H3a.5.5 0 0 0-.5.5v10a.5.5 0 0 0 .5.5h10a.5.5 0 0 0 .5-.5V8a.5.5 0 0 1 1 0v5a1.5 1.5 0 0 1-1.5 1.5H3z"/>
<path d="m8.354 10.354 7-7a.5.5 0 0 0-.708-.708L8 9.293 5.354 6.646a.5.5 0 1 0-.708.708l3 3a.5.5 0 0 0 .708 0z"/>
</svg> &nbsp;
Approve
</button>
<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog modal-primary" role="document">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">Fill the form</h4>
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<form class="form-horizontal" action="/admin/approve-application/{{ $application->id }}" method="post">
@csrf
<div class="modal-body">
<div class="card-body">
<input type="hidden" name="id" value="{{ $application->id }}">
<div class="form-group row">
<label class="col-sm-5 col-form-label" for="input-normal">Legalizatnio number</label>
<div class="col-sm-6">
<input name="legalization_number" class="form-control" id="input-normal" type="text" name="input-normal" placeholder="Normal">
</div>
</div>
<div class="form-group row">
<label class="col-sm-5 col-form-label" for="input-normal">Expiration date</label>
<div class="col-sm-6">
<input name="expires_at" class="form-control" id="input-normal" type="date" name="input-normal" placeholder="Normal">
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-secondary" type="button" data-dismiss="modal">Close</button>
<button class="btn btn-success" type="submit">Save</button>
</div>
</form>
</div>
<!-- /.modal-content-->
</div>
<!-- /.modal-dialog-->
</div>
@else
<button class="btn btn-secondary mb-4" type="button">Approved</button>
@endif
<a href="/admin/create-application-ticket" class="btn btn-success mb-4">
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" class="bi bi-ticket-perforated" viewBox="0 0 16 16">
<path d="M4 4.85v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Zm-7 1.8v.9h1v-.9H4Zm7 0v.9h1v-.9h-1Z"/>
<path d="M1.5 3A1.5 1.5 0 0 0 0 4.5V6a.5.5 0 0 0 .5.5 1.5 1.5 0 1 1 0 3 .5.5 0 0 0-.5.5v1.5A1.5 1.5 0 0 0 1.5 13h13a1.5 1.5 0 0 0 1.5-1.5V10a.5.5 0 0 0-.5-.5 1.5 1.5 0 0 1 0-3A.5.5 0 0 0 16 6V4.5A1.5 1.5 0 0 0 14.5 3h-13ZM1 4.5a.5.5 0 0 1 .5-.5h13a.5.5 0 0 1 .5.5v1.05a2.5 2.5 0 0 0 0 4.9v1.05a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-1.05a2.5 2.5 0 0 0 0-4.9V4.5Z"/>
</svg> &nbsp;
Create ticket
</a>
@if ($application->account->type == 'business')
<div class="form-group">
<label for="company"><small>Profile type</small></label>
<h6><strong>Entreprenuer</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Country</small></label>
<h6><strong>{{ $application->account->country->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Name</small></label>
<h6><strong>{{ $application->account->profile->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Surname</small></label>
<h6><strong>{{ $application->account->profile->surname ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Patronomic</small></label>
<h6><strong>{{ $application->account->profile->patronomic_name ?? null }}</strong></h6>
</div>
@if (isset($application->account->profile->date_of_birth))
<div class="form-group">
<label for="company"><small>Date of birth</small></label>
<h6><strong>{{ Carbon\Carbon::parse($application->account->profile->date_of_birth)->format('d.m.Y') }}</strong></h6>
</div>
@endif
<div class="form-group">
<label for="company"><small>Birthplace</small></label>
<h6><strong>{{ $application->account->profile->birth_place ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration address</small></label>
<h6><strong>{{ $application->account->profile->registration_address ?? null }}</strong></h6>
</div>
@else
<div class="form-group">
<label for="company"><small>Profile type</small></label>
<h6><strong>Company</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Name</small></label>
<h6><strong>{{ $application->account->profile->name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Short name</small></label>
<h6><strong>{{ $application->account->profile->short_name ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration number</small></label>
<h6><strong>{{ $application->account->profile->registration_number ?? null }}</strong></h6>
</div>
@if (isset($application->account->profile->registration_date))
<div class="form-group">
<label for="company"><small>Registration date</small></label>
<h6><strong>{{ Carbon\Carbon::parse($application->account->profile->registration_date)->format('d.m.Y') }}</strong></h6>
</div>
@endif
<div class="form-group">
<label for="company"><small>Registration agency</small></label>
<h6><strong>{{ $application->account->profile->state_registration_agency ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration place</small></label>
<h6><strong>{{ $application->account->profile->registration_place ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Registration address</small></label>
<h6><strong>{{ $application->account->profile->registration_address ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Fond capital</small></label>
<h6><strong>{{ $application->account->profile->fond_capital ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Management types</small></label>
<h6><strong>{{ $application->account->profile->management_types ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Signers</small></label>
<h6><strong>{{ $application->account->profile->signers ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Share holders</small></label>
<h6><strong>{{ $application->account->profile->share_holders ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Organizational form</small></label>
<h6><strong>{{ $application->account->profile->organizational_form ?? null }}</strong></h6>
</div>
<div class="form-group">
<label for="company"><small>Is agent?</small></label>
<h6><strong>{{ $application->account->profile->is_agent ?? false }}</strong></h6>
</div>
@endif
</div>
</div>
</div>
<div class="col-md-8 mb-4">
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#attachments" role="tab" aria-controls="applications" aria-selected="true">
<svg style="width: 18px" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
<path stroke-linecap="round" stroke-linejoin="round" d="M19.5 14.25v-2.625a3.375 3.375 0 00-3.375-3.375h-1.5A1.125 1.125 0 0113.5 7.125v-1.5a3.375 3.375 0 00-3.375-3.375H8.25m2.25 0H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 00-9-9z" />
</svg> &nbsp;
Attachments
<span class="badge badge-pill badge-secondary">{{ count($application->attachments) }}</span>
</a>
</li>
</ul>
<div class="tab-content">
<div class="tab-pane active" id="attachments" role="tabpanel">
<table class="table table-responsive-sm table-striped mb-0">
<thead class="thead-light">
<tr>
<th>Name</th>
<th>Size (Kb)</th>
<th>Type</th>
</tr>
</thead>
<tbody>
@foreach ($application->attachments as $attachment)
@if ($attachment->file)
<tr>
<td>
<a class="nav-link" href="/storage/{{ $attachment->file }}" target="_blank">
{{ $attachment->name }}
</a>
</td>
<td>
{{ $attachment->size }} Kb
</td>
<td>
{{ $application->type }}
</td>
</tr>
@endif
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endsection

View File

@ -71,9 +71,9 @@
<div class="" style="height: 68vh; overflow-y: auto;">
<div class="chat-log" id="chat-log">
<div id="chat-messages">
{{-- <div class="chat-log__item client"><h3 class="chat-log__author">{{ $ticket->client->firstname ?? null }} {{ $ticket->client->lastname ?? null }}<small class="small-date"> {{ Carbon\Carbon::parse($ticket->created_at)->format('d.m.Y h:i') }} </small></h3>
<div class="chat-log__item client"><h3 class="chat-log__author">{{ $ticket->client->firstname ?? null }} {{ $ticket->client->lastname ?? null }}<small class="small-date"> {{ Carbon\Carbon::parse($ticket->created_at)->format('d.m.Y h:i') }} </small></h3>
<div class="chat-log__message"><p>{{ $ticket->content }}</p>
</div> --}}
</div>
</div>
</div>
<div>

View File

@ -43,6 +43,6 @@
Route::get('/preview-application/{id}',[ResourceController::class, 'previewApplicationAdmin']);
Route::post('/approve-application/{id}', [ResourceController::class, 'approveApplication']);
Route::get('/export-account-admin/{id}', [ExportController::class, 'export']);
Route::get('/create-application-ticket', [TicketController::class, 'createAppTicket']);
Route::post('/create-application-ticket', [TicketController::class, 'createAppTicket']);
}); // this should be the absolute last line of this file