leave user employee module setup

This commit is contained in:
Ranjan 2024-04-07 13:13:58 +05:45
parent da9f493572
commit cfd2147536
174 changed files with 9312 additions and 9540 deletions

18
.htaccess Normal file
View File

@ -0,0 +1,18 @@
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule ^ ^$1 [N]
RewriteCond %{REQUEST_URI} (\.\w+$) [NC]
RewriteRule ^(.*)$ public/$1
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ server.php
</IfModule>

View File

@ -0,0 +1,67 @@
<?php
namespace Modules\Attendance\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
class AttendanceController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
return view('attendance::index');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
return view('attendance::create');
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('attendance::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
return view('attendance::edit');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

View File

@ -0,0 +1,114 @@
<?php
namespace Modules\Attendance\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class AttendanceServiceProvider extends ServiceProvider
{
protected string $moduleName = 'Attendance';
protected string $moduleNameLower = 'attendance';
/**
* Boot the application events.
*/
public function boot(): void
{
$this->registerCommands();
$this->registerCommandSchedules();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
}
/**
* Register the service provider.
*/
public function register(): void
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register commands in the format of Command::class
*/
protected function registerCommands(): void
{
// $this->commands([]);
}
/**
* Register command Schedules.
*/
protected function registerCommandSchedules(): void
{
// $this->app->booted(function () {
// $schedule = $this->app->make(Schedule::class);
// $schedule->command('inspire')->hourly();
// });
}
/**
* Register translations.
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
}
}
/**
* Register config.
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
}
/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder','')));
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
}
/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
$paths[] = $path.'/modules/'.$this->moduleNameLower;
}
}
return $paths;
}
}

View File

@ -0,0 +1,49 @@
<?php
namespace Modules\Attendance\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*/
public function boot(): void
{
parent::boot();
}
/**
* Define the routes for the application.
*/
public function map(): void
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('Attendance', '/routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('Attendance', '/routes/api.php'));
}
}

View File

@ -0,0 +1,30 @@
{
"name": "nwidart/attendance",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\Attendance\\": "app/",
"Modules\\Attendance\\Database\\Factories\\": "database/factories/",
"Modules\\Attendance\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\Attendance\\Tests\\": "tests/"
}
}
}

View File

View File

@ -0,0 +1,5 @@
<?php
return [
'name' => 'Attendance',
];

View File

@ -0,0 +1,16 @@
<?php
namespace Modules\Attendance\database\seeders;
use Illuminate\Database\Seeder;
class AttendanceDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $this->call([]);
}
}

View File

@ -0,0 +1,11 @@
{
"name": "Attendance",
"alias": "attendance",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\Attendance\\Providers\\AttendanceServiceProvider"
],
"files": []
}

View File

@ -0,0 +1,15 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.5",
"sass": "^1.69.5",
"postcss": "^8.3.7",
"vite": "^4.0.0"
}
}

View File

@ -0,0 +1,7 @@
@extends('attendance::layouts.master')
@section('content')
<h1>Hello World</h1>
<p>Module: {!! config('attendance.name') !!}</p>
@endsection

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Attendance Module - {{ config('app.name', 'Laravel') }}</title>
<meta name="description" content="{{ $description ?? '' }}">
<meta name="keywords" content="{{ $keywords ?? '' }}">
<meta name="author" content="{{ $author ?? '' }}">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
{{-- Vite CSS --}}
{{-- {{ module_vite('build-attendance', 'resources/assets/sass/app.scss') }} --}}
</head>
<body>
@yield('content')
{{-- Vite JS --}}
{{-- {{ module_vite('build-attendance', 'resources/assets/js/app.js') }} --}}
</body>

View File

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Attendance\Http\Controllers\AttendanceController;
/*
*--------------------------------------------------------------------------
* API Routes
*--------------------------------------------------------------------------
*
* Here is where you can register API routes for your application. These
* routes are loaded by the RouteServiceProvider within a group which
* is assigned the "api" middleware group. Enjoy building your API!
*
*/
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
Route::apiResource('attendance', AttendanceController::class)->names('attendance');
});

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\Attendance\Http\Controllers\AttendanceController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::group([], function () {
Route::resource('attendance', AttendanceController::class)->names('attendance');
});

View File

@ -0,0 +1,26 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
build: {
outDir: '../../public/build-attendance',
emptyOutDir: true,
manifest: true,
},
plugins: [
laravel({
publicDirectory: '../../public',
buildDirectory: 'build-attendance',
input: [
__dirname + '/resources/assets/sass/app.scss',
__dirname + '/resources/assets/js/app.js'
],
refresh: true,
}),
],
});
//export const paths = [
// 'Modules/Attendance/resources/assets/sass/app.scss',
// 'Modules/Attendance/resources/assets/js/app.js',
//];

View File

@ -1,13 +0,0 @@
<?php
namespace Modules\Employee\Models;
use Illuminate\Database\Eloquent\Model;
class Employee extends Model
{
protected $table = 'employees';
protected $primaryKey = 'employee_id';
protected $guarded = [];
}

View File

@ -4,8 +4,6 @@ namespace Modules\Employee\Providers;
use Illuminate\Support\Facades\Blade; use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
use Modules\Employee\Repositories\EmployeeInterface;
use Modules\Employee\Repositories\EmployeeRepository;
class EmployeeServiceProvider extends ServiceProvider class EmployeeServiceProvider extends ServiceProvider
{ {
@ -31,7 +29,6 @@ class EmployeeServiceProvider extends ServiceProvider
*/ */
public function register(): void public function register(): void
{ {
$this->app->bind(EmployeeInterface::class, EmployeeRepository::class);
$this->app->register(RouteServiceProvider::class); $this->app->register(RouteServiceProvider::class);
} }

View File

@ -1,12 +0,0 @@
<?php
namespace Modules\Employee\Repositories;
interface EmployeeInterface
{
public function findAll();
public function getEmployeeById($employeeId);
public function delete($employeeId);
public function create(array $EmployeeDetails);
public function update($employeeId, array $newDetails);
}

View File

@ -1,34 +0,0 @@
<?php
namespace Modules\Employee\Repositories;
use Modules\Employee\Models\Employee;
class EmployeeRepository implements EmployeeInterface
{
public function findAll()
{
return Employee::get();
}
public function getEmployeeById($employeeId)
{
return Employee::findOrFail($employeeId);
}
public function delete($employeeId)
{
Employee::destroy($employeeId);
}
public function create(array $employeeDetails)
{
return Employee::create($employeeDetails);
}
public function update($employeeId, array $newDetails)
{
return Employee::whereId($employeeId)->update($newDetails);
}
}

View File

@ -5,21 +5,8 @@
<div class="container-fluid"> <div class="container-fluid">
<!-- start page title --> <!-- start page title -->
<div class="row"> @include('layouts.partials.breadcrumb', ['title' => 'Employee'])
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">Team</h4>
<div class="page-title-right">
<ol class="breadcrumb m-0">
<li class="breadcrumb-item"><a href="javascript: void(0);">Pages</a></li>
<li class="breadcrumb-item active">Team</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title --> <!-- end page title -->
<div class="card"> <div class="card">
@ -37,7 +24,7 @@
<div class="list-grid-nav hstack gap-1"> <div class="list-grid-nav hstack gap-1">
<button class="btn btn-success addMembers-modal" data-bs-toggle="modal" <button class="btn btn-success addMembers-modal" data-bs-toggle="modal"
data-bs-target="#addmemberModal"><i class="ri-add-fill me-1 align-bottom"></i> Add Members</button> data-bs-target="#addmemberModal"><i class="ri-add-fill me-1 align-bottom"></i> Create Employee</button>
</div> </div>
</div> </div>
@ -53,6 +40,7 @@
<div id="teamlist"> <div id="teamlist">
<div class="team-list row grid-view-filter" id="team-member-list"> <div class="team-list row grid-view-filter" id="team-member-list">
<div class="col"> <div class="col">
<div class="card team-box"> <div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-9.jpg" alt="" class="img-fluid"> <div class="team-cover"> <img src="assets/images/small/img-9.jpg" alt="" class="img-fluid">
@ -112,6 +100,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="card team-box"> <div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-12.jpg" alt="" class="img-fluid"> <div class="team-cover"> <img src="assets/images/small/img-12.jpg" alt="" class="img-fluid">
@ -172,6 +161,7 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col"> <div class="col">
<div class="card team-box"> <div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-11.jpg" alt="" <div class="team-cover"> <img src="assets/images/small/img-11.jpg" alt=""
@ -231,809 +221,13 @@
</div> </div>
</div> </div>
</div> </div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-1.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn active"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="9"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="9"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-8.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Jennifer Carter</h5>
</a>
<p class="text-muted member-designation mb-0">UI/UX Designer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">241</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">204</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-10.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="8"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="8"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">
<div class="avatar-title bg-light text-primary rounded-circle text-uppercase border">ME
</div>
</div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Megan Elmore</h5>
</a>
<p class="text-muted member-designation mb-0">Team Leader &amp; Web Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">201</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">263</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-2.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="7"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="7"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-4.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Alexis Clarke</h5>
</a>
<p class="text-muted member-designation mb-0">Backend Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">132</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">147</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-4.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn active"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="6"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="6"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">
<div class="avatar-title bg-light text-primary rounded-circle text-uppercase border">NC
</div>
</div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Nathan Cole</h5>
</a>
<p class="text-muted member-designation mb-0">Front-End Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">352</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">376</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-7.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn active"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="5"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="5"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-6.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Joseph Parker</h5>
</a>
<p class="text-muted member-designation mb-0">Full Stack Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">64</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">93</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-3.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="4"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="4"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-5.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Erica Kernan</h5>
</a>
<p class="text-muted member-designation mb-0">Web Designer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">345</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">298</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-5.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn active"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="3"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="3"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">
<div class="avatar-title bg-light text-primary rounded-circle text-uppercase border">DP
</div>
</div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Donald Palmer</h5>
</a>
<p class="text-muted member-designation mb-0">Wed Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">97</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">135</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-8.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="2"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="2"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0"><img
src="assets/images/users/avatar-7.jpg" alt=""
class="member-img img-fluid d-block rounded-circle"></div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Jack Gough</h5>
</a>
<p class="text-muted member-designation mb-0">React Js Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">87</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">121</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="{{ route('employee.show', 1) }}"
class="btn btn-light view-btn">View Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
<div class="col">
<div class="card team-box">
<div class="team-cover"> <img src="assets/images/small/img-6.jpg" alt=""
class="img-fluid"> </div>
<div class="card-body p-4">
<div class="row align-items-center team-row">
<div class="col team-settings">
<div class="row">
<div class="col">
<div class="me-2 flex-shrink-0"> <button type="button"
class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button> </div>
</div>
<div class="col dropdown text-end"> <a href="javascript:void(0);" data-bs-toggle="dropdown"
aria-expanded="false"> <i class="ri-more-fill fs-17"></i> </a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item edit-list" href="#addmemberModal" data-bs-toggle="modal"
data-edit-id="1"><i class="ri-pencil-line text-muted me-2 align-bottom"></i>Edit</a>
</li>
<li><a class="dropdown-item remove-list" href="#removeMemberModal"
data-bs-toggle="modal" data-remove-id="1"><i
class="ri-delete-bin-5-line text-muted me-2 align-bottom"></i>Remove</a></li>
</ul>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="team-profile-img">
<div class="avatar-lg img-thumbnail rounded-circle flex-shrink-0">
<div class="avatar-title bg-light text-primary rounded-circle text-uppercase border">MW
</div>
</div>
<div class="team-content"> <a class="member-name" data-bs-toggle="offcanvas"
href="#member-overview" aria-controls="member-overview">
<h5 class="fs-16 mb-1">Marie Ward</h5>
</a>
<p class="text-muted member-designation mb-0">Backend Developer</p>
</div>
</div>
</div>
<div class="col-lg-4 col">
<div class="row text-muted text-center">
<div class="col-6 border-end border-end-dashed">
<h5 class="projects-num mb-1">145</h5>
<p class="text-muted mb-0">Projects</p>
</div>
<div class="col-6">
<h5 class="tasks-num mb-1">210</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
</div>
<div class="col-lg-2 col">
<div class="text-end"> <a href="pages-profile.html" class="btn btn-light view-btn">View
Profile</a> </div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="mb-3 text-center">
<a href="javascript:void(0);" class="text-success"><i
class="mdi mdi-loading mdi-spin fs-20 me-2 align-middle"></i> Load More </a>
</div>
</div>
<div class="mt-4 py-4 text-center" id="noresult" style="display: none;">
<lord-icon src="https://cdn.lordicon.com/msoeawqm.json" trigger="loop"
colors="primary:#405189,secondary:#0ab39c" style="width:72px;height:72px"></lord-icon>
<h5 class="mt-4">Sorry! No Result Found</h5>
</div>
<!-- Modal -->
<div class="modal fade" id="addmemberModal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered">
<div class="modal-content border-0">
<div class="modal-body">
<form autocomplete="off" id="memberlist-form" class="needs-validation" novalidate="">
<div class="row">
<div class="col-lg-12">
<input type="hidden" id="memberid-input" class="form-control" value="">
<div class="px-1 pt-1">
<div class="modal-team-cover position-relative mt-n4 mx-n4 rounded-top mb-0 overflow-hidden">
<img src="assets/images/small/img-9.jpg" alt="" id="cover-img"
class="img-fluid">
<div class="d-flex position-absolute end-0 start-0 top-0 p-3">
<div class="flex-grow-1">
<h5 class="modal-title text-white" id="createMemberLabel">Add New Members</h5>
</div> </div>
<div class="flex-shrink-0">
<div class="d-flex align-items-center gap-3">
<div>
<label for="cover-image-input" class="mb-0" data-bs-toggle="tooltip"
data-bs-placement="top" aria-label="Select Cover Image"
data-bs-original-title="Select Cover Image">
<div class="avatar-xs">
<div
class="avatar-title bg-light rounded-circle text-muted cursor-pointer border">
<i class="ri-image-fill"></i>
</div>
</div>
</label>
<input class="form-control d-none" value="" id="cover-image-input"
type="file" accept="image/png, image/gif, image/jpeg">
</div>
<button type="button" class="btn-close btn-close-white" id="createMemberBtn-close"
data-bs-dismiss="modal" aria-label="Close"></button>
</div>
</div>
</div>
</div>
</div>
<div class="mt-n5 mb-4 pt-2 text-center">
<div class="position-relative d-inline-block">
<div class="position-absolute bottom-0 end-0">
<label for="member-image-input" class="mb-0" data-bs-toggle="tooltip"
data-bs-placement="right" aria-label="Select Member Image"
data-bs-original-title="Select Member Image">
<div class="avatar-xs">
<div class="avatar-title bg-light rounded-circle text-muted cursor-pointer border">
<i class="ri-image-fill"></i>
</div>
</div>
</label>
<input class="form-control d-none" value="" id="member-image-input"
type="file" accept="image/png, image/gif, image/jpeg">
</div>
<div class="avatar-lg">
<div class="avatar-title bg-light rounded-circle">
<img src="assets/images/users/user-dummy-img.jpg" id="member-img"
class="avatar-md rounded-circle h-auto">
</div>
</div>
</div>
</div>
<div class="mb-3">
<label for="teammembersName" class="form-label">Name</label>
<input type="text" class="form-control" id="teammembersName" placeholder="Enter name"
required="">
<div class="invalid-feedback">Please Enter a member name.</div>
</div> </div>
<div class="mb-4">
<label for="designation" class="form-label">Designation</label>
<input type="text" class="form-control" id="designation"
placeholder="Enter designation" required="">
<div class="invalid-feedback">Please Enter a designation.</div>
</div>
<input type="hidden" id="project-input" class="form-control" value="">
<input type="hidden" id="task-input" class="form-control" value="">
<div class="hstack justify-content-end gap-2">
<button type="button" class="btn btn-light" data-bs-dismiss="modal">Close</button>
<button type="submit" class="btn btn-success" id="addNewMember">Add Member</button>
</div>
</div>
</div>
</form>
</div>
</div>
<!--end modal-content-->
</div>
<!--end modal-dialog-->
</div>
<!--end modal-->
<div class="offcanvas offcanvas-end border-0" tabindex="-1" id="member-overview">
<!--end offcanvas-header-->
<div class="offcanvas-body profile-offcanvas p-0">
<div class="team-cover">
<img src="assets/images/small/img-9.jpg" alt="" class="img-fluid">
</div>
<div class="p-3">
<div class="team-settings">
<div class="row">
<div class="col">
<button type="button" class="btn btn-light btn-icon rounded-circle btn-sm favourite-btn"> <i
class="ri-star-fill fs-14"></i> </button>
</div>
<div class="col dropdown text-end">
<a href="javascript:void(0);" id="dropdownMenuLink14" data-bs-toggle="dropdown"
aria-expanded="false">
<i class="ri-more-fill fs-17"></i>
</a>
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="dropdownMenuLink14">
<li><a class="dropdown-item" href="javascript:void(0);"><i
class="ri-star-line me-2 align-middle"></i>Favorites</a></li>
<li><a class="dropdown-item" href="javascript:void(0);"><i
class="ri-delete-bin-5-line me-2 align-middle"></i>Delete</a></li>
</ul>
</div>
</div>
</div>
<!--end col-->
</div>
<div class="p-3 text-center">
<img src="assets/images/users/avatar-2.jpg" alt=""
class="avatar-lg img-thumbnail rounded-circle profile-img mx-auto">
<div class="mt-3">
<h5 class="fs-15 profile-name">Nancy Martino</h5>
<p class="text-muted profile-designation">Team Leader &amp; HR</p>
</div>
<div class="hstack justify-content-center mt-4 gap-2">
<div class="avatar-xs">
<a href="javascript:void(0);"
class="avatar-title bg-secondary-subtle text-secondary fs-16 rounded">
<i class="ri-facebook-fill"></i>
</a>
</div>
<div class="avatar-xs">
<a href="javascript:void(0);" class="avatar-title bg-success-subtle text-success fs-16 rounded">
<i class="ri-slack-fill"></i>
</a>
</div>
<div class="avatar-xs">
<a href="javascript:void(0);" class="avatar-title bg-info-subtle text-info fs-16 rounded">
<i class="ri-linkedin-fill"></i>
</a>
</div>
<div class="avatar-xs">
<a href="javascript:void(0);" class="avatar-title bg-danger-subtle text-danger fs-16 rounded">
<i class="ri-dribbble-fill"></i>
</a>
</div>
</div>
</div>
<div class="row g-0 text-center">
<div class="col-6">
<div class="border-start-0 border border-dashed p-3">
<h5 class="profile-project mb-1">124</h5>
<p class="text-muted mb-0">Projects</p>
</div>
</div>
<!--end col-->
<div class="col-6">
<div class="border-start-0 border border-dashed p-3">
<h5 class="profile-task mb-1">81</h5>
<p class="text-muted mb-0">Tasks</p>
</div>
</div>
<!--end col-->
</div>
<!--end row-->
<div class="p-3">
<h5 class="fs-15 mb-3">Personal Details</h5>
<div class="mb-3">
<p class="text-muted text-uppercase fw-semibold fs-12 mb-2">Number</p>
<h6>+(256) 2451 8974</h6>
</div>
<div class="mb-3">
<p class="text-muted text-uppercase fw-semibold fs-12 mb-2">Email</p>
<h6>nancymartino@email.com</h6>
</div>
<div>
<p class="text-muted text-uppercase fw-semibold fs-12 mb-2">Location</p>
<h6 class="mb-0">Carson City - USA</h6>
</div>
</div>
<div class="border-top p-3">
<h5 class="fs-15 mb-4">File Manager</h5>
<div class="d-flex mb-3">
<div class="avatar-xs flex-shrink-0">
<div class="avatar-title bg-danger-subtle text-danger fs-16 rounded">
<i class="ri-image-2-line"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1"><a href="javascript:void(0);">Images</a></h6>
<p class="text-muted mb-0">4469 Files</p>
</div>
<div class="text-muted">
12 GB
</div>
</div>
<div class="d-flex mb-3">
<div class="avatar-xs flex-shrink-0">
<div class="avatar-title bg-secondary-subtle text-secondary fs-16 rounded">
<i class="ri-file-zip-line"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1"><a href="javascript:void(0);">Documents</a></h6>
<p class="text-muted mb-0">46 Files</p>
</div>
<div class="text-muted">
3.46 GB
</div>
</div>
<div class="d-flex mb-3">
<div class="avatar-xs flex-shrink-0">
<div class="avatar-title bg-success-subtle text-success fs-16 rounded">
<i class="ri-live-line"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1"><a href="javascript:void(0);">Media</a></h6>
<p class="text-muted mb-0">124 Files</p>
</div>
<div class="text-muted">
4.3 GB
</div>
</div>
<div class="d-flex">
<div class="avatar-xs flex-shrink-0">
<div class="avatar-title bg-primary-subtle text-primary fs-16 rounded">
<i class="ri-error-warning-line"></i>
</div>
</div>
<div class="flex-grow-1 ms-3">
<h6 class="mb-1"><a href="javascript:void(0);">Others</a></h6>
<p class="text-muted mb-0">18 Files</p>
</div>
<div class="text-muted">
846 MB
</div>
</div>
</div>
</div>
<!--end offcanvas-body-->
<div class="offcanvas-foorter hstack position-relative gap-3 border p-3 text-center">
<button class="btn btn-light w-100"><i class="ri-question-answer-fill ms-1 align-bottom"></i> Send
Message</button>
<a href="pages-profile.html" class="btn btn-primary w-100"><i
class="ri-user-3-fill ms-1 align-bottom"></i> View Profile</a>
</div>
</div>
<!--end offcanvas-->
</div> </div>
</div><!-- end col --> </div><!-- end col -->
</div> </div>

View File

@ -4,21 +4,7 @@
<div class="page-content"> <div class="page-content">
<div class="container-fluid"> <div class="container-fluid">
<!-- start page title --> <!-- start page title -->
<div class="row"> @include('layouts.partials.breadcrumb', ['title' => $title])
<div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">{{ $title }}</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">{{ $title }}</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title --> <!-- end page title -->
<div class="row"> <div class="row">
<div class="col-lg-8"> <div class="col-lg-8">

View File

@ -84,8 +84,9 @@
<a href="{{ route('leave.edit', $leave->leave_id) }}" <a href="{{ route('leave.edit', $leave->leave_id) }}"
class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a> class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
<a href="{{ route('leave.destroy', $leave->leave_id) }}" data-id="{{ $leave->leave_id }}" <a href="javascript:void(0);" data-link="{{ route('leave.destroy', $leave->leave_id) }}"
class="link-danger fs-15 remove-item-btn"><i class="ri-delete-bin-line"></i></a> data-id="{{ $leave->leave_id }}" class="link-danger fs-15 remove-item-btn"><i
class="ri-delete-bin-line"></i></a>
</div> </div>
</td> </td>
@ -98,48 +99,10 @@
</div> </div>
</div> </div>
</div> </div>
</div><!--end row--> </div>
<!--end row-->
</div>
</div> </div>
<!-- container-fluid --> <!-- container-fluid -->
</div>
@include('leave::partials.view') @include('leave::partials.view')
@endsection @endsection
@push('js')
<script>
$('.remove-item-btn').on('click', function(e) {
e.preventDefault();
let url = $(this).attr('href');
let id = $(this).data('id');
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'DELETE',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
id: id
},
success: function(response) {
location.reload();
},
error: function(xhr, status, error) {
console.error(xhr.responseText);
}
});
}
});
});
</script>
@endpush

