landing page completed
@ -1514,6 +1514,24 @@ CREATE TABLE IF NOT EXISTS `tbl_visa_grants` (
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
||||
');
|
||||
|
||||
DB::statement('
|
||||
CREATE TABLE IF NOT EXISTS `tbl_banners` (
|
||||
`banner_id` int(11) AUTO_INCREMENT PRIMARY KEY,
|
||||
`display` varchar(255) NULL DEFAULT NULL,
|
||||
`title` varchar(250) NULL DEFAULT NULL,
|
||||
`text` text NULL DEFAULT NULL,
|
||||
`extra_content` LONGTEXT NULL DEFAULT NULL,
|
||||
`cover` varchar(255) NULL DEFAULT NULL,
|
||||
`display_order` int(11) NOT NULL DEFAULT 1,
|
||||
`status` int(11) NOT NULL DEFAULT 1,
|
||||
`createdby` int(11) DEFAULT NULL,
|
||||
`updatedby` int(11) DEFAULT NULL,
|
||||
`created_at` timestamp NULL DEFAULT NULL,
|
||||
`updated_at` timestamp NULL DEFAULT NULL
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4
|
||||
');
|
||||
|
||||
if (!(DB::table('users')->first())) {
|
||||
DB::statement("INSERT INTO `tbl_users` (`id`, `name`, `email`, `username`, `email_verified_at`, `status`, `password`, `is_admin`, `remember_token`, `created_at`, `updated_at`) VALUES
|
||||
(1, 'Prajwal Adhikari', 'prajwalbro@hotmail.com', 'prajwalbro@hotmail.com', '2024-04-18 09:59:01', 1, '$2y$10$3zlF9VeXexzWKRDPZuDio.W7RZIC3tU.cjwMoLzG8ki8bVwAQn1WW', 1, NULL, '2024-04-18 09:58:39', '2024-04-18 09:58:46');");
|
||||
|
196
app/Http/Controllers/BannerController.php
Normal file
@ -0,0 +1,196 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Banners;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
|
||||
class BannerController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Banners $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
createActivityLog(BannerController::class, 'index', ' Banners index');
|
||||
$data = Banners::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("crud.generated.banner.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
createActivityLog(BannerController::class, 'create', ' Banners create');
|
||||
$TableData = Banners::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
return view("crud.generated.banner.create", compact('TableData'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
createActivityLog(BannerController::class, 'store', ' Banners store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_banners')]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(BannerController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Banners Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('banner.index')->with('success', 'The Banners created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Banners::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Banners::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
createActivityLog(BannerController::class, 'show', ' Banners show');
|
||||
$data = Banners::findOrFail($id);
|
||||
|
||||
return view("crud.generated.banner.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
createActivityLog(BannerController::class, 'edit', ' Banners edit');
|
||||
$TableData = Banners::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Banners::findOrFail($id);
|
||||
if ($request->ajax()) {
|
||||
$html = view("crud.generated.banner.ajax.edit", compact('data'))->render();
|
||||
return response()->json(['status' => true, 'content' => $html], 200);
|
||||
}
|
||||
return view("crud.generated.banner.edit", compact('data', 'TableData'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
createActivityLog(BannerController::class, 'update', ' Banners update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('banner_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(BannerController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Banners updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('banner.index')->with('success','The Banners updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Banners updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
createActivityLog(BannerController::class, 'destroy', ' Banners destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(BannerController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Banners Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
createActivityLog(BannerController::class, 'destroy', ' Banners destroy');
|
||||
$data = Banners::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(BannerController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Banners Deleted Successfully.'], 200);
|
||||
}
|
||||
}
|
@ -3,6 +3,7 @@
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Articles;
|
||||
use App\Models\Banners;
|
||||
use App\Models\Benefits;
|
||||
use App\Models\Blogs;
|
||||
use App\Models\Countries;
|
||||
@ -43,6 +44,7 @@ class WebsiteController extends Controller
|
||||
public function home()
|
||||
{
|
||||
return view('landing.index', [
|
||||
'banners' => Banners::get(),
|
||||
'benefits' => Benefits::get(),
|
||||
'success_stories' => Success_stories::get(),
|
||||
'visa_grants' => Visa_grants::get(),
|
||||
|
52
app/Models/Banners.php
Normal file
@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
|
||||
class Banners extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
protected $primaryKey = 'banner_id';
|
||||
public $timestamps = true;
|
||||
protected $fillable = [
|
||||
'display',
|
||||
'title',
|
||||
'text',
|
||||
'extra_content',
|
||||
'cover',
|
||||
'display_order',
|
||||
'status',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
|
||||
];
|
||||
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
protected function getStatusNameAttribute()
|
||||
{
|
||||
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
|
||||
}
|
||||
|
||||
protected function createdBy(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => User::find($value) ? User::find($value)->name : '',
|
||||
);
|
||||
}
|
||||
|
||||
protected function updatedBy(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => User::find($value) ? User::find($value)->name : '',
|
||||
);
|
||||
}
|
||||
}
|
@ -42,11 +42,11 @@
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li>
|
||||
{{-- <a href="{{ route('enquiry.destroy', $item->id) }}" class="dropdown-item"
|
||||
onclick="confirmDelete(this.href)">
|
||||
<a href="{{ route('enquiry.destroy', $item->enquiry_id) }}"
|
||||
class="dropdown-item" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Delete') }}
|
||||
</a> --}}
|
||||
</a>
|
||||
{{-- @if ($item->is_read == 0)
|
||||
<a href="{{ route('enquiry.markAsRead', ['id' => $item->id]) }}"
|
||||
class="dropdown-item" onclick="confirmRead(this.href)">
|
||||
|
@ -75,6 +75,7 @@
|
||||
|
||||
|
||||
<li class="menu-title"><i class="ri-more-fill"></i> <span data-key="t-pages">Pages</span></li>
|
||||
{{ CCMS::createMenuLink('Banner', route('banner.index')) }}
|
||||
{{ CCMS::createMenuLink('Enquiries', route('enquiries-list')) }}
|
||||
{{ CCMS::createMenuLink('Testimonials', route('success_stories.index')) }}
|
||||
{{ CCMS::createMenuLink('Benefits', route('benefits.index')) }}
|
||||
|
167
resources/views/crud/generated/banner/create.blade.php
Normal file
@ -0,0 +1,167 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">Add Banner</h4>
|
||||
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">Add Banner</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('banner.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-xl-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createTextarea('text', 'text ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="card mt-3">
|
||||
<h4>Custom Details</h4>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('banner.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Images
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('cover', 'Cover Photo') }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image_thumb', 'Image Thumb') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('banner.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
createFormFieldsRepeater();
|
||||
// addFormField();
|
||||
// const addButtonContainer = document.getElementById('add-button-container');
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Fields';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Icon </label>");
|
||||
const fieldTitleInput = document.createElement('input');
|
||||
fieldTitleInput.setAttribute('type', 'text');
|
||||
fieldTitleInput.setAttribute('name', `fieldTitles[]`);
|
||||
fieldTitleInput.setAttribute('placeholder', 'Icon');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldTitleInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldTitleInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
const fieldInputContainer2 = document.createElement('div');
|
||||
fieldInputContainer2.classList.add("col");
|
||||
fieldInputContainer2.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Title </label>");
|
||||
const fieldHeaderInput = document.createElement('input');
|
||||
fieldHeaderInput.setAttribute('type', 'text');
|
||||
fieldHeaderInput.setAttribute('name', `fieldHeader[]`);
|
||||
fieldHeaderInput.setAttribute('placeholder', 'Title')
|
||||
fieldHeaderInput.classList.add('form-control');
|
||||
fieldInputContainer2.appendChild(fieldHeaderInput);
|
||||
fieldContainer.appendChild(fieldInputContainer2);
|
||||
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Description </label>");
|
||||
const fieldDescriptionsInput = document.createElement('input');
|
||||
fieldDescriptionsInput.setAttribute('type', 'text');
|
||||
fieldDescriptionsInput.setAttribute('name', `fieldDescriptions[]`);
|
||||
fieldDescriptionsInput.setAttribute('placeholder', 'Description')
|
||||
fieldDescriptionsInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDescriptionsInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>"
|
||||
);
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer4.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
makeSortable();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
function makeSortable() {
|
||||
$(document).ready(function() {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
@endpush
|
233
resources/views/crud/generated/banner/edit.blade.php
Normal file
@ -0,0 +1,233 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<!-- start page title -->
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
|
||||
<h4 class="mb-sm-0">Edit Banner</h4>
|
||||
|
||||
|
||||
<div class="page-title-right">
|
||||
<ol class="breadcrumb m-0">
|
||||
<li class="breadcrumb-item"><a href="javascript: void(0);">Dashboards</a></li>
|
||||
<li class="breadcrumb-item active">Edit Banner</li>
|
||||
</ol>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end page title -->
|
||||
<form action="{{ route('banner.update', $data->banner_id) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='banner_id' value='{{ $data->banner_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-xl-9 mb-3">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('text', 'text ckeditor-classic', 'Description', $data->text) }}
|
||||
</div>
|
||||
<div class="border mt-3 border-dashed"></div>
|
||||
<div>
|
||||
@if ($data->extra_content)
|
||||
@foreach (json_decode($data->extra_content) as $content)
|
||||
<div class="form-field row">
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Title
|
||||
</label><input type="text" name="fieldTitles[]" placeholder="Title"
|
||||
class="form-control" autocomplete="off" value="{{ $content->fieldTitle }}">
|
||||
</div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label"> Header
|
||||
</label><input type="text" name="fieldHeader[]" placeholder="Header"
|
||||
class="form-control" autocomplete="off" value="{{ $content->fieldHeader }}">
|
||||
</div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label">
|
||||
Description </label><input type="text" name="fieldDescriptions[]"
|
||||
class="form-control" value="{{ $content->fieldDescriptions }}"></div>
|
||||
<div class="col"><label for="fieldName" class="form-label col-form-label">
|
||||
<span class="row-selector-handle">☰</span></label><button
|
||||
class="btn btn-danger col form-control" onclick="removeRow(this);">Remove
|
||||
Field</button></div>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<h5>Additional Content</h5>
|
||||
<div id="repeater-container"></div>
|
||||
<div id="add-button-container"></div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">SEO</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12">{{ createText('seo_title', 'seo_title', 'Seo Title', '', $data->sec_title) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_keywords', 'seo_keywords ', 'Seo Keywords', $data->seo_keywords) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('seo_descriptions', 'seo_descriptions ', 'Seo Descriptions', '', $data->seo_descriptions) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('og_tags', 'og_tags ', 'Og Tags', '', $data->og_tags) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('banner.index')); ?>
|
||||
</div>
|
||||
<div class="col-xl-3">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<h4 class="card-title mb-0">
|
||||
Images
|
||||
</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createImageInput('cover', 'Cover Photo', '', $data->cover) }}
|
||||
</div>
|
||||
<div class="border mb-3 border-dashed"></div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createImageInput('image_thumb', 'Image Thumb', '', $data->image_thumb) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('banner.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
function createFormFieldsRepeater() {
|
||||
const repeaterContainer = document.getElementById('repeater-container');
|
||||
const addButtonContainer = document.getElementById('add-button-container');
|
||||
|
||||
// Add button
|
||||
const addButton = document.createElement('button');
|
||||
addButton.textContent = 'Add Field';
|
||||
addButton.addEventListener('click', addFormField);
|
||||
addButtonContainer.appendChild(addButton);
|
||||
|
||||
// Repeater fields
|
||||
let fieldCount = 0;
|
||||
|
||||
function addFormField() {
|
||||
event.preventDefault();
|
||||
fieldCount++;
|
||||
|
||||
// Create form field container
|
||||
const fieldContainer = document.createElement('div');
|
||||
fieldContainer.classList.add('form-field');
|
||||
fieldContainer.classList.add('row');
|
||||
const fieldInputContainer = document.createElement('div');
|
||||
fieldInputContainer.classList.add("col");
|
||||
fieldInputContainer.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Icon </label>");
|
||||
const fieldTitleInput = document.createElement('input');
|
||||
fieldTitleInput.setAttribute('type', 'text');
|
||||
fieldTitleInput.setAttribute('name', `fieldTitles[]`);
|
||||
fieldTitleInput.setAttribute('placeholder', 'Icon');
|
||||
fieldInputContainer.classList.add('col');
|
||||
fieldTitleInput.classList.add('form-control');
|
||||
fieldInputContainer.appendChild(fieldTitleInput);
|
||||
fieldContainer.appendChild(fieldInputContainer);
|
||||
|
||||
// header input
|
||||
const fieldInputContainer2 = document.createElement('div');
|
||||
fieldInputContainer2.classList.add("col");
|
||||
fieldInputContainer2.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Title </label>");
|
||||
const fieldHeaderInput = document.createElement('input');
|
||||
fieldHeaderInput.setAttribute('type', 'text');
|
||||
fieldHeaderInput.setAttribute('name', `fieldHeader[]`);
|
||||
fieldHeaderInput.setAttribute('placeholder', 'Title');
|
||||
fieldHeaderInput.classList.add('form-control');
|
||||
fieldInputContainer2.appendChild(fieldHeaderInput);
|
||||
fieldContainer.appendChild(fieldInputContainer2);
|
||||
|
||||
//description input
|
||||
const fieldInputContainer3 = document.createElement('div');
|
||||
fieldInputContainer3.classList.add("col");
|
||||
fieldInputContainer3.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\"> Description </label>");
|
||||
const fieldDescriptionsInput = document.createElement('input');
|
||||
fieldDescriptionsInput.setAttribute('type', 'text');
|
||||
fieldDescriptionsInput.setAttribute('name', `fieldDescriptions[]`);
|
||||
fieldDescriptionsInput.setAttribute('placeholder', 'Description')
|
||||
fieldDescriptionsInput.classList.add('form-control');
|
||||
fieldInputContainer3.appendChild(fieldDescriptionsInput);
|
||||
fieldContainer.appendChild(fieldInputContainer3);
|
||||
|
||||
// Remove button
|
||||
const fieldInputContainer4 = document.createElement('div');
|
||||
fieldInputContainer4.classList.add("col");
|
||||
fieldInputContainer4.innerHTML = (
|
||||
"<label for=\"fieldName\" class=\"form-label col-form-label\">   <span class=\"row-selector-handle\">☰</span></label>"
|
||||
);
|
||||
const removeButton = document.createElement('button');
|
||||
removeButton.textContent = 'Remove Field';
|
||||
removeButton.classList.add('btn');
|
||||
removeButton.classList.add('btn-danger');
|
||||
removeButton.classList.add('col');
|
||||
removeButton.classList.add('form-control');
|
||||
removeButton.addEventListener('click', () => {
|
||||
//event.preventDefault();
|
||||
repeaterContainer.removeChild(fieldContainer);
|
||||
});
|
||||
fieldInputContainer3.appendChild(removeButton);
|
||||
fieldContainer.appendChild(fieldInputContainer4);
|
||||
|
||||
|
||||
repeaterContainer.appendChild(fieldContainer);
|
||||
}
|
||||
makeSortable();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function removeRow(button) {
|
||||
event.preventDefault();
|
||||
const row = button.parentNode.parentNode;
|
||||
row.parentNode.removeChild(row);
|
||||
}
|
||||
</script>
|
||||
<!-- jQuery library -->
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
|
||||
<!-- jQuery UI Sortable library -->
|
||||
<script src="https://code.jquery.com/ui/1.13.1/jquery-ui.js"></script>
|
||||
|
||||
<!-- Add the CSS for jQuery UI Sortable (optional, but recommended for styling) -->
|
||||
<link rel="stylesheet" href="https://code.jquery.com/ui/1.13.1/themes/base/jquery-ui.css">
|
||||
|
||||
<script>
|
||||
function makeSortable() {
|
||||
$(document).ready(function() {
|
||||
// Make the repeater-container sortable
|
||||
$("#repeater-container").sortable({
|
||||
axis: "y", // Allow sorting only vertically
|
||||
handle: ".row-selector-handle", // Define the handle element for dragging (form-field class)
|
||||
containment: "parent", // Keep the sorting within the repeater-container
|
||||
});
|
||||
|
||||
// Disable text selection while dragging to avoid text highlighting
|
||||
$("#repeater-container").disableSelection();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
createFormFieldsRepeater();
|
||||
</script>
|
||||
@endpush
|
231
resources/views/crud/generated/banner/index.blade.php
Normal file
@ -0,0 +1,231 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Banner List") }}</h2>
|
||||
<a href="{{ route('banner.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_banner" data-url="{{ route('banner.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("display") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("extra_content") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("cover") }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span
|
||||
class="overline-title">{{ label("Action") }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
|
||||
<tr data-id="{{$item->banner_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->display }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">{{ $item->extra_content }}</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->cover) }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{route('banner.show',[$item->banner_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('banner.edit',[$item->banner_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('banner.toggle',[$item->banner_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('banner.destroy',[$item->banner_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('banner.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete=false;
|
||||
}
|
||||
});
|
||||
});
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@endpush
|
||||
|
29
resources/views/crud/generated/banner/show.blade.php
Normal file
@ -0,0 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('banner.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Display : </b> <span>{{$data->display}}</span></p><p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Text : </b> <span>{{$data->text}}</span></p><p><b>Extra Content : </b> <span>{{$data->extra_content}}</span></p><p><b>Cover : </b> <span>{{$data->cover}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Createdby : </b> <span>{{$data->createdby}}</span></p><p><b>Updatedby : </b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{$data->created_at}}</span></p>
|
||||
<p><b>Created By :</b> <span>{{$data->createdBy}}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{$data->updated_at}}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{$data->updatedBy}}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endSection
|
@ -30,7 +30,7 @@
|
||||
}
|
||||
|
||||
.hero-section {
|
||||
background: url({{ asset('trust/assets/images/background/sweden.png') }}) no-repeat center top/cover;
|
||||
/* background: url({{ asset('trust/assets/images/background/sweden.png') }}) no-repeat center top/cover; */
|
||||
color: var(--dark-text);
|
||||
/* padding: 100px 0; */
|
||||
}
|
||||
@ -109,7 +109,8 @@
|
||||
.benefit-icon {
|
||||
width: 180px;
|
||||
height: 180px;
|
||||
background: var(--primary-color);
|
||||
background: linear-gradient(to right, #e8171a 60%, #ffa21c 100%);
|
||||
;
|
||||
color: white;
|
||||
border-radius: 50%;
|
||||
display: flex;
|
||||
@ -196,7 +197,7 @@
|
||||
}
|
||||
|
||||
.text-primary-custom {
|
||||
color: var(--primary-color) !important;
|
||||
color: #e8171a !important;
|
||||
}
|
||||
|
||||
.flowchart-container {
|
||||
@ -799,43 +800,47 @@
|
||||
|
||||
<section class="hero-section">
|
||||
<div class="container-fluid">
|
||||
<div class="row min-vh-100" style="background: linear-gradient(to right, #e8171a 60%, #ffa21c 100%);">
|
||||
<div class="col-lg-6">
|
||||
<img src="" alt="Landing Image" class="img-fluid h-100 w-100" style="object-fit: cover;">
|
||||
<div class="row min-vh-100" style="background: linear-gradient(135deg, #264552, #203a43, #19343f);">
|
||||
<div class="col-lg-6 d-flex flex-column">
|
||||
@foreach ($banners as $banner)
|
||||
<img src="{{ asset($banner->cover) }}" alt="Landing Image" class="img-fluid h-100 w-100"
|
||||
style="object-fit: cover;">
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 d-flex align-items-center justify-content-center p-4">
|
||||
<div class="w-100" style="max-width: 500px;">
|
||||
<div class="form-container animate-fade-in-up">
|
||||
<h3 class="form-title">Registration Form</h3>
|
||||
<div class="form-container animate-fade-in-up p-4 rounded-4 shadow"
|
||||
style="background: #c9c6c6; color: #333; border: 1px solid #ddd; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.05);">
|
||||
<h3 class="form-title text-center mb-4" style="color: #222;">Registration Form</h3>
|
||||
<form id="enquiry-form" action="{{ route('form.submit-enquiry') }}" method="POST">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<div class="form-group mb-3">
|
||||
<label for="name" class="form-label">Full Name <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="name" name="name"
|
||||
placeholder="Enter your full name" required>
|
||||
<input type="text" class="form-control border border-light-subtle" id="name"
|
||||
name="name" placeholder="Enter your full name" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group mb-3">
|
||||
<label for="email" class="form-label">Email Address <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="email" class="form-control" id="email" name="email"
|
||||
placeholder="Enter your email" required>
|
||||
<input type="email" class="form-control border border-light-subtle" id="email"
|
||||
name="email" placeholder="Enter your email" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="form-group mb-3">
|
||||
<label for="phone" class="form-label">Phone Number <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="tel" class="form-control" id="phone" name="phone"
|
||||
placeholder="Enter your phone number" required>
|
||||
<input type="tel" class="form-control border border-light-subtle" id="phone"
|
||||
name="phone" placeholder="Enter your phone number" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="qualification" class="form-label">
|
||||
Highest Qualification<span class="text-danger">*</span>
|
||||
</label>
|
||||
<select class="form-control" id="qualification" name="qualification" required>
|
||||
<div class="form-group mb-3">
|
||||
<label for="qualification" class="form-label">Highest Qualification <span
|
||||
class="text-danger">*</span></label>
|
||||
<select class="form-control border border-light-subtle" id="qualification"
|
||||
name="qualification" required>
|
||||
<option value="">-Select Qualification-</option>
|
||||
<option value="10">+2 or Equivalent</option>
|
||||
<option value="20">Bachelors (3 year) or Equivalent</option>
|
||||
@ -844,35 +849,36 @@
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="score" class="form-label">Score<span class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="score" name="score"
|
||||
placeholder="Enter Score" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label for="passed_year" class="form-label">Passed Year<span
|
||||
<div class="form-group mb-3">
|
||||
<label for="score" class="form-label">Score <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control" id="passed_year" name="passed_year"
|
||||
placeholder="Enter Passed Year" required>
|
||||
<input type="text" class="form-control border border-light-subtle" id="score"
|
||||
name="score" placeholder="Enter Score" required>
|
||||
</div>
|
||||
|
||||
<div class="form-group mb-3">
|
||||
<label for="passed_year" class="form-label">Passed Year <span
|
||||
class="text-danger">*</span></label>
|
||||
<input type="text" class="form-control border border-light-subtle" id="passed_year"
|
||||
name="passed_year" placeholder="Enter Passed Year" required>
|
||||
</div>
|
||||
|
||||
@if ($setting->recaptcha_site_key)
|
||||
<div class="form-group">
|
||||
<div class="form-group mb-3">
|
||||
<div id="g-recaptcha-response" class="g-recaptcha mb-2"
|
||||
data-sitekey="{{ $setting->recaptcha_site_key }}"></div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<button type="submit" class="btn-primary" id="submit">
|
||||
<button type="submit" class="btn btn-dark w-100" id="submit">
|
||||
Register
|
||||
</button>
|
||||
|
||||
<div id="message-notification" class="text-success mt-3"></div>
|
||||
|
||||
<div id="message-notification" class="text-success mt-3 text-center"></div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -880,33 +886,48 @@
|
||||
</section>
|
||||
|
||||
|
||||
<section class="section-padding bg-light">
|
||||
<div class="container">
|
||||
<h2 class="section-title text-center">
|
||||
Testimonials
|
||||
</h2>
|
||||
<div class="row g-3">
|
||||
@foreach ($success_stories as $story)
|
||||
<div class="col-xl-3 col-lg-4 col-md-6 col-12">
|
||||
<div class="visa-post">
|
||||
@foreach (json_decode($story->extra_content) as $content)
|
||||
<iframe width="100%" height="350" src="{{ $content->fieldHeader }}"
|
||||
title="{{ $story->title }}" frameborder="0"
|
||||
<!-- Successful Visa Grants -->
|
||||
<section class="section-padding" style="background-color: #aeb5bb">
|
||||
@foreach ($success_stories as $story)
|
||||
<div class="container">
|
||||
<h2 class="section-title text-center" style="color: #fc4e24">
|
||||
Trusted by Many — Testimonials
|
||||
</h2>
|
||||
<div class="row g-3">
|
||||
@php
|
||||
function convertToEmbedUrl($url)
|
||||
{
|
||||
$parsed = parse_url($url);
|
||||
if (isset($parsed['query'])) {
|
||||
parse_str($parsed['query'], $queryParams);
|
||||
if (isset($queryParams['v'])) {
|
||||
return 'https://www.youtube.com/embed/' . $queryParams['v'];
|
||||
}
|
||||
}
|
||||
return $url; // fallback
|
||||
}
|
||||
@endphp
|
||||
|
||||
@foreach (json_decode($story->extra_content) as $content)
|
||||
<div class="col-xl-3 col-lg-4 col-md-6 col-12">
|
||||
<div class="visa-post">
|
||||
<iframe width="100%" height="350"
|
||||
src="{{ convertToEmbedUrl($content->fieldHeader) }}" title="video1" frameborder="0"
|
||||
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||
referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</section>
|
||||
|
||||
<!-- Benefits of choosing TEF -->
|
||||
<section class="section-padding">
|
||||
<section class="section-padding bg-light">
|
||||
<div class="container">
|
||||
<h2 class="section-title text-center">
|
||||
Benefits
|
||||
<h2 class="section-title text-center" style="color: #fc4e24">
|
||||
Benefits of Choosing Us
|
||||
</h2>
|
||||
<div class="row g-4">
|
||||
<!-- Benefit 1 -->
|
||||
@ -914,7 +935,8 @@
|
||||
@foreach (json_decode($tef->extra_content) as $content)
|
||||
<div class="col-lg-3 col-md-6">
|
||||
<div class="text-center">
|
||||
<div class="benefit-icon mb-3" style="font-size: 2.5rem; color: #5291b6;">
|
||||
<div class="benefit-icon mb-3"
|
||||
style="font-size: 2.5rem; color: linear-gradient(to right, #e8171a 60%, #ffa21c 100%);">
|
||||
{{ $content->fieldHeader }}
|
||||
</div>
|
||||
<h5 class="text-primary-custom">{{ $tef->title }}</h5>
|
||||
@ -929,16 +951,16 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<section class="section-padding bg-light">
|
||||
<section class="section-padding" style="background-color: #c1c8cf">
|
||||
<div class="container">
|
||||
<h2 class="section-title text-center">
|
||||
Success Stories
|
||||
<h2 class="section-title text-center" style="color: #fc4e24">
|
||||
Our Success Stories
|
||||
</h2>
|
||||
<div class="row g-3">
|
||||
@foreach ($visa_grants as $visas)
|
||||
<div class="col-xl-3 col-lg-4 col-md-6 col-12">
|
||||
<div class="visa-post">
|
||||
<img src="{{ asset($visas->cover) }}" />
|
||||
<img src="{{ asset($visas->cover) }}" width="400px" height="400px" />
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
@ -946,6 +968,73 @@
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.7.1.min.js"
|
||||
integrity="sha256-/JqT3SQfawRcv/BIHPThkBvs0OEvtFFmqPF/lYI/Cxo=" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/toastr.js/latest/toastr.min.js"
|
||||
integrity="sha512-VEd+nq25CkR676O+pLBnDW09R7VQX9Mdiij052gVCp5yVH3jGtH70Ho/UUv4mJDsEdTvqRCFZg0NKGiojGnUCw=="
|
||||
crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
|
||||
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
|
||||
|
||||
<script>
|
||||
$(document).on("submit", "#enquiry-form", function(event) {
|
||||
event.preventDefault();
|
||||
|
||||
const action = $(this).attr("action");
|
||||
const url = new URL(window.location.href);
|
||||
const isRecaptchaEnabled = !!"{{ $setting->recaptcha_site_key }}";
|
||||
|
||||
|
||||
let formData = $(this).serializeArray();
|
||||
|
||||
if (isRecaptchaEnabled) {
|
||||
formData.push({
|
||||
name: 'g-recaptcha-response',
|
||||
value: grecaptcha.getResponse()
|
||||
});
|
||||
}
|
||||
|
||||
$("#submit")
|
||||
.html(`Submitting...`)
|
||||
.attr("disabled", true);
|
||||
|
||||
$.ajax({
|
||||
url: action,
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
data: formData,
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr("content"),
|
||||
},
|
||||
success: function(response) {
|
||||
if (response.status == 200) {
|
||||
toastr.success(response.message);
|
||||
document.getElementById("message-notification").innerHTML = response.message;
|
||||
$("#enquiry-form")[0].reset();
|
||||
}
|
||||
},
|
||||
error: function(xhr) {
|
||||
if (xhr.status === 422 || xhr.status === 500) {
|
||||
let errors = xhr.responseJSON.errors;
|
||||
for (let key in errors) {
|
||||
const errorMessage = errors[key][0];
|
||||
toastr.error(errorMessage);
|
||||
}
|
||||
} else {
|
||||
console.log(xhr.responseText);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
// grecaptcha.reset();
|
||||
$("#submit").html(`<span>Register</span>`)
|
||||
.attr("disabled", false);
|
||||
form.reset();
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
15
routes/CRUDgenerated/route.banner.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
use App\Http\Controllers\BannerController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
Route::prefix("banner")->group(function () {
|
||||
Route::get('/', [BannerController::class, 'index'])->name('banner.index');
|
||||
Route::get('/create', [BannerController::class, 'create'])->name('banner.create');
|
||||
Route::post('/store', [BannerController::class, 'store'])->name('banner.store');
|
||||
Route::post('/sort', [BannerController::class, 'sort'])->name('banner.sort');
|
||||
Route::post('/updatealias', [BannerController::class, 'updatealias'])->name('banner.updatealias');
|
||||
Route::get('/show/{id}', [BannerController::class, 'show'])->name('banner.show');
|
||||
Route::get('/edit/{id}', [BannerController::class, 'edit'])->name('banner.edit') ;
|
||||
Route::post('/update/{id}', [BannerController::class, 'update'])->name('banner.update');
|
||||
Route::delete('/destroy/{id}', [BannerController::class, 'destroy'])->name('banner.destroy');
|
||||
Route::get('/toggle/{id}', [BannerController::class, 'toggle'])->name('banner.toggle');
|
||||
});
|
@ -151,5 +151,6 @@ Route::middleware('auth')->group(function () {
|
||||
require __DIR__ . '/CRUDgenerated/route.success_stories.php';
|
||||
require __DIR__ . '/CRUDgenerated/route.benefits.php';
|
||||
require __DIR__ . '/CRUDgenerated/route.visa_grants.php';
|
||||
require __DIR__ . '/CRUDgenerated/route.banner.php';
|
||||
});
|
||||
require __DIR__ . '/route.client.php';
|
||||
|
BIN
storage/app/public/files/1/676540a0d26a6.jpg
Normal file
After Width: | Height: | Size: 309 KiB |
BIN
storage/app/public/files/1/676d028dc4cc1.jpg
Normal file
After Width: | Height: | Size: 280 KiB |
BIN
storage/app/public/files/1/676d030f74195.jpg
Normal file
After Width: | Height: | Size: 279 KiB |
BIN
storage/app/public/files/1/686775da614b2.png
Normal file
After Width: | Height: | Size: 988 KiB |
After Width: | Height: | Size: 1.8 MiB |
After Width: | Height: | Size: 1.6 MiB |
After Width: | Height: | Size: 2.1 MiB |
After Width: | Height: | Size: 214 KiB |
BIN
storage/app/public/files/1/final.png
Normal file
After Width: | Height: | Size: 301 KiB |
BIN
storage/app/public/files/1/finalrohini.png
Normal file
After Width: | Height: | Size: 388 KiB |
After Width: | Height: | Size: 264 KiB |
After Width: | Height: | Size: 244 KiB |
BIN
storage/app/public/files/1/rohini-banner.png
Normal file
After Width: | Height: | Size: 386 KiB |
After Width: | Height: | Size: 1.0 MiB |