This commit is contained in:
pbao9
2026-01-30 10:49:48 +07:00
parent 891fe5d161
commit 68ee544ecb
137 changed files with 12519 additions and 695 deletions
@@ -0,0 +1,89 @@
@extends("admin.main")
@section("content")
@if(auth()->guard('admins')->user()->can("add email template"))
<div class="card card-outline card-primary">
<form action="{{ route('template.store') }}" method="post">
@csrf
<div class="card-body">
<div class="row">
<div class="col">
{{--Template name--}}
<div class="form-group row">
<label class="col-md-4" for="name">Template Name</label>
<div class="col-md-8">
<input type="text" id="name" name="name" placeholder="Template Name"
value="{{ old('name') }}" class="form-control">
</div>
</div>
{{--Subject Email--}}
<div class="form-group row">
<label class="col-md-4" for="subject">Subject</label>
<div class="col-md-8">
<input type="text" id="subject" name="subject" placeholder="Subject Email"
value="{{ old('subject') }}" class="form-control">
</div>
</div>
{{--Subject Email--}}
<div class="form-group row">
<label class="col-md-4" for="message">Content Message</label>
<div class="col-md-8">
<textarea class="tinymce" id="message" name="message" rows="10"></textarea>
</div>
</div>
{{--Product Type--}}
<div class="form-group row">
<label class="col-md-4" for="lastname">Email Type</label>
<div class="col-md-8">
<select class="custom-select" name="type_id">
<option value="0">General Messages</option>
@if($type->count())
@foreach($type->all() as $item)
<option
value="{{ $item->id }}" @selected(old('type_id') === $item->id) >{{ $item->name }}</option>
@endforeach
@endif
</select>
</div>
</div>
{{--Status--}}
<div class="form-group row">
<label class="col-md-4" for="lastname">Status</label>
<div class="col-md-8">
<select class="custom-select" name="status">
<option value="1">Active</option>
<option value="0">No Active</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="card-footer">
<a href="{{ route('product.index') }}" class="btn btn-outline-secondary">Trở về</a>
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
</div>
</form>
</div>
<div class="card card-outline card-primary">
@include("admin.template.note")
</div>
@else
<div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any email template
management department</h5>
</div>
@endif
@endsection
@push('scripts')
<script src="{{ asset('lib/tinymce/tinymce.min.js') }}"></script>
<script>
tinymce.init({
selector: '.tinymce',
entity_encoding: "raw",
plugins: "autosave print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template code codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists textcolor wordcount contextmenu colorpicker textpattern help paste"
});
</script>
@endpush
@@ -0,0 +1,91 @@
@extends("admin.main")
@section("content")
@if(auth()->guard('admins')->user()->can("edit email template"))
<div class="card card-outline card-primary">
<form action="{{ route('template.update') }}" method="post">
@csrf
@method('put')
<input type="hidden" name="id" value="{{ $template->id }}">
<div class="card-body">
<div class="row">
<div class="col">
{{--Template name--}}
<div class="form-group row">
<label class="col-md-4" for="name">Template Name</label>
<div class="col-md-8">
<input type="text" id="name" name="name" placeholder="Template Name"
value="{{ $template->name }}" class="form-control">
</div>
</div>
{{--Subject Email--}}
<div class="form-group row">
<label class="col-md-4" for="subject">Subject</label>
<div class="col-md-8">
<input type="text" id="subject" name="subject" placeholder="Subject Email"
value="{{ $template->subject }}" class="form-control">
</div>
</div>
{{--Subject Email--}}
<div class="form-group row">
<label class="col-md-4" for="message">Content Message</label>
<div class="col-md-8">
<textarea class="tinymce" id="message" name="message"
rows="10">{!! $template->message !!}</textarea>
</div>
</div>
{{--Product Type--}}
<div class="form-group row">
<label class="col-md-4" for="lastname">Email Type</label>
<div class="col-md-8">
<select class="custom-select" name="type_id">
<option value="0">General Messages</option>
@if($type->count())
@foreach($type->all() as $item)
<option
value="{{ $item->id }}" @selected($template->type_id === $item->id) >{{ $item->name }}</option>
@endforeach
@endif
</select>
</div>
</div>
{{--Status--}}
<div class="form-group row">
<label class="col-md-4" for="lastname">Status</label>
<div class="col-md-8">
<select class="custom-select" name="status">
<option value="1" @selected($template->status === 1)>Active</option>
<option value="0" @selected($template->status === 0)>No Active</option>
</select>
</div>
</div>
</div>
</div>
</div>
<div class="card-footer">
<a href="{{ route('template.index') }}" class="btn btn-outline-secondary">Trở về</a>
<button type="submit" class="btn btn-outline-primary">Lưu dữ liệu</button>
</div>
</form>
</div>
<div class="card card-outline card-primary">
@include("admin.template.note")
</div>
@else
<div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any email template management department</h5>
</div>
@endif
@push('scripts')
<script src="{{ asset('lib/tinymce/tinymce.min.js') }}"></script>
<script>
tinymce.init({
selector: '.tinymce',
entity_encoding: "raw",
plugins: "autosave print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template code codesample table charmap hr pagebreak nonbreaking anchor insertdatetime advlist lists textcolor wordcount contextmenu colorpicker textpattern help paste"
});
</script>
@endpush
@endsection
@@ -0,0 +1,82 @@
@php use App\Http\Helpers\Helper; @endphp
@extends("admin.main")
@section("content")
@if(auth()->guard('admins')->user()->can('manager email template'))
<div class="card card-primary card-outline">
<div class="card-header">
<a href="{{ route('template.create') }}" class="btn btn-outline-secondary">
<i class="fas fa-plus"></i> Add New Template
</a>
</div>
<div class="card-body">
<table class="table table-invoice table-bordered">
<thead>
<tr>
<th style="width: 10px">
<label for=""></label><input type="checkbox" name="check" class="check-all" id="">
</th>
<th>Status</th>
<th>Template Name</th>
<th>Type Name</th>
<th style="width: 40px"></th>
<th style="width: 40px"></th>
</tr>
</thead>
<tbody>
@if($template->count())
@foreach($template->all() as $item)
<tr>
<td class="text-center">
<input type="checkbox" name="id[]" id="" value="{{ $item->id }}">
</td>
<td class="text-center">
{!! Helper::Status($item->status) !!}
</td>
<td class="text-center">
{{ $item->name }}
</td>
<td class="text-center">
@if($item->Type)
{{ $item->Type->name }}
@else
General Message
@endif
</td>
<td>
<a class="btn btn-warning btn-sm"
href="{{ route('template.edit',['id' => $item->id]) }}">
<i class="fas fa-user-edit"></i>
</a>
</td>
<td>
@if(auth()->guard('admins')->user()->can('delete email template'))
<form method="post" class="d-inline"
action="{{ route('product.destroy') }}">
@csrf
@method('delete')
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
class="btn btn-sm btn-danger" data-original-title="Xoá">
<i class="fas fa-trash"></i>
</button>
</form>
@endif
</td>
@endforeach
@endif
</tbody>
</table>
</div>
<div class="card-footer">
{{ $template->withQueryString()->links() }}
</div>
</div>
@else
<div class="alert alert-danger alert-dismissible">
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Email template
management department</h5>
</div>
@endif
@endsection
@@ -0,0 +1,49 @@
<div class="card-body box-info__noted">
<dl class="row">
<dt class="col-md-12">
<h3>Client Related</h3>
<hr>
</dt>
<dt class="col-sm-4">Client ID</dt>
<dd class="col-sm-8">{$client_id}</dd>
<dt class="col-sm-4">First Name</dt>
<dd class="col-sm-8">{$client_first_name}</dd>
<dt class="col-sm-4">Last Name</dt>
<dd class="col-sm-8">{$client_last_name}</dd>
<dt class="col-sm-4">Company Name</dt>
<dd class="col-sm-8">{$client_company_name}</dd>
<dt class="col-sm-4">Email Address</dt>
<dd class="col-sm-8">{$client_email}</dd>
<dt class="col-sm-4">Address</dt>
<dd class="col-sm-8">{$client_address}</dd>
<dt class="col-sm-4">City</dt>
<dd class="col-sm-8">{$client_city}</dd>
<dt class="col-sm-4">State/Region</dt>
<dd class="col-sm-8">{$client_state}</dd>
<dt class="col-sm-4">Postcode</dt>
<dd class="col-sm-8">{$client_postcode}</dd>
<dt class="col-sm-4">Country</dt>
<dd class="col-sm-8">{$client_country}</dd>
<dt class="col-sm-4">Phone Number</dt>
<dd class="col-sm-8">{$client_phone}</dd>
<dt class="col-sm-4">Status</dt>
<dd class="col-sm-8">{$client_status}</dd>
<dt class="col-md-12">
<h3>Product/Service Related</h3>
<hr>
</dt>
<dt class="col-sm-4">Order ID</dt>
<dd class="col-sm-8">{$order_id}</dd>
<dt class="col-sm-4">Service ID</dt>
<dd class="col-sm-8">{$service_id}</dd>
<dt class="col-sm-4">Product Name</dt>
<dd class="col-sm-8">{$product_name}</dd>
<dt class="col-sm-4">Os Name</dt>
<dd class="col-sm-8">{$os_name}</dd>
<dt class="col-sm-4">Username</dt>
<dd class="col-sm-8">{$service_username}</dd>
<dt class="col-sm-4">Password</dt>
<dd class="col-sm-8">{$service_password}</dd>
</dl>
</div>