View File

@ -0,0 +1,72 @@
<?php
namespace Modules\User\Http\Controllers;
use App\Http\Controllers\Controller;
use App\Models\User;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
class UserController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
$data = User::latest()->get();
$editable = false;
return view('user::index', compact('data', 'editable'));
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['title'] = "Create User";
return view('user::create', $data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request): RedirectResponse
{
//
}
/**
* Show the specified resource.
*/
public function show($id)
{
return view('user::show');
}
/**
* Show the form for editing the specified resource.
*/
public function edit($id)
{
$data['title'] = "Edit User";
$data['user'] = User::findOrFail($id);
return view('user::edit', $data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id): RedirectResponse
{
//
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
//
}
}

View File

View File

View File

View File

@ -0,0 +1,49 @@
<?php
namespace Modules\User\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* Called before routes are registered.
*
* Register any model bindings or pattern based filters.
*/
public function boot(): void
{
parent::boot();
}
/**
* Define the routes for the application.
*/
public function map(): void
{
$this->mapApiRoutes();
$this->mapWebRoutes();
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*/
protected function mapWebRoutes(): void
{
Route::middleware('web')->group(module_path('User', '/routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*/
protected function mapApiRoutes(): void
{
Route::middleware('api')->prefix('api')->name('api.')->group(module_path('User', '/routes/api.php'));
}
}

View File

@ -0,0 +1,114 @@
<?php
namespace Modules\User\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
class UserServiceProvider extends ServiceProvider
{
protected string $moduleName = 'User';
protected string $moduleNameLower = 'user';
/**
* Boot the application events.
*/
public function boot(): void
{
$this->registerCommands();
$this->registerCommandSchedules();
$this->registerTranslations();
$this->registerConfig();
$this->registerViews();
$this->loadMigrationsFrom(module_path($this->moduleName, 'database/migrations'));
}
/**
* Register the service provider.
*/
public function register(): void
{
$this->app->register(RouteServiceProvider::class);
}
/**
* Register commands in the format of Command::class
*/
protected function registerCommands(): void
{
// $this->commands([]);
}
/**
* Register command Schedules.
*/
protected function registerCommandSchedules(): void
{
// $this->app->booted(function () {
// $schedule = $this->app->make(Schedule::class);
// $schedule->command('inspire')->hourly();
// });
}
/**
* Register translations.
*/
public function registerTranslations(): void
{
$langPath = resource_path('lang/modules/'.$this->moduleNameLower);
if (is_dir($langPath)) {
$this->loadTranslationsFrom($langPath, $this->moduleNameLower);
$this->loadJsonTranslationsFrom($langPath);
} else {
$this->loadTranslationsFrom(module_path($this->moduleName, 'lang'), $this->moduleNameLower);
$this->loadJsonTranslationsFrom(module_path($this->moduleName, 'lang'));
}
}
/**
* Register config.
*/
protected function registerConfig(): void
{
$this->publishes([module_path($this->moduleName, 'config/config.php') => config_path($this->moduleNameLower.'.php')], 'config');
$this->mergeConfigFrom(module_path($this->moduleName, 'config/config.php'), $this->moduleNameLower);
}
/**
* Register views.
*/
public function registerViews(): void
{
$viewPath = resource_path('views/modules/'.$this->moduleNameLower);
$sourcePath = module_path($this->moduleName, 'resources/views');
$this->publishes([$sourcePath => $viewPath], ['views', $this->moduleNameLower.'-module-views']);
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->moduleNameLower);
$componentNamespace = str_replace('/', '\\', config('modules.namespace').'\\'.$this->moduleName.'\\'.ltrim(config('modules.paths.generator.component-class.path'), config('modules.paths.app_folder','')));
Blade::componentNamespace($componentNamespace, $this->moduleNameLower);
}
/**
* Get the services provided by the provider.
*/
public function provides(): array
{
return [];
}
private function getPublishableViewPaths(): array
{
$paths = [];
foreach (config('view.paths') as $path) {
if (is_dir($path.'/modules/'.$this->moduleNameLower)) {
$paths[] = $path.'/modules/'.$this->moduleNameLower;
}
}
return $paths;
}
}

View File

View File

@ -0,0 +1,30 @@
{
"name": "nwidart/user",
"description": "",
"authors": [
{
"name": "Nicolas Widart",
"email": "n.widart@gmail.com"
}
],
"extra": {
"laravel": {
"providers": [],
"aliases": {
}
}
},
"autoload": {
"psr-4": {
"Modules\\User\\": "app/",
"Modules\\User\\Database\\Factories\\": "database/factories/",
"Modules\\User\\Database\\Seeders\\": "database/seeders/"
}
},
"autoload-dev": {
"psr-4": {
"Modules\\User\\Tests\\": "tests/"
}
}
}

View File

View File

@ -0,0 +1,5 @@
<?php
return [
'name' => 'User',
];

View File

View File

View File

@ -0,0 +1,16 @@
<?php
namespace Modules\User\database\seeders;
use Illuminate\Database\Seeder;
class UserDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*/
public function run(): void
{
// $this->call([]);
}
}

11
Modules/User/module.json Normal file
View File

@ -0,0 +1,11 @@
{
"name": "User",
"alias": "user",
"description": "",
"keywords": [],
"priority": 0,
"providers": [
"Modules\\User\\Providers\\UserServiceProvider"
],
"files": []
}

15
Modules/User/package.json Normal file
View File

@ -0,0 +1,15 @@
{
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "vite build"
},
"devDependencies": {
"axios": "^1.1.2",
"laravel-vite-plugin": "^0.7.5",
"sass": "^1.69.5",
"postcss": "^8.3.7",
"vite": "^4.0.0"
}
}

View File

View File

View File

View File

@ -0,0 +1,44 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- 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">{{ $title }}</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">{{ $title }}</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<form action="{{ route('user.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('user::partials.action', ['btnType' => 'Save'])
</form>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,44 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<!-- 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">{{ $title }}</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">{{ $title }}</li>
</ol>
</div>
</div>
</div>
</div>
<!-- end page title -->
<div class="row">
<div class="col-lg-8">
<div class="card">
<div class="card-body">
<form action="{{ route('user.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('user::partials.action', ['btnType' => 'Save'])
</form>
</div>
</div>
</div>
</div>
<!--end row-->
</div>
<!-- container-fluid -->
</div>
@endsection
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,73 @@
@extends('layouts.app')
@section('content')
<div class="page-content">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header d-flex justify-content-between align-items-center">
<h4>{{ label('Users List') }}</h4>
<a href="{{ route('user.create') }}" class="btn btn-info"><span>{{ label('Create New') }}</span></a>
</div>
<div class="card-body">
<div class="table-responsive">
<table id="buttons-datatables" class="display table-sm table-bordered table" style="width:100%">
<thead class="">
<tr>
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Name') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Email') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('User Name') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Role') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Branch') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label('Employee') }}</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->id }}" data-display_order="{{ $item->display_order }}"
class="draggable-row">
<td class="tb-col">{{ $i++ }}</td>
<td class="tb-col">{{ $item->name }}</td>
<td class="tb-col">{{ $item->email }}</td>
<td class="tb-col">{{ $item->username }}</td>
<td class="tb-col">{!! getFieldData('tbl_roles', 'title', 'role_id', $item->roles_id) !!}
<td class="tb-col">{!! getFieldData('tbl_branches', 'title', 'branch_id', $item->branches_id) !!}
<td class="tb-col">{!! getFieldData('tbl_employees', 'title', 'employee_id', $item->employees_id) !!}
</td>
<td class="tb-col">
<div class="hstack flex-wrap gap-3">
<a href="javascript:void(0);" class="link-info fs-15 view-item-btn" data-bs-toggle="modal"
data-bs-target="#viewModal">
<i class="ri-eye-line"></i>
</a>
<a href="{{ route('user.edit', $item->id) }}" class="link-success fs-15 edit-item-btn"><i
class="ri-edit-2-line"></i></a>
<a href="javascript:void(0);" data-link="{{ route('user.destroy', $item->id) }}"
data-id="{{ $item->id }}" class="link-danger fs-15 remove-item-btn"><i
class="ri-delete-bin-line"></i></a>
</div>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
@include('user::partials.view')
@endsection

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token() }}">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>User Module - {{ config('app.name', 'Laravel') }}</title>
<meta name="description" content="{{ $description ?? '' }}">
<meta name="keywords" content="{{ $keywords ?? '' }}">
<meta name="author" content="{{ $author ?? '' }}">
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
{{-- Vite CSS --}}
{{-- {{ module_vite('build-user', 'resources/assets/sass/app.scss') }} --}}
</head>
<body>
@yield('content')
{{-- Vite JS --}}
{{-- {{ module_vite('build-user', 'resources/assets/js/app.js') }} --}}
</body>

