commit
This commit is contained in:
2025-08-09 04:43:00 +07:00
parent e075da48fd
commit 95bb93afa6
10 changed files with 17014 additions and 563 deletions

117
.idea/blade.xml generated Normal file
View File

@@ -0,0 +1,117 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="BladeInjectionConfiguration" default="false">
<directives>
<data directive="@append" />
<data directive="@auth" injection="true" prefix="&lt;?php&#10;if(auth()-&gt;guard(" suffix=")-&gt;check()): ?&gt;" />
<data directive="@aware" injection="true" prefix="&lt;?php $attributes = $attributes-&gt;exceptProps(" suffix="); ?&gt;" />
<data directive="@break" injection="true" prefix="&lt;?php&#10;if(" suffix=") break; ?&gt;" />
<data directive="@can" injection="true" prefix="&lt;?php&#10;if (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;check(" suffix=")): ?&gt;" />
<data directive="@canany" injection="true" prefix="&lt;?php&#10;if (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;any(" suffix=")): ?&gt;" />
<data directive="@cannot" injection="true" prefix="&lt;?php&#10;if (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;denies(" suffix=")): ?&gt;" />
<data directive="@case" injection="true" prefix="&lt;?php&#10;case (" suffix="): ?&gt;" />
<data directive="@checked" injection="true" prefix="&lt;?php if(" suffix=") {echo 'checked';}?&gt;" />
<data directive="@choice" injection="true" prefix="&lt;?php&#10;echo app('translator')-&gt;choice(" suffix="); ?&gt;" />
<data directive="@class" injection="true" prefix="class=&quot;&lt;?php echo \Illuminate\Support\Arr::toCssClasses(" suffix=")?&gt;&quot;" />
<data directive="@component" injection="true" prefix="&lt;?php&#10;$__env-&gt;startComponent(" suffix="); ?&gt;" />
<data directive="@componentfirst" injection="true" prefix="&lt;?php&#10;$__env-&gt;startComponentFirst(" suffix="); ?&gt;" />
<data directive="@continue" injection="true" prefix="&lt;?php&#10;if(" suffix=") continue; ?&gt;" />
<data directive="@csrf" />
<data directive="@dd" injection="true" prefix="&lt;?php&#10;dd(" suffix="); ?&gt;" />
<data directive="@default" />
<data directive="@disabled" injection="true" prefix="&lt;?php if(" suffix=") {echo 'disabled';}?&gt;" />
<data directive="@dump" injection="true" prefix="&lt;?php&#10;dump(" suffix="); ?&gt;" />
<data directive="@each" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;renderEach(" suffix="); ?&gt;" />
<data directive="@else" />
<data directive="@elseauth" injection="true" prefix="&lt;?php&#10;elseif(auth()-&gt;guard(" suffix=")-&gt;check()): ?&gt;" />
<data directive="@elsecan" injection="true" prefix="&lt;?php&#10;elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;check(" suffix=")): ?&gt;" />
<data directive="@elsecanany" injection="true" prefix="&lt;?php&#10;elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;any(" suffix=")): ?&gt;" />
<data directive="@elsecannot" injection="true" prefix="&lt;?php&#10;elseif (app(\Illuminate\Contracts\Auth\Access\Gate::class)-&gt;denies(" suffix=")): ?&gt;" />
<data directive="@elseguest" injection="true" prefix="&lt;?php&#10;elseif(auth()-&gt;guard(" suffix=")-&gt;guest()): ?&gt;" />
<data directive="@elseif" injection="true" prefix="&lt;?php&#10;elseif(" suffix="): ?&gt;" />
<data directive="@empty" injection="true" prefix="&lt;?php&#10;if(empty(" suffix=")): ?&gt;" />
<data directive="@endauth" />
<data directive="@endcan" />
<data directive="@endcanany" />
<data directive="@endcannot" />
<data directive="@endcomponent" />
<data directive="@endcomponentClass" />
<data directive="@endcomponentfirst" />
<data directive="@endempty" />
<data directive="@endenv" />
<data directive="@enderror" />
<data directive="@endfor" />
<data directive="@endforeach" />
<data directive="@endforelse" />
<data directive="@endfragment" />
<data directive="@endguest" />
<data directive="@endif" />
<data directive="@endisset" />
<data directive="@endlang" />
<data directive="@endonce" />
<data directive="@endphp" />
<data directive="@endprepend" />
<data directive="@endprependonce" />
<data directive="@endproduction" />
<data directive="@endpush" />
<data directive="@endpushif" />
<data directive="@endpushonce" />
<data directive="@endsection" />
<data directive="@endslot" />
<data directive="@endswitch" />
<data directive="@endunless" />
<data directive="@endverbatim" />
<data directive="@endwhile" />
<data directive="@env" injection="true" prefix="&lt;?php&#10;if(app()-&gt;environment(" suffix=")): ?&gt;" />
<data directive="@error" injection="true" prefix="&lt;?php&#10;$__errorArgs = [" suffix="];&#10;$__bag = $errors-&gt;getBag($__errorArgs[1] ?? 'default');&#10;if ($__bag-&gt;has($__errorArgs[0])) :&#10;if (isset($message)) { $__messageOriginal = $message; }&#10;$message = $__bag-&gt;first($__errorArgs[0]); ?&gt;" />
<data directive="@extends" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;make(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))-&gt;render(); ?&gt;" />
<data directive="@extendsfirst" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;first(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))-&gt;render(); ?&gt;" />
<data directive="@for" injection="true" prefix="&lt;?php&#10;for(" suffix="): ?&gt;" />
<data directive="@foreach" injection="true" prefix="&lt;?php&#10;foreach(" suffix="): ?&gt;" />
<data directive="@forelse" injection="true" prefix="&lt;?php&#10;foreach(" suffix="): ?&gt;" />
<data directive="@fragment" injection="true" prefix="&lt;?php&#10;$__env-&gt;startFragment(" suffix="); ?&gt;" />
<data directive="@guest" injection="true" prefix="&lt;?php&#10;if(auth()-&gt;guard(" suffix=")-&gt;guest()): ?&gt;" />
<data directive="@hasSection" injection="true" prefix="&lt;?php&#10;if (! empty(trim($__env-&gt;yieldContent(" suffix=")))): ?&gt;" />
<data directive="@if" injection="true" prefix="&lt;?php&#10;if(" suffix="): ?&gt;" />
<data directive="@include" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;make(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))-&gt;render(); ?&gt;" />
<data directive="@includeFirst" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;first(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))-&gt;render(); ?&gt;" />
<data directive="@includeUnless" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;renderUnless(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?&gt;" />
<data directive="@includeWhen" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;renderWhen(" suffix=", \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path'])); ?&gt;" />
<data directive="@isset" injection="true" prefix="&lt;?php&#10;if(isset(" suffix=")): ?&gt;" />
<data directive="@js" injection="true" prefix="&lt;?php _bladeDirective(" suffix="); ?&gt;" />
<data directive="@json" injection="true" prefix="&lt;?php&#10;echo json_encode(" suffix=") ?&gt;" />
<data directive="@lang" injection="true" prefix="&lt;?php&#10;echo app('translator')-&gt;get(" suffix="); ?&gt;" />
<data directive="@method" injection="true" prefix="&lt;?php&#10;echo method_field(" suffix="); ?&gt;" />
<data directive="@once" />
<data directive="@overwrite" />
<data directive="@parent" />
<data directive="@php" injection="true" prefix="&lt;?php&#10;(" suffix="); ?&gt;" />
<data directive="@prepend" injection="true" prefix="&lt;?php&#10;$__env-&gt;startPrepend(" suffix="); ?&gt;" />
<data directive="@prependonce" injection="true" prefix="&lt;?php&#10;$___phpstorm_prepend_once_params = [" suffix="]; if (! $__env-&gt;hasRenderedOnce($___phpstorm_prepend_once_params[1])): $__env-&gt;markAsRenderedOnce($___phpstorm_prepend_once_params); $__env-&gt;startPrepend($___phpstorm_prepend_once_params[0]); ?&gt;" />
<data directive="@production" />
<data directive="@props" injection="true" prefix="&lt;?php $attributes = $attributes-&gt;exceptProps(" suffix="); ?&gt;" />
<data directive="@push" injection="true" prefix="&lt;?php&#10;$__env-&gt;startPush(" suffix="); ?&gt;" />
<data directive="@pushif" injection="true" prefix="&lt;?php&#10;$__pushif_args = explode(','," suffix=", 2); if({$__pushif_args[0]}): $__env-&gt;startPush({$__pushif_args[1]}); ?&gt;" />
<data directive="@pushonce" injection="true" prefix="&lt;?php&#10;$__php_storm_push_once_params = [" suffix="]; if (!$__env-&gt;hasRenderedOnce($__php_storm_push_once_params[1])): $__env-&gt;markAsRenderedOnce($__php_storm_push_once_params[1]); $__env-&gt;startPush($__php_storm_push_once_params[0]); ?&gt;" />
<data directive="@readonly" injection="true" prefix="&lt;?php&#10;if(" suffix="): echo 'readonly'; endif; ?&gt;" />
<data directive="@required" injection="true" prefix="&lt;?php&#10;if(" suffix="): echo 'required'; endif; ?&gt;" />
<data directive="@section" injection="true" prefix="&lt;?php&#10;$__env-&gt;startSection(" suffix="); ?&gt;" />
<data directive="@sectionMissing" injection="true" prefix="&lt;?php&#10;if (empty(trim($__env-&gt;yieldContent(" suffix=")))): ?&gt;" />
<data directive="@selected" injection="true" prefix="&lt;?php if(" suffix=") {echo 'selected';}?&gt;" />
<data directive="@show" />
<data directive="@slot" injection="true" prefix="&lt;?php&#10;$__env-&gt;slot(" suffix="); ?&gt;" />
<data directive="@stack" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;yieldPushContent(" suffix="); ?&gt;" />
<data directive="@stop" />
<data directive="@style" injection="true" prefix="class=&quot;&lt;?php echo \Illuminate\Support\Arr::toCssStyles(" suffix=")?&gt;&quot;" />
<data directive="@switch" injection="true" prefix="&lt;?php&#10;switch(" suffix="): ?&gt;" />
<data directive="@unless" injection="true" prefix="&lt;?php&#10;if (! (" suffix=")): ?&gt;" />
<data directive="@unset" injection="true" prefix="&lt;?php&#10;unset(" suffix="); ?&gt;" />
<data directive="@verbatim" />
<data directive="@vite" injection="true" prefix="&lt;?php echo vite_func(" suffix="); ?&gt;" />
<data directive="@viteReactRefresh" />
<data directive="@vitereactrefresh" />
<data directive="@while" injection="true" prefix="&lt;?php&#10;while(" suffix="): ?&gt;" />
<data directive="@yield" injection="true" prefix="&lt;?php&#10;echo $__env-&gt;yieldContent(" suffix="); ?&gt;" />
</directives>
</component>
</project>

5
.idea/community.iml generated
View File

@@ -5,6 +5,7 @@
<sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" /> <sourceFolder url="file://$MODULE_DIR$/app" isTestSource="false" packagePrefix="App\" />
<sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/spec" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="false" packagePrefix="Tests\" /> <sourceFolder url="file://$MODULE_DIR$/tests" isTestSource="false" packagePrefix="Tests\" />
<sourceFolder url="file://$MODULE_DIR$/tests/Unit" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/vendor/composer" /> <excludeFolder url="file://$MODULE_DIR$/vendor/composer" />
<excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" /> <excludeFolder url="file://$MODULE_DIR$/vendor/graham-campbell/result-type" />
<excludeFolder url="file://$MODULE_DIR$/vendor/laravelcollective/html" /> <excludeFolder url="file://$MODULE_DIR$/vendor/laravelcollective/html" />
@@ -168,6 +169,10 @@
<excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" /> <excludeFolder url="file://$MODULE_DIR$/vendor/psr/container" />
<excludeFolder url="file://$MODULE_DIR$/vendor/aws/aws-crt-php" /> <excludeFolder url="file://$MODULE_DIR$/vendor/aws/aws-crt-php" />
<excludeFolder url="file://$MODULE_DIR$/vendor/aws/aws-sdk-php" /> <excludeFolder url="file://$MODULE_DIR$/vendor/aws/aws-sdk-php" />
<excludeFolder url="file://$MODULE_DIR$/storage/app" />
<excludeFolder url="file://$MODULE_DIR$/storage/clockwork" />
<excludeFolder url="file://$MODULE_DIR$/storage/debugbar" />
<excludeFolder url="file://$MODULE_DIR$/storage/framework" />
</content> </content>
<orderEntry type="inheritedJdk" /> <orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />

25
.idea/laravel-idea.xml generated Normal file
View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="InertiaPackage">
<option name="directoryPaths">
<list />
</option>
</component>
<component name="LaravelIdeaMainSettings">
<option name="codeGeneration">
<LaravelCodeGeneration>
<option name="generationStringSettings">
<map>
<entry key="createFormRequest:baseClass" value="App\Http\Requests\Request" />
</map>
</option>
</LaravelCodeGeneration>
</option>
<option name="frameworkFound" value="true" />
<option name="translation">
<LaravelTranslation>
<option name="defaultPath" value="lang" />
</LaravelTranslation>
</option>
</component>
</project>

47
.idea/php.xml generated
View File

@@ -1,5 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<project version="4"> <project version="4">
<component name="MessDetectorOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCSFixerOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PHPCodeSnifferOptionsConfiguration">
<option name="highlightLevel" value="WARNING" />
<option name="transferred" value="true" />
</component>
<component name="PhpIncludePathManager"> <component name="PhpIncludePathManager">
<include_path> <include_path>
<path value="$PROJECT_DIR$/vendor/composer" /> <path value="$PROJECT_DIR$/vendor/composer" />
@@ -165,12 +175,47 @@
<path value="$PROJECT_DIR$/vendor/psr/container" /> <path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/aws/aws-crt-php" /> <path value="$PROJECT_DIR$/vendor/aws/aws-crt-php" />
<path value="$PROJECT_DIR$/vendor/aws/aws-sdk-php" /> <path value="$PROJECT_DIR$/vendor/aws/aws-sdk-php" />
<path value="$PROJECT_DIR$/vendor/chumper/zipper" />
<path value="$PROJECT_DIR$/vendor/chumper/datatable" />
<path value="$PROJECT_DIR$/vendor/sly/notification-pusher" />
<path value="$PROJECT_DIR$/vendor/brozot/laravel-fcm" />
<path value="$PROJECT_DIR$/vendor/guzzlehttp/uri-template" />
<path value="$PROJECT_DIR$/vendor/unisharp/laravel-ckeditor" />
<path value="$PROJECT_DIR$/vendor/itsgoingd/clockwork" />
<path value="$PROJECT_DIR$/vendor/sabberworm/php-css-parser" />
<path value="$PROJECT_DIR$/vendor/zendframework/zend-hydrator" />
<path value="$PROJECT_DIR$/vendor/zendframework/zendservice-apple-apns" />
<path value="$PROJECT_DIR$/vendor/zendframework/zend-validator" />
<path value="$PROJECT_DIR$/vendor/zendframework/zend-json" />
<path value="$PROJECT_DIR$/vendor/zendframework/zend-stdlib" />
<path value="$PROJECT_DIR$/vendor/zendframework/zend-uri" />
<path value="$PROJECT_DIR$/vendor/zendframework/zend-escaper" />
<path value="$PROJECT_DIR$/vendor/zendframework/zend-loader" />
<path value="$PROJECT_DIR$/vendor/zendframework/zendservice-google-gcm" />
<path value="$PROJECT_DIR$/vendor/zendframework/zend-http" />
<path value="$PROJECT_DIR$/vendor/beyondcode/laravel-query-detector" />
<path value="$PROJECT_DIR$/vendor/laravel/pint" />
<path value="$PROJECT_DIR$/vendor/phenx/php-svg-lib" />
<path value="$PROJECT_DIR$/vendor/thomaswelton/gravatarlib" />
<path value="$PROJECT_DIR$/vendor/thomaswelton/laravel-gravatar" />
<path value="$PROJECT_DIR$/vendor/davibennun/laravel-push-notification" />
<path value="$PROJECT_DIR$/vendor/symfony/http-client" />
<path value="$PROJECT_DIR$/vendor/symfony/http-client-contracts" />
<path value="$PROJECT_DIR$/vendor/symfony/mailgun-mailer" />
<path value="$PROJECT_DIR$/vendor/symfony/options-resolver" />
</include_path> </include_path>
</component> </component>
<component name="PhpProjectSharedConfiguration" php_language_level="7.2" /> <component name="PhpProjectSharedConfiguration" php_language_level="8.0" />
<component name="PhpStanOptionsConfiguration">
<option name="transferred" value="true" />
</component>
<component name="PhpUnit"> <component name="PhpUnit">
<phpunit_settings> <phpunit_settings>
<PhpUnitSettings custom_loader_path="$PROJECT_DIR$/public/vendor/autoload.php" />
<PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" /> <PhpUnitSettings configuration_file_path="$PROJECT_DIR$/phpunit.xml" custom_loader_path="$PROJECT_DIR$/vendor/autoload.php" use_configuration_file="true" />
</phpunit_settings> </phpunit_settings>
</component> </component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project> </project>

1
.idea/phpunit.xml generated
View File

@@ -4,6 +4,7 @@
<option name="directories"> <option name="directories">
<list> <list>
<option value="$PROJECT_DIR$/tests" /> <option value="$PROJECT_DIR$/tests" />
<option value="$PROJECT_DIR$/tests/Unit" />
</list> </list>
</option> </option>
</component> </component>

View File

@@ -7,6 +7,7 @@ use App\Http\Controllers\Controller;
// models // models
use App\Model\helpdesk\Priority; use App\Model\helpdesk\Priority;
use App\Model\helpdesk\Ticket_Thread; use App\Model\helpdesk\Ticket_Thread;
use App\Model\helpdesk\Agent\Location;
// classes // classes
use Exception; use Exception;

View File

@@ -83,15 +83,15 @@ class UserController extends Controller
/* get all values in Sys_user */ /* get all values in Sys_user */
$table = \Datatable::table() $table = \Datatable::table()
->addColumn( ->addColumn(
Lang::get('lang.name'), Lang::get('lang.name'),
Lang::get('lang.email'), Lang::get('lang.email'),
Lang::get('lang.phone'), Lang::get('lang.phone'),
Lang::get('lang.status'), Lang::get('lang.status'),
Lang::get('lang.last_login'), Lang::get('lang.last_login'),
Lang::get('lang.role'), Lang::get('lang.role'),
Lang::get('lang.action') Lang::get('lang.action')
) // these are the column headings to be shown ) // these are the column headings to be shown
->noScript(); ->noScript();
return view('themes.default1.agent.helpdesk.user.index', compact('table')); return view('themes.default1.agent.helpdesk.user.index', compact('table'));
@@ -141,100 +141,100 @@ class UserController extends Controller
if ($search !== '') { if ($search !== '') {
$users = $users->where(function ($query) use ($search) { $users = $users->where(function ($query) use ($search) {
$query->where('user_name', 'LIKE', '%'.$search.'%'); $query->where('user_name', 'LIKE', '%' . $search . '%');
$query->orWhere('email', 'LIKE', '%'.$search.'%'); $query->orWhere('email', 'LIKE', '%' . $search . '%');
$query->orWhere('first_name', 'LIKE', '%'.$search.'%'); $query->orWhere('first_name', 'LIKE', '%' . $search . '%');
$query->orWhere('last_name', 'LIKE', '%'.$search.'%'); $query->orWhere('last_name', 'LIKE', '%' . $search . '%');
$query->orWhere('mobile', 'LIKE', '%'.$search.'%'); $query->orWhere('mobile', 'LIKE', '%' . $search . '%');
$query->orWhere('updated_at', 'LIKE', '%'.$search.'%'); $query->orWhere('updated_at', 'LIKE', '%' . $search . '%');
$query->orWhere('country_code', 'LIKE', '%'.$search.'%'); $query->orWhere('country_code', 'LIKE', '%' . $search . '%');
}); });
} }
// displaying list of users with chumper datatables // displaying list of users with chumper datatables
// return \Datatable::collection(User::where('role', "!=", "admin")->get()) // return \Datatable::collection(User::where('role', "!=", "admin")->get())
return \Yajra\DataTables\Facades\DataTables::of($users) return \Yajra\DataTables\Facades\DataTables::of($users)
/* column username */ /* column username */
->removeColumn('id', 'last_name', 'country_code', 'phone_number') ->removeColumn('id', 'last_name', 'country_code', 'phone_number')
->addColumn('user_name', function ($model) { ->addColumn('user_name', function ($model) {
if ($model->first_name) { if ($model->first_name) {
$string = strip_tags($model->first_name.' '.$model->last_name); $string = strip_tags($model->first_name . ' ' . $model->last_name);
} else { } else {
$string = strip_tags($model->user_name); $string = strip_tags($model->user_name);
} }
if (strlen($string) > 30) { if (strlen($string) > 30) {
// truncate string // truncate string
$stringCut = mb_substr($string, 0, 30, 'UTF-8').'...'; $stringCut = mb_substr($string, 0, 30, 'UTF-8') . '...';
} else { } else {
$stringCut = $string; $stringCut = $string;
} }
return "<a href='".route('user.show', $model->id)."' title='".$string."''>".$stringCut.'</a>'; return "<a href='" . route('user.show', $model->id) . "' title='" . $string . "''>" . $stringCut . '</a>';
}) })
/* column email */ /* column email */
->addColumn('email', function ($model) { ->addColumn('email', function ($model) {
$email = "<a href='".route('user.show', $model->id)."'>".e($model->email).'</a>'; $email = "<a href='" . route('user.show', $model->id) . "'>" . e($model->email) . '</a>';
return $email; return $email;
}) })
/* column phone */ /* column phone */
->addColumn('mobile', function ($model) { ->addColumn('mobile', function ($model) {
$phone = ''; $phone = '';
if ($model->phone_number) { if ($model->phone_number) {
$phone = htmlspecialchars($model->ext.' '.$model->phone_number, ENT_QUOTES, 'UTF-8'); $phone = htmlspecialchars($model->ext . ' ' . $model->phone_number, ENT_QUOTES, 'UTF-8');
} }
$mobile = ''; $mobile = '';
if ($model->mobile) { if ($model->mobile) {
$mobile = htmlspecialchars($model->mobile, ENT_QUOTES, 'UTF-8'); $mobile = htmlspecialchars($model->mobile, ENT_QUOTES, 'UTF-8');
} }
$phone = $phone.'&nbsp;&nbsp;&nbsp;'.$mobile; $phone = $phone . '&nbsp;&nbsp;&nbsp;' . $mobile;
return $phone; return $phone;
}) })
/* column account status */ /* column account status */
->addColumn('active', function ($model) { ->addColumn('active', function ($model) {
$status = $model->active; $status = $model->active;
if ($status == 1) { if ($status == 1) {
$stat = '<button class="btn btn-success btn-xs">Active</button>'; $stat = '<button class="btn btn-success btn-xs">Active</button>';
} else { } else {
$stat = '<button class="btn btn-danger btn-xs">Inactive</button>'; $stat = '<button class="btn btn-danger btn-xs">Inactive</button>';
} }
return $stat; return $stat;
}) })
/* column last login date */ /* column last login date */
->addColumn('updated_at', function ($model) { ->addColumn('updated_at', function ($model) {
$t = $model->updated_at; $t = $model->updated_at;
return TicketController::usertimezone($t); return TicketController::usertimezone($t);
}) })
/* column Role */ /* column Role */
->addColumn('role', function ($model) { ->addColumn('role', function ($model) {
$role = $model->role; $role = $model->role;
return $role; return $role;
}) })
/* column actions */ /* column actions */
->addColumn('Actions', function ($model) { ->addColumn('Actions', function ($model) {
if ($model->is_delete == 0) { if ($model->is_delete == 0) {
return '<a href="'.route('user.edit', $model->id).'" class="btn btn-warning btn-xs">'.\Lang::get('lang.edit').'</a>&nbsp; <a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>'; return '<a href="' . route('user.edit', $model->id) . '" class="btn btn-warning btn-xs">' . \Lang::get('lang.edit') . '</a>&nbsp; <a href="' . route('user.show', $model->id) . '" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>';
} else { } else {
if (Auth::user()->role == 'admin') { if (Auth::user()->role == 'admin') {
// @if(Auth::user()->role == 'admin') // @if(Auth::user()->role == 'admin')
return '<a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>'; return '<a href="' . route('user.show', $model->id) . '" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>';
} }
if (Auth::user()->role == 'agent') { if (Auth::user()->role == 'agent') {
// @if(Auth::user()->role == 'admin') // @if(Auth::user()->role == 'admin')
if ($model->role == 'user') { if ($model->role == 'user') {
return '<a href="'.route('user.show', $model->id).'" class="btn btn-primary btn-xs">'.\Lang::get('lang.view').'</a>'; return '<a href="' . route('user.show', $model->id) . '" class="btn btn-primary btn-xs">' . \Lang::get('lang.view') . '</a>';
} }
} }
} }
}) })
->rawColumns(['user_name', 'email', 'mobile', 'active', 'updated_at', 'role', 'Actions']) ->rawColumns(['user_name', 'email', 'mobile', 'active', 'updated_at', 'role', 'Actions'])
->make(); ->make();
} }
public function restoreUser($id) public function restoreUser($id)
@@ -341,7 +341,7 @@ class UserController extends Controller
return redirect('user')->with('success', Lang::get('lang.User-Created-Successfully')); return redirect('user')->with('success', Lang::get('lang.User-Created-Successfully'));
} }
// $user->save(); // $user->save();
/* redirect to Index page with Success Message */ /* redirect to Index page with Success Message */
return redirect('user')->with('success', Lang::get('lang.User-Created-Successfully')); return redirect('user')->with('success', Lang::get('lang.User-Created-Successfully'));
} catch (Exception $e) { } catch (Exception $e) {
@@ -396,7 +396,7 @@ class UserController extends Controller
$email = $user->email; $email = $user->email;
$this->PhpMailController->sendmail($from = $this->PhpMailController $this->PhpMailController->sendmail($from = $this->PhpMailController
->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => null, 'scenario' => 'reset_new_password'], $template_variables = ['user' => $name, 'user_password' => $password]); ->mailfrom('1', '0'), $to = ['name' => $name, 'email' => $email], $message = ['subject' => null, 'scenario' => 'reset_new_password'], $template_variables = ['user' => $name, 'user_password' => $password]);
return redirect('user')->with('success', Lang::get('lang.password_change_successfully')); return redirect('user')->with('success', Lang::get('lang.password_change_successfully'));
} catch (Exception $e) { } catch (Exception $e) {
@@ -535,7 +535,7 @@ class UserController extends Controller
$ticket->assigned_to = $assign_to[1]; $ticket->assigned_to = $assign_to[1];
$user_detail = User::where('id', '=', $assign_to[1])->first(); $user_detail = User::where('id', '=', $assign_to[1])->first();
$assignee = $user_detail->first_name.' '.$user_detail->last_name; $assignee = $user_detail->first_name . ' ' . $user_detail->last_name;
$ticket_number = $ticket->ticket_number; $ticket_number = $ticket->ticket_number;
$ticket->save(); $ticket->save();
@@ -543,7 +543,7 @@ class UserController extends Controller
$thread->ticket_id = $ticket->id; $thread->ticket_id = $ticket->id;
$thread->user_id = Auth::user()->id; $thread->user_id = Auth::user()->id;
$thread->is_internal = 1; $thread->is_internal = 1;
$thread->body = 'This Ticket has been assigned to '.$assignee; $thread->body = 'This Ticket has been assigned to ' . $assignee;
$thread->save(); $thread->save();
} }
$user = User::find($id); $user = User::find($id);
@@ -646,6 +646,7 @@ class UserController extends Controller
// dd('here'); // dd('here');
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first(); $settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first(); $email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
$departments = Department::all();
$user = new User(); $user = new User();
/* select the field where id = $id(request Id) */ /* select the field where id = $id(request Id) */
@@ -659,7 +660,7 @@ class UserController extends Controller
// $org_name=Organization::where('id','=',$org_id)->pluck('name')->first(); // $org_name=Organization::where('id','=',$org_id)->pluck('name')->first();
// dd($org_name); // dd($org_name);
return view('themes.default1.agent.helpdesk.user.edit', compact('users', 'orgs', 'settings', 'email_mandatory', 'organization_id'))->with('phonecode', $phonecode->phonecode); return view('themes.default1.agent.helpdesk.user.edit', compact('users', 'orgs', 'settings', 'email_mandatory', 'organization_id', 'departments'))->with('phonecode', $phonecode->phonecode);
} catch (Exception $e) { } catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage()); return redirect()->back()->with('fails', $e->getMessage());
} }
@@ -740,11 +741,11 @@ class UserController extends Controller
$status = $settings->status; $status = $settings->status;
$departments = Department::all(); $departments = Department::all();
try { try {
return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user', 'departments')) return view('themes.default1.agent.helpdesk.user.profile-edit', compact('user', 'departments'))
->with([ ->with([
'phonecode' => $phonecode->phonecode, 'phonecode' => $phonecode->phonecode,
'verify' => $status, 'verify' => $status,
]); ]);
} catch (Exception $e) { } catch (Exception $e) {
return redirect()->back()->with('fails', $e->getMessage()); return redirect()->back()->with('fails', $e->getMessage());
} }
@@ -783,7 +784,7 @@ class UserController extends Controller
// fetching upload destination path // fetching upload destination path
$destinationPath = 'uploads/profilepic'; $destinationPath = 'uploads/profilepic';
// adding a random value to profile picture filename // adding a random value to profile picture filename
$fileName = rand(0000, 9999).'.'.str_replace(' ', '_', $name); $fileName = rand(0000, 9999) . '.' . str_replace(' ', '_', $name);
// moving the picture to a destination folder // moving the picture to a destination folder
Input::file('profile_pic')->move($destinationPath, $fileName); Input::file('profile_pic')->move($destinationPath, $fileName);
// saving filename to database // saving filename to database
@@ -997,13 +998,13 @@ class UserController extends Controller
$date = $request->input('date'); $date = $request->input('date');
$date = str_replace(' ', '', $date); $date = str_replace(' ', '', $date);
$date_array = explode(':', $date); $date_array = explode(':', $date);
$first = $date_array[0].' 00:00:00'; $first = $date_array[0] . ' 00:00:00';
$second = $date_array[1].' 23:59:59'; $second = $date_array[1] . ' 23:59:59';
$first_date = $this->convertDate($first); $first_date = $this->convertDate($first);
$second_date = $this->convertDate($second); $second_date = $this->convertDate($second);
$users = $this->getUsers($first_date, $second_date); $users = $this->getUsers($first_date, $second_date);
$excel_controller = new \App\Http\Controllers\Common\ExcelController(); $excel_controller = new \App\Http\Controllers\Common\ExcelController();
$filename = 'users'.$date; $filename = 'users' . $date;
return $excel_controller->export($filename, $users); return $excel_controller->export($filename, $users);
} catch (Exception $ex) { } catch (Exception $ex) {
@@ -1022,13 +1023,13 @@ class UserController extends Controller
{ {
$user = new User(); $user = new User();
$users = $user->leftJoin('user_assign_organization', 'users.id', '=', 'user_assign_organization.user_id') $users = $user->leftJoin('user_assign_organization', 'users.id', '=', 'user_assign_organization.user_id')
->leftJoin('organization', 'user_assign_organization.org_id', '=', 'organization.id') ->leftJoin('organization', 'user_assign_organization.org_id', '=', 'organization.id')
->whereBetween('users.created_at', [$first, $last]) ->whereBetween('users.created_at', [$first, $last])
->where('role', 'user') ->where('role', 'user')
->where('active', 1) ->where('active', 1)
->select('users.user_name as Username', 'users.email as Email', 'users.first_name as Fisrtname', 'users.last_name as Lastname', 'organization.name as Organization') ->select('users.user_name as Username', 'users.email as Email', 'users.first_name as Fisrtname', 'users.last_name as Lastname', 'organization.name as Organization')
->get() ->get()
->toArray(); ->toArray();
return $users; return $users;
} }
@@ -1052,7 +1053,7 @@ class UserController extends Controller
// dd(Input::all()); // dd(Input::all());
// $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email'))->first(); // $user = User::select('id', 'mobile', 'user_name')->where('email', '=', $request->input('email'))->first();
$otp = Otp::select('otp', 'updated_at')->where('user_id', '=', Input::get('u_id')) $otp = Otp::select('otp', 'updated_at')->where('user_id', '=', Input::get('u_id'))
->first(); ->first();
if ($otp != null) { if ($otp != null) {
$otp_length = strlen(Input::get('otp')); $otp_length = strlen(Input::get('otp'));
if ($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp'))) { if ($otp_length == 6 && !preg_match('/[a-z]/i', Input::get('otp'))) {
@@ -1069,7 +1070,7 @@ class UserController extends Controller
} else { } else {
if (Hash::check(Input::get('otp'), $otp->otp)) { if (Hash::check(Input::get('otp'), $otp->otp)) {
Otp::where('user_id', '=', Input::get('u_id')) Otp::where('user_id', '=', Input::get('u_id'))
->update(['otp' => '']); ->update(['otp' => '']);
// User::where('id', '=', $user->id) // User::where('id', '=', $user->id)
// ->update(['active' => 1]); // ->update(['active' => 1]);
@@ -1097,7 +1098,7 @@ class UserController extends Controller
{ {
$users = User::where('role', '<>', 'user')->where('active', '=', 1)->orderBy('first_name')->get(); $users = User::where('role', '<>', 'user')->where('active', '=', 1)->orderBy('first_name')->get();
foreach ($users as $user) { foreach ($users as $user) {
echo "<option value='user_$user->id'>".$user->name().'</option>'; echo "<option value='user_$user->id'>" . $user->name() . '</option>';
} }
} }
} }

16202
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -2,211 +2,234 @@
@section('Users') @section('Users')
class="nav-link active" class="nav-link active"
@stop @stop
@section('user-bar') @section('user-bar')
class="nav-link active" class="nav-link active"
@stop @stop
@section('user') @section('user')
class="active" class="active"
@stop @stop
@section('user-directory') @section('user-directory')
class="nav-link active" class="nav-link active"
@stop @stop
<!-- header --> <!-- header -->
@section('PageHeader') @section('PageHeader')
<h1>{!! Lang::get('lang.edit_user') !!}</h1> <h1>{!! Lang::get('lang.edit_user') !!}</h1>
@stop @stop
<!-- /header --> <!-- /header -->
<!-- content --> <!-- content -->
@section('content') @section('content')
@if(Session::has('fails')) @if (Session::has('fails'))
<div class="alert alert-danger alert-dismissable"> <div class="alert alert-danger alert-dismissable">
<i class="fas fa-ban"></i> <i class="fas fa-ban"></i>
<b>{!! Lang::get('lang.alert') !!}!</b> <b>{!! Lang::get('lang.alert') !!}!</b>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{Session::get('fails')}} {{ Session::get('fails') }}
</div> </div>
@endif
gfggggdgd
@if(Session::has('errors'))
<div class="alert alert-danger alert-dismissable">
<i class="fas fa-ban"></i>
<b>{!! Lang::get('lang.alert') !!}!</b>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<br/>
@if($errors->first('first_name'))
<li class="error-message-padding">{!! $errors->first('first_name', ':message') !!}</li>
@endif
@if($errors->first('last_name'))
<li class="error-message-padding">{!! $errors->first('last_name', ':message') !!}</li>
@endif
@if($errors->first('user_name'))
<li class="error-message-padding">{!! $errors->first('user_name', ':message') !!}</li>
@endif
@if($errors->first('email'))
<li class="error-message-padding">{!! $errors->first('email', ':message') !!}</li>
@endif
@if($errors->first('mobile'))
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
@endif
@if($errors->first('ext'))
<li class="error-message-padding">{!! $errors->first('ext', ':message') !!}</li>
@endif
@if($errors->first('phone_number'))
<li class="error-message-padding">{!! $errors->first('phone_number', ':message') !!}</li>
@endif
@if($errors->first('active'))
<li class="error-message-padding">{!! $errors->first('active', ':message') !!}</li>
@endif
</div>
@endif @endif
<!-- open a form -->
{!! Form::model($users,['url'=>'user/'.$users->id,'method'=>'PATCH']) !!}
<div class="card card-light">
<div class="card-header">
<h3 class="card-title">
{!! Lang::get('lang.user_credentials') !!}
</h3>
</div>
<div class="card-body">
<div class="row">
<!-- First name : first name : Required -->
<div class="col-sm-4 form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
{!! Form::label('first_name',Lang::get('lang.first_name')) !!}<span class="text-red"> *</span>
{!! Form::text('first_name',null,['class' => 'form-control']) !!}
</div>
<!-- Last name : last name : Required -->
<div class="col-sm-4 form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
{!! Form::label('last_name',Lang::get('lang.last_name')) !!}
{!! Form::text('last_name',null,['class' => 'form-control']) !!}
</div>
<!-- User Name : Text : Required-->
<div class="col-sm-4 form-group {{ $errors->has('user_name') ? 'has-error' : '' }}">
{!! Form::label('user_name',Lang::get('lang.user_name')) !!}<span class="text-red"> *</span>
{!! Form::text('user_name',null,['class' => 'form-control']) !!}
</div>
</div>
<div class="row">
<!-- Email Address : Email : Required -->
<div class="col-sm-6 form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{!! Form::label('email',Lang::get('lang.email')) !!}<span class="text-red"> *</span>
{!! Form::email('email',null,['class' => 'form-control']) !!}
</div>
<div class="col-sm-6 form-group {{ $errors->has('organization') ? 'has-error' : '' }}">
{!! Form::label('organization',Lang::get('lang.organization')) !!}
<select class="form-control" name="org_id"> @if (Session::has('errors'))
@foreach($orgs as $org) <div class="alert alert-danger alert-dismissable">
<option value="{!! $org->id !!}" <?php <i class="fas fa-ban"></i>
if ($org->id==$organization_id) { <b>{!! Lang::get('lang.alert') !!}!</b>
echo 'selected'; <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
} <br />
?> >{!! $org->name !!}</option> @if ($errors->first('first_name'))
@endforeach <li class="error-message-padding">{!! $errors->first('first_name', ':message') !!}</li>
</select> @endif
@if ($errors->first('last_name'))
</div> <li class="error-message-padding">{!! $errors->first('last_name', ':message') !!}</li>
@endif
@if ($errors->first('user_name'))
<li class="error-message-padding">{!! $errors->first('user_name', ':message') !!}</li>
@endif
@if ($errors->first('email'))
<li class="error-message-padding">{!! $errors->first('email', ':message') !!}</li>
@endif
@if ($errors->first('mobile'))
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
@endif
@if ($errors->first('ext'))
<li class="error-message-padding">{!! $errors->first('ext', ':message') !!}</li>
@endif
@if ($errors->first('phone_number'))
<li class="error-message-padding">{!! $errors->first('phone_number', ':message') !!}</li>
@endif
@if ($errors->first('active'))
<li class="error-message-padding">{!! $errors->first('active', ':message') !!}</li>
@endif
</div> </div>
<div class="row"> @endif
<div class="col-sm-1 form-group {{ Session::has('country_code_error') ? 'has-error' : '' }}"> <!-- open a form -->
{!! Form::label('country_code',Lang::get('lang.country-code')) !!} {!! Form::model($users, ['url' => 'user/' . $users->id, 'method' => 'PATCH']) !!}
{!! $errors->first('country_code', '<spam class="help-block">:message</spam>') !!} <div class="card card-light">
{!! Form::text('country_code',null,['class' => 'form-control', 'placeholder' => $phonecode, 'title' => Lang::get('lang.enter-country-phone-code')]) !!} <div class="card-header">
<h3 class="card-title">
{!! Lang::get('lang.user_credentials') !!}
</h3>
</div>
<div class="card-body">
<div class="row">
<!-- First name : first name : Required -->
<div class="col-sm-4 form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
{!! Form::label('first_name', Lang::get('lang.first_name')) !!}<span class="text-red"> *</span>
{!! Form::text('first_name', null, ['class' => 'form-control']) !!}
</div>
<!-- Last name : last name : Required -->
<div class="col-sm-4 form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
{!! Form::label('last_name', Lang::get('lang.last_name')) !!}
{!! Form::text('last_name', null, ['class' => 'form-control']) !!}
</div>
<!-- User Name : Text : Required-->
<div class="col-sm-4 form-group {{ $errors->has('user_name') ? 'has-error' : '' }}">
{!! Form::label('user_name', Lang::get('lang.user_name')) !!}<span class="text-red"> *</span>
{!! Form::text('user_name', null, ['class' => 'form-control']) !!}
</div>
</div> </div>
<!-- mobile Number : Text : --> <div class="row">
<div class="col-md-3 form-group {{ $errors->has('mobile') ? 'has-error' : '' }}"> <!-- Email Address : Email : Required -->
{!! Form::label('mobile',Lang::get('lang.mobile')) !!} <div class="col-sm-4 form-group {{ $errors->has('email') ? 'has-error' : '' }}">
{!! Form::input('number', 'mobile',null,['class' => 'form-control']) !!} {!! Form::label('email', Lang::get('lang.email')) !!}<span class="text-red"> *</span>
</div> {!! Form::email('email', null, ['class' => 'form-control']) !!}
<div class="col-sm-1 form-group {{ $errors->has('ext') ? 'has-error' : '' }}"> </div>
<label for="ext">{!! Lang::get('lang.ext') !!}</label>
{!! Form::text('ext',null,['class' => 'form-control']) !!}
<div class="col-sm-4 form-group {{ $errors->has('organization') ? 'has-error' : '' }}">
{!! Form::label('organization', Lang::get('lang.organization')) !!}
<select class="form-control" name="org_id">
@foreach ($orgs as $org)
<option value="{!! $org->id !!}" <?php
if ($org->id == $organization_id) {
echo 'selected';
}
?>>{!! $org->name !!}</option>
@endforeach
</select>
</div>
<div class="col-sm-4 form-group {{ $errors->has('dept_id') ? 'has-error' : '' }}">
{!! Form::label('dept_id', 'Phòng ban') !!}
<select class="form-control" name="dept_id" id="dept_id" required>
<option value="">-- Chọn phòng ban --</option>
@foreach ($departments as $department)
<option value="{{ $department->id }}"
{{ isset($users) && $users->department && $users->department->id == $department->id ? 'selected' : '' }}>
{{ $department->name }}
</option>
@endforeach
</select>
</div>
</div> </div>
<div class="col-sm-3 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}">
<label for="phone_number">{!! Lang::get('lang.phone') !!}</label> <div class="row">
{!! Form::text('phone_number',null,['class' => 'form-control']) !!} <div class="col-sm-1 form-group {{ Session::has('country_code_error') ? 'has-error' : '' }}">
</div> {!! Form::label('country_code', Lang::get('lang.country-code')) !!}
<div class="col-sm-2 form-group {{ $errors->has('active') ? 'has-error' : '' }}"> {!! $errors->first('country_code', '<spam class="help-block">:message</spam>') !!}
{!! Form::label('active',Lang::get('lang.status')) !!} {!! Form::text('country_code', null, [
<div class="row"> 'class' => 'form-control',
<div class="col-sm-12"> 'placeholder' => $phonecode,
{!! Form::radio('active','1',true) !!} {{Lang::get('lang.active')}} 'title' => Lang::get('lang.enter-country-phone-code'),
]) !!}
</div>
<!-- mobile Number : Text : -->
<div class="col-md-3 form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
{!! Form::label('mobile', Lang::get('lang.mobile')) !!}
{!! Form::input('number', 'mobile', null, ['class' => 'form-control']) !!}
</div>
<div class="col-sm-1 form-group {{ $errors->has('ext') ? 'has-error' : '' }}">
<label for="ext">{!! Lang::get('lang.ext') !!}</label>
{!! Form::text('ext', null, ['class' => 'form-control']) !!}
</div>
<div class="col-sm-3 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}">
<label for="phone_number">{!! Lang::get('lang.phone') !!}</label>
{!! Form::text('phone_number', null, ['class' => 'form-control']) !!}
</div>
<div class="col-sm-2 form-group {{ $errors->has('active') ? 'has-error' : '' }}">
{!! Form::label('active', Lang::get('lang.status')) !!}
<div class="row">
<div class="col-sm-12">
{!! Form::radio('active', '1', true) !!} {{ Lang::get('lang.active') }}
</div>
<div class="col-sm-12">
{!! Form::radio('active', '0') !!} {{ Lang::get('lang.inactive') }}
</div>
</div> </div>
<div class="col-sm-12"> </div>
{!! Form::radio('active','0') !!} {{Lang::get('lang.inactive')}} <div class="col-sm-2 form-group {{ $errors->has('ban') ? 'has-error' : '' }}">
{!! Form::label('ban', Lang::get('lang.ban')) !!}
<div class="row">
<div class="col-sm-12">
{!! Form::radio('ban', '1', true) !!} {{ Lang::get('lang.enable') }}
</div>
<div class="col-sm-12">
{!! Form::radio('ban', '0') !!} {{ Lang::get('lang.disable') }}
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-sm-2 form-group {{ $errors->has('ban') ? 'has-error' : '' }}"> <!-- Internal Notes : Textarea -->
{!! Form::label('ban',Lang::get('lang.ban')) !!} <div class="form-group">
<div class="row"> {!! Form::label('internal_note', Lang::get('lang.internal_notes')) !!}
<div class="col-sm-12"> {!! Form::textarea('internal_note', null, ['class' => 'form-control', 'size' => '30x5']) !!}
{!! Form::radio('ban','1',true) !!} {{Lang::get('lang.enable')}}
</div>
<div class="col-sm-12">
{!! Form::radio('ban','0') !!} {{Lang::get('lang.disable')}}
</div>
</div>
</div> </div>
</div> </div>
<!-- Internal Notes : Textarea --> <div class="card-footer">
<div class="form-group"> {!! Form::submit(Lang::get('lang.update'), ['class' => 'btn btn-primary']) !!}
{!! Form::label('internal_note',Lang::get('lang.internal_notes')) !!}
{!! Form::textarea('internal_note',null,['class' => 'form-control', 'size' => '30x5']) !!}
</div> </div>
</div> </div>
<div class="card-footer"> <script>
{!! Form::submit(Lang::get('lang.update'),['class'=>'btn btn-primary'])!!} $(function() {
</div> $("textarea").summernote({
</div> height: 300,
<script> tabsize: 2,
$(function() { toolbar: [
$("textarea").summernote({ ['style', ['bold', 'italic', 'underline', 'clear']],
height: 300, ['font', ['strikethrough', 'superscript', 'subscript']],
tabsize: 2, ['fontsize', ['fontsize']],
toolbar: [ ['color', ['color']],
['style', ['bold', 'italic', 'underline', 'clear']], ['para', ['ul', 'ol', 'paragraph']],
['font', ['strikethrough', 'superscript', 'subscript']], ['height', ['height']]
['fontsize', ['fontsize']], ]
['color', ['color']], });
['para', ['ul', 'ol', 'paragraph']], });
['height', ['height']] </script>
]
});
});
</script>
@stop @stop
@section('FooterInclude') @section('FooterInclude')
<!--<script> <!--<script>
$('#org').autocomplete({ $('#org').autocomplete({
minLength: 1, minLength: 1,
source: function (request, response) { source: function(request, response) {
$.getJSON("{{url('get-organization')}}", { $.getJSON("{{ url('get-organization') }}", {
term: request.term term: request.term
}, function (data) { }, function(data) {
var array = data.error ? [] : $.map(data, function (m) { var array = data.error ? [] : $.map(data, function(m) {
return { return {
label: m.label, label: m.label,
value: m.value value: m.value
}; };
});
response(array);
}); });
response(array); },
}); select: function(event, ui) {
}, $("#org").val(ui.item.label); // display the selected text
select: function (event, ui) { $("#field_id").val(ui.item.value); // save selected id to hidden input
$("#org").val(ui.item.label); // display the selected text return false;
$("#field_id").val(ui.item.value); // save selected id to hidden input }
return false; });
} </script>-->
});
</script>--> @stop
@stop

View File

@@ -1,334 +1,365 @@
@extends('themes.default1.agent.layout.agent') @extends('themes.default1.agent.layout.agent')
@section('Dashboard') @section('Dashboard')
class="nav-link active" class="nav-link active"
@stop @stop
@section('dashboard-bar') @section('dashboard-bar')
active active
@stop @stop
@section('profile') @section('profile')
class="nav-link active" class="nav-link active"
@stop @stop
@section('PageHeader') @section('PageHeader')
<h1>{{Lang::get('lang.edit-profile')}}</h1> <h1>{{ Lang::get('lang.edit-profile') }}</h1>
@stop @stop
@section('content') @section('content')
@if(Session::has('success1')) @if (Session::has('success1'))
<div class="alert alert-success alert-dismissable"> <div class="alert alert-success alert-dismissable">
<i class="fas fa-check-circle"></i> <i class="fas fa-check-circle"></i>
<b>Success</b> <b>Success</b>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{Session::get('success1')}} {{ Session::get('success1') }}
</div> </div>
@endif @endif
<!-- fail message --> <!-- fail message -->
@if(Session::has('fails1')) @if (Session::has('fails1'))
<div class="alert alert-danger alert-dismissable"> <div class="alert alert-danger alert-dismissable">
<i class="fas fa-ban"></i> <i class="fas fa-ban"></i>
<b>Fail!</b> <b>Fail!</b>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{Session::get('fails1')}} {{ Session::get('fails1') }}
</div> </div>
@endif @endif
@if(Session::has('success')) @if (Session::has('success'))
<div class="alert alert-success alert-dismissable"> <div class="alert alert-success alert-dismissable">
<i class="fas fa-check-circle"></i> <i class="fas fa-check-circle"></i>
<b>Success</b> <b>Success</b>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{Session::get('success')}} {{ Session::get('success') }}
</div> </div>
@endif @endif
<!-- fail message --> <!-- fail message -->
@if(Session::has('fails')) @if (Session::has('fails'))
<div class="alert alert-danger alert-dismissable"> <div class="alert alert-danger alert-dismissable">
<i class="fas fa-ban"></i> <i class="fas fa-ban"></i>
<b>Fail!</b> <b>Fail!</b>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
{{Session::get('fails')}} {{ Session::get('fails') }}
</div> </div>
@endif @endif
@if(Session::has('errors')) @if (Session::has('errors'))
<?php //dd($errors); ?> <?php //dd($errors);
?>
<div class="alert alert-danger alert-dismissable"> <div class="alert alert-danger alert-dismissable">
<i class="fa fa-ban"></i> <i class="fa fa-ban"></i>
<b>{!! Lang::get('lang.alert') !!}!</b> <b>{!! Lang::get('lang.alert') !!}!</b>
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button> <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
<br/> <br />
@if($errors->first('first_name')) @if ($errors->first('first_name'))
<li class="error-message-padding">{!! $errors->first('first_name', ':message') !!}</li> <li class="error-message-padding">{!! $errors->first('first_name', ':message') !!}</li>
@endif
@if ($errors->first('mobile'))
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li>
@endif
</div>
@endif @endif
@if($errors->first('mobile')) <div class="row">
<li class="error-message-padding">{!! $errors->first('mobile', ':message') !!}</li> <div class="col-md-6">
@endif {!! Form::model($user, [
</div> 'url' => 'agent-profile',
@endif 'id' => 'agent-profile',
<div class="row"> 'method' => 'PATCH',
<div class="col-md-6"> 'files' => true,
{!! Form::model($user,['url'=>'agent-profile', 'id' => 'agent-profile', 'method' => 'PATCH','files'=>true]) !!} ]) !!}
<div class="card card-light"> <div class="card card-light">
<div class="card-header"> <div class="card-header">
<h3 class="card-title"> <h3 class="card-title">
{!! Lang::get('lang.profile') !!} {!! Lang::get('lang.profile') !!}
</h3> </h3>
</div>
<div class="card-body">
<!-- first name -->
<div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
{!! Form::label('first_name',Lang::get('lang.first_name')) !!} <span class="text-red"> *</span>
{!! Form::text('first_name',null,['class' => 'form-control']) !!}
</div> </div>
<!-- last name --> <div class="card-body">
<div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}"> <!-- first name -->
{!! Form::label('last_name',Lang::get('lang.last_name')) !!} <div class="form-group {{ $errors->has('first_name') ? 'has-error' : '' }}">
{!! Form::text('last_name',null,['class' => 'form-control']) !!} {!! Form::label('first_name', Lang::get('lang.first_name')) !!} <span class="text-red"> *</span>
</div> {!! Form::text('first_name', null, ['class' => 'form-control']) !!}
<!-- gender --> </div>
<div class="form-group"> <!-- last name -->
{!! Form::label('gender',Lang::get('lang.gender')) !!} <div class="form-group {{ $errors->has('last_name') ? 'has-error' : '' }}">
{!! Form::label('last_name', Lang::get('lang.last_name')) !!}
{!! Form::text('last_name', null, ['class' => 'form-control']) !!}
</div>
<!-- gender -->
<div class="form-group">
{!! Form::label('gender', Lang::get('lang.gender')) !!}
<div class="row">
<div class="col-sm-3">
{!! Form::radio('gender', '1', true) !!} {{ Lang::get('lang.male') }}
</div>
<div class="col-sm-3">
{!! Form::radio('gender', '0') !!} {{ Lang::get('lang.female') }}
</div>
</div>
</div>
<div class="form-group">
<label for="dept_id">Phòng ban</label>
<select class="form-control" name="dept_id" id="dept_id" required>
<option value="">-- Chọn phòng ban --</option>
@foreach ($departments as $department)
<option value="{{ $department->id }}"
{{ $user->dept_id == $department->id ? 'selected' : '' }}>
{{ $department->name }}
</option>
@endforeach
</select>
</div>
<div class="row"> <div class="row">
<div class="col-sm-3"> <!-- phone extension -->
{!! Form::radio('gender','1',true) !!} {{Lang::get('lang.male')}} <div class="col-sm-2 form-group {{ Session::has('country_code_error') ? 'has-error' : '' }}">
{!! Form::label('country_code', Lang::get('lang.country-code')) !!}
{!! Form::text('country_code', null, [
'class' => 'form-control',
'placeholder' => $phonecode,
'title' => Lang::get('lang.enter-country-phone-code'),
'id' => 'code',
]) !!}
</div> </div>
<div class="col-sm-3"> <!-- phone number -->
{!! Form::radio('gender','0') !!} {{Lang::get('lang.female')}} <div class="col-sm-8 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}">
{!! Form::label('phone_number', Lang::get('lang.phone')) !!}
{!! Form::text('phone_number', null, ['class' => 'form-control']) !!}
</div>
<div class="col-sm-2 form-group {{ $errors->has('ext') ? 'has-error' : '' }}">
{!! Form::label('ext', Lang::get('lang.ext')) !!}
{!! Form::text('ext', null, ['class' => 'form-control']) !!}
</div> </div>
</div> </div>
</div> <!-- mobile -->
<div class="form-group"> <div class="form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
<label for="dept_id">Phòng ban</label> {!! Form::label('mobile', Lang::get('lang.mobile_number')) !!}
<select class="form-control" name="dept_id" id="dept_id" required> {!! Form::input('number', 'mobile', null, ['class' => 'form-control', 'id' => 'mobile']) !!}
<option value="">-- Chọn phòng ban --</option>
@foreach ($departments as $department)
<option value="{{ $department->id }}"
{{ $user->dept_id == $department->id ? 'selected' : '' }}>
{{ $department->name }}
</option>
@endforeach
</select>
</div>
<div class="row">
<!-- phone extension -->
<div class="col-sm-2 form-group {{ Session::has('country_code_error') ? 'has-error' : '' }}">
{!! Form::label('country_code',Lang::get('lang.country-code')) !!}
{!! Form::text('country_code',null,['class' => 'form-control', 'placeholder' => $phonecode, 'title' => Lang::get('lang.enter-country-phone-code'), 'id' => 'code']) !!}
</div> </div>
<!-- phone number --> <div class="form-group {{ $errors->has('agent_sign') ? 'has-error' : '' }}">
<div class="col-sm-8 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}"> {!! Form::label('agent_sign', Lang::get('lang.agent_sign')) !!}
{!! Form::label('phone_number',Lang::get('lang.phone')) !!} {!! Form::textarea('agent_sign', null, ['class' => 'form-control']) !!}
{!! Form::text('phone_number',null,['class' => 'form-control']) !!}
</div> </div>
<div class="col-sm-2 form-group {{ $errors->has('ext') ? 'has-error' : '' }}"> <div class="form-group {{ $errors->has('profile_pic') ? 'has-error' : '' }}">
{!! Form::label('ext',Lang::get('lang.ext')) !!} <!-- profile pic -->
{!! Form::text('ext',null,['class' => 'form-control']) !!} <div type="file" class="btn btn-default btn-file" style="color:orange">
<i class="fa fa-user"> </i>
{!! Form::label('profile_pic', Lang::get('lang.profile_pic'), ['style' => 'font-weight:400;margin-bottom:0px;']) !!}
{!! Form::file('profile_pic', ['class' => 'form-file']) !!}
</div>
</div> </div>
{!! Form::token() !!}
{!! Form::close() !!}
</div> </div>
<!-- mobile --> <div class="card-footer">
<div class="form-group {{ $errors->has('mobile') ? 'has-error' : '' }}"> {!! Form::submit(Lang::get('lang.update'), ['class' => 'btn btn-primary']) !!}
{!! Form::label('mobile',Lang::get('lang.mobile_number')) !!}
{!! Form::input('number', 'mobile',null,['class' => 'form-control', 'id' => 'mobile']) !!}
</div> </div>
<div class="form-group {{ $errors->has('agent_sign') ? 'has-error' : '' }}">
{!! Form::label('agent_sign',Lang::get('lang.agent_sign')) !!}
{!! Form::textarea('agent_sign',null,['class' => 'form-control']) !!}
</div>
<div class="form-group {{ $errors->has('profile_pic') ? 'has-error' : '' }}">
<!-- profile pic -->
<div type="file" class="btn btn-default btn-file" style="color:orange">
<i class="fa fa-user"> </i>
{!! Form::label('profile_pic',Lang::get('lang.profile_pic'),['style'=>'font-weight:400;margin-bottom:0px;']) !!}
{!! Form::file('profile_pic',['class' => 'form-file']) !!}
</div>
</div>
{!! Form::token() !!}
{!! Form::close() !!}
</div> </div>
<div class="card-footer"> </div>
{!! Form::submit(Lang::get('lang.update'),['class'=>'btn btn-primary'])!!} <div class="col-md-6">
{!! Form::model($user, ['url' => 'agent-profile-password/' . $user->id, 'method' => 'PATCH']) !!}
<div class="card card-light">
<div class="card-header">
<h3 class="card-title">{!! Lang::get('lang.change_password') !!}</h3>
</div>
<div class="card-body pb-0">
<!-- old password -->
<div class="form-group has-feedback {{ $errors->has('old_password') ? 'has-error' : '' }}">
{!! Form::label('old_password', Lang::get('lang.old_password')) !!} <span class="text-red"> *</span>
{!! Form::password('old_password', ['class' => 'form-control']) !!}
{!! $errors->first('old_password', '<spam class="help-block">:message</spam>') !!}
<span class="glyphicon glyphicon-lock form-control-feedback"
style="float: right;top: -46px;left: -10px;"></span>
</div>
<!-- new password -->
<div class="form-group has-feedback {{ $errors->has('new_password') ? 'has-error' : '' }}">
{!! Form::label('new_password', Lang::get('lang.new_password')) !!} <span class="text-red"> *</span>
{!! Form::password('new_password', ['class' => 'form-control']) !!}
{!! $errors->first('new_password', '<spam class="help-block">:message</spam>') !!}
<span class="glyphicon glyphicon-lock form-control-feedback"
style="float: right;top: -46px;left: -10px;"></span>
</div>
<!-- confirm password -->
<div class="form-group has-feedback {{ $errors->has('confirm_password') ? 'has-error' : '' }}">
{!! Form::label('confirm_password', Lang::get('lang.confirm_password')) !!} <span class="text-red"> *</span>
{!! Form::password('confirm_password', ['class' => 'form-control']) !!}
{!! $errors->first('confirm_password', '<spam class="help-block">:message</spam>') !!}
<span class="glyphicon glyphicon-lock form-control-feedback"
style="float: right;top: -46px;left: -10px;"></span>
</div>
</div>
<div class="card-footer">
{!! Form::submit(Lang::get('lang.update'), ['class' => 'btn btn-primary']) !!}
</div>
</div> </div>
</div> </div>
</div> </div>
<div class="col-md-6"> {!! Form::close() !!}
{!! Form::model($user,['url'=>'agent-profile-password/'.$user->id , 'method' => 'PATCH']) !!} <!-- Modal for last step of setting -->
<div class="card card-light"> <div class="modal fade" id="last-modal">
<div class="card-header"> <div class="modal-dialog" role="document">
<h3 class="card-title">{!! Lang::get('lang.change_password') !!}</h3> <div class="col-md-2"></div>
</div> <div class="col-md-12" style="height:40%">
<div class="card-body pb-0"> <div class="modal-content">
<!-- old password --> <div class="modal-header">
<div class="form-group has-feedback {{ $errors->has('old_password') ? 'has-error' : '' }}"> <h4 class="modal-title">{{ Lang::get('lang.verify-number') }}</h4>
{!! Form::label('old_password',Lang::get('lang.old_password')) !!} <span class="text-red"> *</span> <button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span
{!! Form::password('old_password',['class' => 'form-control']) !!} aria-hidden="true">×</span></button>
{!! $errors->first('old_password', '<spam class="help-block">:message</spam>') !!} </div>
<span class="glyphicon glyphicon-lock form-control-feedback" style="float: right;top: -46px;left: -10px;"></span> <div class="modal-body">
</div> <div id="custom-alert-body2">
<!-- new password --> <div class="row">
<div class="form-group has-feedback {{ $errors->has('new_password') ? 'has-error' : '' }}"> <div class="col-md-12">
{!! Form::label('new_password',Lang::get('lang.new_password')) !!} <span class="text-red"> *</span> <div id="loader2" style="display:none">
{!! Form::password('new_password',['class' => 'form-control']) !!} <center><img src="{{ asset('lb-faveo/media/images/gifloader.gif') }}"></center>
{!! $errors->first('new_password', '<spam class="help-block">:message</spam>') !!} </div>
<span class="glyphicon glyphicon-lock form-control-feedback" style="float: right;top: -46px;left: -10px;"></span> <div id="verify-success" style="display:none"
</div> class="alert alert-success alert-dismissable">
<!-- confirm password --> <i class="fa fa-check-circle"> </i>
<div class="form-group has-feedback {{ $errors->has('confirm_password') ? 'has-error' : '' }}"> <span id = "success_message"></span>
{!! Form::label('confirm_password',Lang::get('lang.confirm_password')) !!} <span class="text-red"> *</span> </div>
{!! Form::password('confirm_password',['class' => 'form-control']) !!} <div id="verify-fail" style="display:none"
{!! $errors->first('confirm_password', '<spam class="help-block">:message</spam>') !!} class="alert alert-danger alert-dismissable">
<span class="glyphicon glyphicon-lock form-control-feedback" style="float: right;top: -46px;left: -10px;"></span> <i class="fa fa-ban"> </i> <b> {!! Lang::get('lang.alert') !!}! </b>
</div> <span id = "error_message"></span>
</div> </div>
<div class="card-footer"> </div>
{!! Form::submit(Lang::get('lang.update'),['class'=>'btn btn-primary'])!!}
</div>
</div>
</div>
</div>
{!! Form::close() !!}
<!-- Modal for last step of setting -->
<div class="modal fade" id="last-modal">
<div class="modal-dialog" role="document">
<div class="col-md-2"></div>
<div class="col-md-12" style="height:40%">
<div class="modal-content">
<div class="modal-header">
<h4 class="modal-title">{{Lang::get('lang.verify-number')}}</h4>
<button type="button" class="close closemodal" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
</div>
<div class="modal-body">
<div id="custom-alert-body2">
<div class="row">
<div class="col-md-12">
<div id="loader2" style="display:none">
<center><img src="{{asset('lb-faveo/media/images/gifloader.gif')}}"></center>
</div>
<div id="verify-success" style="display:none" class="alert alert-success alert-dismissable">
<i class="fa fa-check-circle"> </i>
<span id = "success_message"></span>
</div>
<div id="verify-fail" style="display:none" class="alert alert-danger alert-dismissable">
<i class="fa fa-ban"> </i> <b> {!! Lang::get('lang.alert') !!}! </b>
<span id = "error_message"></span>
</div> </div>
</div>
<div id="verify-number-form">
{!! Form::open(['id' => 'verify-otp', 'method' => 'POST']) !!}
<div class="row">
<div class="col-md-8">
{{ Lang::get('lang.get-verify-message') }}
</div>
<div class="col-md-4">
{!! Form::text('token', '', [
'class' => 'form-control',
'required' => true,
'placeholder' => Lang::get('lang.enter-otp'),
'id' => 'otp',
]) !!}
</div>
</div> </div>
</div> </div>
</div> </div>
<div id="verify-number-form"> <div class="modal-footer justify-content-between">
{!! Form::open(['id'=>'verify-otp','method' => 'POST'] )!!} <button type="button" id="close-last"
<div class="row"> class="btn btn-default closemodal">{{ Lang::get('lang.close') }}</button>
<div class="col-md-8"> <div id="last-submit"><input type="submit" id="merge-btn" class="btn btn-primary"
{{ Lang::get('lang.get-verify-message') }} value="{!! Lang::get('lang.verify') !!}"></input></div>
</div>
<div class="col-md-4">
{!! Form::text('token','',['class' => 'form-control', 'required' => true, 'placeholder' => Lang::get('lang.enter-otp'), 'id' => 'otp']) !!}
</div>
</div>
</div> </div>
{!! Form::close() !!}
</div> </div>
<div class="modal-footer justify-content-between">
<button type="button" id="close-last" class="btn btn-default closemodal">{{Lang::get('lang.close')}}</button>
<div id="last-submit"><input type="submit" id="merge-btn" class="btn btn-primary" value="{!! Lang::get('lang.verify') !!}"></input></div>
</div>
{!! Form::close() !!}
</div> </div>
</div> </div>
</div> </div>
</div> <!-- modal end -->
<!-- modal end --> <script>
<script> $(function() {
$(function() { $("textarea").wysihtml5();
$("textarea").wysihtml5(); });
}); </script>
</script> @if ($verify == 1 || $verify == '1')
@if($verify == 1 || $verify == '1') <script type="text/javascript">
<script type="text/javascript"> $('#agent-profile').on('submit', function(e) {
$('#agent-profile').on('submit', function(e){ var old_mobile = "<?php echo $user->mobile; ?>";
var old_mobile = "<?php echo $user->mobile;?>"; var email = "<?php echo $user->email; ?>";
var email = "<?php echo $user->email;?>"; var full_name = "<?php echo $user->first_name; ?>";
var full_name = "<?php echo $user->first_name; ?>"; var mobile = document.getElementById('mobile').value;
var mobile = document.getElementById('mobile').value; var code = document.getElementById('code').value;
var code = document.getElementById('code').value; if (code == '' || code == null) {
if (code == '' || code == null) { //do nothingalert
//do nothingalert } else {
} else { var id = "<?php echo $user->id; ?>";
var id = "<?php echo $user->id; ?>"; if (mobile !== old_mobile) {
if (mobile !== old_mobile) {
e.preventDefault();
$('#last-modal').css('display', 'block');
$.ajax({
url: '{{URL::route("agent-verify-number")}}',
type: 'post', // performing a POST request
data : {
mobile : mobile,
full_name: full_name,
email: email,
code: code // will be accessible in $_POST['data1']
},
dataType: 'json',
beforeSend: function() {
$('#loader2').css('display', 'block');
$('#verify-number-form').css('display', 'none');
$('#verify-fail').css('display', 'none');
$('verify-success').css('display', 'none');
},
success: function(response) {
$('#loader2').css('display', 'none');
$('#verify-number-form').css('display', 'block');
$('#verify-otp').on('submit', function(e){
e.preventDefault(); e.preventDefault();
var otp = document.getElementById('otp').value; $('#last-modal').css('display', 'block');
$.ajax({ $.ajax({
url: '{{URL::route("post-agent-verify-number")}}', url: '{{ URL::route('agent-verify-number') }}',
type: 'POST', type: 'post', // performing a POST request
data: { data: {
otp: otp, mobile: mobile,
u_id: id, full_name: full_name,
email: email,
code: code // will be accessible in $_POST['data1']
}, },
dataType: 'html', dataType: 'json',
beforeSend: function(){ beforeSend: function() {
$('#loader2').css('display', 'block'); $('#loader2').css('display', 'block');
$('#verify-number-form').css('display', 'none'); $('#verify-number-form').css('display', 'none');
$('#verify-fail').css('display', 'none'); $('#verify-fail').css('display', 'none');
$('verify-success').css('display', 'none'); $('verify-success').css('display', 'none');
}, },
success: function(response){ success: function(response) {
if( response == 1) { $('#loader2').css('display', 'none');
$('#verify-number-form').css('display', 'block');
$('#verify-otp').on('submit', function(e) {
e.preventDefault();
var otp = document.getElementById('otp').value;
$.ajax({
url: '{{ URL::route('post-agent-verify-number') }}',
type: 'POST',
data: {
otp: otp,
u_id: id,
},
dataType: 'html',
beforeSend: function() {
$('#loader2').css('display', 'block');
$('#verify-number-form').css('display',
'none');
$('#verify-fail').css('display', 'none');
$('verify-success').css('display', 'none');
},
success: function(response) {
if (response == 1) {
$('#loader2').css('display', 'none');
var message =
"{{ Lang::get('lang.number-verification-sussessfull') }}";
$('#success_message').html(message);
$('#verify-success').css('display',
'block');
$('#agent-profile').unbind('submit')
.submit();
} else {
$('#loader2').css('display', 'none');
$("#error_message").html(response);
$('#verify-fail').css('display',
'block');
$('#verify-number-form').css('display',
'block');
}
}
});
});
},
complete: function(jqXHR, textStatus) {
if (textStatus === "parsererror" || textStatus === "timeout" ||
textStatus === "abort" || textStatus === "error") {
var message = "{{ Lang::get('lang.otp-not-sent') }}";
$('#loader2').css('display', 'none'); $('#loader2').css('display', 'none');
var message = "{{Lang::get('lang.number-verification-sussessfull')}}"; $("#error_message").html(message);
$('#success_message').html(message); $("#merge-btn").css('display', 'none');
$('#verify-success').css('display', 'block');
$('#agent-profile').unbind('submit').submit();
} else {
$('#loader2').css('display', 'none');
$("#error_message").html(response);
$('#verify-fail').css('display', 'block'); $('#verify-fail').css('display', 'block');
$('#verify-number-form').css('display', 'block');
} }
} }
}); });
});
},
complete: function( jqXHR, textStatus) {
if (textStatus === "parsererror" || textStatus === "timeout" || textStatus === "abort" || textStatus === "error") {
var message = "{{Lang::get('lang.otp-not-sent')}}";
$('#loader2').css('display', 'none');
$("#error_message").html(message);
$("#merge-btn").css('display', 'none');
$('#verify-fail').css('display', 'block');
} }
} }
}); });
} $('.closemodal').on('click', function() {
$('#last-modal').css('display', 'none');
} });
}); </script>
$('.closemodal').on('click', function(){ @endif
$('#last-modal').css('display', 'none'); @stop
});
</script>
@endif
@stop