Added CRUD routes for benefits, success stories, and visa grants
Landing registration page completed except design
This commit is contained in:
@ -275,14 +275,14 @@ class CCMS
|
|||||||
{
|
{
|
||||||
$isActive = request()->fullUrl() == $URL;
|
$isActive = request()->fullUrl() == $URL;
|
||||||
$activeClass = $isActive ? 'active' : '';
|
$activeClass = $isActive ? 'active' : '';
|
||||||
?>
|
?>
|
||||||
<li>
|
<li>
|
||||||
<a class="nav-link menu-link <?php echo $activeClass; ?>" href="<?php echo $URL; ?>"><i
|
<a class="nav-link menu-link <?php echo $activeClass; ?>" href="<?php echo $URL; ?>"><i
|
||||||
class="ri-file-text-line "></i> <span data-key="t-landing">
|
class="ri-file-text-line "></i> <span data-key="t-landing">
|
||||||
<?php echo $text; ?>
|
<?php echo $text; ?>
|
||||||
</span></a>
|
</span></a>
|
||||||
</li>
|
</li>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
public static function getslider()
|
public static function getslider()
|
||||||
{
|
{
|
||||||
@ -309,7 +309,7 @@ class CCMS
|
|||||||
public static function showMenu($menulocation_alias)
|
public static function showMenu($menulocation_alias)
|
||||||
{
|
{
|
||||||
$MenuItems = CCMS::getMenuItems($menulocation_alias);
|
$MenuItems = CCMS::getMenuItems($menulocation_alias);
|
||||||
?>
|
?>
|
||||||
<ul class="navbar-nav d-flex align-items-center">
|
<ul class="navbar-nav d-flex align-items-center">
|
||||||
<?php foreach ($MenuItems as $menuItem): ?>
|
<?php foreach ($MenuItems as $menuItem): ?>
|
||||||
<?php $menuItem->alias = str_replace("-", "_", $menuItem->alias); ?>
|
<?php $menuItem->alias = str_replace("-", "_", $menuItem->alias); ?>
|
||||||
@ -330,7 +330,7 @@ class CCMS
|
|||||||
</li>
|
</li>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</ul>
|
</ul>
|
||||||
<?php
|
<?php
|
||||||
}
|
}
|
||||||
public static function getMenuItems($menulocation_alias, $parentId = 0)
|
public static function getMenuItems($menulocation_alias, $parentId = 0)
|
||||||
{
|
{
|
||||||
@ -739,9 +739,10 @@ class CCMS
|
|||||||
`name` varchar(255) NULL DEFAULT NULL,
|
`name` varchar(255) NULL DEFAULT NULL,
|
||||||
`email` varchar(255) NULL DEFAULT NULL,
|
`email` varchar(255) NULL DEFAULT NULL,
|
||||||
`phone` varchar(255) NULL DEFAULT NULL,
|
`phone` varchar(255) NULL DEFAULT NULL,
|
||||||
`message` varchar(255) NULL DEFAULT NULL,
|
`qualification` varchar(255) NULL DEFAULT NULL,
|
||||||
|
`score` varchar(255) NULL DEFAULT NULL,
|
||||||
|
`passed_year` varchar(255) NULL DEFAULT NULL,
|
||||||
`status` int(11) NOT NULL DEFAULT 1,
|
`status` int(11) NOT NULL DEFAULT 1,
|
||||||
`is_read` boolean NOT NULL DEFAULT 0,
|
|
||||||
`created_at` timestamp NULL DEFAULT NULL,
|
`created_at` timestamp NULL DEFAULT NULL,
|
||||||
`updated_at` timestamp NULL DEFAULT NULL
|
`updated_at` timestamp NULL DEFAULT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
|
||||||
@ -1463,6 +1464,56 @@ CREATE TABLE IF NOT EXISTS `tbl_visagrantposts` (
|
|||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
');
|
');
|
||||||
|
|
||||||
|
DB::statement('
|
||||||
|
CREATE TABLE IF NOT EXISTS `tbl_success_stories` (
|
||||||
|
`stories_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
|
||||||
|
');
|
||||||
|
|
||||||
|
DB::statement('
|
||||||
|
CREATE TABLE IF NOT EXISTS `tbl_benefits` (
|
||||||
|
`benefit_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
|
||||||
|
');
|
||||||
|
|
||||||
|
DB::statement('
|
||||||
|
CREATE TABLE IF NOT EXISTS `tbl_visa_grants` (
|
||||||
|
`visa_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())) {
|
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
|
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');");
|
(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');");
|
||||||
@ -1471,7 +1522,7 @@ CREATE TABLE IF NOT EXISTS `tbl_visagrantposts` (
|
|||||||
if (!(DB::table('settings')->first())) {
|
if (!(DB::table('settings')->first())) {
|
||||||
DB::statement("INSERT INTO `tbl_settings` (`title`, `description`, `status`) values ('Bibhuti LMS', '', '1');");
|
DB::statement("INSERT INTO `tbl_settings` (`title`, `description`, `status`) values ('Bibhuti LMS', '', '1');");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Schema::hasColumn('testimonials', 'rating')) {
|
if (!Schema::hasColumn('testimonials', 'rating')) {
|
||||||
Schema::table('testimonials', function (Blueprint $table) {
|
Schema::table('testimonials', function (Blueprint $table) {
|
||||||
$table->integer('rating')->nullable();
|
$table->integer('rating')->nullable();
|
||||||
|
228
app/Http/Controllers/BenefitsController.php
Normal file
228
app/Http/Controllers/BenefitsController.php
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Models\Benefits;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use App\Service\CommonModelService;
|
||||||
|
use Log;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
|
class BenefitsController extends Controller
|
||||||
|
{
|
||||||
|
protected $modelService;
|
||||||
|
public function __construct(Benefits $model)
|
||||||
|
{
|
||||||
|
$this->modelService = new CommonModelService($model);
|
||||||
|
}
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(BenefitsController::class, 'index', ' Benefits index');
|
||||||
|
$data = Benefits::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||||
|
|
||||||
|
return view("crud.generated.benefits.index", compact('data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(BenefitsController::class, 'create', ' Benefits create');
|
||||||
|
$TableData = Benefits::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||||
|
return view("crud.generated.benefits.create", compact('TableData'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(BenefitsController::class, 'store', ' Benefits 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_benefits')]);
|
||||||
|
$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);
|
||||||
|
});
|
||||||
|
if (isset($request->fieldTitles)) {
|
||||||
|
$fieldTitles = $request->fieldTitles;
|
||||||
|
$fieldHeader = $request->fieldHeader;
|
||||||
|
$fieldDescriptions = $request->fieldDescriptions;
|
||||||
|
$fieldData = [];
|
||||||
|
// Loop through the arrays and create an associative array for each field
|
||||||
|
for ($i = 0; $i < count($fieldTitles); $i++) {
|
||||||
|
$fieldData[] = [
|
||||||
|
'fieldTitle' => $fieldTitles[$i],
|
||||||
|
'fieldHeader' => $fieldHeader[$i],
|
||||||
|
'fieldDescriptions' => $fieldDescriptions[$i],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// Convert the field data array to JSON string
|
||||||
|
$requestData["extra_content"] = json_encode($fieldData);
|
||||||
|
}
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
|
$operationNumber = getOperationNumber();
|
||||||
|
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
createErrorLog(BenefitsController::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 Benefits Created Successfully.'], 200);
|
||||||
|
}
|
||||||
|
return redirect()->route('benefits.index')->with('success', 'The Benefits created Successfully.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sort(Request $request)
|
||||||
|
{
|
||||||
|
$idOrder = $request->input('id_order');
|
||||||
|
|
||||||
|
foreach ($idOrder as $index => $id) {
|
||||||
|
$companyArticle = Benefits::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 = Benefits::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(BenefitsController::class, 'show', ' Benefits show');
|
||||||
|
$data = Benefits::findOrFail($id);
|
||||||
|
|
||||||
|
return view("crud.generated.benefits.show", compact('data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function edit(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(BenefitsController::class, 'edit', ' Benefits edit');
|
||||||
|
$TableData = Benefits::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||||
|
$data = Benefits::findOrFail($id);
|
||||||
|
if ($request->ajax()) {
|
||||||
|
$html = view("crud.generated.benefits.ajax.edit", compact('data'))->render();
|
||||||
|
return response()->json(['status' => true, 'content' => $html], 200);
|
||||||
|
}
|
||||||
|
return view("crud.generated.benefits.edit", compact('data', 'TableData'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(BenefitsController::class, 'update', ' Benefits 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);
|
||||||
|
});
|
||||||
|
if (isset($request->fieldTitles)) {
|
||||||
|
$fieldTitles = $request->fieldTitles;
|
||||||
|
$fieldHeader = $request->fieldHeader;
|
||||||
|
$fieldDescriptions = $request->fieldDescriptions;
|
||||||
|
$fieldData = [];
|
||||||
|
// Loop through the arrays and create an associative array for each field
|
||||||
|
for ($i = 0; $i < count($fieldTitles); $i++) {
|
||||||
|
$fieldData[] = [
|
||||||
|
'fieldTitle' => $fieldTitles[$i],
|
||||||
|
'fieldHeader' => $fieldHeader[$i],
|
||||||
|
'fieldDescriptions' => $fieldDescriptions[$i],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// Convert the field data array to JSON string
|
||||||
|
$requestData["extra_content"] = json_encode($fieldData);
|
||||||
|
}
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
|
$OperationNumber = getOperationNumber();
|
||||||
|
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('benefit_id'));
|
||||||
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
createErrorLog(BenefitsController::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 Benefits updated Successfully.'], 200);
|
||||||
|
}
|
||||||
|
// return redirect()->route('benefits.index')->with('success','The Benefits updated Successfully.');
|
||||||
|
return redirect()->back()->with('success', 'The Benefits updated successfully.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(BenefitsController::class, 'destroy', ' Benefits destroy');
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
|
$OperationNumber = getOperationNumber();
|
||||||
|
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
createErrorLog(BenefitsController::class, 'destroy', $e->getMessage());
|
||||||
|
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
DB::commit();
|
||||||
|
return response()->json(['status' => true, 'message' => 'The Benefits Deleted Successfully.'], 200);
|
||||||
|
}
|
||||||
|
public function toggle(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(BenefitsController::class, 'destroy', ' Benefits destroy');
|
||||||
|
$data = Benefits::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(BenefitsController::class, 'destroy', $e->getMessage());
|
||||||
|
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
DB::commit();
|
||||||
|
return response()->json(['status' => true, 'message' => 'The Benefits Deleted Successfully.'], 200);
|
||||||
|
}
|
||||||
|
}
|
@ -280,7 +280,6 @@ class FormsController extends Controller
|
|||||||
'name' => 'required',
|
'name' => 'required',
|
||||||
'email' => 'required|email',
|
'email' => 'required|email',
|
||||||
'phone' => 'required',
|
'phone' => 'required',
|
||||||
'message' => 'required',
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($setting->recaptcha_secret_key) {
|
if ($setting->recaptcha_secret_key) {
|
||||||
@ -320,8 +319,6 @@ class FormsController extends Controller
|
|||||||
"name" => $r->input('name'),
|
"name" => $r->input('name'),
|
||||||
"email" => $r->input('email'),
|
"email" => $r->input('email'),
|
||||||
"phone" => $r->input('phone'),
|
"phone" => $r->input('phone'),
|
||||||
"message" => $r->input('message'),
|
|
||||||
"service_id" => $r->input('service_id'),
|
|
||||||
];
|
];
|
||||||
|
|
||||||
Enquiries::create($FormData);
|
Enquiries::create($FormData);
|
||||||
@ -329,7 +326,7 @@ class FormsController extends Controller
|
|||||||
return response()->json([
|
return response()->json([
|
||||||
'success' => true,
|
'success' => true,
|
||||||
'status' => 200,
|
'status' => 200,
|
||||||
'message' => 'Thank you for your enquiry. We will get back to you soon.',
|
'message' => 'Thank you. We will get back to you soon.',
|
||||||
], 200);
|
], 200);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
228
app/Http/Controllers/Success_storiesController.php
Normal file
228
app/Http/Controllers/Success_storiesController.php
Normal file
@ -0,0 +1,228 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Models\Success_stories;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use App\Service\CommonModelService;
|
||||||
|
use Log;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
|
class Success_storiesController extends Controller
|
||||||
|
{
|
||||||
|
protected $modelService;
|
||||||
|
public function __construct(Success_stories $model)
|
||||||
|
{
|
||||||
|
$this->modelService = new CommonModelService($model);
|
||||||
|
}
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(Success_storiesController::class, 'index', ' Success_stories index');
|
||||||
|
$data = Success_stories::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||||
|
|
||||||
|
return view("crud.generated.success_stories.index", compact('data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(Success_storiesController::class, 'create', ' Success_stories create');
|
||||||
|
$TableData = Success_stories::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||||
|
return view("crud.generated.success_stories.create", compact('TableData'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(Success_storiesController::class, 'store', ' Success_stories 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_success_stories')]);
|
||||||
|
$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);
|
||||||
|
});
|
||||||
|
if (isset($request->fieldTitles)) {
|
||||||
|
$fieldTitles = $request->fieldTitles;
|
||||||
|
$fieldHeader = $request->fieldHeader;
|
||||||
|
$fieldDescriptions = $request->fieldDescriptions;
|
||||||
|
$fieldData = [];
|
||||||
|
// Loop through the arrays and create an associative array for each field
|
||||||
|
for ($i = 0; $i < count($fieldTitles); $i++) {
|
||||||
|
$fieldData[] = [
|
||||||
|
'fieldTitle' => $fieldTitles[$i],
|
||||||
|
'fieldHeader' => $fieldHeader[$i],
|
||||||
|
'fieldDescriptions' => $fieldDescriptions[$i],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// Convert the field data array to JSON string
|
||||||
|
$requestData["extra_content"] = json_encode($fieldData);
|
||||||
|
}
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
|
$operationNumber = getOperationNumber();
|
||||||
|
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
createErrorLog(Success_storiesController::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 Success_stories Created Successfully.'], 200);
|
||||||
|
}
|
||||||
|
return redirect()->route('success_stories.index')->with('success', 'The Success_stories created Successfully.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sort(Request $request)
|
||||||
|
{
|
||||||
|
$idOrder = $request->input('id_order');
|
||||||
|
|
||||||
|
foreach ($idOrder as $index => $id) {
|
||||||
|
$companyArticle = Success_stories::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 = Success_stories::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(Success_storiesController::class, 'show', ' Success_stories show');
|
||||||
|
$data = Success_stories::findOrFail($id);
|
||||||
|
|
||||||
|
return view("crud.generated.success_stories.show", compact('data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function edit(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(Success_storiesController::class, 'edit', ' Success_stories edit');
|
||||||
|
$TableData = Success_stories::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||||
|
$data = Success_stories::findOrFail($id);
|
||||||
|
if ($request->ajax()) {
|
||||||
|
$html = view("crud.generated.success_stories.ajax.edit", compact('data'))->render();
|
||||||
|
return response()->json(['status' => true, 'content' => $html], 200);
|
||||||
|
}
|
||||||
|
return view("crud.generated.success_stories.edit", compact('data', 'TableData'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(Success_storiesController::class, 'update', ' Success_stories 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);
|
||||||
|
});
|
||||||
|
if (isset($request->fieldTitles)) {
|
||||||
|
$fieldTitles = $request->fieldTitles;
|
||||||
|
$fieldHeader = $request->fieldHeader;
|
||||||
|
$fieldDescriptions = $request->fieldDescriptions;
|
||||||
|
$fieldData = [];
|
||||||
|
// Loop through the arrays and create an associative array for each field
|
||||||
|
for ($i = 0; $i < count($fieldTitles); $i++) {
|
||||||
|
$fieldData[] = [
|
||||||
|
'fieldTitle' => $fieldTitles[$i],
|
||||||
|
'fieldHeader' => $fieldHeader[$i],
|
||||||
|
'fieldDescriptions' => $fieldDescriptions[$i],
|
||||||
|
];
|
||||||
|
}
|
||||||
|
// Convert the field data array to JSON string
|
||||||
|
$requestData["extra_content"] = json_encode($fieldData);
|
||||||
|
}
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
|
$OperationNumber = getOperationNumber();
|
||||||
|
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('stories_id'));
|
||||||
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
createErrorLog(Success_storiesController::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 Success_stories updated Successfully.'], 200);
|
||||||
|
}
|
||||||
|
// return redirect()->route('success_stories.index')->with('success','The Success_stories updated Successfully.');
|
||||||
|
return redirect()->back()->with('success', 'The Success_stories updated successfully.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(Success_storiesController::class, 'destroy', ' Success_stories destroy');
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
|
$OperationNumber = getOperationNumber();
|
||||||
|
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
createErrorLog(Success_storiesController::class, 'destroy', $e->getMessage());
|
||||||
|
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
DB::commit();
|
||||||
|
return response()->json(['status' => true, 'message' => 'The Success_stories Deleted Successfully.'], 200);
|
||||||
|
}
|
||||||
|
public function toggle(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(Success_storiesController::class, 'destroy', ' Success_stories destroy');
|
||||||
|
$data = Success_stories::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(Success_storiesController::class, 'destroy', $e->getMessage());
|
||||||
|
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
DB::commit();
|
||||||
|
return response()->json(['status' => true, 'message' => 'The Success_stories Deleted Successfully.'], 200);
|
||||||
|
}
|
||||||
|
}
|
198
app/Http/Controllers/Visa_grantsController.php
Normal file
198
app/Http/Controllers/Visa_grantsController.php
Normal file
@ -0,0 +1,198 @@
|
|||||||
|
<?php
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
use App\Http\Controllers\Controller;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use App\Models\Visa_grants;
|
||||||
|
use Illuminate\Support\Facades\DB;
|
||||||
|
use Illuminate\Support\Facades\Validator;
|
||||||
|
use App\Service\CommonModelService;
|
||||||
|
use Log;
|
||||||
|
use Exception;
|
||||||
|
|
||||||
|
class Visa_grantsController extends Controller
|
||||||
|
{
|
||||||
|
protected $modelService;
|
||||||
|
public function __construct(Visa_grants $model)
|
||||||
|
{
|
||||||
|
$this->modelService = new CommonModelService($model);
|
||||||
|
}
|
||||||
|
public function index(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(Visa_grantsController::class, 'index', ' Visa_grants index');
|
||||||
|
$data = Visa_grants::where('status','<>',-1)->orderBy('display_order')->get();
|
||||||
|
|
||||||
|
return view("crud.generated.visa_grants.index", compact('data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(Visa_grantsController::class, 'create', ' Visa_grants create');
|
||||||
|
$TableData = Visa_grants::where('status','<>',-1)->orderBy('display_order')->get();
|
||||||
|
return view("crud.generated.visa_grants.create",compact('TableData'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request)
|
||||||
|
{
|
||||||
|
createActivityLog(Visa_grantsController::class, 'store', ' Visa_grants 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_visa_grants')]);
|
||||||
|
$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(Visa_grantsController::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 Visa_grants Created Successfully.'], 200);
|
||||||
|
}
|
||||||
|
return redirect()->route('visa_grants.index')->with('success','The Visa_grants created Successfully.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function sort(Request $request)
|
||||||
|
{
|
||||||
|
$idOrder = $request->input('id_order');
|
||||||
|
|
||||||
|
foreach ($idOrder as $index => $id) {
|
||||||
|
$companyArticle = Visa_grants::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 = Visa_grants::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(Visa_grantsController::class, 'show', ' Visa_grants show');
|
||||||
|
$data = Visa_grants::findOrFail($id);
|
||||||
|
|
||||||
|
return view("crud.generated.visa_grants.show", compact('data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function edit(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(Visa_grantsController::class, 'edit', ' Visa_grants edit');
|
||||||
|
$TableData = Visa_grants::where('status','<>',-1)->orderBy('display_order')->get();
|
||||||
|
$data = Visa_grants::findOrFail($id);
|
||||||
|
if ($request->ajax()) {
|
||||||
|
$html = view("crud.generated.visa_grants.ajax.edit", compact('data'))->render();
|
||||||
|
return response()->json(['status' => true, 'content' => $html], 200);
|
||||||
|
}
|
||||||
|
return view("crud.generated.visa_grants.edit", compact('data','TableData'));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public function update(Request $request, $id)
|
||||||
|
{
|
||||||
|
createActivityLog(Visa_grantsController::class, 'update', ' Visa_grants 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('visa_id'));
|
||||||
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
createErrorLog(Visa_grantsController::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 Visa_grants updated Successfully.'], 200);
|
||||||
|
}
|
||||||
|
// return redirect()->route('visa_grants.index')->with('success','The Visa_grants updated Successfully.');
|
||||||
|
return redirect()->back()->with('success', 'The Visa_grants updated successfully.');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy(Request $request,$id)
|
||||||
|
{
|
||||||
|
createActivityLog(Visa_grantsController::class, 'destroy', ' Visa_grants destroy');
|
||||||
|
DB::beginTransaction();
|
||||||
|
try {
|
||||||
|
$OperationNumber = getOperationNumber();
|
||||||
|
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||||
|
} catch (Exception $e) {
|
||||||
|
DB::rollBack();
|
||||||
|
Log::info($e->getMessage());
|
||||||
|
createErrorLog(Visa_grantsController::class, 'destroy', $e->getMessage());
|
||||||
|
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
DB::commit();
|
||||||
|
return response()->json(['status'=>true,'message'=>'The Visa_grants Deleted Successfully.'],200);
|
||||||
|
}
|
||||||
|
public function toggle(Request $request,$id)
|
||||||
|
{
|
||||||
|
createActivityLog(Visa_grantsController::class, 'destroy', ' Visa_grants destroy');
|
||||||
|
$data = Visa_grants::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(Visa_grantsController::class, 'destroy', $e->getMessage());
|
||||||
|
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||||
|
}
|
||||||
|
DB::commit();
|
||||||
|
return response()->json(['status'=>true,'message'=>'The Visa_grants Deleted Successfully.'],200);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -3,6 +3,7 @@
|
|||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use App\Models\Articles;
|
use App\Models\Articles;
|
||||||
|
use App\Models\Benefits;
|
||||||
use App\Models\Blogs;
|
use App\Models\Blogs;
|
||||||
use App\Models\Countries;
|
use App\Models\Countries;
|
||||||
use App\Models\Faqs;
|
use App\Models\Faqs;
|
||||||
@ -15,8 +16,10 @@ use App\Models\Preparationclassoffers;
|
|||||||
use App\Models\Quicklinks;
|
use App\Models\Quicklinks;
|
||||||
use App\Models\Services;
|
use App\Models\Services;
|
||||||
use App\Models\Settings;
|
use App\Models\Settings;
|
||||||
|
use App\Models\Success_stories;
|
||||||
use App\Models\Teams;
|
use App\Models\Teams;
|
||||||
use App\Models\Testimonials;
|
use App\Models\Testimonials;
|
||||||
|
use App\Models\Visa_grants;
|
||||||
use App\Models\Visagrantposts;
|
use App\Models\Visagrantposts;
|
||||||
use CCMS;
|
use CCMS;
|
||||||
use Illuminate\Http\Request; // Import the Request class
|
use Illuminate\Http\Request; // Import the Request class
|
||||||
@ -39,12 +42,16 @@ class WebsiteController extends Controller
|
|||||||
|
|
||||||
public function home()
|
public function home()
|
||||||
{
|
{
|
||||||
|
return view('landing.index', [
|
||||||
return view("bibhuti.landing");
|
'benefits' => Benefits::get(),
|
||||||
|
'success_stories' => Success_stories::get(),
|
||||||
|
'visa_grants' => Visa_grants::get(),
|
||||||
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showTeam(){
|
public function showTeam()
|
||||||
$teamList = Teams::orderBy('display_order','asc')->get();
|
{
|
||||||
|
$teamList = Teams::orderBy('display_order', 'asc')->get();
|
||||||
return view("$this->path.pages.team", compact('teamList'));
|
return view("$this->path.pages.team", compact('teamList'));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -79,15 +86,15 @@ class WebsiteController extends Controller
|
|||||||
$contact = DB::table("contacts")->where("contact_id", $menuItem->ref)->get()[0];
|
$contact = DB::table("contacts")->where("contact_id", $menuItem->ref)->get()[0];
|
||||||
|
|
||||||
return view("client.jupiter.inside.contact", compact('contact'));
|
return view("client.jupiter.inside.contact", compact('contact'));
|
||||||
// break;
|
// break;
|
||||||
case 'tbl_countries':
|
case 'tbl_countries':
|
||||||
//$countries=DB::table("countries")->where("article_id",$menuItem->ref)->get()[0];
|
//$countries=DB::table("countries")->where("article_id",$menuItem->ref)->get()[0];
|
||||||
//return view("client.jupiter.inside.article",compact('article'));
|
//return view("client.jupiter.inside.article",compact('article'));
|
||||||
//break;
|
//break;
|
||||||
case 'tbl_articles':
|
case 'tbl_articles':
|
||||||
$article = DB::table("articles")->where("article_id", $menuItem->ref)->get()[0];
|
$article = DB::table("articles")->where("article_id", $menuItem->ref)->get()[0];
|
||||||
return view("client.jupiter.inside.article", compact('article'));
|
return view("client.jupiter.inside.article", compact('article'));
|
||||||
//break;
|
//break;
|
||||||
case '':
|
case '':
|
||||||
default:
|
default:
|
||||||
// echo $menuItem->alias;die;
|
// echo $menuItem->alias;die;
|
||||||
@ -98,7 +105,6 @@ class WebsiteController extends Controller
|
|||||||
} else {
|
} else {
|
||||||
return view("client.jupiter.inside" . ltrim($menuItem->ref));
|
return view("client.jupiter.inside" . ltrim($menuItem->ref));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -133,9 +139,9 @@ class WebsiteController extends Controller
|
|||||||
|
|
||||||
public function showDestination($alias = null, $subalias = null)
|
public function showDestination($alias = null, $subalias = null)
|
||||||
{
|
{
|
||||||
if($alias){
|
if ($alias) {
|
||||||
$destination = Countries::where('alias',$alias)->with(['articles','institutions'])->first();
|
$destination = Countries::where('alias', $alias)->with(['articles', 'institutions'])->first();
|
||||||
if(!$destination){
|
if (!$destination) {
|
||||||
return view("$this->path.pages.404");
|
return view("$this->path.pages.404");
|
||||||
}
|
}
|
||||||
return view("$this->path.pages.destination", compact('destination'));
|
return view("$this->path.pages.destination", compact('destination'));
|
||||||
@ -203,13 +209,13 @@ class WebsiteController extends Controller
|
|||||||
|
|
||||||
public function showBlogs($alias = null)
|
public function showBlogs($alias = null)
|
||||||
{
|
{
|
||||||
if($alias){
|
if ($alias) {
|
||||||
$blog = Blogs::where('alias',$alias)->first();
|
$blog = Blogs::where('alias', $alias)->first();
|
||||||
if(!$blog){
|
if (!$blog) {
|
||||||
return view("$this->path.pages.404");
|
return view("$this->path.pages.404");
|
||||||
}
|
}
|
||||||
return view("$this->path.pages.blog-single",compact('blog'));
|
return view("$this->path.pages.blog-single", compact('blog'));
|
||||||
}else{
|
} else {
|
||||||
$blogList = Blogs::latest()->paginate(6);
|
$blogList = Blogs::latest()->paginate(6);
|
||||||
return view("$this->path.pages.blog-list", compact('blogList'));
|
return view("$this->path.pages.blog-list", compact('blogList'));
|
||||||
}
|
}
|
||||||
@ -218,21 +224,21 @@ class WebsiteController extends Controller
|
|||||||
public function showFaqs()
|
public function showFaqs()
|
||||||
{
|
{
|
||||||
$faqs = Faqs::latest()->get();
|
$faqs = Faqs::latest()->get();
|
||||||
return view("$this->path.pages.faq",compact('faqs'));
|
return view("$this->path.pages.faq", compact('faqs'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showServices($alias = null)
|
public function showServices($alias = null)
|
||||||
{
|
{
|
||||||
if($alias){
|
if ($alias) {
|
||||||
$service = Services::where('alias',$alias)->first();
|
$service = Services::where('alias', $alias)->first();
|
||||||
if(!$service){
|
if (!$service) {
|
||||||
return view("$this->path.pages.404");
|
return view("$this->path.pages.404");
|
||||||
}
|
}
|
||||||
return view("$this->path.pages.service-single",compact('service'));
|
return view("$this->path.pages.service-single", compact('service'));
|
||||||
}else{
|
} else {
|
||||||
|
|
||||||
$serviceList = Services::orderBy('display_order','asc')->take(15)->get();
|
$serviceList = Services::orderBy('display_order', 'asc')->take(15)->get();
|
||||||
return view("$this->path.pages.service-list",compact('serviceList'));
|
return view("$this->path.pages.service-list", compact('serviceList'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -240,12 +246,11 @@ class WebsiteController extends Controller
|
|||||||
{
|
{
|
||||||
if ($alias) {
|
if ($alias) {
|
||||||
$data = Articles::where("alias", $alias)->where('status', 1)->with('children')->first();
|
$data = Articles::where("alias", $alias)->where('status', 1)->with('children')->first();
|
||||||
if(!$data){
|
if (!$data) {
|
||||||
return view("$this->path.pages.404");
|
return view("$this->path.pages.404");
|
||||||
}
|
}
|
||||||
return view("$this->path.pages.$alias", compact('data'));
|
return view("$this->path.pages.$alias", compact('data'));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function showevents(Request $r, $alias = null, $subalias = null)
|
public function showevents(Request $r, $alias = null, $subalias = null)
|
||||||
@ -376,15 +381,15 @@ class WebsiteController extends Controller
|
|||||||
|
|
||||||
public function showGalleries($alias = null)
|
public function showGalleries($alias = null)
|
||||||
{
|
{
|
||||||
if($alias){
|
if ($alias) {
|
||||||
$gallery = Galleries::where('alias', $alias)->first();
|
$gallery = Galleries::where('alias', $alias)->first();
|
||||||
if(!$gallery){
|
if (!$gallery) {
|
||||||
return view("$this->path.pages.404");
|
return view("$this->path.pages.404");
|
||||||
}
|
}
|
||||||
return view("$this->path.pages.gallery-single", compact('gallery'));
|
return view("$this->path.pages.gallery-single", compact('gallery'));
|
||||||
}else{
|
} else {
|
||||||
$galleryList = Galleries::where('status', 1)->latest()->select(['title', 'alias', 'thumb'])->paginate(12);
|
$galleryList = Galleries::where('status', 1)->latest()->select(['title', 'alias', 'thumb'])->paginate(12);
|
||||||
return view("$this->path.pages.gallery-list", compact('galleryList'));
|
return view("$this->path.pages.gallery-list", compact('galleryList'));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
51
app/Models/Benefits.php
Normal file
51
app/Models/Benefits.php
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?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 Benefits extends Model
|
||||||
|
{
|
||||||
|
use HasFactory, CreatedUpdatedBy;
|
||||||
|
|
||||||
|
protected $primaryKey = 'benefit_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 : '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -11,17 +11,5 @@ class Enquiries extends Model
|
|||||||
|
|
||||||
protected $primaryKey = 'enquiry_id';
|
protected $primaryKey = 'enquiry_id';
|
||||||
public $timestamps = true;
|
public $timestamps = true;
|
||||||
protected $fillable = [
|
protected $guarded = [];
|
||||||
'name',
|
|
||||||
'phone',
|
|
||||||
'email',
|
|
||||||
'is_read',
|
|
||||||
'message',
|
|
||||||
'service_id',
|
|
||||||
];
|
|
||||||
|
|
||||||
public function service()
|
|
||||||
{
|
|
||||||
return $this->belongsTo(Services::class, 'service_id', 'service_id');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
51
app/Models/Success_stories.php
Normal file
51
app/Models/Success_stories.php
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?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 Success_stories extends Model
|
||||||
|
{
|
||||||
|
use HasFactory, CreatedUpdatedBy;
|
||||||
|
|
||||||
|
protected $primaryKey = 'stories_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 : '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
51
app/Models/Visa_grants.php
Normal file
51
app/Models/Visa_grants.php
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?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 Visa_grants extends Model
|
||||||
|
{
|
||||||
|
use HasFactory, CreatedUpdatedBy;
|
||||||
|
|
||||||
|
protected $primaryKey = 'visa_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 : '',
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
@ -75,9 +75,11 @@
|
|||||||
|
|
||||||
|
|
||||||
<li class="menu-title"><i class="ri-more-fill"></i> <span data-key="t-pages">Pages</span></li>
|
<li class="menu-title"><i class="ri-more-fill"></i> <span data-key="t-pages">Pages</span></li>
|
||||||
{{ CCMS::createMenuLink('Page', route('articles.index')) }}
|
|
||||||
{{ CCMS::createMenuLink('Services', route('services.index')) }}
|
|
||||||
{{ CCMS::createMenuLink('Enquiries', route('enquiries-list')) }}
|
{{ CCMS::createMenuLink('Enquiries', route('enquiries-list')) }}
|
||||||
|
{{ CCMS::createMenuLink('Testimonials', route('success_stories.index')) }}
|
||||||
|
{{ CCMS::createMenuLink('Benefits', route('benefits.index')) }}
|
||||||
|
{{ CCMS::createMenuLink('Success Stories', route('visa_grants.index')) }}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
167
resources/views/crud/generated/benefits/create.blade.php
Normal file
167
resources/views/crud/generated/benefits/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 Benefits</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 Benefits</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end page title -->
|
||||||
|
<form action="{{ route('benefits.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('benefits.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('benefits.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/benefits/edit.blade.php
Normal file
233
resources/views/crud/generated/benefits/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 Benefits</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 Benefits</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end page title -->
|
||||||
|
<form action="{{ route('benefits.update', $data->benefit_id) }}" id="updateCustomForm" method="POST">
|
||||||
|
@csrf <input type=hidden name='benefit_id' value='{{ $data->benefit_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('benefits.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_photo) }}
|
||||||
|
</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('benefits.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/benefits/index.blade.php
Normal file
231
resources/views/crud/generated/benefits/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("Benefits List") }}</h2>
|
||||||
|
<a href="{{ route('benefits.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table dataTable" id="tbl_benefits" data-url="{{ route('benefits.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->benefit_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('benefits.show',[$item->benefit_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||||
|
<li><a href="{{route('benefits.edit',[$item->benefit_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('benefits.toggle',[$item->benefit_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('benefits.destroy',[$item->benefit_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('benefits.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/benefits/show.blade.php
Normal file
29
resources/views/crud/generated/benefits/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('benefits.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
|
167
resources/views/crud/generated/success_stories/create.blade.php
Normal file
167
resources/views/crud/generated/success_stories/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 Success Stories</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 Success Stories</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end page title -->
|
||||||
|
<form action="{{ route('success_stories.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('success_stories.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('success_stories.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/success_stories/edit.blade.php
Normal file
233
resources/views/crud/generated/success_stories/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 Success Stories</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 Success Stories</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end page title -->
|
||||||
|
<form action="{{ route('success_stories.update', $data->stories_id) }}" id="updateCustomForm" method="POST">
|
||||||
|
@csrf <input type=hidden name='stories_id' value='{{ $data->stories_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('success_stories.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_photo) }}
|
||||||
|
</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('success_stories.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/success_stories/index.blade.php
Normal file
231
resources/views/crud/generated/success_stories/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("Success_stories List") }}</h2>
|
||||||
|
<a href="{{ route('success_stories.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table dataTable" id="tbl_success_stories" data-url="{{ route('success_stories.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->stories_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('success_stories.show',[$item->stories_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||||
|
<li><a href="{{route('success_stories.edit',[$item->stories_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('success_stories.toggle',[$item->stories_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('success_stories.destroy',[$item->stories_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('success_stories.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
|
||||||
|
|
@ -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('success_stories.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
|
168
resources/views/crud/generated/visa_grants/create.blade.php
Normal file
168
resources/views/crud/generated/visa_grants/create.blade.php
Normal file
@ -0,0 +1,168 @@
|
|||||||
|
@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 Visa Grants</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 Visa Grants</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end page title -->
|
||||||
|
<form action="{{ route('visa_grants.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('visa_grants.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('visa_grants.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
|
234
resources/views/crud/generated/visa_grants/edit.blade.php
Normal file
234
resources/views/crud/generated/visa_grants/edit.blade.php
Normal file
@ -0,0 +1,234 @@
|
|||||||
|
|
||||||
|
@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 Visa Grants</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 Visa Grants</li>
|
||||||
|
</ol>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- end page title -->
|
||||||
|
<form action="{{ route('visa_grants.update', $data->visa_id) }}" id="updateCustomForm" method="POST">
|
||||||
|
@csrf <input type=hidden name='visa_id' value='{{ $data->visa_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('visa_grants.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('visa_grants.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/visa_grants/index.blade.php
Normal file
231
resources/views/crud/generated/visa_grants/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("Visa_grants List") }}</h2>
|
||||||
|
<a href="{{ route('visa_grants.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<table class="table dataTable" id="tbl_visa_grants" data-url="{{ route('visa_grants.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->visa_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('visa_grants.show',[$item->visa_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||||
|
<li><a href="{{route('visa_grants.edit',[$item->visa_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('visa_grants.toggle',[$item->visa_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('visa_grants.destroy',[$item->visa_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('visa_grants.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/visa_grants/show.blade.php
Normal file
29
resources/views/crud/generated/visa_grants/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('visa_grants.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
|
File diff suppressed because it is too large
Load Diff
15
routes/CRUDgenerated/route.benefits.php
Normal file
15
routes/CRUDgenerated/route.benefits.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
use App\Http\Controllers\BenefitsController;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
Route::prefix("benefits")->group(function () {
|
||||||
|
Route::get('/', [BenefitsController::class, 'index'])->name('benefits.index');
|
||||||
|
Route::get('/create', [BenefitsController::class, 'create'])->name('benefits.create');
|
||||||
|
Route::post('/store', [BenefitsController::class, 'store'])->name('benefits.store');
|
||||||
|
Route::post('/sort', [BenefitsController::class, 'sort'])->name('benefits.sort');
|
||||||
|
Route::post('/updatealias', [BenefitsController::class, 'updatealias'])->name('benefits.updatealias');
|
||||||
|
Route::get('/show/{id}', [BenefitsController::class, 'show'])->name('benefits.show');
|
||||||
|
Route::get('/edit/{id}', [BenefitsController::class, 'edit'])->name('benefits.edit') ;
|
||||||
|
Route::post('/update/{id}', [BenefitsController::class, 'update'])->name('benefits.update');
|
||||||
|
Route::delete('/destroy/{id}', [BenefitsController::class, 'destroy'])->name('benefits.destroy');
|
||||||
|
Route::get('/toggle/{id}', [BenefitsController::class, 'toggle'])->name('benefits.toggle');
|
||||||
|
});
|
15
routes/CRUDgenerated/route.success_stories.php
Normal file
15
routes/CRUDgenerated/route.success_stories.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
use App\Http\Controllers\Success_storiesController;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
Route::prefix("success_stories")->group(function () {
|
||||||
|
Route::get('/', [Success_storiesController::class, 'index'])->name('success_stories.index');
|
||||||
|
Route::get('/create', [Success_storiesController::class, 'create'])->name('success_stories.create');
|
||||||
|
Route::post('/store', [Success_storiesController::class, 'store'])->name('success_stories.store');
|
||||||
|
Route::post('/sort', [Success_storiesController::class, 'sort'])->name('success_stories.sort');
|
||||||
|
Route::post('/updatealias', [Success_storiesController::class, 'updatealias'])->name('success_stories.updatealias');
|
||||||
|
Route::get('/show/{id}', [Success_storiesController::class, 'show'])->name('success_stories.show');
|
||||||
|
Route::get('/edit/{id}', [Success_storiesController::class, 'edit'])->name('success_stories.edit') ;
|
||||||
|
Route::post('/update/{id}', [Success_storiesController::class, 'update'])->name('success_stories.update');
|
||||||
|
Route::delete('/destroy/{id}', [Success_storiesController::class, 'destroy'])->name('success_stories.destroy');
|
||||||
|
Route::get('/toggle/{id}', [Success_storiesController::class, 'toggle'])->name('success_stories.toggle');
|
||||||
|
});
|
15
routes/CRUDgenerated/route.visa_grants.php
Normal file
15
routes/CRUDgenerated/route.visa_grants.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
use App\Http\Controllers\Visa_grantsController;
|
||||||
|
use Illuminate\Support\Facades\Route;
|
||||||
|
Route::prefix("visa_grants")->group(function () {
|
||||||
|
Route::get('/', [Visa_grantsController::class, 'index'])->name('visa_grants.index');
|
||||||
|
Route::get('/create', [Visa_grantsController::class, 'create'])->name('visa_grants.create');
|
||||||
|
Route::post('/store', [Visa_grantsController::class, 'store'])->name('visa_grants.store');
|
||||||
|
Route::post('/sort', [Visa_grantsController::class, 'sort'])->name('visa_grants.sort');
|
||||||
|
Route::post('/updatealias', [Visa_grantsController::class, 'updatealias'])->name('visa_grants.updatealias');
|
||||||
|
Route::get('/show/{id}', [Visa_grantsController::class, 'show'])->name('visa_grants.show');
|
||||||
|
Route::get('/edit/{id}', [Visa_grantsController::class, 'edit'])->name('visa_grants.edit') ;
|
||||||
|
Route::post('/update/{id}', [Visa_grantsController::class, 'update'])->name('visa_grants.update');
|
||||||
|
Route::delete('/destroy/{id}', [Visa_grantsController::class, 'destroy'])->name('visa_grants.destroy');
|
||||||
|
Route::get('/toggle/{id}', [Visa_grantsController::class, 'toggle'])->name('visa_grants.toggle');
|
||||||
|
});
|
@ -73,7 +73,6 @@ Route::middleware('auth')->group(function () {
|
|||||||
|
|
||||||
// Provide the download link for the backup file
|
// Provide the download link for the backup file
|
||||||
return response()->download($backupPath)->deleteFileAfterSend(true);
|
return response()->download($backupPath)->deleteFileAfterSend(true);
|
||||||
|
|
||||||
})->name('backup.db');
|
})->name('backup.db');
|
||||||
});
|
});
|
||||||
Route::prefix("form")->group(function () {
|
Route::prefix("form")->group(function () {
|
||||||
@ -149,5 +148,8 @@ Route::middleware('auth')->group(function () {
|
|||||||
require __DIR__ . '/route.preparationclasstestimonials.php';
|
require __DIR__ . '/route.preparationclasstestimonials.php';
|
||||||
require __DIR__ . '/route.visagrantposts.php';
|
require __DIR__ . '/route.visagrantposts.php';
|
||||||
require __DIR__ . '/route.features.php';
|
require __DIR__ . '/route.features.php';
|
||||||
|
require __DIR__ . '/CRUDgenerated/route.success_stories.php';
|
||||||
|
require __DIR__ . '/CRUDgenerated/route.benefits.php';
|
||||||
|
require __DIR__ . '/CRUDgenerated/route.visa_grants.php';
|
||||||
});
|
});
|
||||||
require __DIR__ . '/route.client.php';
|
require __DIR__ . '/route.client.php';
|
||||||
|
BIN
storage/app/public/files/1/success-1.png
Normal file
BIN
storage/app/public/files/1/success-1.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Reference in New Issue
Block a user