View File

@ -0,0 +1,23 @@
<div class="mb-3">
<label for="name" class="form-label">Name</label>
<input type="text" class="form-control" id="name" placeholder="Enter name" name="name"
value="{{ old('end_date', $leave->name ?? '') }}" required>
<div class="invalid-feedback">
Please enter employee name.
</div>
</div>
<div class="mb-3">
<label for="email" class="form-label">Email</label>
<input type="text" class="form-control" id="email" name="email"
value="{{ old('email', $leave->email ?? '') }}">
</div>
<div class="text-end">
<button type="submit" class="btn btn-primary">{{ $btnType }}</button>
</div>
@push('js')
<script src="{{ asset('assets/js/pages/form-validation.init.js') }}"></script>
@endpush

View File

@ -0,0 +1,16 @@
<div class="modal fade" id="viewModal" tabindex="-1" aria-labelledby="viewModalLabel" aria-modal="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="exampleModalgridLabel">View User</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<form action="{{ route('user.store') }}" class="needs-validation" novalidate method="post">
@csrf
@include('user::partials.action', ['btnType' => 'View'])
</form>
</div>
</div>
</div>
</div>

View File

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\User\Http\Controllers\UserController;
/*
*--------------------------------------------------------------------------
* API Routes
*--------------------------------------------------------------------------
*
* Here is where you can register API routes for your application. These
* routes are loaded by the RouteServiceProvider within a group which
* is assigned the "api" middleware group. Enjoy building your API!
*
*/
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
Route::apiResource('user', UserController::class)->names('user');
});

View File

@ -0,0 +1,19 @@
<?php
use Illuminate\Support\Facades\Route;
use Modules\User\Http\Controllers\UserController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::group([], function () {
Route::resource('user', UserController::class)->names('user');
});

View File

@ -0,0 +1,26 @@
import { defineConfig } from 'vite';
import laravel from 'laravel-vite-plugin';
export default defineConfig({
build: {
outDir: '../../public/build-user',
emptyOutDir: true,
manifest: true,
},
plugins: [
laravel({
publicDirectory: '../../public',
buildDirectory: 'build-user',
input: [
__dirname + '/resources/assets/sass/app.scss',
__dirname + '/resources/assets/js/app.js'
],
refresh: true,
}),
],
});
//export const paths = [
// 'Modules/User/resources/assets/sass/app.scss',
// 'Modules/User/resources/assets/js/app.js',
//];

View File

@ -1,40 +1,41 @@
<?php <?php
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Countries;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use App\Service\CommonModelService;
use Log;
use Exception;
class CountriesController extends Controller use App\Http\Controllers\Controller;
{ use App\Models\Country\Country;
use App\Service\CommonModelService;
use Exception;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Validator;
use Log;
class CountriesController extends Controller
{
protected $modelService; protected $modelService;
public function __construct(Countries $model) public function __construct(Country $model)
{ {
$this->modelService = new CommonModelService($model); $this->modelService = new CommonModelService($model);
} }
public function index(Request $request) public function index(Request $request)
{ {
createActivityLog(CountriesController::class, 'index', ' Countries index'); // createActivityLog(CountriesController::class, 'index', ' Country index');
$data = Countries::where('status','<>',-1)->orderBy('display_order')->get(); $data = Country::where('status', '<>', -1)->orderBy('display_order')->get();
return view("crud.generated.countries.index", compact('data')); return view("crud.generated.countries.index", compact('data'));
} }
public function create(Request $request) public function create(Request $request)
{ {
createActivityLog(CountriesController::class, 'create', ' Countries create'); // createActivityLog(CountriesController::class, 'create', ' Country create');
$TableData = Countries::where('status','<>',-1)->orderBy('display_order')->get(); $TableData = Country::where('status', '<>', -1)->orderBy('display_order')->get();
$editable=false; $editable = false;
return view("crud.generated.countries.edit",compact('TableData','editable')); return view("crud.generated.countries.edit", compact('TableData', 'editable'));
} }
public function store(Request $request) public function store(Request $request)
{ {
createActivityLog(CountriesController::class, 'store', ' Countries store'); // createActivityLog(CountriesController::class, 'store', ' Country store');
$validator = Validator::make($request->all(), [ $validator = Validator::make($request->all(), [
//ADD REQUIRED FIELDS FOR VALIDATION //ADD REQUIRED FIELDS FOR VALIDATION
]); ]);
@ -42,15 +43,15 @@
if ($validator->fails()) { if ($validator->fails()) {
return response()->json([ return response()->json([
'error' => $validator->errors(), 'error' => $validator->errors(),
],500); ], 500);
} }
$request->request->add(['alias' => slugify($request->title)]); $request->request->add(['alias' => slugify($request->title)]);
$request->request->add(['display_order' => getDisplayOrder('tbl_countries')]); $request->request->add(['display_order' => getDisplayOrder('tbl_countries')]);
$request->request->add(['created_at' => date("Y-m-d h:i:s")]); $request->request->add(['created_at' => date("Y-m-d h:i:s")]);
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]); $request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
$requestData=$request->all(); $requestData = $request->all();
array_walk_recursive($requestData, function (&$value) { array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL').'/', '', $value); $value = str_replace(env('APP_URL') . '/', '', $value);
}); });
array_walk_recursive($requestData, function (&$value) { array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value); $value = str_replace(env('APP_URL'), '', $value);
@ -67,9 +68,9 @@
} }
DB::commit(); DB::commit();
if ($request->ajax()) { if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Countries Created Successfully.'], 200); return response()->json(['status' => true, 'message' => 'The Country Created Successfully.'], 200);
} }
return redirect()->route('countries.index')->with('success','The Countries created Successfully.'); return redirect()->route('countries.index')->with('success', 'The Country created Successfully.');
} }
public function sort(Request $request) public function sort(Request $request)
@ -77,7 +78,7 @@
$idOrder = $request->input('id_order'); $idOrder = $request->input('id_order');
foreach ($idOrder as $index => $id) { foreach ($idOrder as $index => $id) {
$companyArticle = Countries::find($id); $companyArticle = Country::find($id);
$companyArticle->display_order = $index + 1; $companyArticle->display_order = $index + 1;
$companyArticle->save(); $companyArticle->save();
} }
@ -89,7 +90,7 @@
$articleId = $request->input('articleId'); $articleId = $request->input('articleId');
$newAlias = $request->input('newAlias'); $newAlias = $request->input('newAlias');
$companyArticle = Countries::find($articleId); $companyArticle = Country::find($articleId);
if (!$companyArticle) { if (!$companyArticle) {
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404); return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
} }
@ -98,31 +99,26 @@
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200); return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
} }
public function show(Request $request, $id) public function show(Request $request, $id)
{ {
createActivityLog(CountriesController::class, 'show', ' Countries show'); // createActivityLog(CountriesController::class, 'show', ' Country show');
$data = Countries::findOrFail($id); $data = Country::findOrFail($id);
return view("crud.generated.countries.show", compact('data')); return view("crud.generated.countries.show", compact('data'));
} }
public function edit(Request $request, $id) public function edit(Request $request, $id)
{ {
createActivityLog(CountriesController::class, 'edit', ' Countries edit'); // createActivityLog(CountriesController::class, 'edit', ' Country edit');
$TableData = Countries::where('status','<>',-1)->orderBy('display_order')->get(); $TableData = Country::where('status', '<>', -1)->orderBy('display_order')->get();
$data = Countries::findOrFail($id); $data = Country::findOrFail($id);
$editable=true; $editable = true;
return view("crud.generated.countries.edit", compact('data','TableData','editable')); return view("crud.generated.countries.edit", compact('data', 'TableData', 'editable'));
} }
public function update(Request $request, $id) public function update(Request $request, $id)
{ {
createActivityLog(CountriesController::class, 'update', ' Countries update'); // createActivityLog(CountriesController::class, 'update', ' Country update');
$validator = Validator::make($request->all(), [ $validator = Validator::make($request->all(), [
//ADD VALIDATION FOR REQIRED FIELDS //ADD VALIDATION FOR REQIRED FIELDS
]); ]);
@ -130,11 +126,11 @@
if ($validator->fails()) { if ($validator->fails()) {
return response()->json([ return response()->json([
'error' => $validator->errors(), 'error' => $validator->errors(),
],500); ], 500);
} }
$requestData=$request->all(); $requestData = $request->all();
array_walk_recursive($requestData, function (&$value) { array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL').'/', '', $value); $value = str_replace(env('APP_URL') . '/', '', $value);
}); });
array_walk_recursive($requestData, function (&$value) { array_walk_recursive($requestData, function (&$value) {
$value = str_replace(env('APP_URL'), '', $value); $value = str_replace(env('APP_URL'), '', $value);
@ -151,15 +147,15 @@
} }
DB::commit(); DB::commit();
if ($request->ajax()) { if ($request->ajax()) {
return response()->json(['status' => true, 'message' => 'The Countries updated Successfully.'], 200); return response()->json(['status' => true, 'message' => 'The Country updated Successfully.'], 200);
} }
// return redirect()->route('countries.index')->with('success','The Countries updated Successfully.'); // return redirect()->route('countries.index')->with('success','The Country updated Successfully.');
return redirect()->back()->with('success', 'The Countries updated successfully.'); return redirect()->back()->with('success', 'The Country updated successfully.');
} }
public function destroy(Request $request,$id) public function destroy(Request $request, $id)
{ {
createActivityLog(CountriesController::class, 'destroy', ' Countries destroy'); // createActivityLog(CountriesController::class, 'destroy', ' Country destroy');
DB::beginTransaction(); DB::beginTransaction();
try { try {
$OperationNumber = getOperationNumber(); $OperationNumber = getOperationNumber();
@ -171,13 +167,13 @@
return response()->json(['status' => false, 'message' => $e->getMessage()], 500); return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
} }
DB::commit(); DB::commit();
return response()->json(['status'=>true,'message'=>'The Countries Deleted Successfully.'],200); return response()->json(['status' => true, 'message' => 'The Country Deleted Successfully.'], 200);
} }
public function toggle(Request $request,$id) public function toggle(Request $request, $id)
{ {
createActivityLog(CountriesController::class, 'destroy', ' Countries destroy'); // createActivityLog(CountriesController::class, 'destroy', ' Country destroy');
$data = Countries::findOrFail($id); $data = Country::findOrFail($id);
$requestData=['status'=>($data->status==1)?0:1]; $requestData = ['status' => ($data->status == 1) ? 0 : 1];
DB::beginTransaction(); DB::beginTransaction();
try { try {
$OperationNumber = getOperationNumber(); $OperationNumber = getOperationNumber();
@ -189,15 +185,15 @@
return response()->json(['status' => false, 'message' => $e->getMessage()], 500); return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
} }
DB::commit(); DB::commit();
return response()->json(['status'=>true,'message'=>'The Countries Deleted Successfully.'],200); return response()->json(['status' => true, 'message' => 'The Country Deleted Successfully.'], 200);
} }
public function clone(Request $request,$id) public function clone (Request $request, $id)
{ {
createActivityLog(CountriesController::class, 'clone', ' Countries clone'); // createActivityLog(CountriesController::class, 'clone', ' Country clone');
$data = Countries::findOrFail($id); $data = Country::findOrFail($id);
unset($data['updatedby']); unset($data['updatedby']);
unset($data['createdby']); unset($data['createdby']);
$requestData=$data->toArray(); $requestData = $data->toArray();
DB::beginTransaction(); DB::beginTransaction();
try { try {
$OperationNumber = getOperationNumber(); $OperationNumber = getOperationNumber();
@ -209,10 +205,7 @@
return response()->json(['status' => false, 'message' => $e->getMessage()], 500); return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
} }
DB::commit(); DB::commit();
return response()->json(['status'=>true,'message'=>'The Countries Clonned Successfully.'],200); return response()->json(['status' => true, 'message' => 'The Country Clonned Successfully.'], 200);
}
} }
}

View File

