Compare commits
32 Commits
omis_leave
...
efe174e3b3
Author | SHA1 | Date | |
---|---|---|---|
efe174e3b3 | |||
c7c79e69a5 | |||
d80b1aa0e9 | |||
c378522598 | |||
7e345ef4e3 | |||
8d4ae8c598 | |||
91e7943546 | |||
1dbc6cabf8 | |||
e0fe321cb7 | |||
3267e212f7 | |||
b5c603ceec | |||
c1a81191fa | |||
d92366b1f4 | |||
c019fcb02d | |||
4eace5b650 | |||
09222c8a3a | |||
6b6696ded4 | |||
4f34db3381 | |||
cfd2147536 | |||
da9f493572 | |||
8a9cb39352 | |||
dbe6632313 | |||
58d8ee8080 | |||
c792d0a7e0 | |||
7d7f7223f6 | |||
73b666affc | |||
f4718d7d55 | |||
3324d7e3ae | |||
6717db6f4a | |||
f7b7d80b87 | |||
2dc9e4afe7 | |||
89d7a82f03 |
18
.htaccess
Normal file
18
.htaccess
Normal 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>
|
0
Modules/Admin/app/Http/Controllers/.gitkeep
Normal file
0
Modules/Admin/app/Http/Controllers/.gitkeep
Normal file
67
Modules/Admin/app/Http/Controllers/AdminController.php
Normal file
67
Modules/Admin/app/Http/Controllers/AdminController.php
Normal file
@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
|
||||
class AdminController extends Controller
|
||||
{
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
return view('admin::index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
return view('admin::create');
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('admin::show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
return view('admin::edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Admin\Repositories\AppreciationRepository;
|
||||
|
||||
class AppreciationController extends Controller
|
||||
{
|
||||
private $appreciationRepository;
|
||||
|
||||
public function __construct(AppreciationRepository $appreciationRepository)
|
||||
{
|
||||
$this->appreciationRepository = $appreciationRepository;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = "Appreciation Lists";
|
||||
$data['appreciationLists'] = $this->appreciationRepository->findAll();
|
||||
return view('admin::appreciations.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = "Create Appreciation";
|
||||
$data['editable'] = false;
|
||||
return view('admin::appreciations.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->appreciationRepository->create($request->all());
|
||||
toastr()->success('Appreciation Created Successfully.');
|
||||
return redirect()->route('appreciation.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('admin::appreciations.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = "Edit Appreciation";
|
||||
$data['editable'] = true;
|
||||
$data['appreciation'] = $this->appreciationRepository->getAppreciationById($id);
|
||||
return view('admin::appreciations.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$this->appreciationRepository->update($id, $request->all());
|
||||
toastr()->success('Appreciation Updated Successfully.');
|
||||
return redirect()->route('appreciation.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
218
Modules/Admin/app/Http/Controllers/CastesController.php
Normal file
218
Modules/Admin/app/Http/Controllers/CastesController.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
use Modules\Admin\Models\Castes;
|
||||
|
||||
class CastesController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Castes $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'index', ' Castes index');
|
||||
$data = Castes::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::castes.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'create', ' Castes create');
|
||||
$TableData = Castes::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$editable = false;
|
||||
return view("admin::castes.edit", compact('TableData', 'editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'store', ' Castes store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_castes')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CastesController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Castes Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('castes.index')->with('success', 'The Castes created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Castes::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Castes::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'show', ' Castes show');
|
||||
$data = Castes::findOrFail($id);
|
||||
|
||||
return view("admin::castes.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'edit', ' Castes edit');
|
||||
$TableData = Castes::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Castes::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::castes.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'update', ' Castes update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('caste_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CastesController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Castes updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('castes.index')->with('success','The Castes updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Castes updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'destroy', ' Castes destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CastesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Castes Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'destroy', ' Castes destroy');
|
||||
$data = Castes::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CastesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Castes Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CastesController::class, 'clone', ' Castes clone');
|
||||
$data = Castes::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CastesController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Castes Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
219
Modules/Admin/app/Http/Controllers/CitiesController.php
Normal file
219
Modules/Admin/app/Http/Controllers/CitiesController.php
Normal file
@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
use Modules\Admin\Models\Cities;
|
||||
|
||||
class CitiesController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Cities $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'index', ' Cities index');
|
||||
$data = Cities::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::cities.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'create', ' Cities create');
|
||||
$TableData = Cities::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$editable = false;
|
||||
return view("admin::cities.edit", compact('TableData', 'editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'store', ' Cities store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_cities')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CitiesController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Cities Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('cities.index')->with('success', 'The Cities created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Cities::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Cities::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'show', ' Cities show');
|
||||
$data = Cities::findOrFail($id);
|
||||
|
||||
return view("admin::cities.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'edit', ' Cities edit');
|
||||
$TableData = Cities::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Cities::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::cities.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'update', ' Cities update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('city_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CitiesController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Cities updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('cities.index')->with('success','The Cities updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Cities updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'destroy', ' Cities destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CitiesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Cities Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'destroy', ' Cities destroy');
|
||||
$data = Cities::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CitiesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Cities Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CitiesController::class, 'clone', ' Cities clone');
|
||||
$data = Cities::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CitiesController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Cities Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
211
Modules/Admin/app/Http/Controllers/CountriesController.php
Normal file
211
Modules/Admin/app/Http/Controllers/CountriesController.php
Normal file
@ -0,0 +1,211 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Service\CommonModelService;
|
||||
use Exception;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Log;
|
||||
use Modules\Admin\Models\Country;
|
||||
|
||||
class CountriesController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Country $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'index', ' Country index');
|
||||
$data = Country::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::countries.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'create', ' Country create');
|
||||
$editable = false;
|
||||
return view("admin::countries.edit", compact('editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'store', ' Country store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_countries')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CountriesController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Country Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('countries.index')->with('success', 'The Country created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Country::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Country::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'show', ' Country show');
|
||||
$data = Country::findOrFail($id);
|
||||
|
||||
return view("admin::countries.show", compact('data'));
|
||||
}
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'edit', ' Country edit');
|
||||
$TableData = Country::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Country::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::countries.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'update', ' Country update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('country_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CountriesController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Country updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('countries.index')->with('success','The Country updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Country updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'destroy', ' Country destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CountriesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Country Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'destroy', ' Country destroy');
|
||||
$data = Country::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CountriesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Country Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(CountriesController::class, 'clone', ' Country clone');
|
||||
$data = Country::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(CountriesController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Country Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
}
|
218
Modules/Admin/app/Http/Controllers/DepartmentsController.php
Normal file
218
Modules/Admin/app/Http/Controllers/DepartmentsController.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
use Modules\Admin\Models\Departments;
|
||||
|
||||
class DepartmentsController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Departments $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
|
||||
$data = Departments::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::departments.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
|
||||
$TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$editable = false;
|
||||
return view("admin::departments.edit", compact('TableData', 'editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_departments')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DepartmentsController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Departments Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('department.index')->with('success', 'The Departments created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Departments::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Departments::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
|
||||
$data = Departments::findOrFail($id);
|
||||
|
||||
return view("admin::departments.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
|
||||
$TableData = Departments::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Departments::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::departments.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('department_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DepartmentsController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Departments updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('departments.index')->with('success','The Departments updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Departments updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DepartmentsController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Departments Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
|
||||
$data = Departments::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DepartmentsController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Departments Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
|
||||
$data = Departments::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DepartmentsController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Departments Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
209
Modules/Admin/app/Http/Controllers/DesignationsController.php
Normal file
209
Modules/Admin/app/Http/Controllers/DesignationsController.php
Normal file
@ -0,0 +1,209 @@
|
||||
<?php
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
use Modules\Admin\Models\Designations;
|
||||
|
||||
class DesignationsController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Designations $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
$data = Designations::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::designations.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
$TableData = Designations::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$editable = false;
|
||||
return view("admin::designations.edit", compact('TableData', 'editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_designations')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DesignationsController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Designations Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('designation.index')->with('success', 'The Designations created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Designations::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Designations::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
$data = Designations::findOrFail($id);
|
||||
|
||||
return view("admin::designations.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
$TableData = Designations::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Designations::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::designations.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('designation_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DesignationsController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Designations updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('designations.index')->with('success','The Designations updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Designations updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DesignationsController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Designations Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
$data = Designations::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DesignationsController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Designations Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
$data = Designations::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DesignationsController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Designations Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
218
Modules/Admin/app/Http/Controllers/DistrictsController.php
Normal file
218
Modules/Admin/app/Http/Controllers/DistrictsController.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
use Modules\Admin\Models\Districts;
|
||||
|
||||
class DistrictsController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Districts $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'index', ' Districts index');
|
||||
$data = Districts::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::districts.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'create', ' Districts create');
|
||||
$TableData = Districts::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$editable = false;
|
||||
return view("admin::districts.edit", compact('TableData', 'editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'store', ' Districts store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_districts')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DistrictsController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Districts Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('districts.index')->with('success', 'The Districts created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Districts::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Districts::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'show', ' Districts show');
|
||||
$data = Districts::findOrFail($id);
|
||||
|
||||
return view("admin::districts.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'edit', ' Districts edit');
|
||||
$TableData = Districts::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Districts::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::districts.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'update', ' Districts update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('district_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DistrictsController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Districts updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('districts.index')->with('success','The Districts updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Districts updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'destroy', ' Districts destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DistrictsController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Districts Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'destroy', ' Districts destroy');
|
||||
$data = Districts::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DistrictsController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Districts Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(DistrictsController::class, 'clone', ' Districts clone');
|
||||
$data = Districts::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(DistrictsController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Districts Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
218
Modules/Admin/app/Http/Controllers/GendersController.php
Normal file
218
Modules/Admin/app/Http/Controllers/GendersController.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
use Modules\Admin\Models\Genders;
|
||||
|
||||
class GendersController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Genders $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'index', ' Genders index');
|
||||
$data = Genders::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::genders.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'create', ' Genders create');
|
||||
$TableData = Genders::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$editable = false;
|
||||
return view("admin::genders.edit", compact('TableData', 'editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'store', ' Genders store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_genders')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(GendersController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Genders Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('genders.index')->with('success', 'The Genders created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Genders::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Genders::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'show', ' Genders show');
|
||||
$data = Genders::findOrFail($id);
|
||||
|
||||
return view("admin::genders.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'edit', ' Genders edit');
|
||||
$TableData = Genders::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Genders::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::genders.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'update', ' Genders update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('gender_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(GendersController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Genders updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('genders.index')->with('success','The Genders updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Genders updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'destroy', ' Genders destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(GendersController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Genders Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'destroy', ' Genders destroy');
|
||||
$data = Genders::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(GendersController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Genders Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(GendersController::class, 'clone', ' Genders clone');
|
||||
$data = Genders::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(GendersController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Genders Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
218
Modules/Admin/app/Http/Controllers/NationalitiesController.php
Normal file
218
Modules/Admin/app/Http/Controllers/NationalitiesController.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
use Modules\Admin\Models\Nationalities;
|
||||
|
||||
class NationalitiesController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Nationalities $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'index', ' Nationalities index');
|
||||
$data = Nationalities::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::nationalities.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'create', ' Nationalities create');
|
||||
$TableData = Nationalities::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$editable = false;
|
||||
return view("admin::nationalities.edit", compact('TableData', 'editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'store', ' Nationalities store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_nationalities')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(NationalitiesController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Nationalities Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('nationalities.index')->with('success', 'The Nationalities created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Nationalities::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Nationalities::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'show', ' Nationalities show');
|
||||
$data = Nationalities::findOrFail($id);
|
||||
|
||||
return view("admin::nationalities.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'edit', ' Nationalities edit');
|
||||
$TableData = Nationalities::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Nationalities::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::nationalities.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'update', ' Nationalities update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('nationality_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(NationalitiesController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Nationalities updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('nationalities.index')->with('success','The Nationalities updated Successfully.');
|
||||
return redirect()->back()->with('success', 'The Nationalities updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'destroy', ' Nationalities destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(NationalitiesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Nationalities Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'destroy', ' Nationalities destroy');
|
||||
$data = Nationalities::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(NationalitiesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Nationalities Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(NationalitiesController::class, 'clone', ' Nationalities clone');
|
||||
$data = Nationalities::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(NationalitiesController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Nationalities Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Admin\Repositories\PromotionDemotionRepository;
|
||||
|
||||
class PromotionDemotionController extends Controller
|
||||
{
|
||||
private $promotionDemotionRepository;
|
||||
public function __construct(PromotionDemotionRepository $promotionDemotionRepository)
|
||||
{
|
||||
$this->promotionDemotionRepository = $promotionDemotionRepository;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = "Promotion/ Demotion Lists";
|
||||
$data['promotionDemotionLists'] = $this->promotionDemotionRepository->findAll();
|
||||
return view('admin::promotiondemotions.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['editable'] = false;
|
||||
$data['title'] = "Create Promotion/ Demotion";
|
||||
return view('admin::promotiondemotions.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->promotionDemotionRepository->create($request->all());
|
||||
toastr()->success('Promotion/ Demotion Created Successfully');
|
||||
return redirect()->route('promotionDemotion.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('admin::promotiondemotions.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['editable'] = false;
|
||||
$data['title'] = "Edit Promotion/ Demotion";
|
||||
$data['promotionDemotion'] = $this->promotionDemotionRepository->getPromotionDemotionById($id);
|
||||
return view('admin::promotiondemotions.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$this->promotionDemotionRepository->update($id, $request->all());
|
||||
toastr()->success('Promotion/ Demotion Updated Successfully');
|
||||
return redirect()->route('promotionDemotion.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$this->promotionDemotionRepository->delete($id);
|
||||
toastr()->success('Promotion/ Demotion Deleted Successfully');
|
||||
return redirect()->route('promotionDemotion.index');
|
||||
}
|
||||
}
|
218
Modules/Admin/app/Http/Controllers/ProvinceController.php
Normal file
218
Modules/Admin/app/Http/Controllers/ProvinceController.php
Normal file
@ -0,0 +1,218 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Log;
|
||||
use Exception;
|
||||
use Modules\Admin\Models\Province;
|
||||
|
||||
class ProvinceController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
public function __construct(Province $model)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'index', ' Province index');
|
||||
|
||||
$data = Province::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("admin::provinces.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'create', ' Province create');
|
||||
|
||||
$editable = false;
|
||||
|
||||
return view("admin::provinces.edit", compact('editable'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'store', ' Province store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->request->add(['alias' => slugify($request->title)]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_province')]);
|
||||
$request->request->add(['created_at' => date("Y-m-d h:i:s")]);
|
||||
$request->request->add(['updated_at' => date("Y-m-d h:i:s")]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$operationNumber = getOperationNumber();
|
||||
$this->modelService->create($operationNumber, $operationNumber, null, $requestData);
|
||||
} catch (\Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(ProvinceController::class, 'store', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Province Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('provinces.index')->with('success', 'The Province created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Province::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
|
||||
return response()->json(['status' => true, 'content' => 'The articles sorted successfully.'], 200);
|
||||
}
|
||||
public function updatealias(Request $request)
|
||||
{
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Province::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
$companyArticle->alias = $newAlias;
|
||||
$companyArticle->save();
|
||||
return response()->json(['status' => true, 'content' => 'Alias updated successfully.'], 200);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'show', ' Province show');
|
||||
$data = Province::findOrFail($id);
|
||||
|
||||
return view("admin::provinces.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'edit', ' Province edit');
|
||||
$TableData = Province::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Province::findOrFail($id);
|
||||
$editable = true;
|
||||
return view("admin::provinces.edit", compact('data', 'TableData', 'editable'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'update', ' Province update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $request->input('provience_id'));
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(ProvinceController::class, 'update', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Province updated Successfully.'], 200);
|
||||
}
|
||||
return redirect()->back()->with('success', 'The Province updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'destroy', ' Province destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(ProvinceController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Province Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'destroy', ' Province destroy');
|
||||
$data = Province::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->update($OperationNumber, $OperationNumber, null, $requestData, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(ProvinceController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Province Deleted Successfully.'], 200);
|
||||
}
|
||||
public function clone(Request $request, $id)
|
||||
{
|
||||
// createActivityLog(ProvinceController::class, 'clone', ' Province clone');
|
||||
$data = Province::findOrFail($id);
|
||||
unset($data['updatedby']);
|
||||
unset($data['createdby']);
|
||||
$requestData = $data->toArray();
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->create($OperationNumber, $OperationNumber, null, $requestData);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(ProvinceController::class, 'clone', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Province Clonned Successfully.'], 200);
|
||||
}
|
||||
|
||||
}
|
83
Modules/Admin/app/Http/Controllers/ResignationController.php
Normal file
83
Modules/Admin/app/Http/Controllers/ResignationController.php
Normal file
@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\RedirectResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Response;
|
||||
use Modules\Admin\Repositories\ResignationRepository;
|
||||
|
||||
class ResignationController extends Controller
|
||||
{
|
||||
private $resignationRepository;
|
||||
|
||||
public function __construct(ResignationRepository $resignationRepository)
|
||||
{
|
||||
$this->resignationRepository = $resignationRepository;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$data['title'] = 'Resignation List';
|
||||
$data['resignationLists'] = $this->resignationRepository->findAll();
|
||||
return view('admin::resignations.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Create Resignation';
|
||||
$data['editable'] = false;
|
||||
return view('admin::resignations.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request): RedirectResponse
|
||||
{
|
||||
$this->resignationRepository->create($request->all());
|
||||
return redirect()->route('resignation.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
return view('admin::resignations.show');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit Resignation';
|
||||
$data['editable'] = true;
|
||||
$data['resignation'] = $this->resignationRepository->getResignationById($id);
|
||||
return view('admin::resignations.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id): RedirectResponse
|
||||
{
|
||||
$this->resignationRepository->update($id, $request->all());
|
||||
return redirect()->route('resignation.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
0
Modules/Admin/app/Http/Requests/.gitkeep
Normal file
0
Modules/Admin/app/Http/Requests/.gitkeep
Normal file
0
Modules/Admin/app/Models/.gitkeep
Normal file
0
Modules/Admin/app/Models/.gitkeep
Normal file
30
Modules/Admin/app/Models/Appreciation.php
Normal file
30
Modules/Admin/app/Models/Appreciation.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Admin\Database\factories\AppreciationFactory;
|
||||
|
||||
class Appreciation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_appreciations';
|
||||
protected $primaryKey = 'appreciation_id';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'alias',
|
||||
'type',
|
||||
'employee_id',
|
||||
'appreciated_by',
|
||||
'appreciated_date',
|
||||
'status',
|
||||
'description',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
}
|
16
Modules/Admin/app/Models/Castes.php
Normal file
16
Modules/Admin/app/Models/Castes.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Castes extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_castes';
|
||||
protected $primaryKey = 'caste_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
16
Modules/Admin/app/Models/Cities.php
Normal file
16
Modules/Admin/app/Models/Cities.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Cities extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_cities';
|
||||
protected $primaryKey = 'city_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
18
Modules/Admin/app/Models/Country.php
Normal file
18
Modules/Admin/app/Models/Country.php
Normal file
@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Country extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = 'tbl_countries';
|
||||
protected $fillable = [
|
||||
'country_name',
|
||||
'phone_code',
|
||||
'country_code',
|
||||
'status',
|
||||
];
|
||||
}
|
16
Modules/Admin/app/Models/Departments.php
Normal file
16
Modules/Admin/app/Models/Departments.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Departments extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_departments';
|
||||
protected $primaryKey = 'department_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
16
Modules/Admin/app/Models/Designations.php
Normal file
16
Modules/Admin/app/Models/Designations.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Designations extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_designations';
|
||||
protected $primaryKey = 'designation_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
20
Modules/Admin/app/Models/Districts.php
Normal file
20
Modules/Admin/app/Models/Districts.php
Normal file
@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Districts extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_districts';
|
||||
protected $primaryKey = 'district_id';
|
||||
protected $fillable = [
|
||||
'district_name',
|
||||
'countries_id',
|
||||
'provinces_id',
|
||||
'status',
|
||||
];
|
||||
}
|
16
Modules/Admin/app/Models/Genders.php
Normal file
16
Modules/Admin/app/Models/Genders.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Genders extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_genders';
|
||||
protected $primaryKey = 'gender_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
16
Modules/Admin/app/Models/Nationalities.php
Normal file
16
Modules/Admin/app/Models/Nationalities.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Nationalities extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_nationalities';
|
||||
protected $primaryKey = 'nationality_id';
|
||||
|
||||
protected $guarded = [];
|
||||
}
|
31
Modules/Admin/app/Models/PromotionDemotion.php
Normal file
31
Modules/Admin/app/Models/PromotionDemotion.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Admin\Database\factories\PromotionDemotionFactory;
|
||||
|
||||
class PromotionDemotion extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = "tbl_promotion_demotions";
|
||||
protected $primaryKey = "promotion_demotion_id";
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'employee_id',
|
||||
'title',
|
||||
'employee_id',
|
||||
'old_designation_id',
|
||||
'new_designation_id',
|
||||
'type',
|
||||
'status',
|
||||
'description',
|
||||
'remarks',
|
||||
];
|
||||
|
||||
|
||||
}
|
23
Modules/Admin/app/Models/Province.php
Normal file
23
Modules/Admin/app/Models/Province.php
Normal file
@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Province extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_provinces';
|
||||
protected $primaryKey = 'province_id';
|
||||
protected $fillable = [
|
||||
'province_name',
|
||||
'country_id',
|
||||
'status',
|
||||
];
|
||||
public function country()
|
||||
{
|
||||
return $this->belongsTo(Country::class);
|
||||
}
|
||||
}
|
31
Modules/Admin/app/Models/Resignation.php
Normal file
31
Modules/Admin/app/Models/Resignation.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Modules\Admin\Database\factories\ResignationFactory;
|
||||
|
||||
class Resignation extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
|
||||
protected $table = 'tbl_resignations';
|
||||
|
||||
protected $primaryKey = 'resignation_id';
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'employee_id',
|
||||
'resignation_date',
|
||||
'approved_date',
|
||||
'approved_by',
|
||||
'description',
|
||||
'remarks',
|
||||
'status',
|
||||
'createdBy',
|
||||
'updatedBy',
|
||||
];
|
||||
}
|
0
Modules/Admin/app/Providers/.gitkeep
Normal file
0
Modules/Admin/app/Providers/.gitkeep
Normal file
114
Modules/Admin/app/Providers/AdminServiceProvider.php
Normal file
114
Modules/Admin/app/Providers/AdminServiceProvider.php
Normal file
@ -0,0 +1,114 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AdminServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $moduleName = 'Admin';
|
||||
|
||||
protected string $moduleNameLower = 'admin';
|
||||
|
||||
/**
|
||||
* 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;
|
||||
}
|
||||
}
|
49
Modules/Admin/app/Providers/RouteServiceProvider.php
Normal file
49
Modules/Admin/app/Providers/RouteServiceProvider.php
Normal file
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\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('Admin', '/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('Admin', '/routes/api.php'));
|
||||
}
|
||||
}
|
0
Modules/Admin/app/Repositories/.gitkeep
Normal file
0
Modules/Admin/app/Repositories/.gitkeep
Normal file
12
Modules/Admin/app/Repositories/AppreciationInterface.php
Normal file
12
Modules/Admin/app/Repositories/AppreciationInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface AppreciationInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getAppreciationById($appreciationId);
|
||||
public function delete($appreciationId);
|
||||
public function create(array $AppreciationDetails);
|
||||
public function update($appreciationId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/AppreciationRepository.php
Normal file
35
Modules/Admin/app/Repositories/AppreciationRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Appreciation;
|
||||
|
||||
|
||||
class AppreciationRepository implements AppreciationInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Appreciation::get();
|
||||
}
|
||||
|
||||
public function getAppreciationById($appreciationId)
|
||||
{
|
||||
return Appreciation::findOrFail($appreciationId);
|
||||
}
|
||||
|
||||
public function delete($appreciationId)
|
||||
{
|
||||
Appreciation::destroy($appreciationId);
|
||||
}
|
||||
|
||||
public function create(array $appreciationDetails)
|
||||
{
|
||||
return Appreciation::create($appreciationDetails);
|
||||
}
|
||||
|
||||
public function update($appreciationId, array $newDetails)
|
||||
{
|
||||
return Appreciation::where('appreciation_id', $appreciationId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface PromotionDemotionInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getPromotionDemotionById($promotionDemotionId);
|
||||
public function delete($promotionDemotionId);
|
||||
public function create(array $PromotionDemotionDetails);
|
||||
public function update($promotionDemotionId, array $newDetails);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\PromotionDemotion;
|
||||
|
||||
|
||||
class PromotionDemotionRepository implements PromotionDemotionInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return PromotionDemotion::get();
|
||||
}
|
||||
|
||||
public function getPromotionDemotionById($promotionDemotionId)
|
||||
{
|
||||
return PromotionDemotion::findOrFail($promotionDemotionId);
|
||||
}
|
||||
|
||||
public function delete($promotionDemotionId)
|
||||
{
|
||||
PromotionDemotion::destroy($promotionDemotionId);
|
||||
}
|
||||
|
||||
public function create(array $promotionDemotionDetails)
|
||||
{
|
||||
return PromotionDemotion::create($promotionDemotionDetails);
|
||||
}
|
||||
|
||||
public function update($promotionDemotionId, array $newDetails)
|
||||
{
|
||||
return PromotionDemotion::where('promotion_demotion_id', $promotionDemotionId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
12
Modules/Admin/app/Repositories/ResignationInterface.php
Normal file
12
Modules/Admin/app/Repositories/ResignationInterface.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
interface ResignationInterface
|
||||
{
|
||||
public function findAll();
|
||||
public function getResignationById($resignationId);
|
||||
public function delete($resignationId);
|
||||
public function create(array $ResignationDetails);
|
||||
public function update($resignationId, array $newDetails);
|
||||
}
|
35
Modules/Admin/app/Repositories/ResignationRepository.php
Normal file
35
Modules/Admin/app/Repositories/ResignationRepository.php
Normal file
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\Repositories;
|
||||
|
||||
use Modules\Admin\Models\Resignation;
|
||||
|
||||
|
||||
class ResignationRepository implements ResignationInterface
|
||||
{
|
||||
public function findAll()
|
||||
{
|
||||
return Resignation::get();
|
||||
}
|
||||
|
||||
public function getResignationById($resignationId)
|
||||
{
|
||||
return Resignation::findOrFail($resignationId);
|
||||
}
|
||||
|
||||
public function delete($resignationId)
|
||||
{
|
||||
Resignation::destroy($resignationId);
|
||||
}
|
||||
|
||||
public function create(array $resignationDetails)
|
||||
{
|
||||
return Resignation::create($resignationDetails);
|
||||
}
|
||||
|
||||
public function update($resignationId, array $newDetails)
|
||||
{
|
||||
return Resignation::where('resignation_id', $resignationId)->update($newDetails);
|
||||
}
|
||||
|
||||
}
|
62
Modules/Admin/app/Services/AdminService.php
Normal file
62
Modules/Admin/app/Services/AdminService.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
namespace Modules\Admin\Services;
|
||||
|
||||
use Modules\Admin\Models\Castes;
|
||||
use Modules\Admin\Models\Cities;
|
||||
use Modules\Admin\Models\Country;
|
||||
use Modules\Admin\Models\Departments;
|
||||
use Modules\Admin\Models\Designations;
|
||||
use Modules\Admin\Models\Districts;
|
||||
use Modules\Admin\Models\Genders;
|
||||
use Modules\Admin\Models\Nationalities;
|
||||
use Modules\Admin\Models\Province;
|
||||
|
||||
final class AdminService
|
||||
{
|
||||
function pluckCountries()
|
||||
{
|
||||
return Country::pluck('title', 'country_id');
|
||||
}
|
||||
|
||||
function pluckProvinces()
|
||||
{
|
||||
return Province::pluck('title', 'province_id');
|
||||
}
|
||||
|
||||
function pluckDistricts()
|
||||
{
|
||||
return Districts::pluck('title', 'district_id');
|
||||
|
||||
}
|
||||
|
||||
function pluckCities()
|
||||
{
|
||||
return Cities::pluck('title', 'city_id');
|
||||
}
|
||||
|
||||
function pluckCastes()
|
||||
{
|
||||
return Castes::pluck('title', 'caste_id');
|
||||
}
|
||||
|
||||
function pluckGenders()
|
||||
{
|
||||
return Genders::pluck('title', 'gender_id');
|
||||
}
|
||||
|
||||
function pluckNationalities()
|
||||
{
|
||||
return Nationalities::pluck('title', 'nationality_id');
|
||||
}
|
||||
|
||||
function pluckDepartments()
|
||||
{
|
||||
return Departments::pluck('title', 'department_id');
|
||||
}
|
||||
|
||||
function pluckDesignations()
|
||||
{
|
||||
return Designations::pluck('title', 'designation_id');
|
||||
}
|
||||
}
|
||||
|
30
Modules/Admin/composer.json
Normal file
30
Modules/Admin/composer.json
Normal file
@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "nwidart/admin",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\Admin\\": "app/",
|
||||
"Modules\\Admin\\Database\\Factories\\": "database/factories/",
|
||||
"Modules\\Admin\\Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Modules\\Admin\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
0
Modules/Admin/config/.gitkeep
Normal file
0
Modules/Admin/config/.gitkeep
Normal file
5
Modules/Admin/config/config.php
Normal file
5
Modules/Admin/config/config.php
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'Admin',
|
||||
];
|
0
Modules/Admin/database/factories/.gitkeep
Normal file
0
Modules/Admin/database/factories/.gitkeep
Normal file
0
Modules/Admin/database/migrations/.gitkeep
Normal file
0
Modules/Admin/database/migrations/.gitkeep
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_promotion_demotions', function (Blueprint $table) {
|
||||
$table->tinyInteger('promotion_demotion_id')->unsigned()->autoIncrement();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('alias')->nullable();
|
||||
$table->unsignedBigInteger('employee_id')->nullable();
|
||||
$table->unsignedBigInteger('old_designation_id')->nullable();
|
||||
$table->unsignedBigInteger('new_designation_id')->nullable();
|
||||
$table->unsignedBigInteger('type')->nullable();
|
||||
$table->unsignedBigInteger('status')->nullable();
|
||||
$table->date('date')->nullable();
|
||||
$table->mediumText('description')->nullable();
|
||||
$table->mediumText('remarks')->nullable();
|
||||
$table->unsignedBigInteger('createdBy')->nullable();
|
||||
$table->unsignedBigInteger('updatedBy')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_promotion_demotions');
|
||||
}
|
||||
};
|
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_appreciations', function (Blueprint $table) {
|
||||
$table->tinyInteger('appreciation_id')->unsigned()->autoIncrement();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('alias')->nullable();
|
||||
$table->string('type')->nullable();
|
||||
$table->unsignedBigInteger('employee_id')->nullable();
|
||||
$table->unsignedBigInteger('appreciated_by')->nullable();
|
||||
$table->date('appreciated_date')->nullable();
|
||||
$table->unsignedBigInteger('status')->nullable();
|
||||
$table->mediumText('description')->nullable();
|
||||
$table->mediumText('remarks')->nullable();
|
||||
$table->unsignedBigInteger('createdBy')->nullable();
|
||||
$table->unsignedBigInteger('updatedBy')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_appreciations');
|
||||
}
|
||||
};
|
@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration {
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('tbl_resignations', function (Blueprint $table) {
|
||||
$table->tinyInteger('resignation_id')->unsigned()->autoIncrement();
|
||||
$table->unsignedBigInteger('employee_id')->nullable();
|
||||
$table->date('resignation_date')->nullable();
|
||||
$table->date('approved_date')->nullable();
|
||||
$table->unsignedBigInteger('approved_by')->nullable();
|
||||
$table->mediumText('description')->nullable();
|
||||
$table->mediumText('remarks')->nullable();
|
||||
$table->unsignedBigInteger('status')->nullable();
|
||||
$table->unsignedBigInteger('createdBy')->nullable();
|
||||
$table->unsignedBigInteger('updatedBy')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('tbl_resignations');
|
||||
}
|
||||
};
|
0
Modules/Admin/database/seeders/.gitkeep
Normal file
0
Modules/Admin/database/seeders/.gitkeep
Normal file
16
Modules/Admin/database/seeders/AdminDatabaseSeeder.php
Normal file
16
Modules/Admin/database/seeders/AdminDatabaseSeeder.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\Admin\database\seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class AdminDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
11
Modules/Admin/module.json
Normal file
11
Modules/Admin/module.json
Normal file
@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "Admin",
|
||||
"alias": "admin",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\Admin\\Providers\\AdminServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
15
Modules/Admin/package.json
Normal file
15
Modules/Admin/package.json
Normal 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"
|
||||
}
|
||||
}
|
0
Modules/Admin/resources/assets/.gitkeep
Normal file
0
Modules/Admin/resources/assets/.gitkeep
Normal file
0
Modules/Admin/resources/assets/js/app.js
Normal file
0
Modules/Admin/resources/assets/js/app.js
Normal file
0
Modules/Admin/resources/assets/sass/app.scss
Normal file
0
Modules/Admin/resources/assets/sass/app.scss
Normal file
0
Modules/Admin/resources/views/.gitkeep
Normal file
0
Modules/Admin/resources/views/.gitkeep
Normal file
23
Modules/Admin/resources/views/appreciations/create.blade.php
Normal file
23
Modules/Admin/resources/views/appreciations/create.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->form('POST')->route('appreciation.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('admin::partials.appreciations.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
23
Modules/Admin/resources/views/appreciations/edit.blade.php
Normal file
23
Modules/Admin/resources/views/appreciations/edit.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->modelForm($appreciation, 'PUT')->route('appreciation.update', $appreciation->appreciation_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('admin::partials.appreciations.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
75
Modules/Admin/resources/views/appreciations/index.blade.php
Normal file
75
Modules/Admin/resources/views/appreciations/index.blade.php
Normal file
@ -0,0 +1,75 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('appreciation.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Appreciation</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Employee</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Appreciated Type</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Appreciated By</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Appreciated Date</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($appreciationLists as $index => $item)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->employee_id }}</td>
|
||||
<td class="tb-col">{{ $item->type }}</td>
|
||||
<td class="tb-col">{{ $item->appreciated_by }}</td>
|
||||
<td class="tb-col">{{ $item->appreciated_date }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('appreciation.show', [$item->appreciation_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
|
||||
</li>
|
||||
|
||||
<li><a href="{{ route('appreciation.edit', [$item->appreciation_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
Edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{ route('appreciation.destroy', [$item->appreciation_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
48
Modules/Admin/resources/views/appreciations/show.blade.php
Normal file
48
Modules/Admin/resources/views/appreciations/show.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Job Description : </b> <span>{{ $data->job_description }}</span></p>
|
||||
<p><b>Departments Id : </b> <span>{{ $data->departments_id }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
41
Modules/Admin/resources/views/castes/edit.blade.php
Normal file
41
Modules/Admin/resources/views/castes/edit.blade.php
Normal file
@ -0,0 +1,41 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Caste'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
|
||||
<div class='card-body'>
|
||||
|
||||
<form action="{{ $editable ? route('castes.update', [$data->caste_id]) : route('castes.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
|
||||
@csrf
|
||||
<input type=hidden name='caste_id' value='{{ $editable ? $data->caste_id : '' }}' />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mt-2">
|
||||
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('castes.index')); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
265
Modules/Admin/resources/views/castes/index.blade.php
Normal file
265
Modules/Admin/resources/views/castes/index.blade.php
Normal file
@ -0,0 +1,265 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Caste'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Caste Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('castes.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Caste</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_castes" data-url="{{ route('castes.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($data as $index => $item)
|
||||
<tr data-id="{{ $item->caste_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->caste_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->caste_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('castes.show', [$item->caste_id]) }}" class="dropdown-item"><i
|
||||
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>
|
||||
<a href="{{ route('castes.toggle', [$item->caste_id]) }}" 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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('castes.clone', [$item->caste_id]) }}" 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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('castes.destroy', [$item->caste_id]) }}"
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('castes.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
43
Modules/Admin/resources/views/castes/show.blade.php
Normal file
43
Modules/Admin/resources/views/castes/show.blade.php
Normal file
@ -0,0 +1,43 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Caste'])
|
||||
|
||||
<!-- end page title -->
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('castes.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
47
Modules/Admin/resources/views/cities/edit.blade.php
Normal file
47
Modules/Admin/resources/views/cities/edit.blade.php
Normal file
@ -0,0 +1,47 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'City'])
|
||||
|
||||
<!-- end page title -->
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
<form action="{{ $editable ? route('cities.update', [$data->city_id]) : route('cities.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
|
||||
@csrf
|
||||
<input type=hidden name='city_id' value='{{ $editable ? $data->city_id : '' }}' />
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-6">
|
||||
{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_districts', 'title', 'district_id', $editable ? $data->districts_id : '', 'District', 'districts_id', 'form-control select2', 'status<>-1') }}
|
||||
</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 mt-2">
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('cities.index')); ?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
270
Modules/Admin/resources/views/cities/index.blade.php
Normal file
270
Modules/Admin/resources/views/cities/index.blade.php
Normal file
@ -0,0 +1,270 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'City'])
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">City Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('cities.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create City</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_cities" data-url="{{ route('cities.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('District') }}</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" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
@foreach ($data as $item)
|
||||
<tr data-id="{{ $item->city_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_districts', 'title', 'district_id', $item->districts_id) !!}
|
||||
</td>
|
||||
<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>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->city_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('cities.show', [$item->city_id]) }}" class="dropdown-item"><i
|
||||
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>
|
||||
<a href="{{ route('cities.toggle', [$item->city_id]) }}" 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>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('cities.clone', [$item->city_id]) }}" 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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('cities.destroy', [$item->city_id]) }}" 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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('cities.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
37
Modules/Admin/resources/views/cities/show.blade.php
Normal file
37
Modules/Admin/resources/views/cities/show.blade.php
Normal file
@ -0,0 +1,37 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('cities.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Districts Id : </b> <span>{{ $data->districts_id }}</span></p>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Description : </b> <span>{{ $data->description }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
50
Modules/Admin/resources/views/countries/edit.blade.php
Normal file
50
Modules/Admin/resources/views/countries/edit.blade.php
Normal file
@ -0,0 +1,50 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Country'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<form action="{{ $editable ? route('countries.update', [$data->country_id]) : route('countries.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
@csrf
|
||||
|
||||
<input type=hidden name='country_id' value='{{ $editable ? $data->country_id : '' }}' />
|
||||
|
||||
<div class='card'>
|
||||
|
||||
<div class='card-body'>
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-12">
|
||||
{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
|
||||
</div>
|
||||
|
||||
{{-- <div class="col-lg-12 pb-4">
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Description', $editable ? $data->description : '') }}
|
||||
</div> --}}
|
||||
|
||||
<div class="border border-dashed"></div>
|
||||
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<div class="col-md-12">
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('countries.index')); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
230
Modules/Admin/resources/views/countries/index.blade.php
Normal file
230
Modules/Admin/resources/views/countries/index.blade.php
Normal file
@ -0,0 +1,230 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Country'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Country Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('countries.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Country</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_countries" data-url="{{ route('countries.sort') }}">
|
||||
<thead class="table-light">
|
||||
<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('title') }}</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
|
||||
class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($data as $index => $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' : ''; ?>">
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->country_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->country_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('countries.show', [$item->country_id]) }}" class="dropdown-item"><i
|
||||
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>
|
||||
<a href="{{ route('countries.toggle', [$item->country_id]) }}"
|
||||
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>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('countries.destroy', [$item->country_id]) }}"
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('countries.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
var isRowReorderComplete = false;
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
52
Modules/Admin/resources/views/countries/show.blade.php
Normal file
52
Modules/Admin/resources/views/countries/show.blade.php
Normal file
@ -0,0 +1,52 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Employee'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Employee'])
|
||||
|
||||
<!-- end page title -->
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Detail'); ?></h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('countries.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Description : </b> <span>{{ $data->description }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
54
Modules/Admin/resources/views/departments/edit.blade.php
Normal file
54
Modules/Admin/resources/views/departments/edit.blade.php
Normal file
@ -0,0 +1,54 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Employee'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class='card-body'>
|
||||
|
||||
<form action="{{ $editable ? route('department.update', [$data->department_id]) : route('department.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
|
||||
@csrf
|
||||
|
||||
<input type=hidden name='department_id' value='{{ $editable ? $data->department_id : '' }}' />
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-6">
|
||||
{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
|
||||
</div>
|
||||
|
||||
{{-- <div class="col-lg-6">
|
||||
|
||||
{{ createCustomSelect('tbl_branches', 'title', 'branch_id', $editable ? $data->branches_id : '', 'Branch', 'branches_id', 'form-control select2', 'status<>-1') }}
|
||||
|
||||
</div> --}}
|
||||
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
|
||||
</div>
|
||||
|
||||
{{-- <div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Description', $editable ? $data->description : '') }}
|
||||
</div> --}}
|
||||
|
||||
<div class="col-md-12 mt-2">
|
||||
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('department.index')); ?>
|
||||
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
274
Modules/Admin/resources/views/departments/index.blade.php
Normal file
274
Modules/Admin/resources/views/departments/index.blade.php
Normal file
@ -0,0 +1,274 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Department'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Department Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('department.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Department</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_departments" data-url="{{ route('department.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('branches') }}</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->department_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->department_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->department_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_branches', 'title', 'branch_id', $item->branches_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('department.show', [$item->department_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('department.edit', [$item->department_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('department.toggle', [$item->department_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('department.clone', [$item->department_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('department.destroy', [$item->department_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
|
||||
if (isEditing) {
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('department.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
47
Modules/Admin/resources/views/departments/show.blade.php
Normal file
47
Modules/Admin/resources/views/departments/show.blade.php
Normal file
@ -0,0 +1,47 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Department'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('department.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Branches Id : </b> <span>{{ $data->branches_id }}</span></p>
|
||||
<p><b>Description : </b> <span>{{ $data->description }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
55
Modules/Admin/resources/views/designations/edit.blade.php
Normal file
55
Modules/Admin/resources/views/designations/edit.blade.php
Normal file
@ -0,0 +1,55 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Designation'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
<form
|
||||
action="{{ $editable ? route('designation.update', [$data->designation_id]) : route('designation.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
|
||||
@csrf
|
||||
|
||||
<input type=hidden name='designation_id' value='{{ $editable ? $data->designation_id : '' }}' />
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-6">
|
||||
{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
|
||||
</div>
|
||||
|
||||
{{-- <div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_departments', 'title', 'department_id', $editable ? $data->departments_id : '', 'Department', 'departments_id', 'form-control select2', 'status<>-1') }}
|
||||
</div> --}}
|
||||
|
||||
<div class="col-lg-12">
|
||||
|
||||
{{ createPlainTextArea('job_description', '', 'Job Description', $editable ? $data->job_description : '') }}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12">
|
||||
|
||||
{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mt-2">
|
||||
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('designation.index')); ?>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
280
Modules/Admin/resources/views/designations/index.blade.php
Normal file
280
Modules/Admin/resources/views/designations/index.blade.php
Normal file
@ -0,0 +1,280 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Designation'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Designation Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designation.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Designation</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_designations" data-url="{{ route('designation.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('S.N') }}</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('Job Description') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Department') }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($data as $index => $item)
|
||||
<tr data-id="{{ $item->designation_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->designation_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->designation_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->job_description }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_departments', 'title', 'department_id', $item->departments_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('designations.show', [$item->designation_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('designations.edit', [$item->designation_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('designations.toggle', [$item->designation_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('designations.clone', [$item->designation_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('designations.destroy', [$item->designation_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('designation.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
48
Modules/Admin/resources/views/designations/show.blade.php
Normal file
48
Modules/Admin/resources/views/designations/show.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Designation'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Job Description : </b> <span>{{ $data->job_description }}</span></p>
|
||||
<p><b>Departments Id : </b> <span>{{ $data->departments_id }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
46
Modules/Admin/resources/views/districts/edit.blade.php
Normal file
46
Modules/Admin/resources/views/districts/edit.blade.php
Normal file
@ -0,0 +1,46 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'District'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
<form action="{{ $editable ? route('districts.update', [$data->district_id]) : route('districts.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
|
||||
@csrf
|
||||
|
||||
<input type=hidden name='district_id' value='{{ $editable ? $data->district_id : '' }}' />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_provinces', 'title', 'province_id', $editable ? $data->provinces_id : '', 'Province', 'provinces_id', 'form-control select2', 'status<>-1') }}
|
||||
</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('districts.index')); ?>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
275
Modules/Admin/resources/views/districts/index.blade.php
Normal file
275
Modules/Admin/resources/views/districts/index.blade.php
Normal file
@ -0,0 +1,275 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'District'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">District Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('districts.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create District</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_districts" data-url="{{ route('districts.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('provinces') }}</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" 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->district_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_provinces', 'title', 'province_id', $item->provinces_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->district_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->district_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('districts.show', [$item->district_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('districts.edit', [$item->district_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('districts.toggle', [$item->district_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('districts.clone', [$item->district_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('districts.destroy', [$item->district_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('districts.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
45
Modules/Admin/resources/views/districts/show.blade.php
Normal file
45
Modules/Admin/resources/views/districts/show.blade.php
Normal file
@ -0,0 +1,45 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Province'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Detail'); ?></h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('districts.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Province: </b> <span>{{ $data->proviences_id }}</span></p>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Description : </b> <span>{{ $data->description }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
39
Modules/Admin/resources/views/genders/edit.blade.php
Normal file
39
Modules/Admin/resources/views/genders/edit.blade.php
Normal file
@ -0,0 +1,39 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
\<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Gender'])
|
||||
|
||||
<!-- end page title -->
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
<form action="{{ $editable ? route('genders.update', [$data->gender_id]) : route('genders.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
|
||||
@csrf
|
||||
<input type=hidden name='gender_id' value='{{ $editable ? $data->gender_id : '' }}' />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mt-2">
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('genders.index')); ?>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
265
Modules/Admin/resources/views/genders/index.blade.php
Normal file
265
Modules/Admin/resources/views/genders/index.blade.php
Normal file
@ -0,0 +1,265 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Gender'])
|
||||
|
||||
<!-- end page title -->
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Gender Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('genders.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Gender</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_genders" data-url="{{ route('genders.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($data as $index => $item)
|
||||
<tr data-id="{{ $item->gender_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->gender_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->gender_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('genders.show', [$item->gender_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('genders.edit', [$item->gender_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i> {{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('genders.toggle', [$item->gender_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('genders.clone', [$item->gender_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('genders.destroy', [$item->gender_id]) }}"
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('genders.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
42
Modules/Admin/resources/views/genders/show.blade.php
Normal file
42
Modules/Admin/resources/views/genders/show.blade.php
Normal file
@ -0,0 +1,42 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Nationality'])
|
||||
|
||||
<!-- end page title -->
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('nationalities.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
7
Modules/Admin/resources/views/index.blade.php
Normal file
7
Modules/Admin/resources/views/index.blade.php
Normal file
@ -0,0 +1,7 @@
|
||||
@extends('admin::layouts.master')
|
||||
|
||||
@section('content')
|
||||
<h1>Hello World</h1>
|
||||
|
||||
<p>Module: {!! config('admin.name') !!}</p>
|
||||
@endsection
|
29
Modules/Admin/resources/views/layouts/master.blade.php
Normal file
29
Modules/Admin/resources/views/layouts/master.blade.php
Normal 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>Admin 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-admin', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-admin', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
40
Modules/Admin/resources/views/nationalities/edit.blade.php
Normal file
40
Modules/Admin/resources/views/nationalities/edit.blade.php
Normal file
@ -0,0 +1,40 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Nationality'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
<form
|
||||
action="{{ $editable ? route('nationalities.update', [$data->nationality_id]) : route('nationalities.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
|
||||
@csrf
|
||||
|
||||
<input type=hidden name='nationality_id' value='{{ $editable ? $data->nationality_id : '' }}' />
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-lg-12">
|
||||
{{ createText('title', 'title', 'Title', '', $editable ? $data->title : '') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createPlainTextArea('remarks', '', 'Remarks', $editable ? $data->remarks : '') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12 mt-2">
|
||||
<?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-danger btn-cancel', '', 'Cancel', route('nationalities.index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
267
Modules/Admin/resources/views/nationalities/index.blade.php
Normal file
267
Modules/Admin/resources/views/nationalities/index.blade.php
Normal file
@ -0,0 +1,267 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Nationality'])
|
||||
|
||||
<!-- end page title -->
|
||||
<div class="card">
|
||||
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Nationality Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('nationalities.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i>Create Nationality</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_nationalities" data-url="{{ route('nationalities.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('title') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">{{ label('Action') }}</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($data as $index => $item)
|
||||
<tr data-id="{{ $item->nationality_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->nationality_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->nationality_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('nationalities.show', [$item->nationality_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('nationalities.edit', [$item->nationality_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('nationalities.toggle', [$item->nationality_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('nationalities.clone', [$item->nationality_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('nationalities.destroy', [$item->nationality_id]) }}"
|
||||
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>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('nationalities.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
42
Modules/Admin/resources/views/nationalities/show.blade.php
Normal file
42
Modules/Admin/resources/views/nationalities/show.blade.php
Normal file
@ -0,0 +1,42 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Nationality'])
|
||||
|
||||
<!-- end page title -->
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('nationalities.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
@ -0,0 +1,43 @@
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Title')->class('form-label') }}
|
||||
{{ html()->text('title')->class('form-control')->placeholder('Enter Title') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Appreciation Type')->class('form-label') }}
|
||||
{{ html()->select('type', [1 => 'Employee of the Month', 2 => 'Best Manger'])->class('form-select')->placeholder('Select Type') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Employee')->class('form-label') }}
|
||||
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Appreciated By')->class('form-label') }}
|
||||
{{ html()->select('appreciated_by')->class('form-select')->placeholder('Select Who Appreciated') }}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Appreciated Date')->class('form-label') }}
|
||||
{{ html()->date('appreciated_date')->class('form-control')->placeholder('Select Date') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }}
|
||||
</div>
|
||||
|
||||
<div class="text-end">
|
||||
{{ html()->button($editable ? 'Update' : 'Add Appreciation', 'submit')->class('btn btn-success') }}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,46 @@
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Title')->class('form-label') }}
|
||||
{{ html()->text('title')->class('form-control')->placeholder('Enter Title') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Type')->class('form-label') }}
|
||||
{{ html()->select('type', [1 => 'Promotion', 2 => 'Demotion'])->class('form-select')->placeholder('Select Type') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Employee')->class('form-label') }}
|
||||
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Previous Designation')->class('form-label') }}
|
||||
{{ html()->select('old_designation_id')->class('form-select')->placeholder('Select Previous Desgination') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('New Designation')->class('form-label') }}
|
||||
{{ html()->select('new_designation_id')->class('form-select')->placeholder('Select New Desgination') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Date')->class('form-label') }}
|
||||
{{ html()->date('date')->class('form-control')->placeholder('Select Date') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Description')->class('form-label') }}
|
||||
{{ html()->textarea('description')->class('form-control')->attributes(['rows' => 5]) }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 5]) }}
|
||||
</div>
|
||||
|
||||
<div class="text-end">
|
||||
{{ html()->button($editable ? 'Update' : 'Add Promotion/ Demotion', 'submit')->class('btn btn-success') }}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,26 @@
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Employee')->class('form-label') }}
|
||||
{{ html()->select('employee_id')->class('form-select')->placeholder('Select Employee') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-4 col-md-6">
|
||||
{{ html()->label('Resignation Date')->class('form-label') }}
|
||||
{{ html()->date('resignation_date')->class('form-control')->placeholder('Select Resignation Date') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Reason')->class('form-label') }}
|
||||
{{ html()->textarea('description')->class('form-control')->placeholder('Write reason for resgination')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 col-md-12">
|
||||
{{ html()->label('Remarks')->class('form-label') }}
|
||||
{{ html()->textarea('remarks')->class('form-control')->attributes(['rows' => 3]) }}
|
||||
</div>
|
||||
|
||||
<div class="text-end">
|
||||
{{ html()->button($editable ? 'Update' : 'Add Resignation', 'submit')->class('btn btn-success') }}
|
||||
</div>
|
||||
</div>
|
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->form('POST')->route('promotionDemotion.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('admin::partials.promotiondemotions.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->modelForm($promotionDemotion, 'PUT')->route('promotionDemotion.update', $promotionDemotion->promotion_demotion_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('admin::partials.promotiondemotions.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,75 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Promotion/ Demotion'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Promotion/ Demotion Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('promotionDemotion.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Promotion/ Demotion</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Title</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Employee</span></th>
|
||||
<th class="tb-col" width="20%"><span class="overline-title">Previous Designation</span></th>
|
||||
<th class="tb-col" width="20%"><span class="overline-title">New Designation</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($promotionDemotionLists as $index => $item)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">{{ $item->employee_id }}</td>
|
||||
<td class="tb-col">{{ $item->old_promotion_demotion_id }}</td>
|
||||
<td class="tb-col">{{ $item->new_promotion_demotion_id }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('promotionDemotion.show', [$item->promotion_demotion_id]) }}"
|
||||
class="dropdown-item"><i class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
|
||||
</li>
|
||||
|
||||
<li><a href="{{ route('promotionDemotion.edit', [$item->promotion_demotion_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
Edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{ route('promotionDemotion.destroy', [$item->promotion_demotion_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@ -0,0 +1,48 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Job Description : </b> <span>{{ $data->job_description }}</span></p>
|
||||
<p><b>Departments Id : </b> <span>{{ $data->departments_id }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
37
Modules/Admin/resources/views/provinces/edit.blade.php
Normal file
37
Modules/Admin/resources/views/provinces/edit.blade.php
Normal file
@ -0,0 +1,37 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Province'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
<form action="{{ $editable ? route('provinces.update', [$data->province_id]) : route('provinces.store') }}"
|
||||
id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='province_id' value='{{ $editable ? $data->province_id : '' }}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_countries', 'title', 'country_id', $editable ? $data->countries_id : '', 'Countries Id', 'countries_id', 'form-control select2', 'status<>-1') }}
|
||||
</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('provinces.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
283
Modules/Admin/resources/views/provinces/index.blade.php
Normal file
283
Modules/Admin/resources/views/provinces/index.blade.php
Normal file
@ -0,0 +1,283 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Province'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Province Lists</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('provinces.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Province</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="dataTable table" id="tbl_provinces" data-url="{{ route('provinces.sort') }}">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Sn.') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('countries') }}</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" 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->province_id }}" data-display_order="{{ $item->display_order }}"
|
||||
class="draggable-row <?php echo $item->status == 0 ? 'bg-light bg-danger' : ''; ?>">
|
||||
<td class="tb-col">{{ $i++ }}</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_countries', 'title', 'country_id', $item->countries_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ $item->title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->province_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->province_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('provinces.show', [$item->province_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> {{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('provinces.edit', [$item->province_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i> {{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('provinces.toggle', [$item->province_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('provinces.clone', [$item->province_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('provinces.destroy', [$item->province_id]) }}"
|
||||
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>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('provinces.updatealias') }}";
|
||||
var data = {
|
||||
articleId: articleId,
|
||||
newAlias: newAlias
|
||||
};
|
||||
|
||||
$.ajax({
|
||||
url: ajaxUrl,
|
||||
type: 'POST',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: data,
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// Switch to editing state
|
||||
aliasSpan.hide();
|
||||
aliasInput.show().focus();
|
||||
$(this).addClass('editing').text('Save Alias');
|
||||
}
|
||||
});
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
});
|
||||
|
||||
var isRowReorderComplete = false;
|
||||
|
||||
mytable.on('row-reorder', function(e, diff, edit) {
|
||||
isRowReorderComplete = true;
|
||||
});
|
||||
|
||||
mytable.on('draw', function() {
|
||||
if (isRowReorderComplete) {
|
||||
var url = mytable.table().node().getAttribute('data-url');
|
||||
var ids = mytable.rows().nodes().map(function(node) {
|
||||
return $(node).data('id');
|
||||
}).toArray();
|
||||
|
||||
console.log(ids);
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: "POST",
|
||||
headers: {
|
||||
"X-CSRF-TOKEN": $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
}
|
||||
});
|
||||
isRowReorderComplete = false;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function confirmDelete(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'You will not be able to recover this item!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Delete',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Deleted!', 'The item has been deleted.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred while deleting the item.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmToggle(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Publish Status of Item will be changed!! if Unpublished, links will be dead!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Publishing Status has been updated.', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function confirmClone(url) {
|
||||
event.preventDefault();
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: 'Clonning will create replica of current row. No any linked data will be updated!',
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonText: 'Proceed',
|
||||
cancelButtonText: 'Cancel',
|
||||
reverseButtons: true
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
success: function(response) {
|
||||
Swal.fire('Updated!', 'Clonning Completed', 'success');
|
||||
location.reload();
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
Swal.fire('Error!', 'An error occurred.', 'error');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
@endpush
|
45
Modules/Admin/resources/views/provinces/show.blade.php
Normal file
45
Modules/Admin/resources/views/provinces/show.blade.php
Normal file
@ -0,0 +1,45 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => 'Province'])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Detail'); ?></h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('provinces.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<p><b>Countries Id : </b> <span>{{ $data->countries_id }}</span></p>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Description : </b> <span>{{ $data->description }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
23
Modules/Admin/resources/views/resignations/create.blade.php
Normal file
23
Modules/Admin/resources/views/resignations/create.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->form('POST')->route('resignation.store')->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('admin::partials.resignations.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
23
Modules/Admin/resources/views/resignations/edit.blade.php
Normal file
23
Modules/Admin/resources/views/resignations/edit.blade.php
Normal file
@ -0,0 +1,23 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class='card-body'>
|
||||
|
||||
{{ html()->modelForm($resignation, 'PUT')->route('resignation.update', $resignation->resignation_id)->class(['needs-validation'])->attributes(['novalidate'])->open() }}
|
||||
|
||||
@include('admin::partials.resignations.action')
|
||||
|
||||
{{ html()->form()->close() }}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
77
Modules/Admin/resources/views/resignations/index.blade.php
Normal file
77
Modules/Admin/resources/views/resignations/index.blade.php
Normal file
@ -0,0 +1,77 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">{{ $title }}</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('resignation.create') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Create Resignation</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table id="buttons-datatables" class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th class="tb-col"><span class="overline-title">S.N</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Employee</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Resignation Date</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Approved Date</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Approved By</span></th>
|
||||
<th class="tb-col"><span class="overline-title">Status</span></th>
|
||||
<th class="tb-col" data-sortable="false"><span class="overline-title">Action</span>
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
@foreach ($resignationLists as $index => $item)
|
||||
<tr>
|
||||
<td class="tb-col">{{ $index + 1 }}</td>
|
||||
<td class="tb-col">{{ $item->employee_id }}</td>
|
||||
<td class="tb-col">{{ $item->resignation_date }}</td>
|
||||
<td class="tb-col">{{ $item->approved_date }}</td>
|
||||
<td class="tb-col">{{ $item->approved_by }}</td>
|
||||
<td class="tb-col">{{ $item->status }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="dropdown d-inline-block">
|
||||
<button class="btn btn-soft-secondary btn-sm dropdown" type="button" data-bs-toggle="dropdown"
|
||||
aria-expanded="false">
|
||||
<i class="ri-more-fill align-middle"></i>
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="{{ route('resignation.show', [$item->resignation_id]) }}" class="dropdown-item"><i
|
||||
class="ri-eye-fill text-muted me-2 align-bottom"></i> View</a>
|
||||
</li>
|
||||
|
||||
<li><a href="{{ route('resignation.edit', [$item->resignation_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill text-muted me-2 align-bottom"></i>
|
||||
Edit</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="{{ route('resignation.destroy', [$item->resignation_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill text-muted me-2 align-bottom"></i> Delete
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
48
Modules/Admin/resources/views/resignations/show.blade.php
Normal file
48
Modules/Admin/resources/views/resignations/show.blade.php
Normal file
@ -0,0 +1,48 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="page-content">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!-- start page title -->
|
||||
@include('layouts.partials.breadcrumb', ['title' => $title])
|
||||
|
||||
<!-- end page title -->
|
||||
|
||||
<div class='card'>
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">View Detail</h5>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ route('designations.index') }}" class="btn btn-success waves-effect waves-light"><i
|
||||
class="ri-add-fill me-1 align-bottom"></i> Back to List</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class='card-body'>
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Status : </b> <span
|
||||
class="{{ $data->status == 1 ? 'text-success' : 'text-danger' }}">{{ $data->status == 1 ? 'Active' : 'Inactive' }}</span>
|
||||
</p>
|
||||
<p><b>Remarks : </b> <span>{{ $data->remarks }}</span></p>
|
||||
<p><b>Display Order : </b> <span>{{ $data->display_order }}</span></p>
|
||||
<p><b>Createdby : </b> <span>{{ $data->createdby }}</span></p>
|
||||
<p><b>Updatedby : </b> <span>{{ $data->updatedby }}</span></p>
|
||||
<p><b>Job Description : </b> <span>{{ $data->job_description }}</span></p>
|
||||
<p><b>Departments Id : </b> <span>{{ $data->departments_id }}</span></p>
|
||||
<div class="d-flex justify-content-between">
|
||||
<div>
|
||||
<p><b>Created On :</b> <span>{{ $data->created_at }}</span></p>
|
||||
<p><b>Created By :</b> <span>{{ $data->createdBy }}</span></p>
|
||||
</div>
|
||||
<div>
|
||||
<p><b>Updated On :</b> <span>{{ $data->updated_at }}</span></p>
|
||||
<p><b>Updated By :</b> <span>{{ $data->updatedBy }}</span></p>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endSection
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user