Compare commits

..

2 Commits

Author SHA1 Message Date
794c839a95 up new code
up new code
2025-08-19 05:59:14 +07:00
95bb93afa6 commit
commit
2025-08-09 04:43:00 +07:00
14 changed files with 17126 additions and 720 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$/spec" isTestSource="true" />
<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/graham-campbell/result-type" />
<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/aws/aws-crt-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>
<orderEntry type="inheritedJdk" />
<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"?>
<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">
<include_path>
<path value="$PROJECT_DIR$/vendor/composer" />
@@ -165,12 +175,47 @@
<path value="$PROJECT_DIR$/vendor/psr/container" />
<path value="$PROJECT_DIR$/vendor/aws/aws-crt-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>
</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">
<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" />
</phpunit_settings>
</component>
<component name="PsalmOptionsConfiguration">
<option name="transferred" value="true" />
</component>
</project>

1
.idea/phpunit.xml generated
View File

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

View File

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

View File

@@ -646,6 +646,7 @@ class UserController extends Controller
// dd('here');
$settings = CommonSettings::select('status')->where('option_name', '=', 'send_otp')->first();
$email_mandatory = CommonSettings::select('status')->where('option_name', '=', 'email_mandatory')->first();
$departments = Department::all();
$user = new User();
/* 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();
// 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) {
return redirect()->back()->with('fails', $e->getMessage());
}

View File

@@ -23,6 +23,7 @@ use App\Model\helpdesk\Utility\CountryCode;
use App\User;
use App\Model\helpdesk\Agent\Location;
use Exception;
use App\Model\helpdesk\Agent\Department;
// classes
use Form;
use GeoIP;
@@ -66,6 +67,7 @@ class FormController extends Controller
public function getForm(Help_topic $topic, CountryCode $code)
{
$locations = Location::all();
$departments = Department::all();
if (\Config::get('database.install') == '%0%') {
return \Redirect::route('licence');
}
@@ -87,7 +89,7 @@ class FormController extends Controller
[$max_size_in_bytes, $max_size_in_actual] = $this->fileUploadController->file_upload_max_size();
return view('themes.default1.client.helpdesk.form', compact('topics', 'codes', 'email_mandatory', 'max_size_in_bytes', 'max_size_in_actual', 'locations'))->with('phonecode', $phonecode);
return view('themes.default1.client.helpdesk.form', compact('topics', 'codes', 'email_mandatory', 'max_size_in_bytes', 'max_size_in_actual', 'locations', 'departments'))->with('phonecode', $phonecode);
} else {
return \Redirect::route('home');
}

View File

@@ -4,6 +4,7 @@ namespace App\Model\helpdesk\Ticket;
use App\BaseModel;
use App\Model\helpdesk\Agent\Location;
use App\Model\helpdesk\Agent\Department;
class Tickets extends BaseModel
{
@@ -38,7 +39,8 @@ class Tickets extends BaseModel
'created_at',
'updated_at',
'assigned_to',
'locationid' // <-- Thêm locationid vào đây
'locationid', // <-- Thêm locationid vào đây
'submitdep_id'
];
// Các quan hệ cũ...
@@ -71,7 +73,10 @@ class Tickets extends BaseModel
{
return $this->belongsTo(Location::class, 'locationid', 'locationid');
}
public function submitDepartment()
{
return $this->belongsTo(Department::class, 'submitdept_id');
}
public function extraFields()
{
$id = $this->attributes['id'];

View File

@@ -0,0 +1,29 @@
<?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('tickets', function (Blueprint $table) {
$table->unsignedInteger('submitdept_id')->nullable()->after('id');
$table->foreign('submitdept_id')->references('id')->on('department')->onDelete('cascade');
});
}
public function down()
{
Schema::table('tickets', function (Blueprint $table) {
$table->dropForeign(['submitdept_id']);
$table->dropColumn('submitdept_id');
});
}
};

16202
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -33,7 +33,7 @@ class="nav-link active"
{{ Session::get('fails') }}
</div>
@endif
gfggggdgd
@if (Session::has('errors'))
<div class="alert alert-danger alert-dismissable">
<i class="fas fa-ban"></i>
@@ -94,11 +94,13 @@ gfggggdgd
</div>
<div class="row">
<!-- Email Address : Email : Required -->
<div class="col-sm-6 form-group {{ $errors->has('email') ? 'has-error' : '' }}">
<div class="col-sm-4 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' : '' }}">
<div class="col-sm-4 form-group {{ $errors->has('organization') ? 'has-error' : '' }}">
{!! Form::label('organization', Lang::get('lang.organization')) !!}
@@ -113,12 +115,34 @@ gfggggdgd
</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 class="row">
<div class="col-sm-1 form-group {{ Session::has('country_code_error') ? 'has-error' : '' }}">
{!! Form::label('country_code', Lang::get('lang.country-code')) !!}
{!! $errors->first('country_code', '<spam class="help-block">:message</spam>') !!}
{!! Form::text('country_code',null,['class' => 'form-control', 'placeholder' => $phonecode, 'title' => Lang::get('lang.enter-country-phone-code')]) !!}
{!! Form::text('country_code', null, [
'class' => 'form-control',
'placeholder' => $phonecode,
'title' => Lang::get('lang.enter-country-phone-code'),
]) !!}
</div>
<!-- mobile Number : Text : -->
<div class="col-md-3 form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
@@ -206,7 +230,6 @@ gfggggdgd
return false;
}
});
</script>-->
@stop

View File

@@ -53,7 +53,8 @@ class="nav-link active"
</div>
@endif
@if (Session::has('errors'))
<?php //dd($errors); ?>
<?php //dd($errors);
?>
<div class="alert alert-danger alert-dismissable">
<i class="fa fa-ban"></i>
@@ -70,7 +71,12 @@ class="nav-link active"
@endif
<div class="row">
<div class="col-md-6">
{!! Form::model($user,['url'=>'agent-profile', 'id' => 'agent-profile', 'method' => 'PATCH','files'=>true]) !!}
{!! Form::model($user, [
'url' => 'agent-profile',
'id' => 'agent-profile',
'method' => 'PATCH',
'files' => true,
]) !!}
<div class="card card-light">
<div class="card-header">
<h3 class="card-title">
@@ -116,7 +122,12 @@ class="nav-link active"
<!-- 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']) !!}
{!! Form::text('country_code', null, [
'class' => 'form-control',
'placeholder' => $phonecode,
'title' => Lang::get('lang.enter-country-phone-code'),
'id' => 'code',
]) !!}
</div>
<!-- phone number -->
<div class="col-sm-8 form-group {{ $errors->has('phone_number') ? 'has-error' : '' }}">
@@ -165,21 +176,24 @@ class="nav-link active"
{!! 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>
<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>
<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>
<span class="glyphicon glyphicon-lock form-control-feedback"
style="float: right;top: -46px;left: -10px;"></span>
</div>
</div>
<div class="card-footer">
@@ -197,7 +211,8 @@ class="nav-link active"
<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>
<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">
@@ -206,11 +221,13 @@ class="nav-link active"
<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">
<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">
<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>
@@ -224,14 +241,21 @@ class="nav-link active"
{{ 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']) !!}
{!! Form::text('token', '', [
'class' => 'form-control',
'required' => true,
'placeholder' => Lang::get('lang.enter-otp'),
'id' => 'otp',
]) !!}
</div>
</div>
</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>
<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>
@@ -260,7 +284,7 @@ $('#agent-profile').on('submit', function(e){
e.preventDefault();
$('#last-modal').css('display', 'block');
$.ajax({
url: '{{URL::route("agent-verify-number")}}',
url: '{{ URL::route('agent-verify-number') }}',
type: 'post', // performing a POST request
data: {
mobile: mobile,
@@ -282,7 +306,7 @@ $('#agent-profile').on('submit', function(e){
e.preventDefault();
var otp = document.getElementById('otp').value;
$.ajax({
url: '{{URL::route("post-agent-verify-number")}}',
url: '{{ URL::route('post-agent-verify-number') }}',
type: 'POST',
data: {
otp: otp,
@@ -291,29 +315,36 @@ $('#agent-profile').on('submit', function(e){
dataType: 'html',
beforeSend: function() {
$('#loader2').css('display', 'block');
$('#verify-number-form').css('display', 'none');
$('#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')}}";
var message =
"{{ Lang::get('lang.number-verification-sussessfull') }}";
$('#success_message').html(message);
$('#verify-success').css('display', 'block');
$('#agent-profile').unbind('submit').submit();
$('#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');
$('#verify-fail').css('display',
'block');
$('#verify-number-form').css('display',
'block');
}
}
});
});
},
complete: function(jqXHR, textStatus) {
if (textStatus === "parsererror" || textStatus === "timeout" || textStatus === "abort" || textStatus === "error") {
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);

View File

@@ -7,35 +7,26 @@
@section('submit')
class = "nav-item active"
@stop
<!-- breadcrumbs -->
@section('breadcrumb')
{{-- <div class="site-hero clearfix"> --}}
<ol class="breadcrumb float-sm-right">
<style>
.words {
margin-right: 10px;
/* Adjust the value to increase or decrease the gap between list items */
}
</style>
<li class="breadcrumb-item"><i class="fas fa-home"></i> {!! Lang::get('lang.you_are_here') !!} : &nbsp;</li>
<li><a class="words" href="{{ url('/') }}">{!! Lang::get('lang.home') !!}</a></li>
<li class="words" style="margin-right: 10px">></li>
<li class="words">></li>
<li><a href="{!! URL::route('form') !!}">{!! Lang::get('lang.submit_a_ticket') !!}</a></li>
</ol>
</div>
@stop
<!-- /breadcrumbs -->
@section('check')
<div id="sidebar" class="site-sidebar col-md-3">
<div id="form-border" class="comment-respond form-border" style="background:#fff">
<section id="section-categories" class="section">
<h2 class="section-title h4 clearfix">
<i class="line"></i>{!! Lang::get('lang.have_a_ticket') !!}?
</h2>
@@ -56,8 +47,10 @@
{!! Form::open(['url' => 'checkmyticket', 'method' => 'POST']) !!}
{!! Form::label('email', Lang::get('lang.email')) !!}<span class="text-red"> *</span>
{!! Form::text('email_address', null, ['class' => 'form-control form-group']) !!}
{!! Form::label('ticket_number', Lang::get('lang.ticket_number')) !!}<span class="text-red"> *</span>
{!! Form::text('ticket_number', null, ['class' => 'form-control form-group']) !!}
<button type="submit" class="btn btn-info"
style="border-color: rgb(0,192,239); background-color: rgb(0,154,186)!important; color:white">
<i class="fas fa-save"></i> {!! Lang::get('lang.check_ticket_status') !!}
@@ -66,11 +59,10 @@
</div>
</section>
</div>
</div><!-- #sidebar -->
</div>
@stop
<!-- content -->
@section('content')
@section('content')
<div id="content" class="site-content col-md-9">
@if (Session::has('message'))
@@ -80,6 +72,7 @@
{!! Session::get('message') !!}
</div>
@endif
@if (count($errors) > 0)
@if (Session::has('check'))
<?php goto a; ?>
@@ -104,51 +97,39 @@
$encrypted_token = $encrypter->encrypt(csrf_token());
?>
<input id="token" type="hidden" value="{{ $encrypted_token }}">
{!! Form::open(['route' => 'client.form.post', 'method' => 'post', 'enctype' => 'multipart/form-data']) !!}
<article class="hentry">
<div id="form-border" class="comment-respond form-border" style="background:#fff">
<section id="section-categories">
<h2 class="section-title h4 clearfix mb-0">
<i class="line" style="border-color: rgb(0,154,186);"></i>{!! Lang::get('lang.submit_a_ticket') !!}
</h2>
<div class="row mt-4">
@if (Auth::user())
{!! Form::hidden('Name', Auth::user()->user_name, ['class' => 'form-control']) !!}
{!! Form::hidden('Name', Auth::user()->user_name) !!}
{!! Form::hidden('Email', Auth::user()->email) !!}
{!! Form::hidden('mobile', Auth::user()->mobile) !!}
{!! Form::hidden('Code', Auth::user()->country_code) !!}
{!! Form::hidden('Phone', Auth::user()->phone_number) !!}
@else
<div class="col-md-12 form-group {{ $errors->has('Name') ? 'has-error' : '' }}">
{!! Form::label('Name', Lang::get('lang.name')) !!}<span class="text-red"> *</span>
{!! Form::text('Name', null, ['class' => 'form-control']) !!}
</div>
@endif
@if (Auth::user())
{!! Form::hidden('Email', Auth::user()->email, ['class' => 'form-control']) !!}
@else
<div class="col-md-12 form-group {{ $errors->has('Email') ? 'has-error' : '' }}">
{!! Form::label('Email', Lang::get('lang.email')) !!}
@if ($email_mandatory->status == 1 || $email_mandatory->status == '1')
@if ($email_mandatory->status == 1)
<span class="text-red"> *</span>
@endif
{!! Form::email('Email', null, ['class' => 'form-control']) !!}
</div>
@endif
@if (!Auth::user())
<div class="col-md-2 form-group {{ Session::has('country_code_error') ? 'has-error' : '' }}">
{!! Form::label('Code', Lang::get('lang.country-code')) !!}
@if ($email_mandatory->status == 0 || $email_mandatory->status == '0')
<span class="text-red"> *</span>
@endif
{!! Form::text('Code', null, [
'class' => 'form-control',
'placeholder' => $phonecode,
@@ -157,71 +138,39 @@
</div>
<div class="col-md-5 form-group {{ $errors->has('mobile') ? 'has-error' : '' }}">
{!! Form::label('mobile', Lang::get('lang.mobile_number')) !!}
@if ($email_mandatory->status == 0 || $email_mandatory->status == '0')
<span class="text-red"> *</span>
@endif
{!! Form::text('mobile', null, ['class' => 'form-control']) !!}
</div>
<div class="col-md-5 form-group {{ $errors->has('Phone') ? 'has-error' : '' }}">
{!! Form::label('Phone', Lang::get('lang.phone')) !!}
{!! Form::text('Phone', null, ['class' => 'form-control']) !!}
</div>
@else
{!! Form::hidden('mobile', Auth::user()->mobile, ['class' => 'form-control']) !!}
{!! Form::hidden('Code', Auth::user()->country_code, ['class' => 'form-control']) !!}
{!! Form::hidden('Phone', Auth::user()->phone_number, ['class' => 'form-control']) !!}
@endif
<div class="col-md-12 form-group {{ $errors->has('help_topic') ? 'has-error' : '' }}">
{!! Form::label('help_topic', Lang::get('lang.choose_a_help_topic')) !!}
{!! $errors->first('help_topic', '<spam class="help-block">:message</spam>') !!}
<?php
$forms = App\Model\helpdesk\Form\Forms::get();
$helptopic = App\Model\helpdesk\Manage\Help_topic::where('status', '=', 1)->get();
//
?><!---->
<select name="helptopic" class="form-control" id="selectid">
<!-- Help Topic + Priority cùng row -->
<div class="col-md-12 form-group row">
<label class="col-md-2 col-form-label">{{ Lang::get('lang.choose_a_help_topic') }}</label>
<div class="col-md-4">
<?php $helptopic = App\Model\helpdesk\Manage\Help_topic::where('status', 1)->get(); ?>
<select name="helptopic" class="form-control">
@foreach ($helptopic as $topic)
<option value="{!! $topic->id !!}">{!! $topic->topic !!}</option>
<option value="{{ $topic->id }}">{{ $topic->topic }}</option>
@endforeach
</select>
</div>
<!-- priority -->
<?php
$Priority = App\Model\helpdesk\Settings\CommonSettings::select('status')->where('option_name', '=', 'user_priority')->first();
$user_Priority = $Priority->status;
?>
@if (Auth::user())
@if (Auth::user()->active == 1)
@if ($user_Priority == 1)
<div class="col-md-12 form-group">
<div class="row">
<div class="col-md-1">
<label>{!! Lang::get('lang.priority') !!}:</label>
</div>
<div class="col-md-12">
<?php $Priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('status', '=', 1)->get(); ?>
{!! Form::select('priority', ['Priority' => $Priority->pluck('priority_desc', 'priority_id')->toArray()], null, [
'class' => 'form-control select',
<label class="col-md-2 col-form-label">{{ Lang::get('lang.priority') }}</label>
<div class="col-md-4">
<?php $Priority = App\Model\helpdesk\Ticket\Ticket_Priority::where('status', 1)->get(); ?>
{!! Form::select('priority', $Priority->pluck('priority_desc', 'priority_id')->toArray(), null, [
'class' => 'form-control',
]) !!}
</div>
</div>
</div>
@endif
@endif
@endif
<div class="col-md-12 form-group {{ $errors->has('Subject') ? 'has-error' : '' }}">
{!! Form::label('Subject', Lang::get('lang.subject')) !!}<span class="text-red"> *</span>
{!! Form::text('Subject', null, ['class' => 'form-control']) !!}
</div>
<div class="form-group row">
<div class="col-md-2">
<label for="location">Vị trí:</label>
</div>
<div class="col-md-7">
<!-- Location + Department -->
<div class="col-md-12 form-group row">
<label for="location" class="col-md-2 col-form-label">Location</label>
<div class="col-md-4">
<select name="location" class="form-control">
<option value="">-- Chọn vị trí --</option>
@foreach ($locations as $loc)
@@ -232,83 +181,53 @@
@endforeach
</select>
</div>
<label for="submitdept_id" class="col-md-2 col-form-label">Department</label>
<div class="col-md-4">
<select name="submitdept_id" class="form-control" id="submitdept_id">
@foreach ($departments as $dept)
<option value="{{ $dept->id }}"
{{ Auth::user()->dept_id == $dept->id ? 'selected' : '' }}>
{{ $dept->name }}
</option>
@endforeach
</select>
</div>
</div>
<!-- Subject -->
<div class="col-md-12 form-group {{ $errors->has('Subject') ? 'has-error' : '' }}">
{!! Form::label('Subject', Lang::get('lang.subject')) !!}<span class="text-red"> *</span>
{!! Form::text('Subject', null, ['class' => 'form-control']) !!}
</div>
<!-- Message -->
<div class="col-md-12 form-group {{ $errors->has('Details') ? 'has-error' : '' }}">
{!! Form::label('Details', Lang::get('lang.message')) !!}<span class="text-red"> *</span>
{!! Form::textarea('Details', null, ['class' => 'form-control']) !!}
</div>
<!-- Attachment -->
<div class="col-md-12 form-group">
<input type="file" name="attachment[]" multiple /><br />
{!! Lang::get('lang.max') !!}. {!! $max_size_in_actual !!}
</div>
{{-- Event fire --}}
<?php \Illuminate\Support\Facades\Event::dispatch(new App\Events\ClientTicketForm()); ?>
<div class="col-md-12" id="response"> </div>
<div id="ss" class="xs-md-6 form-group {{ $errors->has('') ? 'has-error' : '' }}"> </div>
<!-- Submit Button -->
<div class="col-md-12 form-group">
{!! Form::button('<i class="fas fa-save"></i> ' . Lang::get('lang.submit'), [
'type' => 'submit',
'class' => 'btn btn-info float-right',
'style' => 'style="border-color: rgb(0, 192, 239); background-color: rgb(0, 154, 186); color: white;',
'onclick' => 'this.disabled=true;this.innerHTML="Sending, please wait...";this.form.submit();',
'data-v-fce8d630',
'class' => 'btn btn-primary',
]) !!}
</div>
<div class="col-md-12" id="response"> </div>
<div id="ss" class="xs-md-6 form-group {{ $errors->has('') ? 'has-error' : '' }}"> </div>
{!! Form::close() !!}
</div>
</section>
</div>
</article>
{!! Form::close() !!}
</div>
<!--
|====================================================
| SELECTED FORM STORED IN SCRIPT
|====================================================
-->
<script type="text/javascript">
$(document).ready(function() {
var helpTopic = $("#selectid").val();
send(helpTopic);
$("#selectid").on("change", function() {
helpTopic = $("#selectid").val();
send(helpTopic);
});
function send(helpTopic) {
$.ajax({
url: "{{ url('/get-helptopic-form') }}",
data: {
'helptopic': helpTopic
},
type: "GET",
dataType: "html",
success: function(response) {
$("#response").html(response);
},
error: function(response) {
$("#response").html(response);
}
});
}
});
$(function() {
//Add text editor
$("textarea").summernote({
height: 300,
tabsize: 2,
toolbar: [
['style', ['bold', 'italic', 'underline', 'clear']],
['font', ['strikethrough', 'superscript', 'subscript']],
['fontsize', ['fontsize']],
['color', ['color']],
['para', ['ul', 'ol', 'paragraph']],
['height', ['height']]
]
});
});
</script>
@stop