@ -2,7 +2,6 @@
namespace App\Http\Controllers; namespace App\Http\Controllers;
use App\Helpers\BibClass;
use App\Http\Controllers\Controller; use App\Http\Controllers\Controller;
use Exception; use Exception;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@ -41,7 +40,7 @@ class GeneralFormController extends Controller
'icon', 'icon',
'favicon', 'favicon',
'og_image', 'og_image',
'no_image' 'no_image',
); );
self::$textEditorFields = array('details', 'description', 'text', 'qualification', 'experience', 'required_documents', 'biodata', 'privacy_policy', 'content1', 'content2', 'content3'); self::$textEditorFields = array('details', 'description', 'text', 'qualification', 'experience', 'required_documents', 'biodata', 'privacy_policy', 'content1', 'content2', 'content3');
self::$textAreaFields = array('copyright', 'remarks', 'seo_keywords', 'seo_description', 'seo_descriptions', 'intro', 'meta_tags', 'google_map', 'og_tags'); self::$textAreaFields = array('copyright', 'remarks', 'seo_keywords', 'seo_description', 'seo_descriptions', 'intro', 'meta_tags', 'google_map', 'og_tags');
@ -70,7 +69,7 @@ class GeneralFormController extends Controller
$table_field = "Tables_in_$databasdeName"; $table_field = "Tables_in_$databasdeName";
// dd($table->$table_field); // dd($table->$table_field);
if(strpos($table->$table_field,"_logs")){continue;} if (strpos($table->$table_field, "_logs")) {continue;}
$allTables[$table->$table_field] = $table->$table_field; $allTables[$table->$table_field] = $table->$table_field;
} }
return view('crud.form.create', compact('allTables')); return view('crud.form.create', compact('allTables'));
@ -79,7 +78,6 @@ class GeneralFormController extends Controller
} }
} }
public function store(Request $request) public function store(Request $request)
{ {
// dd($request->all()); // dd($request->all());
@ -111,8 +109,6 @@ class GeneralFormController extends Controller
$data['TableRows'] = DB::select("select * from " . $data['TableName']); $data['TableRows'] = DB::select("select * from " . $data['TableName']);
return view("crud.settings.dictonary", $data); return view("crud.settings.dictonary", $data);
case 'curd': case 'curd':
$data['tableName'] = $tableName; $data['tableName'] = $tableName;
$data['directoryName'] = $directoryName; $data['directoryName'] = $directoryName;
@ -162,7 +158,7 @@ class GeneralFormController extends Controller
$string = '_id'; $string = '_id';
$foreign = []; $foreign = [];
foreach ($all_columns as $key => $column) { foreach ($all_columns as $key => $column) {
if (str_contains($column, $string) !== FALSE) { // Yoshi version if (str_contains($column, $string) !== false) { // Yoshi version
$foreign[] = $column; $foreign[] = $column;
} }
} }
@ -188,8 +184,6 @@ class GeneralFormController extends Controller
return array_column(DB::select("SHOW COLUMNS FROM $TableName"), 'Field'); return array_column(DB::select("SHOW COLUMNS FROM $TableName"), 'Field');
} }
public static function ajaxShowContent($TableName, $directoryName) public static function ajaxShowContent($TableName, $directoryName)
{ {
$TableName = strtolower($TableName); $TableName = strtolower($TableName);
@ -212,14 +206,17 @@ class GeneralFormController extends Controller
foreach ($TableCols as $key => $TableCol): foreach ($TableCols as $key => $TableCol):
$TableCol = $TableCol->Field; $TableCol = $TableCol->Field;
if ($key == 0 || $TableCol == 'createdOn' || $TableCol == 'createdBy' || $TableCol == 'updatedBy' || $TableCol == 'created_at' || $TableCol == 'updated_at') if ($key == 0 || $TableCol == 'createdOn' || $TableCol == 'createdBy' || $TableCol == 'updatedBy' || $TableCol == 'created_at' || $TableCol == 'updated_at') {
continue; continue;
}
$TableColLabel = ucwords(str_replace("_", " ", $TableCol)); $TableColLabel = ucwords(str_replace("_", " ", $TableCol));
if ($TableCol == 'status') if ($TableCol == 'status') {
$showContent .= "<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span $showContent .= "<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class=\"{{\$data->$TableCol == 1 ? 'text-success' : 'text-danger'}}\">{{\$data->$TableCol == 1 ? 'Active' : 'Inactive'}}</span></p>"; class=\"{{\$data->$TableCol == 1 ? 'text-success' : 'text-danger'}}\">{{\$data->$TableCol == 1 ? 'Active' : 'Inactive'}}</span></p>";
else } else {
$showContent .= '<p><b>' . $TableColLabel . " :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{\$data->$TableCol}}</span></p>"; $showContent .= '<p><b>' . $TableColLabel . " :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{\$data->$TableCol}}</span></p>";
}
endforeach; endforeach;
$showContent .= "<div class=\"d-flex justify-content-between\"> $showContent .= "<div class=\"d-flex justify-content-between\">
@ -257,12 +254,12 @@ class GeneralFormController extends Controller
$Table_pk = $all_columns[0]; $Table_pk = $all_columns[0];
$all_foreign_table = self::getForeignTable($all_columns); $all_foreign_table = self::getForeignTable($all_columns);
$all_foreignKey = []; $all_foreignKey = [];
if ($all_foreign_table) if ($all_foreign_table) {
foreach ($all_foreign_table as $key => $tablename) { foreach ($all_foreign_table as $key => $tablename) {
$all_foreignKey[$tablename] = self::getTableColumns($tablename); $all_foreignKey[$tablename] = self::getTableColumns($tablename);
$all_foreignKey[$tablename] = $all_foreignKey[$tablename][0] ?? null; $all_foreignKey[$tablename] = $all_foreignKey[$tablename][0] ?? null;
} }
}
$editContent = " $editContent = "
<form action=\"{{\$editable?route('$routeName.update',[\$data->$Table_pk]):route('$routeName.store')}}\" id=\"updateCustomForm\" method=\"POST\" >\n @csrf "; <form action=\"{{\$editable?route('$routeName.update',[\$data->$Table_pk]):route('$routeName.store')}}\" id=\"updateCustomForm\" method=\"POST\" >\n @csrf ";
@ -325,7 +322,6 @@ class GeneralFormController extends Controller
} }
} }
endforeach; endforeach;
$editContent .= ' <div class="col-md-12">'; $editContent .= ' <div class="col-md-12">';
$editContent .= "<?php createButton(\"btn-primary btn-update\",\"\",\"Submit\"); ?>\n"; $editContent .= "<?php createButton(\"btn-primary btn-update\",\"\",\"Submit\"); ?>\n";
@ -333,8 +329,6 @@ class GeneralFormController extends Controller
$editContent .= "</div>"; $editContent .= "</div>";
$editContent .= " </form>"; $editContent .= " </form>";
return $editContent; return $editContent;
} //end of ajaxEditContent method } //end of ajaxEditContent method
public static function editContent($TableName, $directoryName) public static function editContent($TableName, $directoryName)
@ -352,7 +346,7 @@ class GeneralFormController extends Controller
$folder .= str_replace("tbl_", "", $TableName); $folder .= str_replace("tbl_", "", $TableName);
$Table_pk = str_replace("tbl_", "", $TableName) . "_id"; $Table_pk = str_replace("tbl_", "", $TableName) . "_id";
$title = ucwords(str_replace("tbl_", "", $TableName)); $title = ucwords(str_replace("tbl_", "", $TableName));
$editContent = "@extends('backend.template') $editContent = "@extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
@ -392,7 +386,7 @@ class GeneralFormController extends Controller
$Table_pk = str_replace("tbl_", "", $TableName) . "_id"; $Table_pk = str_replace("tbl_", "", $TableName) . "_id";
$title = ucwords(str_replace("tbl_", "", $TableName)); $title = ucwords(str_replace("tbl_", "", $TableName));
$addContent = "@extends('backend.template') $addContent = "@extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
@ -504,7 +498,6 @@ class GeneralFormController extends Controller
$addContent .= "</div>"; $addContent .= "</div>";
$addContent .= " </form>"; $addContent .= " </form>";
return $addContent; return $addContent;
} //End of ajax addContent } //End of ajax addContent
*/ */
@ -524,7 +517,7 @@ class GeneralFormController extends Controller
$Table_pk = str_replace("tbl_", "", $TableName) . "_id"; $Table_pk = str_replace("tbl_", "", $TableName) . "_id";
$title = ucwords(str_replace("tbl_", "", $TableName)); $title = ucwords(str_replace("tbl_", "", $TableName));
$showContent = "@extends('backend.template') $showContent = "@extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
@ -553,7 +546,6 @@ class GeneralFormController extends Controller
return $showContent; return $showContent;
} }
public static function migrationContent($tableName) public static function migrationContent($tableName)
{ {
$tableName = strtolower($tableName); $tableName = strtolower($tableName);
@ -653,9 +645,6 @@ class GeneralFormController extends Controller
fclose($file); fclose($file);
} }
return $RouteContent; return $RouteContent;
} }
@ -679,7 +668,7 @@ class GeneralFormController extends Controller
$tableFields = DB::select("describe $TableName"); $tableFields = DB::select("describe $TableName");
$translated = label('' . $title); $translated = label('' . $title);
$HiddenColumns = array($primaryKey, "remarks", "createdon", "createdby", "updatedby", "seo_title", "seo_descriptions", "seo_keywords", "google_map", "seo_description", "og_tags", "created_at", "updated_at", "description", "details", "text", "display_order", "status"); $HiddenColumns = array($primaryKey, "remarks", "createdon", "createdby", "updatedby", "seo_title", "seo_descriptions", "seo_keywords", "google_map", "seo_description", "og_tags", "created_at", "updated_at", "description", "details", "text", "display_order", "status");
$listContent = '@extends(\'backend.template\') $listContent = '@extends(\'layouts.app\')
@section(\'content\') @section(\'content\')
<div class="card"> <div class="card">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
@ -694,7 +683,7 @@ class GeneralFormController extends Controller
foreach ($columns as $key => $column) { foreach ($columns as $key => $column) {
if (!in_array($column, $HiddenColumns)) if (!in_array($column, $HiddenColumns)) {
switch ($column) { switch ($column) {
case (strpos($column, "parent_") !== false): case (strpos($column, "parent_") !== false):
$listContent .= '<th class="tb-col"><span class="overline-title">{{ label("Parent") }}</span></th>' . PHP_EOL; $listContent .= '<th class="tb-col"><span class="overline-title">{{ label("Parent") }}</span></th>' . PHP_EOL;
@ -706,6 +695,7 @@ class GeneralFormController extends Controller
default: default:
$listContent .= '<th class="tb-col"><span class="overline-title">{{ label("' . $column . '") }}</span></th>' . PHP_EOL; $listContent .= '<th class="tb-col"><span class="overline-title">{{ label("' . $column . '") }}</span></th>' . PHP_EOL;
} }
}
} }
$listContent .= '<th class="tb-col" data-sortable="false"><span $listContent .= '<th class="tb-col" data-sortable="false"><span
@ -1014,7 +1004,6 @@ function confirmClone(url) {
//ajax complete List //ajax complete List
public static function modelContent($tableName, $directoryName) public static function modelContent($tableName, $directoryName)
{ {
$tableName = strtolower($tableName); $tableName = strtolower($tableName);
@ -1025,7 +1014,6 @@ function confirmClone(url) {
$modelClass = ucfirst(str_replace("tbl_", "", $tableName)); $modelClass = ucfirst(str_replace("tbl_", "", $tableName));
$tableFields = DB::select("describe $tableName"); $tableFields = DB::select("describe $tableName");
$pkField = $tableFields[0]->Field; $pkField = $tableFields[0]->Field;
@ -1098,7 +1086,6 @@ function confirmClone(url) {
return $contentString; return $contentString;
} }
public static function controllerContent($tableName, $directoryName) public static function controllerContent($tableName, $directoryName)
{ {
$tableName = strtolower($tableName); $tableName = strtolower($tableName);

View File

@ -1,6 +1,6 @@
<?php <?php
namespace App\Modules\Models\Country; namespace App\Models\Country;
use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
@ -8,12 +8,12 @@ use Illuminate\Database\Eloquent\Model;
class Country extends Model class Country extends Model
{ {
use HasFactory; use HasFactory;
protected $table = 'tbl_countries';
protected $fillable = [ protected $fillable = [
'country_name', 'country_name',
'phone_code', 'phone_code',
'country_code', 'country_code',
'status' 'status',
]; ];
public function provinces() public function provinces()
@ -23,6 +23,6 @@ class Country extends Model
public static function getCountries() public static function getCountries()
{ {
return self::select('id','country_name')->where('status','Active')->get(); return self::select('id', 'country_name')->where('status', 'Active')->get();
} }
} }

View File

@ -0,0 +1,217 @@
<?php
namespace App\Service;
use Carbon\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Hash;
use Yajra\DataTables\Facades\DataTables;
use Exception;
class CommonModelService
{
protected $model;
public function __construct($model)
{
$this->model = $model;
}
/**
* Create operation
* $operationStartNumber -> It is required first time if it contain multiple tables operation
* $operationEndNumber -> It is required Every time on any operation because on showing block it is required.
* $oldValues -> On store/insert old values will be null
* $newValues => On store/insert operation $new values will be model created object values and stoe in json format.
*/
public function create($operationStartNumber, $operationEndNumber, $oldValues, $newValues)
{
$baseClass = get_class($this->model);
$modelData = $this->model->create($newValues);
$prmimayKeyFieldName = $modelData->getKeyName();
$ModelID = $modelData->$prmimayKeyFieldName;
createOperationLog($operationStartNumber, $operationEndNumber, $baseClass, $ModelID, 'create', $oldValues, $modelData);
return $modelData;
}
/**
* update operation
* $operationStartNumber -> It is required first time if it contain multiple tables operation
* $operationEndNumber -> It is required Every time on any operation because on showing block it is required.
* $oldValues -> On store/insert old values case, is required only if it is updated on direct table on like users_roles table case other wise We get here
* null but find from model Id. It will be also stored in json format.
* $newValues => On store/insert operation $new values will be model created object values and stoe in json format.
*/
public function update($operationStartNumber, $operationEndNumber, $oldValues, $newValues, $ModelID)
{
$baseClass = get_class($this->model);
$this->model = $this->model->find($ModelID);
$oldValues = !empty($oldValues) ? $oldValues : $this->model->toArray();
$this->model->update($newValues);
createOperationLog($operationStartNumber, $operationEndNumber, $baseClass, $ModelID, 'update', $oldValues, $this->model->getChanges());
return $this->model;
}
/**
* Create operation
* $operationStartNumber -> It is required first time if it contain multiple tables operation
* $operationEndNumber -> It is required Every time on any operation because on showing block it is required.
* $oldValues -> On store/insert old values will be null
* $newValues => On store/insert operation $new values will be model created object values and stoe in json format.
*/
public function destroy($operationStartNumber, $operationEndNumber, $ModelID)
{
$baseClass = get_class($this->model);
$this->model = $this->model->find($ModelID);
$oldValues = ['status' => $this->model->status];
$this->model->update(['status' => -1]);
createOperationLog($operationStartNumber, $operationEndNumber, $baseClass, $ModelID, 'delete', $oldValues, ['status' => -1]);
return $this->model;
}
/**
* Paginate all User
*
* @param array $filter
* @return Collection
*/
public function paginate(array $filter = [])
{
$filter['limit'] = 25;
return $this->model->orderBy('id', 'DESC')->whereIsDeleted('no')->paginate($filter['limit']);
}
/**
* Get all User
*
* @return Collection
*/
public function all()
{
return $this->model->whereIsDeleted('no')->all();
}
/**
* Get all users with supervisor type
*
* @return Collection
*/
public function find($userId)
{
try {
return $this->model->whereIsDeleted('no')->find($userId);
} catch (Exception $e) {
return null;
}
}
// public function update($userId, array $data)
// {
// try {
// $data['visibility'] = (isset($data['visibility']) ? $data['visibility'] : '') == 'on' ? 'visible' : 'invisible';
// $data['status'] = (isset($data['status']) ? $data['status'] : '') == 'on' ? 'active' : 'in_active';
// $data['availability'] = (isset($data['availability']) ? $data['availability'] : '') == 'on' ? 'available' : 'not_available';
// $data['has_subuser'] = (isset($data['has_subuser']) ? $data['has_subuser'] : '') == 'on' ? 'yes' : 'no';
// $data['last_updated_by'] = Auth::user()->id;
// $user = $this->model->find($userId);
// $user = $user->update($data);
// $this->logger->info(' created successfully', $data);
// return $user;
// } catch (Exception $e) {
// $this->logger->error($e->getMessage());
// return false;
// }
// }
/**
* Delete a User
*
* @param Id
* @return bool
*/
public function delete($userId)
{
try {
$data['last_deleted_by'] = Auth::user()->id;
$data['deleted_at'] = Carbon::now();
$user = $this->model->find($userId);
$data['is_deleted'] = 'yes';
return $user = $user->update($data);
dd($user);
} catch (Exception $e) {
return false;
}
}
public function getUserRoles($id)
{
try {
$user = User::with('roles')->find($id);
$roles = $user->roles;
return $roles;
} catch (Exception $e) {
return false;
}
}
/**
* write brief description
* @param $name
* @return mixed
*/
public function getByName($name)
{
return $this->model->whereIsDeleted('no')->whereName($name);
}
public function getBySlug($id)
{
return $this->model->whereIsDeleted('no')->whereId($id)->first();
}
function uploadFile($file)
{
if (!empty($file)) {
$this->uploadPath = 'uploads/user';
return $fileName = $this->uploadFromAjax($file);
}
}
public function __deleteImages($subCat)
{
try {
if (is_file($subCat->image_path))
unlink($subCat->image_path);
if (is_file($subCat->thumbnail_path))
unlink($subCat->thumbnail_path);
} catch (\Exception $e) {
}
}
public function updateImage($userId, array $data)
{
try {
$user = $this->model->find($userId);
$user = $user->update($data);
return $user;
} catch (Exception $e) {
//$this->logger->error($e->getMessage());
return false;
}
}
}

4
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "18585a0d9833f75d740f42dfc2e2db87", "content-hash": "8382101c555e42e8fbbf188fa8b7b1c6",
"packages": [ "packages": [
{ {
"name": "barryvdh/laravel-debugbar", "name": "barryvdh/laravel-debugbar",
@ -8865,5 +8865,5 @@
"php": "^8.1" "php": "^8.1"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.3.0" "plugin-api-version": "2.6.0"
} }

View File

@ -1,5 +1,6 @@
{ {
"Leave": true, "Leave": true,
"Employee": true,
"Attendance": true, "Attendance": true,
"Employee": true "User": true
} }

View File

@ -1,3 +1,39 @@
$('body').on('click', '.remove-item-btn', function (e) {
e.preventDefault();
let url = $(this).data('href');
let id = $(this).data('id');
Swal.fire({
title: 'Are you sure?',
text: "You won't be able to revert this!",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes, delete it!'
}).then((result) => {
if (result.isConfirmed) {
$.ajax({
url: url,
type: 'DELETE',
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
},
data: {
id: id
},
success: function (response) {
location.reload();
},
error: function (xhr, status, error) {
console.error(xhr.responseText);
}
});
}
});
});
//initialize ckeditor //initialize ckeditor
document.querySelectorAll('.ckeditor-classic').forEach(editor => { document.querySelectorAll('.ckeditor-classic').forEach(editor => {
console.log(editor); console.log(editor);
@ -7,28 +43,28 @@ document.querySelectorAll('.ckeditor-classic').forEach(editor => {
console.error(error); console.error(error);
}); });
}); });
$('.date-picker').nepaliDatePicker({ $('.date-picker').nepaliDatePicker({
// dateFormat: '%D, %M %d, %y', // dateFormat: '%D, %M %d, %y',
dateFormat: '%y-%m-%d', dateFormat: '%y-%m-%d',
closeOnDateSelect: true, closeOnDateSelect: true,
}); });
// initialize filepond // initialize filepond
const inputElement = document.querySelector('.filepond'); const inputElement = document.querySelector('.filepond');
console.log(inputElement); console.log(inputElement);
FilePond.registerPlugin(FilePondPluginImagePreview); FilePond.registerPlugin(FilePondPluginImagePreview);
const pond = FilePond.create(inputElement); const pond = FilePond.create(inputElement);
FilePond.setOptions({ FilePond.setOptions({
server:{ server: {
process:"/filepond/upload", process: "/filepond/upload",
revert: '/delete', revert: '/delete',
headers:{ headers: {
'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content'), 'X-CSRF-TOKEN': document.querySelector('meta[name="csrf-token"]').getAttribute('content'),
}, },
} }
}); });
//ajax form submit //ajax form submit
@ -70,7 +106,7 @@ document.addEventListener('DOMContentLoaded', function () {
}) })
.then(response => { .then(response => {
if (response.ok) { if (response.ok) {
response.json().then(data=>{ response.json().then(data => {
toastr['success'](data.message); toastr['success'](data.message);
}) })
} else { } else {
@ -95,3 +131,4 @@ document.addEventListener('DOMContentLoaded', function () {
}); });

View File

@ -1 +1 @@
function initializeTables(){new DataTable("#example"),new DataTable("#scroll-vertical",{scrollY:"210px",scrollCollapse:!0,paging:!1}),new DataTable("#scroll-horizontal",{scrollX:!0}),new DataTable("#alternative-pagination",{pagingType:"full_numbers"}),new DataTable("#fixed-header",{fixedHeader:!0}),new DataTable("#model-datatables",{responsive:{details:{display:$.fn.dataTable.Responsive.display.modal({header:function(a){a=a.data();return"Details for "+a[0]+" "+a[1]}}),renderer:$.fn.dataTable.Responsive.renderer.tableAll({tableClass:"table"})}}}),new DataTable("#buttons-datatables",{dom:"Bfrtip",buttons:["copy","csv","excel","print","pdf"]}),new DataTable("#ajax-datatables",{ajax:"assets/json/datatable.json"});var a=$("#add-rows").DataTable(),e=1;$("#addRow").on("click",function(){a.row.add([e+".1",e+".2",e+".3",e+".4",e+".5",e+".6",e+".7",e+".8",e+".9",e+".10",e+".11",e+".12"]).draw(!1),e++}),$("#addRow").trigger("click")}document.addEventListener("DOMContentLoaded",function(){initializeTables()}); function initializeTables() { new DataTable("#example"), new DataTable("#scroll-vertical", { scrollY: "210px", scrollCollapse: !0, paging: !1 }), new DataTable("#scroll-horizontal", { scrollX: !0 }), new DataTable("#alternative-pagination", { pagingType: "full_numbers" }), new DataTable("#fixed-header", { fixedHeader: !0 }), new DataTable("#model-datatables", { responsive: { details: { display: $.fn.dataTable.Responsive.display.modal({ header: function (a) { a = a.data(); return "Details for " + a[0] + " " + a[1] } }), renderer: $.fn.dataTable.Responsive.renderer.tableAll({ tableClass: "table" }) } } }), new DataTable("#buttons-datatables", { dom: "Bfrtip", buttons: ["copy", "csv", "excel", "print", "pdf"] }), new DataTable("#ajax-datatables", { ajax: "assets/json/datatable.json" }); var a = $("#add-rows").DataTable(), e = 1; $("#addRow").on("click", function () { a.row.add([e + ".1", e + ".2", e + ".3", e + ".4", e + ".5", e + ".6", e + ".7", e + ".8", e + ".9", e + ".10", e + ".11", e + ".12"]).draw(!1), e++ }), $("#addRow").trigger("click") } document.addEventListener("DOMContentLoaded", function () { initializeTables() });

View File

@ -1,4 +1,4 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class="nk-content"> <div class="nk-content">
<div class="container-fluid"> <div class="container-fluid">
@ -13,15 +13,15 @@
@endif @endif
<div class="nk-content-inner"> <div class="nk-content-inner">
<form method="get" action="{{ route('form.store') }}" enctype="multipart/form-data"> <form method="get" action="{{ route('form.store') }}" enctype="multipart/form-data">
{{Label('Operation')}} {{ Label('Operation') }}
{{ customCreateSelect('type', 'type', '', '', ['ajax-curd' => 'Ajax CURD']) }} {{ customCreateSelect('type', 'type', '', '', ['ajax-curd' => 'Ajax CURD']) }}
{{Label('Table Name')}} {{ Label('Table Name') }}
{{ customCreateSelect('tableName', 'tableName', 'form-control custom-select2', '', $allTables) }} {{ customCreateSelect('tableName', 'tableName', 'form-control custom-select2', '', $allTables) }}
{{Label('Write To')}} {{ Label('Write To') }}
{{ createText('directoryName', 'directoryName', 'Directory Name') }} {{ createText('directoryName', 'directoryName', 'Directory Name') }}
<?php createButton('mt-3 btn-primary', '', 'Submit'); ?> <?php createButton('mt-3 btn-primary', '', 'Submit'); ?>

View File

@ -1,11 +1,11 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class="nk-content"> <div class="nk-content">
<div class="container"> <div class="container">
<div class="nk-content-inner"> <div class="nk-content-inner">
<div class="nk-content-body"> <div class="nk-content-body">
<div class="nk-block-head"> <div class="nk-block-head">
<div class="nk-block-head-between flex-wrap gap g-2"> <div class="nk-block-head-between gap g-2 flex-wrap">
<div class="nk-block-head-content"> <div class="nk-block-head-content">
<h2 class="nk-block-title">Tables in Database</h1> <h2 class="nk-block-title">Tables in Database</h1>
</div> </div>
@ -19,25 +19,28 @@
@foreach ($allTables as $Table) @foreach ($allTables as $Table)
<?php $a++; ?> <?php $a++; ?>
<div class="accordion-item"> <div class="accordion-item">
<h2 class="accordion-header"> <button class="accordion-button" type="button" data-bs-toggle="collapse" data-bs-target="#collapse{{$a}}"> {{$a}}: {{$Table->tablename}} </button> </h2> <h2 class="accordion-header"> <button class="accordion-button" type="button"
<div id="collapse{{$a}}" class="accordion-collapse collapse" data-bs-parent="#accordionTables"> data-bs-toggle="collapse" data-bs-target="#collapse{{ $a }}"> {{ $a }}:
{{ $Table->tablename }} </button> </h2>
<div id="collapse{{ $a }}" class="accordion-collapse collapse"
data-bs-parent="#accordionTables">
<div class="accordion-body"> <div class="accordion-body">
<table class="datatable-init table" data-nk-container="table-responsive"> <table class="datatable-init table" data-nk-container="table-responsive">
<thead class="table-dark"> <thead class="table-dark">
<tr> <tr>
<th class="tb-col"><span class="overline-title">S.N.</span></th> <th class="tb-col"><span class="overline-title">S.N.</span></th>
<th class="tb-col"><span class="overline-title">{{__('lang.Column')}}</span></th> <th class="tb-col"><span class="overline-title">{{ __('lang.Column') }}</span></th>
<th class="tb-col"><span class="overline-title">{{label("Datatype")}}</span></th> <th class="tb-col"><span class="overline-title">{{ label('Datatype') }}</span></th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<?php $sn = 0; ?> <?php $sn = 0; ?>
@foreach($Table->tablecolumns as $column) @foreach ($Table->tablecolumns as $column)
<tr> <tr>
<?php $sn++; ?> <?php $sn++; ?>
<td class="tb-col"><span >{{$sn}}</span></td> <td class="tb-col"><span>{{ $sn }}</span></td>
<td class="tb-col"><span > {{$column->COLUMN_NAME}}</span></td> <td class="tb-col"><span> {{ $column->COLUMN_NAME }}</span></td>
<td class="tb-col"><span > {{$column->COLUMN_TYPE}}</span></td> <td class="tb-col"><span> {{ $column->COLUMN_TYPE }}</span></td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
@ -53,13 +56,12 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endsection @endsection
@push('js') @push('js')
<script> <script>
$(document).ready(function() { $(document).ready(function() {
$('.custom-select2').select2(); $('.custom-select2').select2();
}); });
</script> </script>
@endpush @endpush

View File

@ -1,26 +1,48 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Branche') }}</h2> <h2 class="">{{ label('Add Branche') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('branches.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Cancel', route('branches.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<form action="{{$editable?route('branches.update',[$data->branch_id]):route('branches.store')}}" id="updateCustomForm" method="POST" > <form action="{{ $editable ? route('branches.update', [$data->branch_id]) : route('branches.store') }}"
@csrf <input type=hidden name='branch_id' value='{{$editable?$data->branch_id:''}}'/> id="updateCustomForm" method="POST">
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_companies', 'title', 'company_id', $editable?$data->companies_id:'', 'Companies Id','companies_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}} @csrf <input type=hidden name='branch_id' value='{{ $editable ? $data->branch_id : '' }}' />
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} <div class="row">
</div><div class="col-lg-6">{{createText("email","email","Email",'',$editable?$data->email:'')}} <div class="col-lg-6">
</div><div class="col-lg-6">{{createText("telephone","telephone","Telephone",'',$editable?$data->telephone:'')}} {{ createCustomSelect('tbl_companies', 'title', 'company_id', $editable ? $data->companies_id : '', 'Companies Id', 'companies_id', 'form-control select2', 'status<>-1') }}
</div><div class="col-lg-6">{{createText("phone1","phone1","Phone1",'',$editable?$data->phone1:'')}} </div>
</div><div class="col-lg-6">{{createText("phone2","phone2","Phone2",'',$editable?$data->phone2:'')}} <div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
</div><div class="col-lg-6">{{createText("address","address","Address",'',$editable?$data->address:'')}} </div>
</div><div class="col-lg-6">{{createText("company_reg","company_reg","Company Reg",'',$editable?$data->company_reg:'')}} <div class="col-lg-12 pb-2">
</div><div class="col-lg-6">{{createText("company_pan","company_pan","Company Pan",'',$editable?$data->company_pan:'')}} {{ createTextarea('description', 'description ckeditor-classic', 'Description', $editable ? $data->description : '') }}
</div><div class="col-lg-12 pb-2">{{createImageInput("logo","Logo",'',$editable?$data->logo:'')}} </div>
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} <div class="col-lg-6">{{ createText('email', 'email', 'Email', '', $editable ? $data->email : '') }}
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?> </div>
<?php createButton("btn-primary btn-cancel","","Cancel",route('branches.index')); ?> <div class="col-lg-6">{{ createText('telephone', 'telephone', 'Telephone', '', $editable ? $data->telephone : '') }}
</div> </form></div></div> </div>
<div class="col-lg-6">{{ createText('phone1', 'phone1', 'Phone1', '', $editable ? $data->phone1 : '') }}
</div>
<div class="col-lg-6">{{ createText('phone2', 'phone2', 'Phone2', '', $editable ? $data->phone2 : '') }}
</div>
<div class="col-lg-6">{{ createText('address', 'address', 'Address', '', $editable ? $data->address : '') }}
</div>
<div class="col-lg-6">
{{ createText('company_reg', 'company_reg', 'Company Reg', '', $editable ? $data->company_reg : '') }}
</div>
<div class="col-lg-6">
{{ createText('company_pan', 'company_pan', 'Company Pan', '', $editable ? $data->company_pan : '') }}
</div>
<div class="col-lg-12 pb-2">{{ createImageInput('logo', 'Logo', '', $editable ? $data->logo : '') }}
</div>
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
</div>
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('branches.index')); ?>
</div>
</form>
</div>
</div>
@endsection @endsection

View File

@ -1,26 +1,48 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Edit Branches') }}</h2> <h2 class="">{{ label('Edit Branches') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('branches.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Cancel', route('branches.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<form action="{{$editable?route('branches.update',[$data->branch_id]):route('branches.store')}}" id="updateCustomForm" method="POST" > <form action="{{ $editable ? route('branches.update', [$data->branch_id]) : route('branches.store') }}"
@csrf <input type=hidden name='branch_id' value='{{$editable?$data->branch_id:''}}'/> id="updateCustomForm" method="POST">
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_companies', 'title', 'company_id', $editable?$data->companies_id:'', 'Companies Id','companies_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}} @csrf <input type=hidden name='branch_id' value='{{ $editable ? $data->branch_id : '' }}' />
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} <div class="row">
</div><div class="col-lg-6">{{createText("email","email","Email",'',$editable?$data->email:'')}} <div class="col-lg-6">
</div><div class="col-lg-6">{{createText("telephone","telephone","Telephone",'',$editable?$data->telephone:'')}} {{ createCustomSelect('tbl_companies', 'title', 'company_id', $editable ? $data->companies_id : '', 'Companies Id', 'companies_id', 'form-control select2', 'status<>-1') }}
</div><div class="col-lg-6">{{createText("phone1","phone1","Phone1",'',$editable?$data->phone1:'')}} </div>
</div><div class="col-lg-6">{{createText("phone2","phone2","Phone2",'',$editable?$data->phone2:'')}} <div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
</div><div class="col-lg-6">{{createText("address","address","Address",'',$editable?$data->address:'')}} </div>
</div><div class="col-lg-6">{{createText("company_reg","company_reg","Company Reg",'',$editable?$data->company_reg:'')}} <div class="col-lg-12 pb-2">
</div><div class="col-lg-6">{{createText("company_pan","company_pan","Company Pan",'',$editable?$data->company_pan:'')}} {{ createTextarea('description', 'description ckeditor-classic', 'Description', $editable ? $data->description : '') }}
</div><div class="col-lg-12 pb-2">{{createImageInput("logo","Logo",'',$editable?$data->logo:'')}} </div>
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} <div class="col-lg-6">{{ createText('email', 'email', 'Email', '', $editable ? $data->email : '') }}
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?> </div>
<?php createButton("btn-primary btn-cancel","","Cancel",route('branches.index')); ?> <div class="col-lg-6">{{ createText('telephone', 'telephone', 'Telephone', '', $editable ? $data->telephone : '') }}
</div> </form></div></div> </div>
<div class="col-lg-6">{{ createText('phone1', 'phone1', 'Phone1', '', $editable ? $data->phone1 : '') }}
</div>
<div class="col-lg-6">{{ createText('phone2', 'phone2', 'Phone2', '', $editable ? $data->phone2 : '') }}
</div>
<div class="col-lg-6">{{ createText('address', 'address', 'Address', '', $editable ? $data->address : '') }}
</div>
<div class="col-lg-6">
{{ createText('company_reg', 'company_reg', 'Company Reg', '', $editable ? $data->company_reg : '') }}
</div>
<div class="col-lg-6">
{{ createText('company_pan', 'company_pan', 'Company Pan', '', $editable ? $data->company_pan : '') }}
</div>
<div class="col-lg-12 pb-2">{{ createImageInput('logo', 'Logo', '', $editable ? $data->logo : '') }}
</div>
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
</div>
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('branches.index')); ?>
</div>
</form>
</div>
</div>
@endsection @endsection

View File

@ -1,29 +1,28 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class="card"> <div class="card">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Branches List") }}</h2> <h2>{{ label('Branches List') }}</h2>
<a href="{{ route('branches.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a> <a href="{{ route('branches.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table dataTable" id="tbl_branches" data-url="{{ route('branches.sort') }}"> <table class="dataTable table" id="tbl_branches" data-url="{{ route('branches.sort') }}">
<thead class="table-light"> <thead class="table-light">
<tr> <tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th> <th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("companies") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('companies') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("email") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('email') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("telephone") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('telephone') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("phone1") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('phone1') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("phone2") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('phone2') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("address") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('address') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("company_reg") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('company_reg') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("company_pan") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('company_pan') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("logo") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('logo') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("is_main") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('is_main') }}</span></th>
<th class="tb-col" data-sortable="false"><span <th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
class="overline-title">{{ label("Action") }}</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -32,50 +31,60 @@
$i = 1; $i = 1;
@endphp @endphp
@foreach ($data as $item) @foreach ($data as $item)
<tr data-id="{{ $item->branch_id }}" data-display_order="{{ $item->display_order }}"
<tr data-id="{{$item->branch_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>"> class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
<td class="tb-col">{{ $i++ }}</td><td class="tb-col"> <td class="tb-col">{{ $i++ }}</td>
{!! getFieldData("tbl_companies", "title", "company_id", $item->companies_id) !!} <td class="tb-col">
</td><td class="tb-col">{{ $item->title }}</td> {!! getFieldData('tbl_companies', 'title', 'company_id', $item->companies_id) !!}
<td class="tb-col"> </td>
<div class="alias-wrapper" data-id="{{$item->branch_id}}"> <td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">
<div class="alias-wrapper" data-id="{{ $item->branch_id }}">
<span class="alias">{{ $item->alias }}</span> <span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->branch_id}}" /> <input type="text" class="alias-input d-none" value="{{ $item->alias }}"
id="alias_{{ $item->branch_id }}" />
</div> </div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span> <span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td> </td>
<td class="tb-col">{{ $item->email }}</td> <td class="tb-col">{{ $item->email }}</td>
<td class="tb-col">{{ $item->telephone }}</td> <td class="tb-col">{{ $item->telephone }}</td>
<td class="tb-col">{{ $item->phone1 }}</td> <td class="tb-col">{{ $item->phone1 }}</td>
<td class="tb-col">{{ $item->phone2 }}</td> <td class="tb-col">{{ $item->phone2 }}</td>
<td class="tb-col">{{ $item->address }}</td> <td class="tb-col">{{ $item->address }}</td>
<td class="tb-col">{{ $item->company_reg }}</td> <td class="tb-col">{{ $item->company_reg }}</td>
<td class="tb-col">{{ $item->company_pan }}</td> <td class="tb-col">{{ $item->company_pan }}</td>
<td class="tb-col">{{ showImageThumb($item->logo) }}</td> <td class="tb-col">{{ showImageThumb($item->logo) }}</td>
<td class="tb-col">{{ $item->is_main }}</td> <td class="tb-col">{{ $item->is_main }}</td>
<td class="tb-col"> <td class="tb-col">
<div class="dropdown d-inline-block"> <div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <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> <i class="ri-more-fill align-middle"></i>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{route('branches.show',[$item->branch_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> <li><a href="{{ route('branches.show', [$item->branch_id]) }}" class="dropdown-item"><i
<li><a href="{{route('branches.edit',[$item->branch_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li> class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
<li><a href="{{ route('branches.edit', [$item->branch_id]) }}" class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i> {{ label('Edit') }}</a></li>
<li> <li>
<a href="{{route('branches.toggle',[$item->branch_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)"> <a href="{{ route('branches.toggle', [$item->branch_id]) }}" class="dropdown-item toggle-item-btn"
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }} onclick="confirmToggle(this.href)">
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('branches.clone',[$item->branch_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)"> <a href="{{ route('branches.clone', [$item->branch_id]) }}" class="dropdown-item toggle-item-btn"
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }} onclick="confirmClone(this.href)">
<i class="ri-file-copy-line text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('branches.destroy',[$item->branch_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)"> <a href="{{ route('branches.destroy', [$item->branch_id]) }}" class="dropdown-item remove-item-btn"
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }} onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a> </a>
</li> </li>
@ -85,34 +94,32 @@
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
@endsection
@endsection @push('css')
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
@push("css") <link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.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 @endpush
@push("js") @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/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/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://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/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/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.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script> <script>
$(document).ready(function(e) { $(document).ready(function(e) {
$('.change-alias-badge').on('click', function() { $('.change-alias-badge').on('click', function() {
var aliasWrapper = $(this).prev('.alias-wrapper'); var aliasWrapper = $(this).prev('.alias-wrapper');
var aliasSpan = aliasWrapper.find('.alias'); var aliasSpan = aliasWrapper.find('.alias');
@ -191,11 +198,12 @@ $(document).ready(function(e) {
console.error(error); console.error(error);
} }
}); });
isRowReorderComplete=false; isRowReorderComplete = false;
} }
}); });
}); });
function confirmDelete(url) {
function confirmDelete(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -223,8 +231,9 @@ function confirmDelete(url) {
}); });
} }
}); });
} }
function confirmToggle(url) {
function confirmToggle(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -252,8 +261,9 @@ function confirmToggle(url) {
}); });
} }
}); });
} }
function confirmClone(url) {
function confirmClone(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -281,9 +291,6 @@ function confirmClone(url) {
}); });
} }
}); });
} }
</script> </script>
@endpush @endpush

View File

@ -1,29 +1,47 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2> <h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('branches.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Back to List', route('branches.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<p><b>Companies Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->companies_id}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->email}}</span></p><p><b>Telephone :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->telephone}}</span></p><p><b>Phone1 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->phone1}}</span></p><p><b>Phone2 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->phone2}}</span></p><p><b>Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->address}}</span></p><p><b>Company Reg :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->company_reg}}</span></p><p><b>Company Pan :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->company_pan}}</span></p><p><b>Logo :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->logo}}</span></p><p><b>Is Main :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->is_main}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span <p><b>Companies Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->companies_id }}</span></p>
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between"> <p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->description }}</span></p>
<p><b>Email :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->email }}</span></p>
<p><b>Telephone :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->telephone }}</span></p>
<p><b>Phone1 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->phone1 }}</span></p>
<p><b>Phone2 :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->phone2 }}</span></p>
<p><b>Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->address }}</span></p>
<p><b>Company Reg :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->company_reg }}</span></p>
<p><b>Company Pan :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->company_pan }}</span></p>
<p><b>Logo :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->logo }}</span></p>
<p><b>Is Main :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->is_main }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div> <div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p> <p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p> <p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div> </div>
<div> <div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p> <p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p> <p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endSection @endSection

View File

@ -1,17 +1,24 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Caste') }}</h2> <h2 class="">{{ label('Add Caste') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('castes.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Cancel', route('castes.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<form action="{{$editable?route('castes.update',[$data->caste_id]):route('castes.store')}}" id="updateCustomForm" method="POST" > <form action="{{ $editable ? route('castes.update', [$data->caste_id]) : route('castes.store') }}" id="updateCustomForm"
@csrf <input type=hidden name='caste_id' value='{{$editable?$data->caste_id:''}}'/> method="POST">
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}} @csrf <input type=hidden name='caste_id' value='{{ $editable ? $data->caste_id : '' }}' />
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} <div class="row">
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?> <div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
<?php createButton("btn-primary btn-cancel","","Cancel",route('castes.index')); ?> </div>
</div> </form></div></div> <div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
</div>
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('castes.index')); ?>
</div>
</form>
</div>
</div>
@endsection @endsection

View File

@ -1,19 +1,18 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class="card"> <div class="card">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Caste List") }}</h2> <h2>{{ label('Caste List') }}</h2>
<a href="{{ route('castes.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a> <a href="{{ route('castes.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table dataTable" id="tbl_castes" data-url="{{ route('castes.sort') }}"> <table class="dataTable table" id="tbl_castes" data-url="{{ route('castes.sort') }}">
<thead class="table-light"> <thead class="table-light">
<tr> <tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th> <th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
<th class="tb-col" data-sortable="false"><span <th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
class="overline-title">{{ label("Action") }}</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -22,39 +21,48 @@
$i = 1; $i = 1;
@endphp @endphp
@foreach ($data as $item) @foreach ($data as $item)
<tr data-id="{{ $item->caste_id }}" data-display_order="{{ $item->display_order }}"
<tr data-id="{{$item->caste_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>"> class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td> <td class="tb-col">{{ $i++ }}</td>
<td class="tb-col"> <td class="tb-col">{{ $item->title }}</td>
<div class="alias-wrapper" data-id="{{$item->caste_id}}"> <td class="tb-col">
<div class="alias-wrapper" data-id="{{ $item->caste_id }}">
<span class="alias">{{ $item->alias }}</span> <span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->caste_id}}" /> <input type="text" class="alias-input d-none" value="{{ $item->alias }}"
id="alias_{{ $item->caste_id }}" />
</div> </div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span> <span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td> </td>
<td class="tb-col"> <td class="tb-col">
<div class="dropdown d-inline-block"> <div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <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> <i class="ri-more-fill align-middle"></i>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{route('castes.show',[$item->caste_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> <li><a href="{{ route('castes.show', [$item->caste_id]) }}" class="dropdown-item"><i
<li><a href="{{route('castes.edit',[$item->caste_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li> class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
<li><a href="{{ route('castes.edit', [$item->caste_id]) }}" class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i> {{ label('Edit') }}</a></li>
<li> <li>
<a href="{{route('castes.toggle',[$item->caste_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)"> <a href="{{ route('castes.toggle', [$item->caste_id]) }}" class="dropdown-item toggle-item-btn"
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }} onclick="confirmToggle(this.href)">
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('castes.clone',[$item->caste_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)"> <a href="{{ route('castes.clone', [$item->caste_id]) }}" class="dropdown-item toggle-item-btn"
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }} onclick="confirmClone(this.href)">
<i class="ri-file-copy-line text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('castes.destroy',[$item->caste_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)"> <a href="{{ route('castes.destroy', [$item->caste_id]) }}" class="dropdown-item remove-item-btn"
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }} onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a> </a>
</li> </li>
@ -64,34 +72,32 @@
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
@endsection
@endsection @push('css')
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
@push("css") <link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.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 @endpush
@push("js") @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/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/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://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/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/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.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script> <script>
$(document).ready(function(e) { $(document).ready(function(e) {
$('.change-alias-badge').on('click', function() { $('.change-alias-badge').on('click', function() {
var aliasWrapper = $(this).prev('.alias-wrapper'); var aliasWrapper = $(this).prev('.alias-wrapper');
var aliasSpan = aliasWrapper.find('.alias'); var aliasSpan = aliasWrapper.find('.alias');
@ -170,11 +176,12 @@ $(document).ready(function(e) {
console.error(error); console.error(error);
} }
}); });
isRowReorderComplete=false; isRowReorderComplete = false;
} }
}); });
}); });
function confirmDelete(url) {
function confirmDelete(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -202,8 +209,9 @@ function confirmDelete(url) {
}); });
} }
}); });
} }
function confirmToggle(url) {
function confirmToggle(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -231,8 +239,9 @@ function confirmToggle(url) {
}); });
} }
}); });
} }
function confirmClone(url) {
function confirmClone(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -260,9 +269,6 @@ function confirmClone(url) {
}); });
} }
}); });
} }
</script> </script>
@endpush @endpush

View File

@ -1,29 +1,36 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2> <h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('castes.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Back to List', route('castes.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span <p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between"> <p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div> <div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p> <p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p> <p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div> </div>
<div> <div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p> <p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p> <p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endSection @endSection

View File

@ -1,18 +1,30 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Cities') }}</h2> <h2 class="">{{ label('Add Cities') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('cities.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Cancel', route('cities.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<form action="{{$editable?route('cities.update',[$data->city_id]):route('cities.store')}}" id="updateCustomForm" method="POST" > <form action="{{ $editable ? route('cities.update', [$data->city_id]) : route('cities.store') }}" id="updateCustomForm"
@csrf <input type=hidden name='city_id' value='{{$editable?$data->city_id:''}}'/> method="POST">
<div class="row"><div class="col-lg-6">{{createCustomSelect('tbl_districts', 'title', 'district_id', $editable?$data->districts_id:'', 'Districts Id','districts_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}} @csrf <input type=hidden name='city_id' value='{{ $editable ? $data->city_id : '' }}' />
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} <div class="row">
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} <div class="col-lg-6">
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?> {{ createCustomSelect('tbl_districts', 'title', 'district_id', $editable ? $data->districts_id : '', 'Districts Id', 'districts_id', 'form-control select2', 'status<>-1') }}
<?php createButton("btn-primary btn-cancel","","Cancel",route('cities.index')); ?> </div>
</div> </form></div></div> <div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
</div>
<div class="col-lg-12 pb-2">
{{ createTextarea('description', 'description ckeditor-classic', 'Description', $editable ? $data->description : '') }}
</div>
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
</div>
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('cities.index')); ?>
</div>
</form>
</div>
</div>
@endsection @endsection

View File

@ -1,20 +1,19 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class="card"> <div class="card">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Cities List") }}</h2> <h2>{{ label('Cities List') }}</h2>
<a href="{{ route('cities.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a> <a href="{{ route('cities.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table dataTable" id="tbl_cities" data-url="{{ route('cities.sort') }}"> <table class="dataTable table" id="tbl_cities" data-url="{{ route('cities.sort') }}">
<thead class="table-light"> <thead class="table-light">
<tr> <tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th> <th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("districts") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('districts') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
<th class="tb-col" data-sortable="false"><span <th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
class="overline-title">{{ label("Action") }}</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -23,41 +22,51 @@
$i = 1; $i = 1;
@endphp @endphp
@foreach ($data as $item) @foreach ($data as $item)
<tr data-id="{{ $item->city_id }}" data-display_order="{{ $item->display_order }}"
<tr data-id="{{$item->city_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>"> class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
<td class="tb-col">{{ $i++ }}</td><td class="tb-col"> <td class="tb-col">{{ $i++ }}</td>
{!! getFieldData("tbl_districts", "title", "district_id", $item->districts_id) !!} <td class="tb-col">
</td><td class="tb-col">{{ $item->title }}</td> {!! getFieldData('tbl_districts', 'title', 'district_id', $item->districts_id) !!}
<td class="tb-col"> </td>
<div class="alias-wrapper" data-id="{{$item->city_id}}"> <td class="tb-col">{{ $item->title }}</td>
<td class="tb-col">
<div class="alias-wrapper" data-id="{{ $item->city_id }}">
<span class="alias">{{ $item->alias }}</span> <span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->city_id}}" /> <input type="text" class="alias-input d-none" value="{{ $item->alias }}"
id="alias_{{ $item->city_id }}" />
</div> </div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span> <span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td> </td>
<td class="tb-col"> <td class="tb-col">
<div class="dropdown d-inline-block"> <div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <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> <i class="ri-more-fill align-middle"></i>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{route('cities.show',[$item->city_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> <li><a href="{{ route('cities.show', [$item->city_id]) }}" class="dropdown-item"><i
<li><a href="{{route('cities.edit',[$item->city_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li> class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
<li><a href="{{ route('cities.edit', [$item->city_id]) }}" class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i> {{ label('Edit') }}</a></li>
<li> <li>
<a href="{{route('cities.toggle',[$item->city_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)"> <a href="{{ route('cities.toggle', [$item->city_id]) }}" class="dropdown-item toggle-item-btn"
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }} onclick="confirmToggle(this.href)">
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('cities.clone',[$item->city_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)"> <a href="{{ route('cities.clone', [$item->city_id]) }}" class="dropdown-item toggle-item-btn"
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }} onclick="confirmClone(this.href)">
<i class="ri-file-copy-line text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('cities.destroy',[$item->city_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)"> <a href="{{ route('cities.destroy', [$item->city_id]) }}" class="dropdown-item remove-item-btn"
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }} onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a> </a>
</li> </li>
@ -67,34 +76,32 @@
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
@endsection
@endsection @push('css')
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
@push("css") <link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.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 @endpush
@push("js") @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/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/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://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/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/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.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script> <script>
$(document).ready(function(e) { $(document).ready(function(e) {
$('.change-alias-badge').on('click', function() { $('.change-alias-badge').on('click', function() {
var aliasWrapper = $(this).prev('.alias-wrapper'); var aliasWrapper = $(this).prev('.alias-wrapper');
var aliasSpan = aliasWrapper.find('.alias'); var aliasSpan = aliasWrapper.find('.alias');
@ -173,11 +180,12 @@ $(document).ready(function(e) {
console.error(error); console.error(error);
} }
}); });
isRowReorderComplete=false; isRowReorderComplete = false;
} }
}); });
}); });
function confirmDelete(url) {
function confirmDelete(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -205,8 +213,9 @@ function confirmDelete(url) {
}); });
} }
}); });
} }
function confirmToggle(url) {
function confirmToggle(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -234,8 +243,9 @@ function confirmToggle(url) {
}); });
} }
}); });
} }
function confirmClone(url) {
function confirmClone(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -263,9 +273,6 @@ function confirmClone(url) {
}); });
} }
}); });
} }
</script> </script>
@endpush @endpush

View File

@ -1,29 +1,38 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2> <h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('cities.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Back to List', route('cities.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->districts_id}}</span></p><p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span <p><b>Districts Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->districts_id }}</span></p>
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between"> <p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
<p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->description }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div> <div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p> <p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p> <p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div> </div>
<div> <div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p> <p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p> <p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endSection @endSection

View File

@ -1,19 +1,35 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Company') }}</h2> <h2 class="">{{ label('Add Company') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('companies.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Cancel', route('companies.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<form action="{{$editable?route('companies.update',[$data->company_id]):route('companies.store')}}" id="updateCustomForm" method="POST" > <form action="{{ $editable ? route('companies.update', [$data->company_id]) : route('companies.store') }}"
@csrf <input type=hidden name='company_id' value='{{$editable?$data->company_id:''}}'/> id="updateCustomForm" method="POST">
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}} @csrf <input type=hidden name='company_id' value='{{ $editable ? $data->company_id : '' }}' />
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} <div class="row">
</div><div class="col-lg-6">{{createText("address","address","Address",'',$editable?$data->address:'')}} <div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
</div><div class="col-lg-6">{{createCustomSelect('tbl_cities', 'title', 'city_id', $editable?$data->cities_id:'', 'Cities Id','cities_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-6">{{createCustomSelect('tbl_companytypes', 'title', 'companytype_id', $editable?$data->companytypes_id:'', 'Companytypes Id','companytypes_id', 'form-control select2','status<>-1')}}</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} </div>
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?> <div class="col-lg-12 pb-2">
<?php createButton("btn-primary btn-cancel","","Cancel",route('companies.index')); ?> {{ createTextarea('description', 'description ckeditor-classic', 'Description', $editable ? $data->description : '') }}
</div> </form></div></div> </div>
<div class="col-lg-6">{{ createText('address', 'address', 'Address', '', $editable ? $data->address : '') }}
</div>
<div class="col-lg-6">
{{ createCustomSelect('tbl_cities', 'title', 'city_id', $editable ? $data->cities_id : '', 'Cities Id', 'cities_id', 'form-control select2', 'status<>-1') }}
</div>
<div class="col-lg-6">
{{ createCustomSelect('tbl_companytypes', 'title', 'companytype_id', $editable ? $data->companytypes_id : '', 'Companytypes Id', 'companytypes_id', 'form-control select2', 'status<>-1') }}
</div>
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
</div>
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('companies.index')); ?>
</div>
</form>
</div>
</div>
@endsection @endsection

View File

@ -1,22 +1,21 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class="card"> <div class="card">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Companies List") }}</h2> <h2>{{ label('Companies List') }}</h2>
<a href="{{ route('companies.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a> <a href="{{ route('companies.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table dataTable" id="tbl_companies" data-url="{{ route('companies.sort') }}"> <table class="dataTable table" id="tbl_companies" data-url="{{ route('companies.sort') }}">
<thead class="table-light"> <thead class="table-light">
<tr> <tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th> <th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("address") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('address') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("cities") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('cities') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("companytypes") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('companytypes') }}</span></th>
<th class="tb-col" data-sortable="false"><span <th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
class="overline-title">{{ label("Action") }}</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -25,44 +24,56 @@
$i = 1; $i = 1;
@endphp @endphp
@foreach ($data as $item) @foreach ($data as $item)
<tr data-id="{{ $item->company_id }}" data-display_order="{{ $item->display_order }}"
<tr data-id="{{$item->company_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>"> class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td> <td class="tb-col">{{ $i++ }}</td>
<td class="tb-col"> <td class="tb-col">{{ $item->title }}</td>
<div class="alias-wrapper" data-id="{{$item->company_id}}"> <td class="tb-col">
<div class="alias-wrapper" data-id="{{ $item->company_id }}">
<span class="alias">{{ $item->alias }}</span> <span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->company_id}}" /> <input type="text" class="alias-input d-none" value="{{ $item->alias }}"
id="alias_{{ $item->company_id }}" />
</div> </div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span> <span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td> </td>
<td class="tb-col">{{ $item->address }}</td> <td class="tb-col">{{ $item->address }}</td>
<td class="tb-col"> <td class="tb-col">
{!! getFieldData("tbl_cities", "title", "city_id", $item->cities_id) !!} {!! getFieldData('tbl_cities', 'title', 'city_id', $item->cities_id) !!}
</td><td class="tb-col"> </td>
{!! getFieldData("tbl_companytypes", "title", "companytype_id", $item->companytypes_id) !!} <td class="tb-col">
</td><td class="tb-col"> {!! getFieldData('tbl_companytypes', 'title', 'companytype_id', $item->companytypes_id) !!}
</td>
<td class="tb-col">
<div class="dropdown d-inline-block"> <div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <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> <i class="ri-more-fill align-middle"></i>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{route('companies.show',[$item->company_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> <li><a href="{{ route('companies.show', [$item->company_id]) }}" class="dropdown-item"><i
<li><a href="{{route('companies.edit',[$item->company_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li> class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
<li><a href="{{ route('companies.edit', [$item->company_id]) }}"
class="dropdown-item edit-item-btn"><i class="ri-pencil-fill text-muted me-2 align-bottom"></i>
{{ label('Edit') }}</a></li>
<li> <li>
<a href="{{route('companies.toggle',[$item->company_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)"> <a href="{{ route('companies.toggle', [$item->company_id]) }}" class="dropdown-item toggle-item-btn"
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }} onclick="confirmToggle(this.href)">
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('companies.clone',[$item->company_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)"> <a href="{{ route('companies.clone', [$item->company_id]) }}" class="dropdown-item toggle-item-btn"
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }} onclick="confirmClone(this.href)">
<i class="ri-file-copy-line text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('companies.destroy',[$item->company_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)"> <a href="{{ route('companies.destroy', [$item->company_id]) }}"
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }} class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a> </a>
</li> </li>
@ -72,34 +83,32 @@
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
@endsection
@endsection @push('css')
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
@push("css") <link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.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 @endpush
@push("js") @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/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/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://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/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/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.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script> <script>
$(document).ready(function(e) { $(document).ready(function(e) {
$('.change-alias-badge').on('click', function() { $('.change-alias-badge').on('click', function() {
var aliasWrapper = $(this).prev('.alias-wrapper'); var aliasWrapper = $(this).prev('.alias-wrapper');
var aliasSpan = aliasWrapper.find('.alias'); var aliasSpan = aliasWrapper.find('.alias');
@ -178,11 +187,12 @@ $(document).ready(function(e) {
console.error(error); console.error(error);
} }
}); });
isRowReorderComplete=false; isRowReorderComplete = false;
} }
}); });
}); });
function confirmDelete(url) {
function confirmDelete(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -210,8 +220,9 @@ function confirmDelete(url) {
}); });
} }
}); });
} }
function confirmToggle(url) {
function confirmToggle(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -239,8 +250,9 @@ function confirmToggle(url) {
}); });
} }
}); });
} }
function confirmClone(url) {
function confirmClone(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -268,9 +280,6 @@ function confirmClone(url) {
}); });
} }
}); });
} }
</script> </script>
@endpush @endpush

View File

@ -1,29 +1,40 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2> <h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('companies.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Back to List', route('companies.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->address}}</span></p><p><b>Cities Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->cities_id}}</span></p><p><b>Companytypes Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->companytypes_id}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span <p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between"> <p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->description }}</span></p>
<p><b>Address :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->address }}</span></p>
<p><b>Cities Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->cities_id }}</span></p>
<p><b>Companytypes Id :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->companytypes_id }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div> <div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p> <p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p> <p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div> </div>
<div> <div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p> <p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p> <p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endSection @endSection

View File

@ -1,18 +1,27 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Company Type') }}</h2> <h2 class="">{{ label('Add Company Type') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('companytypes.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Cancel', route('companytypes.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<form action="{{$editable?route('companytypes.update',[$data->companytype_id]):route('companytypes.store')}}" id="updateCustomForm" method="POST" > <form action="{{ $editable ? route('companytypes.update', [$data->companytype_id]) : route('companytypes.store') }}"
@csrf <input type=hidden name='companytype_id' value='{{$editable?$data->companytype_id:''}}'/> id="updateCustomForm" method="POST">
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}} @csrf <input type=hidden name='companytype_id' value='{{ $editable ? $data->companytype_id : '' }}' />
</div><div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description",$editable?$data->description:'')}} <div class="row">
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} <div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?> </div>
<?php createButton("btn-primary btn-cancel","","Cancel",route('companytypes.index')); ?> <div class="col-lg-12 pb-2">
</div> </form></div></div> {{ createTextarea('description', 'description ckeditor-classic', 'Description', $editable ? $data->description : '') }}
</div>
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
</div>
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('companytypes.index')); ?>
</div>
</form>
</div>
</div>
@endsection @endsection

View File

@ -1,19 +1,18 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class="card"> <div class="card">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
<h2>{{ label("Company Type List") }}</h2> <h2>{{ label('Company Type List') }}</h2>
<a href="{{ route('companytypes.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a> <a href="{{ route('companytypes.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table dataTable" id="tbl_companytypes" data-url="{{ route('companytypes.sort') }}"> <table class="dataTable table" id="tbl_companytypes" data-url="{{ route('companytypes.sort') }}">
<thead class="table-light"> <thead class="table-light">
<tr> <tr>
<th class="tb-col"><span class="overline-title">{{label("Sn.")}}</span></th> <th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("title") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th> <th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
<th class="tb-col" data-sortable="false"><span <th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
class="overline-title">{{ label("Action") }}</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -22,39 +21,49 @@
$i = 1; $i = 1;
@endphp @endphp
@foreach ($data as $item) @foreach ($data as $item)
<tr data-id="{{ $item->companytype_id }}" data-display_order="{{ $item->display_order }}"
<tr data-id="{{$item->companytype_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status==0)?"bg-light bg-danger":""; ?>"> class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td> <td class="tb-col">{{ $i++ }}</td>
<td class="tb-col"> <td class="tb-col">{{ $item->title }}</td>
<div class="alias-wrapper" data-id="{{$item->companytype_id}}"> <td class="tb-col">
<div class="alias-wrapper" data-id="{{ $item->companytype_id }}">
<span class="alias">{{ $item->alias }}</span> <span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->companytype_id}}" /> <input type="text" class="alias-input d-none" value="{{ $item->alias }}"
id="alias_{{ $item->companytype_id }}" />
</div> </div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span> <span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td> </td>
<td class="tb-col"> <td class="tb-col">
<div class="dropdown d-inline-block"> <div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <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> <i class="ri-more-fill align-middle"></i>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{route('companytypes.show',[$item->companytype_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> <li><a href="{{ route('companytypes.show', [$item->companytype_id]) }}" class="dropdown-item"><i
<li><a href="{{route('companytypes.edit',[$item->companytype_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li> class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
<li><a href="{{ route('companytypes.edit', [$item->companytype_id]) }}"
class="dropdown-item edit-item-btn"><i class="ri-pencil-fill text-muted me-2 align-bottom"></i>
{{ label('Edit') }}</a></li>
<li> <li>
<a href="{{route('companytypes.toggle',[$item->companytype_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)"> <a href="{{ route('companytypes.toggle', [$item->companytype_id]) }}"
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }} class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('companytypes.clone',[$item->companytype_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)"> <a href="{{ route('companytypes.clone', [$item->companytype_id]) }}"
<i class="ri-file-copy-line align-bottom me-2 text-muted"></i> {{ label('Clone') }} class="dropdown-item toggle-item-btn" onclick="confirmClone(this.href)">
<i class="ri-file-copy-line text-muted me-2 align-bottom"></i> {{ label('Clone') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('companytypes.destroy',[$item->companytype_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)"> <a href="{{ route('companytypes.destroy', [$item->companytype_id]) }}"
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }} class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a> </a>
</li> </li>
@ -64,34 +73,32 @@
</td> </td>
</tr> </tr>
@endforeach @endforeach
</tbody> </tbody>
</table> </table>
</div> </div>
</div> </div>
@endsection
@endsection @push('css')
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
@push("css") <link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.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 @endpush
@push("js") @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/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/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://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/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/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.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script> <script>
$(document).ready(function(e) { $(document).ready(function(e) {
$('.change-alias-badge').on('click', function() { $('.change-alias-badge').on('click', function() {
var aliasWrapper = $(this).prev('.alias-wrapper'); var aliasWrapper = $(this).prev('.alias-wrapper');
var aliasSpan = aliasWrapper.find('.alias'); var aliasSpan = aliasWrapper.find('.alias');
@ -170,11 +177,12 @@ $(document).ready(function(e) {
console.error(error); console.error(error);
} }
}); });
isRowReorderComplete=false; isRowReorderComplete = false;
} }
}); });
}); });
function confirmDelete(url) {
function confirmDelete(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -202,8 +210,9 @@ function confirmDelete(url) {
}); });
} }
}); });
} }
function confirmToggle(url) {
function confirmToggle(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -231,8 +240,9 @@ function confirmToggle(url) {
}); });
} }
}); });
} }
function confirmClone(url) {
function confirmClone(url) {
event.preventDefault(); event.preventDefault();
Swal.fire({ Swal.fire({
title: 'Are you sure?', title: 'Are you sure?',
@ -260,9 +270,6 @@ function confirmClone(url) {
}); });
} }
}); });
} }
</script> </script>
@endpush @endpush

View File

@ -1,29 +1,37 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2> <h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('companytypes.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Back to List', route('companytypes.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span <p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between"> <p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->description }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div> <div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p> <p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p> <p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div> </div>
<div> <div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p> <p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p> <p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endSection @endSection

View File

@ -1,8 +1,8 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<!-- start page title --> <!-- start page title -->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between"> <div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">Add Country</h4> <h4 class="mb-sm-0">Add Country</h4>
<div class="page-title-right"> <div class="page-title-right">
@ -12,23 +12,24 @@
</ol> </ol>
</div> </div>
</div> </div>
</div>
</div>
<!-- end page title -->
<form action="{{route('countries.store')}}" id="storeCustomForm" method="POST">
@csrf
<div class='card'>
<div class='card-body'>
<div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div>
<div class="col-lg-12 pb-2">{{createTextarea("description","description ckeditor-classic","Description")}}</div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div>
</div> </div>
</div> </div>
</div> <!-- end page title -->
<div class="col-md-12"> <form action="{{ route('countries.store') }}" id="storeCustomForm" method="POST">
<?php createButton("btn-primary btn-store","","Submit"); ?> @csrf
<?php createButton("btn-danger btn-cancel","","Cancel",route('countries.index')); ?> <div class='card'>
</div> <div class='card-body'>
</form> <div class="row">
<div class="col-lg-12">{{ createText('title', 'title', 'Title') }}</div>
<div class="col-lg-12 pb-2">{{ createTextarea('description', 'description ckeditor-classic', 'Description') }}
</div>
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks ', 'Remarks') }}</div>
</div>
</div>
</div>
<div class="col-md-12">
<?php createButton('btn-primary btn-store', '', 'Submit'); ?>
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
</div>
</form>
@endsection @endsection

View File

@ -1,8 +1,8 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<!-- start page title --> <!-- start page title -->
<div class="row"> <div class="row">
<div class="col-12"> <div class="col-12">
<div class="page-title-box d-sm-flex align-items-center justify-content-between"> <div class="page-title-box d-sm-flex align-items-center justify-content-between">
<h4 class="mb-sm-0">Edit Country </h4> <h4 class="mb-sm-0">Edit Country </h4>
<div class="page-title-right"> <div class="page-title-right">
@ -12,28 +12,29 @@
</ol> </ol>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<!-- end page title --> <!-- end page title -->
<form action="{{route('countries.update',[$data->country_id])}}" id="updateCustomForm" method="POST" > <form action="{{ route('countries.update', [$data->country_id]) }}" id="updateCustomForm" method="POST">
@csrf <input type=hidden name='country_id' value='{{$data->country_id}}'/> @csrf <input type=hidden name='country_id' value='{{ $data->country_id }}' />
<div class='card'> <div class='card'>
<div class='card-body'> <div class='card-body'>
<div class="row"> <div class="row">
<div class="col-lg-12">{{createText("title","title","Title",'',$data->title)}}</div> <div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $data->title) }}</div>
<div class="col-lg-12 pb-4">{{createTextarea("description","description ckeditor-classic","Description",$data->description)}}</div> <div class="col-lg-12 pb-4">
{{ createTextarea('description', 'description ckeditor-classic', 'Description', $data->description) }}</div>
<div class="border border-dashed"></div> <div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}</div> <div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $data->remarks) }}</div>
</div> </div>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<div class="col-md-12"><?php createButton("btn-primary btn-update","","Update"); ?> <div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Update'); ?>
<?php createButton("btn-danger btn-cancel","","Cancel",route('countries.index')); ?> <?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
</div> </div>
</div> </div>
</div> </div>
</form> </form>
@endsection @endsection

View File

@ -1,8 +1,8 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class="row"> <div class="row">
<div class="col-lg-4"> <div class="col-lg-4">
<form action="{{route('countries.store')}}" id="storeCustomForm" method="POST"> <form action="{{ route('countries.store') }}" id="storeCustomForm" method="POST">
@csrf @csrf
<div class='card'> <div class='card'>
<div class="card-header"> <div class="card-header">
@ -10,18 +10,18 @@
</div> </div>
<div class='card-body'> <div class='card-body'>
<div class="row"> <div class="row">
<div class="col-lg-12">{{createText("title","title","Title")}}</div> <div class="col-lg-12">{{ createText('title', 'title', 'Title') }}</div>
<div class="border border-dashed"></div> <div class="border border-dashed"></div>
<div class="col-lg-12 pb-3">{{createTextarea("description","description ","Description")}}</div> <div class="col-lg-12 pb-3">{{ createTextarea('description', 'description ', 'Description') }}</div>
<div class="border border-dashed"></div> <div class="border border-dashed"></div>
<div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}</div> <div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks ', 'Remarks') }}</div>
</div> </div>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<div class="col-md-12"> <div class="col-md-12">
<?php createButton("btn-primary btn-store", "", "Submit");?> <?php createButton('btn-primary btn-store', '', 'Submit'); ?>
<?php createButton("btn-danger btn-cancel", "", "Cancel", route('countries.index'));?> <?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
</div> </div>
</div> </div>
</div> </div>
@ -30,17 +30,17 @@
<div class="col-lg-8"> <div class="col-lg-8">
<div class="card"> <div class="card">
<div class="card-header d-flex justify-content-between align-items-center"> <div class="card-header d-flex justify-content-between align-items-center">
<h2 class="card-title mb-0">{{ label("Countries List") }}</h2> <h2 class="card-title mb-0">{{ label('Countries List') }}</h2>
</div> </div>
<div class="card-body"> <div class="card-body">
<table class="table dataTable" id="tbl_countries" data-url="{{ route('countries.sort') }}"> <table class="dataTable table" id="tbl_countries" data-url="{{ route('countries.sort') }}">
<thead class="table-light"> <thead class="table-light">
<tr> <tr>
<th class="tb-col text-uppercase"><span class="overline-title">{{label("Sn.")}}</span></th> <th class="tb-col text-uppercase"><span class="overline-title">{{ label('Sn.') }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("title") }}</span></th> <th class="tb-col text-uppercase"><span class="overline-title">{{ label('title') }}</span></th>
<th class="tb-col text-uppercase"><span class="overline-title">{{ label("alias") }}</span></th> <th class="tb-col text-uppercase"><span class="overline-title">{{ label('alias') }}</span></th>
<th class="tb-col text-uppercase" data-sortable="false"><span <th class="tb-col text-uppercase" data-sortable="false"><span
class="overline-title">{{ label("Action") }}</span> class="overline-title">{{ label('Action') }}</span>
</th> </th>
</tr> </tr>
</thead> </thead>
@ -49,31 +49,41 @@
$i = 1; $i = 1;
@endphp @endphp
@foreach ($data as $item) @foreach ($data as $item)
<tr data-id="{{$item->country_id}}" data-display_order="{{$item->display_order}}" class="draggable-row <?php echo ($item->status == 0) ? "bg-light bg-danger" : ""; ?>"> <tr data-id="{{ $item->country_id }}" data-display_order="{{ $item->display_order }}"
<td class="tb-col">{{ $i++ }}</td><td class="tb-col">{{ $item->title }}</td> class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
<td class="tb-col">{{ $i++ }}</td>
<td class="tb-col">{{ $item->title }}</td>
<td class="tb-col"> <td class="tb-col">
<div class="alias-wrapper" data-id="{{$item->country_id}}"> <div class="alias-wrapper" data-id="{{ $item->country_id }}">
<span class="alias">{{ $item->alias }}</span> <span class="alias">{{ $item->alias }}</span>
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->country_id}}" /> <input type="text" class="alias-input d-none" value="{{ $item->alias }}"
id="alias_{{ $item->country_id }}" />
</div> </div>
<span class="badge badge-soft-primary change-alias-badge">change alias</span> <span class="badge badge-soft-primary change-alias-badge">change alias</span>
</td> </td>
<td class="tb-col"> <td class="tb-col">
<div class="dropdown d-inline-block"> <div class="dropdown d-inline-block">
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown" aria-expanded="false"> <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> <i class="ri-more-fill align-middle"></i>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end">
<li><a href="{{route('countries.show',[$item->country_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li> <li><a href="{{ route('countries.show', [$item->country_id]) }}" class="dropdown-item"><i
<li><a href="{{route('countries.edit',[$item->country_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li> class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
<li><a href="{{ route('countries.edit', [$item->country_id]) }}"
class="dropdown-item edit-item-btn"><i
class="ri-pencil-fill text-muted me-2 align-bottom"></i> {{ label('Edit') }}</a></li>
<li> <li>
<a href="{{route('countries.toggle',[$item->country_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)"> <a href="{{ route('countries.toggle', [$item->country_id]) }}"
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }} class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
<i class="ri-article-fill text-muted me-2 align-bottom"></i>
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
</a> </a>
</li> </li>
<li> <li>
<a href="{{route('countries.destroy',[$item->country_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)"> <a href="{{ route('countries.destroy', [$item->country_id]) }}"
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }} class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> {{ label('Delete') }}
</a> </a>
</li> </li>
</ul> </ul>
@ -88,154 +98,156 @@
</div> </div>
</div> </div>
@endsection @endsection
@push("css") @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/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"> <link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
@endpush @endpush
@push("js") @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/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/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://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/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/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.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script> <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script> <script>
$(document).ready(function(e) { $(document).ready(function(e) {
$('.change-alias-badge').on('click', function() { $('.change-alias-badge').on('click', function() {
var aliasWrapper = $(this).prev('.alias-wrapper'); var aliasWrapper = $(this).prev('.alias-wrapper');
var aliasSpan = aliasWrapper.find('.alias'); var aliasSpan = aliasWrapper.find('.alias');
var aliasInput = aliasWrapper.find('.alias-input'); var aliasInput = aliasWrapper.find('.alias-input');
var isEditing = $(this).hasClass('editing'); var isEditing = $(this).hasClass('editing');
aliasInput.toggleClass("d-none"); aliasInput.toggleClass("d-none");
if (isEditing) { if (isEditing) {
// Update alias text and switch to non-editing state // Update alias text and switch to non-editing state
var newAlias = aliasInput.val(); var newAlias = aliasInput.val();
aliasSpan.text(newAlias); aliasSpan.text(newAlias);
aliasSpan.show(); aliasSpan.show();
aliasInput.hide(); aliasInput.hide();
$(this).removeClass('editing').text('Change Alias'); $(this).removeClass('editing').text('Change Alias');
var articleId = $(aliasWrapper).data('id'); var articleId = $(aliasWrapper).data('id');
var ajaxUrl = "{{ route('countries.updatealias') }}"; var ajaxUrl = "{{ route('countries.updatealias') }}";
var data = { var data = {
articleId: articleId, articleId: articleId,
newAlias: newAlias newAlias: newAlias
}; };
$.ajax({ $.ajax({
url: ajaxUrl, url: ajaxUrl,
type: 'POST', type: 'POST',
headers: { headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}, },
data: data, data: data,
success: function(response) { success: function(response) {
console.log(response); console.log(response);
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
console.error(error); console.error(error);
} }
}); });
} else { } else {
// Switch to editing state // Switch to editing state
aliasSpan.hide(); aliasSpan.hide();
aliasInput.show().focus(); aliasInput.show().focus();
$(this).addClass('editing').text('Save Alias'); $(this).addClass('editing').text('Save Alias');
} }
}); });
var mytable = $(".dataTable").DataTable({ var mytable = $(".dataTable").DataTable({
ordering: true, ordering: true,
rowReorder: { rowReorder: {
//selector: 'tr' //selector: 'tr'
}, },
}); });
var isRowReorderComplete = false; var isRowReorderComplete = false;
mytable.on('row-reorder', function(e, diff, edit) { mytable.on('row-reorder', function(e, diff, edit) {
isRowReorderComplete = true; isRowReorderComplete = true;
}); });
mytable.on('draw', function() { mytable.on('draw', function() {
if (isRowReorderComplete) { if (isRowReorderComplete) {
var url = mytable.table().node().getAttribute('data-url'); var url = mytable.table().node().getAttribute('data-url');
var ids = mytable.rows().nodes().map(function(node) { var ids = mytable.rows().nodes().map(function(node) {
return $(node).data('id'); return $(node).data('id');
}).toArray(); }).toArray();
console.log(ids); console.log(ids);
$.ajax({ $.ajax({
url: url, url: url,
type: "POST", type: "POST",
headers: { headers: {
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content') "X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
}, },
data: { data: {
id_order: ids id_order: ids
}, },
success: function(response) { success: function(response) {
console.log(response); console.log(response);
}, },
error: function(xhr, status, error) { error: function(xhr, status, error) {
console.error(error); console.error(error);
} }
}); });
isRowReorderComplete=false; isRowReorderComplete = false;
} }
}); });
}); });
function confirmDelete(url) {
event.preventDefault(); function confirmDelete(url) {
Swal.fire({ event.preventDefault();
title: 'Are you sure?', Swal.fire({
text: 'You will not be able to recover this item!', title: 'Are you sure?',
icon: 'warning', text: 'You will not be able to recover this item!',
showCancelButton: true, icon: 'warning',
confirmButtonText: 'Delete', showCancelButton: true,
cancelButtonText: 'Cancel', confirmButtonText: 'Delete',
reverseButtons: true cancelButtonText: 'Cancel',
}).then((result) => { reverseButtons: true
if (result.isConfirmed) { }).then((result) => {
$.ajax({ if (result.isConfirmed) {
url: url, $.ajax({
type: 'DELETE', url: url,
headers: { type: 'DELETE',
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') headers: {
}, 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
success: function(response) { },
Swal.fire('Deleted!', 'The item has been deleted.', 'success'); success: function(response) {
location.reload(); 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'); error: function(xhr, status, error) {
} Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
}); }
} });
}); }
} });
function confirmToggle(url) { }
event.preventDefault();
Swal.fire({ function confirmToggle(url) {
title: 'Are you sure?', event.preventDefault();
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!', Swal.fire({
icon: 'warning', title: 'Are you sure?',
showCancelButton: true, text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
confirmButtonText: 'Proceed', icon: 'warning',
cancelButtonText: 'Cancel', showCancelButton: true,
reverseButtons: true confirmButtonText: 'Proceed',
}).then((result) => { cancelButtonText: 'Cancel',
if (result.isConfirmed) { reverseButtons: true
$.ajax({ }).then((result) => {
url: url, if (result.isConfirmed) {
type: 'GET', $.ajax({
headers: { url: url,
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') type: 'GET',
}, headers: {
success: function(response) { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success'); },
location.reload(); success: function(response) {
}, Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
error: function(xhr, status, error) { location.reload();
Swal.fire('Error!', 'An error occurred.', 'error'); },
} error: function(xhr, status, error) {
}); Swal.fire('Error!', 'An error occurred.', 'error');
} }
}); });
} }
</script> });
}
</script>
@endpush @endpush

View File

@ -1,29 +1,37 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2><?php echo label('View Details'); ?></h2> <h2><?php echo label('View Details'); ?></h2>
<?php createButton("btn-primary btn-cancel","","Back to List",route('countries.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Back to List', route('countries.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->title}}</span></p><p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->alias}}</span></p><p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->description}}</span></p><p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->display_order}}</span></p><p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span <p><b>Title :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->title }}</span></p>
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->remarks}}</span></p><p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->createdby}}</span></p><p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{$data->updatedby}}</span></p><div class="d-flex justify-content-between"> <p><b>Alias :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->alias }}</span></p>
<p><b>Description :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->description }}</span></p>
<p><b>Display Order :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->display_order }}</span></p>
<p><b>Status :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
</p>
<p><b>Remarks :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->remarks }}</span></p>
<p><b>Createdby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->createdby }}</span></p>
<p><b>Updatedby :&nbsp;&nbsp;&nbsp;&nbsp;</b> <span>{{ $data->updatedby }}</span></p>
<div class="d-flex justify-content-between">
<div> <div>
<p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->created_at}}</span></p> <p><b>Created On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->created_at }}</span></p>
<p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->createdBy}}</span></p> <p><b>Created By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->createdBy }}</span></p>
</div> </div>
<div> <div>
<p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updated_at}}</span></p> <p><b>Updated On :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updated_at }}</span></p>
<p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{$data->updatedBy}}</span></p> <p><b>Updated By :</b>&nbsp;&nbsp;&nbsp;<span>{{ $data->updatedBy }}</span></p>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
@endSection @endSection

View File

@ -1,17 +1,24 @@
@extends('backend.template') @extends('layouts.app')
@section('content') @section('content')
<div class='card'> <div class='card'>
<div class='card-header d-flex justify-content-between align-items-center'> <div class='card-header d-flex justify-content-between align-items-center'>
<h2 class="">{{ label('Add Dags') }}</h2> <h2 class="">{{ label('Add Dags') }}</h2>
<?php createButton("btn-primary btn-cancel","","Cancel",route('dags.index')); ?> <?php createButton('btn-primary btn-cancel', '', 'Cancel', route('dags.index')); ?>
</div> </div>
<div class='card-body'> <div class='card-body'>
<form action="{{$editable?route('dags.update',[$data->dag_id]):route('dags.store')}}" id="updateCustomForm" method="POST" > <form action="{{ $editable ? route('dags.update', [$data->dag_id]) : route('dags.store') }}" id="updateCustomForm"
@csrf <input type=hidden name='dag_id' value='{{$editable?$data->dag_id:''}}'/> method="POST">
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$editable?$data->title:'')}} @csrf <input type=hidden name='dag_id' value='{{ $editable ? $data->dag_id : '' }}' />
</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$editable?$data->remarks:'')}} <div class="row">
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?> <div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
<?php createButton("btn-primary btn-cancel","","Cancel",route('dags.index')); ?> </div>
</div> </form></div></div> <div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
</div>
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('dags.index')); ?>
</div>
</form>
</div>
</div>
@endsection @endsection

Some files were not shown because too many files have changed in this diff Show More