fixed errors and enhanced admin panel
This commit is contained in:
parent
84857335a8
commit
4e44af4bef
|
|
@ -77,7 +77,8 @@ public function create()
|
||||||
|
|
||||||
$application = BrokerApplication::create([
|
$application = BrokerApplication::create([
|
||||||
'account_id' => $this->account->id,
|
'account_id' => $this->account->id,
|
||||||
'state' => 'draft' //default mysql value is new
|
'state' => 'draft', //default mysql value is new
|
||||||
|
'is_local' => true
|
||||||
]);
|
]);
|
||||||
|
|
||||||
foreach ($documents as $document){
|
foreach ($documents as $document){
|
||||||
|
|
|
||||||
|
|
@ -2,21 +2,13 @@
|
||||||
|
|
||||||
namespace App\Http\Controllers\API;
|
namespace App\Http\Controllers\API;
|
||||||
|
|
||||||
use App\Http\Requests\API\ContractRequest;
|
|
||||||
use App\Http\Resources\ContractResource;
|
|
||||||
use App\Http\Resources\CountryResource;
|
use App\Http\Resources\CountryResource;
|
||||||
use App\Http\Resources\CategoryResource;
|
use App\Http\Resources\CategoryResource;
|
||||||
use App\Models\Contract;
|
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
use App\Models\Category;
|
use App\Models\Category;
|
||||||
use App\Http\Controllers\Controller;
|
use App\Http\Controllers\Controller;
|
||||||
use App\Http\Resources\QuestionResource;
|
use App\Http\Resources\QuestionResource;
|
||||||
use App\Models\Account;
|
|
||||||
use App\Models\Application;
|
|
||||||
use App\Models\BrokerApplication;
|
|
||||||
use App\Models\Client;
|
|
||||||
use App\Models\Question;
|
use App\Models\Question;
|
||||||
use Illuminate\Http\Request;
|
|
||||||
|
|
||||||
class ResourceController extends Controller
|
class ResourceController extends Controller
|
||||||
{
|
{
|
||||||
|
|
@ -35,44 +27,4 @@ public function faqs()
|
||||||
return QuestionResource::collection(Question::get());//todo investigate do we need all??
|
return QuestionResource::collection(Question::get());//todo investigate do we need all??
|
||||||
}
|
}
|
||||||
|
|
||||||
public function previewAccountAdmin($id)
|
|
||||||
{
|
|
||||||
$account = Account::with(['country','profile','clients','applications'])//tormoz etdirer todo fix this
|
|
||||||
->find($id);
|
|
||||||
|
|
||||||
return view('admin.preview',[
|
|
||||||
'account' => $account
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function previewApplicationAdmin($id){
|
|
||||||
$application = Application::with(['account', 'attachments', 'ticket'])->find($id);
|
|
||||||
return view('admin.application_preview',[
|
|
||||||
'application' => $application
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
public function previewBrokerApplicationAdmin($id){
|
|
||||||
$application = BrokerApplication::with(['account', 'broker_attachments', 'ticket'])->find($id);
|
|
||||||
return view('admin.broker_application_preview',[
|
|
||||||
'application' => $application
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public function createAccountClient($account_id){
|
|
||||||
return view('admin.account_client_create',[
|
|
||||||
'account_id' => $account_id
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function createClient(Request $request){
|
|
||||||
$data = $request->only('firstname', 'lastname', 'email', 'password', 'account_id');
|
|
||||||
$data['is_verified'] = false;
|
|
||||||
$data['is_suspended'] = false;
|
|
||||||
$client = new Client($data);
|
|
||||||
$client->save();
|
|
||||||
return redirect()->to('/admin/preview/' . $request->account_id . '#users');
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -129,6 +129,18 @@ public function createAppTicket(Request $request){
|
||||||
$ticket = new Ticket($request->only('content', 'title','category_id', 'account_id', 'application_id'));
|
$ticket = new Ticket($request->only('content', 'title','category_id', 'account_id', 'application_id'));
|
||||||
$ticket['status_id'] = 1;
|
$ticket['status_id'] = 1;
|
||||||
$ticket['client_id'] = $request->account_id;
|
$ticket['client_id'] = $request->account_id;
|
||||||
|
$ticket['last_sender'] = 'admin';
|
||||||
|
$ticket->save();
|
||||||
|
$not_suspended_clients = Client::where('is_suspended', 0)->where('account_id', $request->account_id)->get();
|
||||||
|
Notification::send($not_suspended_clients, new TicketPosted());
|
||||||
|
return redirect(route('chat',['ticket_id' => $ticket->id]));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createBrokerAppTicket(Request $request){
|
||||||
|
$ticket = new Ticket($request->only('content', 'title','category_id', 'account_id', 'broker_application_id'));
|
||||||
|
$ticket['status_id'] = 1;
|
||||||
|
$ticket['client_id'] = $request->account_id;
|
||||||
|
$ticket['last_sender'] = 'admin';
|
||||||
$ticket->save();
|
$ticket->save();
|
||||||
$not_suspended_clients = Client::where('is_suspended', 0)->where('account_id', $request->account_id)->get();
|
$not_suspended_clients = Client::where('is_suspended', 0)->where('account_id', $request->account_id)->get();
|
||||||
Notification::send($not_suspended_clients, new TicketPosted());
|
Notification::send($not_suspended_clients, new TicketPosted());
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Requests\AccountRequest;
|
use App\Http\Requests\AccountRequest;
|
||||||
|
use App\Models\Account;
|
||||||
use App\Models\Business;
|
use App\Models\Business;
|
||||||
use App\Models\Company;
|
use App\Models\Company;
|
||||||
use App\Models\Country;
|
use App\Models\Country;
|
||||||
|
|
@ -177,5 +178,22 @@ protected function setupUpdateOperation()
|
||||||
$this->setupCreateOperation();
|
$this->setupCreateOperation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function previewAccountAdmin($id)
|
||||||
|
{
|
||||||
|
$account = Account::with(['country','profile','clients','applications', 'broker_applications'])//tormoz etdirer todo fix this
|
||||||
|
->find($id);
|
||||||
|
|
||||||
|
return view('admin.preview',[
|
||||||
|
'account' => $account
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createAccountClient($account_id)
|
||||||
|
{
|
||||||
|
return view('admin.account_client_create',[
|
||||||
|
'account_id' => $account_id
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,7 @@ function ($value) {
|
||||||
protected function setupListOperation()
|
protected function setupListOperation()
|
||||||
{
|
{
|
||||||
//$this->crud->addClause('where', 'state', '!=', 'new');
|
//$this->crud->addClause('where', 'state', '!=', 'new');
|
||||||
|
|
||||||
$this->crud->addColumns([
|
$this->crud->addColumns([
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
@ -133,7 +134,7 @@ protected function setupListOperation()
|
||||||
'label' => trans('app.application.created_at'),
|
'label' => trans('app.application.created_at'),
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// CRUD::addColumn(['name'=>'country_id', 'type'=>'select','label'=> trans('app.account.country'), 'entity' => 'country' ,'model' => 'App\Model\Country','attribute' => 'name']);
|
|
||||||
$this->crud->addButtonFromModelFunction('line', 'preview_button', 'preview', 'beginning');
|
$this->crud->addButtonFromModelFunction('line', 'preview_button', 'preview', 'beginning');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -159,7 +160,6 @@ public function refine($id){
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function approveApplication(Request $request){
|
public function approveApplication(Request $request){
|
||||||
$application = Application::find($request->id);
|
$application = Application::find($request->id);
|
||||||
$application->state = 'approved';
|
$application->state = 'approved';
|
||||||
|
|
@ -174,62 +174,10 @@ public function approveApplication(Request $request){
|
||||||
return redirect()->back();
|
return redirect()->back();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function previewApplicationAdmin($id){
|
||||||
* Define what happens when the Create operation is loaded.
|
$application = Application::with(['account', 'attachments', 'ticket'])->find($id);
|
||||||
*
|
return view('admin.application_preview',[
|
||||||
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
'application' => $application
|
||||||
* @return void
|
]);
|
||||||
*/
|
}
|
||||||
// protected function setupCreateOperation()
|
|
||||||
// {
|
|
||||||
// CRUD::setValidation(ApplicationRequest::class);
|
|
||||||
// $this->crud->addFields([
|
|
||||||
// [ // SelectMultiple = n-n relationship (with pivot table)
|
|
||||||
// 'label' => trans('app.application.account'),
|
|
||||||
// 'type' => 'custom_select_account',
|
|
||||||
// 'name' => 'account_id', // the method that defines the relationship in your Model
|
|
||||||
// 'entity' => 'account', // the method that defines the relationship in your Model
|
|
||||||
// 'model' => "App\Models\Account", // foreign key model
|
|
||||||
// 'attribute_1' => 'name', // foreign key attribute that is shown to user
|
|
||||||
// 'attribute_2' => 'surname',
|
|
||||||
// ],
|
|
||||||
// [
|
|
||||||
// 'name' => 'state',
|
|
||||||
// 'label' => trans('app.application.state'),
|
|
||||||
// 'type' => 'select_from_array',
|
|
||||||
// 'options' => [
|
|
||||||
// 'new' => trans('app.application.new'),
|
|
||||||
// 'applied' => trans('app.application.applied'),
|
|
||||||
// 'refine' => trans('app.application.refine'),
|
|
||||||
// 'approved' => trans('app.application.approved'),
|
|
||||||
// 'archive' => trans('app.application.archived')
|
|
||||||
// ]
|
|
||||||
// ]
|
|
||||||
// ]);
|
|
||||||
// }
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Define what happens when the Update operation is loaded.
|
|
||||||
*
|
|
||||||
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
|
||||||
* @return void
|
|
||||||
*/
|
|
||||||
// protected function setupUpdateOperation()
|
|
||||||
// {
|
|
||||||
// CRUD::setValidation(ApplicationRequest::class);
|
|
||||||
// $this->crud->addFields([
|
|
||||||
// [
|
|
||||||
// 'name' => 'state',
|
|
||||||
// 'label' => 'State',
|
|
||||||
// 'type' => 'select_from_array',
|
|
||||||
// 'options' => [
|
|
||||||
// 'new' => trans('app.application.new'),
|
|
||||||
// 'applied' => trans('app.application.applied'),
|
|
||||||
// 'refine' => trans('app.application.refine'),
|
|
||||||
// 'approved' => trans('app.application.approved'),
|
|
||||||
// 'archive' => trans('app.application.archived')
|
|
||||||
// ]
|
|
||||||
// ]
|
|
||||||
// ]);
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,16 @@
|
||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Requests\BrokerApplicationRequest;
|
use App\Http\Requests\BrokerApplicationRequest;
|
||||||
|
use App\Models\Account;
|
||||||
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
use App\Models\BrokerApplication;
|
use App\Models\BrokerApplication;
|
||||||
|
use App\Models\Client;
|
||||||
|
use App\Notifications\ApplicationApproved;
|
||||||
|
use App\Notifications\ApplicationRefined;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Notification;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BrokerApplicationCrudController
|
* Class BrokerApplicationCrudController
|
||||||
|
|
@ -24,7 +31,7 @@ class BrokerApplicationCrudController extends CrudController
|
||||||
*/
|
*/
|
||||||
public function setup()
|
public function setup()
|
||||||
{
|
{
|
||||||
if(!(backpack_user()->hasPermissionTo('applications'))){
|
if(!(backpack_user()->hasPermissionTo('broker-applications'))){
|
||||||
$this->crud->denyAccess(['update']);
|
$this->crud->denyAccess(['update']);
|
||||||
}
|
}
|
||||||
if(!(backpack_user()->hasRole('Super Admin'))){
|
if(!(backpack_user()->hasRole('Super Admin'))){
|
||||||
|
|
@ -75,6 +82,17 @@ function ($value) {
|
||||||
$this->crud->addClause('where', 'accepted_by', 'LIKE', '%' . $value . '%');
|
$this->crud->addClause('where', 'accepted_by', 'LIKE', '%' . $value . '%');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$this->crud->addFilter([
|
||||||
|
'name' => 'is_local',
|
||||||
|
'type' => 'dropdown',
|
||||||
|
'label' => trans('app.broker_application.is_local')
|
||||||
|
], [
|
||||||
|
0 => trans('app.no'),
|
||||||
|
1 => trans('app.yes')
|
||||||
|
], function ($value) {
|
||||||
|
$this->crud->addClause('where', 'is_local', $value);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -86,6 +104,7 @@ function ($value) {
|
||||||
protected function setupListOperation()
|
protected function setupListOperation()
|
||||||
{
|
{
|
||||||
//$this->crud->addClause('where', 'state', '!=', 'new');
|
//$this->crud->addClause('where', 'state', '!=', 'new');
|
||||||
|
|
||||||
$this->crud->addColumns([
|
$this->crud->addColumns([
|
||||||
|
|
||||||
[
|
[
|
||||||
|
|
@ -127,37 +146,50 @@ protected function setupListOperation()
|
||||||
'label' => trans('app.application.created_at'),
|
'label' => trans('app.application.created_at'),
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
// CRUD::addColumn(['name'=>'country_id', 'type'=>'select','label'=> trans('app.account.country'), 'entity' => 'country' ,'model' => 'App\Model\Country','attribute' => 'name']);
|
|
||||||
$this->crud->addButtonFromModelFunction('line', 'preview_button', 'preview', 'beginning');
|
$this->crud->addButtonFromModelFunction('line', 'preview_button', 'preview', 'beginning');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function accept($id){
|
||||||
* Define what happens when the Create operation is loaded.
|
$entry = BrokerApplication::findOrfail($id);
|
||||||
*
|
$entry->accepted_by = backpack_user()->name;
|
||||||
* @see https://backpackforlaravel.com/docs/crud-operation-create
|
$entry->state = 'accepted';
|
||||||
* @return void
|
$entry->accepted_date = Carbon::now();
|
||||||
*/
|
$entry->save();
|
||||||
protected function setupCreateOperation()
|
\Alert::add('success', '<strong>Success!</strong><br>Broker application is accepted')->flash();
|
||||||
{
|
return redirect()->back();
|
||||||
CRUD::setValidation(BrokerApplicationRequest::class);
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Fields can be defined using the fluent syntax or array syntax:
|
|
||||||
* - CRUD::field('price')->type('number');
|
|
||||||
* - CRUD::addField(['name' => 'price', 'type' => 'number']));
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public function refine($id){
|
||||||
* Define what happens when the Update operation is loaded.
|
$entry = BrokerApplication::findOrfail($id);
|
||||||
*
|
$entry->state = 'refine';
|
||||||
* @see https://backpackforlaravel.com/docs/crud-operation-update
|
$entry->refine_note = request()->get('note');
|
||||||
* @return void
|
$entry->save();
|
||||||
*/
|
$account = Account::with('clients')->find($entry->account_id);
|
||||||
protected function setupUpdateOperation()
|
$not_suspended_clients = Client::where('is_suspended', 0)->where('account_id', $account->id)->get();
|
||||||
{
|
Notification::send($not_suspended_clients, new ApplicationRefined());
|
||||||
$this->setupCreateOperation();
|
\Alert::add('success', '<strong>Success!</strong><br>Broker application is refined')->flash();
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function approveApplication(Request $request){
|
||||||
|
$application = BrokerApplication::find($request->id);
|
||||||
|
$application->state = 'approved';
|
||||||
|
$application->save();
|
||||||
|
$account = Account::with('clients')->find($application->account_id);
|
||||||
|
$account->broker_number = $request->broker_number;
|
||||||
|
$account->broker_expires_at = $request->broker_expires_at;
|
||||||
|
$account->save();
|
||||||
|
$not_suspended_clients = Client::where('is_suspended', 0)->where('account_id', $account->id)->get();
|
||||||
|
Notification::send($not_suspended_clients, new ApplicationApproved());
|
||||||
|
\Alert::add('success', '<strong>Success!</strong><br>Broker application is approved')->flash();
|
||||||
|
return redirect()->back();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function previewBrokerApplicationAdmin($id){
|
||||||
|
$application = BrokerApplication::with(['account', 'broker_attachments', 'ticket'])->find($id);
|
||||||
|
return view('admin.broker_application_preview',[
|
||||||
|
'application' => $application
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,8 +3,10 @@
|
||||||
namespace App\Http\Controllers\Admin;
|
namespace App\Http\Controllers\Admin;
|
||||||
|
|
||||||
use App\Http\Requests\ClientRequest;
|
use App\Http\Requests\ClientRequest;
|
||||||
|
use App\Models\Client;
|
||||||
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
use Backpack\CRUD\app\Http\Controllers\CrudController;
|
||||||
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
use Backpack\CRUD\app\Library\CrudPanel\CrudPanelFacade as CRUD;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class ClientCrudController
|
* Class ClientCrudController
|
||||||
|
|
@ -119,4 +121,13 @@ protected function setupUpdateOperation()
|
||||||
{
|
{
|
||||||
$this->setupCreateOperation();
|
$this->setupCreateOperation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function createClient(Request $request){
|
||||||
|
$data = $request->only('firstname', 'lastname', 'email', 'password', 'account_id');
|
||||||
|
$data['is_verified'] = false;
|
||||||
|
$data['is_suspended'] = false;
|
||||||
|
$client = new Client($data);
|
||||||
|
$client->save();
|
||||||
|
return redirect()->to('/admin/preview/' . $request->account_id . '#users');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ public function toArray($request)
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
'broker_application_id' => $this->id,
|
'broker_application_id' => $this->id,
|
||||||
|
'is_local' => $this->is_local ?? true,
|
||||||
'state' => $this->state,
|
'state' => $this->state,
|
||||||
'accepted_by' => $this->accepted_by,
|
'accepted_by' => $this->accepted_by,
|
||||||
'accepted_date' => $this->accepted_date,
|
'accepted_date' => $this->accepted_date,
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@ class BrokerApplication extends Model
|
||||||
// public $timestamps = false;
|
// public $timestamps = false;
|
||||||
// protected $guarded = ['id'];
|
// protected $guarded = ['id'];
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
'account_id', 'status','state','accepted_by','approved_by'
|
'account_id', 'status','state','accepted_by','approved_by', 'ticket_id', 'is_local'
|
||||||
];
|
];
|
||||||
// protected $hidden = [];
|
// protected $hidden = [];
|
||||||
protected $dates = ['accepted_date','approved_date','created_at','updated_at'];
|
protected $dates = ['accepted_date','approved_date','created_at','updated_at'];
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,8 @@ class Ticket extends Model
|
||||||
'content',
|
'content',
|
||||||
'category_id',
|
'category_id',
|
||||||
'last_sender',
|
'last_sender',
|
||||||
'application_id'
|
'application_id',
|
||||||
|
'broker_application_id'
|
||||||
];
|
];
|
||||||
// protected $hidden = [];
|
// protected $hidden = [];
|
||||||
// protected $dates = [];
|
// protected $dates = [];
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,33 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function up()
|
||||||
|
{
|
||||||
|
Schema::table('broker_applications', function (Blueprint $table) {
|
||||||
|
$table->foreignId('ticket_id')->nullable()->constrained();
|
||||||
|
$table->foreignId('is_local')->nullable()->constrained();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function down()
|
||||||
|
{
|
||||||
|
Schema::table('broker_applications', function (Blueprint $table) {
|
||||||
|
//
|
||||||
|
});
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
@ -77,6 +77,10 @@
|
||||||
|
|
||||||
'draft' => "Draft",
|
'draft' => "Draft",
|
||||||
],
|
],
|
||||||
|
'broker_application' => [
|
||||||
|
'list_title' => 'Broker applications',
|
||||||
|
'is_local' => 'Is local?'
|
||||||
|
],
|
||||||
'dashboard' => [
|
'dashboard' => [
|
||||||
'title' => 'Dashboard',
|
'title' => 'Dashboard',
|
||||||
'total_tickets' => "Total tickets",
|
'total_tickets' => "Total tickets",
|
||||||
|
|
|
||||||
|
|
@ -19,14 +19,14 @@
|
||||||
<nav aria-label="breadcrumb" class="d-none d-lg-block">
|
<nav aria-label="breadcrumb" class="d-none d-lg-block">
|
||||||
<ol class="breadcrumb m-0 mb-3">
|
<ol class="breadcrumb m-0 mb-3">
|
||||||
<li class="breadcrumb-item"><a href="{{backpack_url()}}">@lang('app.dashboard.title')</a></li>
|
<li class="breadcrumb-item"><a href="{{backpack_url()}}">@lang('app.dashboard.title')</a></li>
|
||||||
<li class="breadcrumb-item"><a href="{{backpack_url('application')}}">@lang('app.application.list_title')</a></li>
|
<li class="breadcrumb-item"><a href="{{backpack_url('broker-application')}}">@lang('app.broker_application.list_title')</a></li>
|
||||||
<li class="breadcrumb-item active" aria-current="page">{{ $application->id }}</li>
|
<li class="breadcrumb-item active" aria-current="page">{{ $application->id }}</li>
|
||||||
</ol>
|
</ol>
|
||||||
</nav>
|
</nav>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
@if ($application->state == 'new')
|
@if ($application->state == 'new')
|
||||||
<form class="form-horizontal" action="{{ route('accepted_application',['id'=>$application->id]) }}"
|
<form class="form-horizontal" action="{{ route('accepted_broker_application',['id'=>$application->id]) }}"
|
||||||
method="get">
|
method="get">
|
||||||
@csrf
|
@csrf
|
||||||
<button class="btn btn-primary mb-4" type="submit" data-toggle="modal" data-target="#successModal">
|
<button class="btn btn-primary mb-4" type="submit" data-toggle="modal" data-target="#successModal">
|
||||||
|
|
@ -64,7 +64,7 @@ class="bi bi-check2-square" viewBox="0 0 16 16">
|
||||||
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span
|
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span
|
||||||
aria-hidden="true">×</span></button>
|
aria-hidden="true">×</span></button>
|
||||||
</div>
|
</div>
|
||||||
<form class="form-horizontal" action="{{route('refine_application',['id'=>$application->id])}}"
|
<form class="form-horizontal" action="{{route('refine_broker_application',['id'=>$application->id])}}"
|
||||||
method="post">
|
method="post">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
@ -98,7 +98,7 @@ class="bi bi-check2-square" viewBox="0 0 16 16">
|
||||||
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span
|
<button class="close" type="button" data-dismiss="modal" aria-label="Close"><span
|
||||||
aria-hidden="true">×</span></button>
|
aria-hidden="true">×</span></button>
|
||||||
</div>
|
</div>
|
||||||
<form class="form-horizontal" action="{{route('approve_application',['id'=>$application->id])}}"
|
<form class="form-horizontal" action="{{route('approve_broker_application',['id'=>$application->id])}}"
|
||||||
method="post">
|
method="post">
|
||||||
@csrf
|
@csrf
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
|
|
@ -107,14 +107,14 @@ class="bi bi-check2-square" viewBox="0 0 16 16">
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-sm-5 col-form-label" for="input-normal">{{ trans('app.account.legalization_number') }}</label>
|
<label class="col-sm-5 col-form-label" for="input-normal">{{ trans('app.account.legalization_number') }}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input name="legalization_number" class="form-control" id="input-normal"
|
<input name="broker_number" class="form-control" id="input-normal"
|
||||||
type="text" name="input-normal" placeholder="Normal">
|
type="text" name="input-normal" placeholder="Normal">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group row">
|
<div class="form-group row">
|
||||||
<label class="col-sm-5 col-form-label" for="input-normal">{{ trans('app.account.expires_at') }}</label>
|
<label class="col-sm-5 col-form-label" for="input-normal">{{ trans('app.account.expires_at') }}</label>
|
||||||
<div class="col-sm-6">
|
<div class="col-sm-6">
|
||||||
<input name="expires_at" class="form-control" id="input-normal"
|
<input name="broker_expires_at" class="form-control" id="input-normal"
|
||||||
type="date" name="input-normal" placeholder="Normal">
|
type="date" name="input-normal" placeholder="Normal">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -154,9 +154,9 @@ class="bi bi-ticket-perforated" viewBox="0 0 16 16">
|
||||||
aria-hidden="true">×</span></button>
|
aria-hidden="true">×</span></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<form method="post" action="{{backpack_url('create-application-ticket')}}" method="POST">
|
<form method="post" action="{{backpack_url('create-broker-application-ticket')}}" method="POST">
|
||||||
@csrf
|
@csrf
|
||||||
<input type="hidden" name="application_id" value="{{ $application->id }}">
|
<input type="hidden" name="broker_application_id" value="{{ $application->id }}">
|
||||||
<input type="hidden" name="account_id" value={{ $application->account_id }}>
|
<input type="hidden" name="account_id" value={{ $application->account_id }}>
|
||||||
<input type="hidden" name="status_id" value="1">
|
<input type="hidden" name="status_id" value="1">
|
||||||
<input type="hidden" name="category_id" value="2">
|
<input type="hidden" name="category_id" value="2">
|
||||||
|
|
@ -209,6 +209,10 @@ class="bi bi-ticket-perforated" viewBox="0 0 16 16">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">{{ trans('app.last_updates.application') }}</h5>
|
<h5 class="card-title">{{ trans('app.last_updates.application') }}</h5>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="company"><small>{{ trans('app.broker_application.is_local') }}</small></label>
|
||||||
|
<h6><strong>{{ $application->is_local == true ? trans('app.yes') : trans('app.no') }}</strong></h6>
|
||||||
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="company"><small>{{ trans('app.ticket.status') }}</small></label>
|
<label for="company"><small>{{ trans('app.ticket.status') }}</small></label>
|
||||||
<h6><strong>{{ trans('app.application.'.$application->state) }}</strong></h6>
|
<h6><strong>{{ trans('app.application.'.$application->state) }}</strong></h6>
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,15 @@
|
||||||
<span class="badge badge-pill badge-secondary">{{ count($account->applications) }}</span>
|
<span class="badge badge-pill badge-secondary">{{ count($account->applications) }}</span>
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
|
<li class="nav-item">
|
||||||
|
<a class="nav-link" data-toggle="tab" href="#broker_applications" role="tab" aria-controls="broker_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>
|
||||||
|
{{ trans('app.broker_application.list_title') }}
|
||||||
|
<span class="badge badge-pill badge-secondary">{{ count($account->broker_applications) }}</span>
|
||||||
|
</a>
|
||||||
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<a class="nav-link" data-toggle="tab" href="#users" role="tab" aria-controls="users" aria-selected="false">
|
<a class="nav-link" data-toggle="tab" href="#users" role="tab" aria-controls="users" aria-selected="false">
|
||||||
<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">
|
<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">
|
||||||
|
|
@ -88,6 +97,46 @@
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="tab-pane" id="broker_applications" role="tabpanel">
|
||||||
|
<table class="table table-responsive-sm table-striped mb-0">
|
||||||
|
<thead class="thead-light">
|
||||||
|
<tr>
|
||||||
|
<th>{{ trans('app.ticket.status') }}</th>
|
||||||
|
<th>{{ trans('app.last_updates.state') }}</th>
|
||||||
|
<th>{{ trans('app.application.created_at') }}</th>
|
||||||
|
<th>{{ trans('app.last_updates.actions') }}</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
@foreach ($account->broker_applications as $broker_application)
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
<div>
|
||||||
|
@if($broker_application->status)
|
||||||
|
<div>{{ trans('app.last_updates.closed') }}</div>
|
||||||
|
@else
|
||||||
|
<div>{{ trans('app.last_updates.open') }}</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
{{ $broker_application->state }}
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<div class="small text-muted"></div><strong>{{ trans('app.company.registration_date') }}: {{ Carbon\Carbon::parse($broker_application->created_at)->format('M d Y') }}</strong>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<a class="nav-link p-0" href="{{backpack_url('preview-broker-application')}}/{{ $broker_application->id }}">
|
||||||
|
<svg style="width: 20px" 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="M13.5 6H5.25A2.25 2.25 0 003 8.25v10.5A2.25 2.25 0 005.25 21h10.5A2.25 2.25 0 0018 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25" />
|
||||||
|
</svg>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforeach
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
<div class="tab-pane" id="users" role="tabpanel">
|
<div class="tab-pane" id="users" role="tabpanel">
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<a href="{{backpack_url('create-account-client')}}/{{ $account->id }}" class="btn btn-primary">
|
<a href="{{backpack_url('create-account-client')}}/{{ $account->id }}" class="btn btn-primary">
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,10 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
use App\Http\Controllers\Admin\AccountCrudController;
|
||||||
use App\Http\Controllers\Admin\ApplicationController;
|
use App\Http\Controllers\Admin\ApplicationController;
|
||||||
use App\Http\Controllers\Admin\ApplicationCrudController;
|
use App\Http\Controllers\Admin\ApplicationCrudController;
|
||||||
|
use App\Http\Controllers\Admin\BrokerApplicationCrudController;
|
||||||
|
use App\Http\Controllers\Admin\ClientCrudController;
|
||||||
use App\Http\Controllers\API\ResourceController;
|
use App\Http\Controllers\API\ResourceController;
|
||||||
use App\Http\Controllers\API\TicketController;
|
use App\Http\Controllers\API\TicketController;
|
||||||
use App\Http\Controllers\ExportController;
|
use App\Http\Controllers\ExportController;
|
||||||
|
|
@ -32,8 +35,6 @@
|
||||||
Route::crud('question', 'QuestionCrudController');
|
Route::crud('question', 'QuestionCrudController');
|
||||||
Route::crud('document', 'DocumentCrudController');
|
Route::crud('document', 'DocumentCrudController');
|
||||||
Route::crud('documentgroup', 'DocumentgroupCrudController');
|
Route::crud('documentgroup', 'DocumentgroupCrudController');
|
||||||
// Route::crud('documentgroup-document', 'DocumentgroupDocumentCrudController');
|
|
||||||
// Route::crud('documentgroup-country', 'DocumentgroupCountryCrudController');
|
|
||||||
Route::crud('ticket', 'TicketCrudController');
|
Route::crud('ticket', 'TicketCrudController');
|
||||||
Route::crud('status', 'StatusCrudController');
|
Route::crud('status', 'StatusCrudController');
|
||||||
Route::crud('category', 'CategoryCrudController');
|
Route::crud('category', 'CategoryCrudController');
|
||||||
|
|
@ -41,17 +42,21 @@
|
||||||
Route::post('/post-message-admin',[TicketController::class,'postMessageAdmin']);
|
Route::post('/post-message-admin',[TicketController::class,'postMessageAdmin']);
|
||||||
Route::get('/ticket-messages', [TicketController::class, 'getTicketMessages']);
|
Route::get('/ticket-messages', [TicketController::class, 'getTicketMessages']);
|
||||||
Route::get('/chat', [TicketController::class, 'chat'])->name('chat');
|
Route::get('/chat', [TicketController::class, 'chat'])->name('chat');
|
||||||
Route::get('/preview/{id}', [ResourceController::class, 'previewAccountAdmin']);
|
Route::get('/preview/{id}', [AccountCrudController::class, 'previewAccountAdmin']);
|
||||||
Route::get('/preview-application/{id}',[ResourceController::class, 'previewApplicationAdmin']);
|
Route::get('/preview-application/{id}',[ApplicationCrudController::class, 'previewApplicationAdmin']);
|
||||||
Route::get('/preview-broker-application/{id}',[ResourceController::class, 'previewBrokerApplicationAdmin']);
|
Route::get('/preview-broker-application/{id}',[BrokerApplicationCrudController::class, 'previewBrokerApplicationAdmin']);
|
||||||
Route::get('/export-account-admin/{id}', [ExportController::class, 'export']);
|
Route::get('/export-account-admin/{id}', [ExportController::class, 'export']);
|
||||||
Route::post('/create-application-ticket', [TicketController::class, 'createAppTicket']);
|
Route::post('/create-application-ticket', [TicketController::class, 'createAppTicket']);
|
||||||
Route::get('/create-account-client/{id}', [ResourceController::class, 'createAccountClient']);
|
Route::post('/create-broker-application-ticket', [TicketController::class, 'createBrokerAppTicket']);
|
||||||
Route::post('/client/custom-create', [ResourceController::class, 'createClient']);
|
Route::get('/create-account-client/{id}', [AccountCrudController::class, 'createAccountClient']);
|
||||||
|
Route::post('/client/custom-create', [ClientCrudController::class, 'createClient']);
|
||||||
Route::crud('contract', 'ContractCrudController');
|
Route::crud('contract', 'ContractCrudController');
|
||||||
Route::get('application/accept/{id}', [ApplicationCrudController::class, 'accept'])->name('accepted_application');
|
Route::get('application/accept/{id}', [ApplicationCrudController::class, 'accept'])->name('accepted_application');
|
||||||
|
Route::get('broker_application/accept/{id}', [BrokerApplicationCrudController::class, 'accept'])->name('accepted_broker_application');
|
||||||
Route::post('application/refine/{id}', [ApplicationCrudController::class, 'refine'])->name('refine_application');
|
Route::post('application/refine/{id}', [ApplicationCrudController::class, 'refine'])->name('refine_application');
|
||||||
|
Route::post('broker_application/refine/{id}', [BrokerApplicationCrudController::class, 'refine'])->name('refine_broker_application');
|
||||||
Route::post('application/approve/{id}', [ApplicationCrudController::class, 'approveApplication'])->name('approve_application');
|
Route::post('application/approve/{id}', [ApplicationCrudController::class, 'approveApplication'])->name('approve_application');
|
||||||
|
Route::post('broker_application/approve/{id}', [BrokerApplicationCrudController::class, 'approveApplication'])->name('approve_broker_application');
|
||||||
Route::post('account/fetch', [TicketController::class, 'accountForTicketsAjax']);
|
Route::post('account/fetch', [TicketController::class, 'accountForTicketsAjax']);
|
||||||
Route::crud('department', 'DepartmentCrudController');
|
Route::crud('department', 'DepartmentCrudController');
|
||||||
Route::crud('resolution', 'ResolutionCrudController');
|
Route::crud('resolution', 'ResolutionCrudController');
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue