changes
196
app/Http/Controllers/AdcategoriesController.php
Normal file
@ -0,0 +1,196 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\AdCategoryRepository;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Adcategories;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Log;
|
||||
use Exception;
|
||||
|
||||
class AdcategoriesController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
protected $adCategoryRepository;
|
||||
public function __construct(Adcategories $model, AdCategoryRepository $adCategoryRepository)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
$this->adCategoryRepository = $adCategoryRepository;
|
||||
}
|
||||
public function index(Request $request)
|
||||
{
|
||||
createActivityLog(AdcategoriesController::class, 'index', ' Adcategories index');
|
||||
$data = Adcategories::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("crud.generated.adcategories.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
createActivityLog(AdcategoriesController::class, 'create', ' Adcategories create');
|
||||
$TableData = Adcategories::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
return view("crud.generated.adcategories.create", compact('TableData'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
createActivityLog(AdcategoriesController::class, 'store', ' Adcategories store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->mergeIfMissing([
|
||||
'alias' => Str::slug($request->title),
|
||||
]);
|
||||
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_adcategories')]);
|
||||
$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);
|
||||
});
|
||||
|
||||
$requestData['createdBy'] = Auth::user()->id;
|
||||
$requestData['updatedBy'] = Auth::user()->id;
|
||||
|
||||
$this->adCategoryRepository->create($requestData);
|
||||
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Adcategories Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('adcategories.index')->with('success', 'The Adcategories created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
{
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Adcategories::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 = Adcategories::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(AdcategoriesController::class, 'show', ' Adcategories show');
|
||||
$data = Adcategories::findOrFail($id);
|
||||
|
||||
return view("crud.generated.adcategories.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdcategoriesController::class, 'edit', ' Adcategories edit');
|
||||
$TableData = Adcategories::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Adcategories::findOrFail($id);
|
||||
if ($request->ajax()) {
|
||||
$html = view("crud.generated.adcategories.ajax.edit", compact('data'))->render();
|
||||
return response()->json(['status' => true, 'content' => $html], 200);
|
||||
}
|
||||
return view("crud.generated.adcategories.edit", compact('data', 'TableData'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdcategoriesController::class, 'update', ' Adcategories update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
|
||||
if ($validator->fails()) {
|
||||
return response()->json([
|
||||
'error' => $validator->errors(),
|
||||
], 500);
|
||||
}
|
||||
$request->mergeIfMissing([
|
||||
'alias' => Str::slug($request->title),
|
||||
]);
|
||||
|
||||
$filterData = $request->except(['_token', '_method']);
|
||||
array_walk_recursive($filterData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($filterData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
|
||||
$this->adCategoryRepository->update($id, $filterData);
|
||||
|
||||
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Adcategories updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('adcategories.index')->with('success','The Adcategories updated Successfully.');
|
||||
return redirect()->route('adcategories.index')->with('success', 'The Adcategories updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdcategoriesController::class, 'destroy', ' Adcategories destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
$this->modelService->destroy($OperationNumber, $OperationNumber, $id);
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(AdcategoriesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Adcategories Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdcategoriesController::class, 'destroy', ' Adcategories destroy');
|
||||
$data = Adcategories::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(AdcategoriesController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Adcategories Deleted Successfully.'], 200);
|
||||
}
|
||||
}
|
@ -5,43 +5,50 @@ namespace App\Http\Controllers;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\Repositories\AdvertisementRepository;
|
||||
use Illuminate\Http\Request;
|
||||
use App\Models\Advertisement;
|
||||
use App\Models\Advertisements;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use App\Service\CommonModelService;
|
||||
use Illuminate\Support\Str;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Log;
|
||||
use Exception;
|
||||
|
||||
class AdvertisementController extends Controller
|
||||
class AdvertisementsController extends Controller
|
||||
{
|
||||
protected $modelService;
|
||||
protected $advertisementRepository;
|
||||
|
||||
public function __construct(Advertisement $model, AdvertisementRepository $advertisementRepository)
|
||||
public function __construct(Advertisements $model, AdvertisementRepository $advertisementRepository)
|
||||
{
|
||||
$this->modelService = new CommonModelService($model);
|
||||
$this->advertisementRepository = $advertisementRepository;
|
||||
}
|
||||
|
||||
public function index(Request $request)
|
||||
{
|
||||
createActivityLog(AdvertisementController::class, 'index', ' Advertisement index');
|
||||
$data = Advertisement::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
createActivityLog(AdvertisementsController::class, 'index', ' Advertisements index');
|
||||
$data = Advertisements::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
|
||||
return view("crud.generated.advertisement.index", compact('data'));
|
||||
return view("crud.generated.advertisements.index", compact('data'));
|
||||
}
|
||||
|
||||
public function create(Request $request)
|
||||
{
|
||||
createActivityLog(AdvertisementController::class, 'create', ' Advertisement create');
|
||||
$TableData = Advertisement::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
return view("crud.generated.advertisement.create", compact('TableData'));
|
||||
createActivityLog(AdvertisementsController::class, 'create', ' Advertisements create');
|
||||
// $sectionData = [
|
||||
// 'topbar' => 'Topbar',
|
||||
// 'sidebar' => 'Sidebar',
|
||||
// 'featuredNews' => 'Featured News',
|
||||
// ''
|
||||
// ]
|
||||
|
||||
$TableData = Advertisements::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
return view("crud.generated.advertisements.create", compact('TableData'));
|
||||
}
|
||||
|
||||
public function store(Request $request)
|
||||
{
|
||||
createActivityLog(AdvertisementController::class, 'store', ' Advertisement store');
|
||||
createActivityLog(AdvertisementsController::class, 'store', ' Advertisements store');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD REQUIRED FIELDS FOR VALIDATION
|
||||
]);
|
||||
@ -56,7 +63,7 @@ class AdvertisementController extends Controller
|
||||
'alias' => Str::slug($request->title),
|
||||
]);
|
||||
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_advertisement')]);
|
||||
$request->request->add(['display_order' => getDisplayOrder('tbl_advertisements')]);
|
||||
$requestData = $request->all();
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
@ -64,22 +71,15 @@ class AdvertisementController extends Controller
|
||||
array_walk_recursive($requestData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
$requestData['createdBy'] = Auth::user()->id;
|
||||
$requestData['updatedBy'] = Auth::user()->id;
|
||||
$requestData['createdby'] = Auth::user()->id;
|
||||
$requestData['updatedby'] = Auth::user()->id;
|
||||
|
||||
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);
|
||||
});
|
||||
|
||||
$this->advertisementRepository->create($requestData);
|
||||
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Advertisement Created Successfully.'], 200);
|
||||
return response()->json(['status' => true, 'message' => 'The Advertisements Created Successfully.'], 200);
|
||||
}
|
||||
return redirect()->route('advertisement.index')->with('success', 'The Advertisement created Successfully.');
|
||||
return redirect()->route('advertisements.index')->with('success', 'The Advertisements created Successfully.');
|
||||
}
|
||||
|
||||
public function sort(Request $request)
|
||||
@ -87,7 +87,7 @@ class AdvertisementController extends Controller
|
||||
$idOrder = $request->input('id_order');
|
||||
|
||||
foreach ($idOrder as $index => $id) {
|
||||
$companyArticle = Advertisement::find($id);
|
||||
$companyArticle = Advertisements::find($id);
|
||||
$companyArticle->display_order = $index + 1;
|
||||
$companyArticle->save();
|
||||
}
|
||||
@ -99,7 +99,7 @@ class AdvertisementController extends Controller
|
||||
|
||||
$articleId = $request->input('articleId');
|
||||
$newAlias = $request->input('newAlias');
|
||||
$companyArticle = Advertisement::find($articleId);
|
||||
$companyArticle = Advertisements::find($articleId);
|
||||
if (!$companyArticle) {
|
||||
return response()->json(['status' => false, 'content' => 'Company article not found.'], 404);
|
||||
}
|
||||
@ -113,29 +113,29 @@ class AdvertisementController extends Controller
|
||||
|
||||
public function show(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdvertisementController::class, 'show', ' Advertisement show');
|
||||
$data = Advertisement::findOrFail($id);
|
||||
createActivityLog(AdvertisementsController::class, 'show', ' Advertisements show');
|
||||
$data = Advertisements::findOrFail($id);
|
||||
|
||||
return view("crud.generated.advertisement.show", compact('data'));
|
||||
return view("crud.generated.advertisements.show", compact('data'));
|
||||
}
|
||||
|
||||
|
||||
public function edit(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdvertisementController::class, 'edit', ' Advertisement edit');
|
||||
$TableData = Advertisement::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Advertisement::findOrFail($id);
|
||||
createActivityLog(AdvertisementsController::class, 'edit', ' Advertisements edit');
|
||||
$TableData = Advertisements::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
$data = Advertisements::findOrFail($id);
|
||||
if ($request->ajax()) {
|
||||
$html = view("crud.generated.advertisement.ajax.edit", compact('data'))->render();
|
||||
$html = view("crud.generated.advertisements.ajax.edit", compact('data'))->render();
|
||||
return response()->json(['status' => true, 'content' => $html], 200);
|
||||
}
|
||||
return view("crud.generated.advertisement.edit", compact('data', 'TableData'));
|
||||
return view("crud.generated.advertisements.edit", compact('data', 'TableData'));
|
||||
}
|
||||
|
||||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdvertisementController::class, 'update', ' Advertisement update');
|
||||
createActivityLog(AdvertisementsController::class, 'update', ' Advertisements update');
|
||||
$validator = Validator::make($request->all(), [
|
||||
//ADD VALIDATION FOR REQIRED FIELDS
|
||||
]);
|
||||
@ -148,26 +148,27 @@ class AdvertisementController extends Controller
|
||||
$request->mergeIfMissing([
|
||||
'alias' => Str::slug($request->title),
|
||||
]);
|
||||
$filterData = $request->except('_method', '_token');
|
||||
|
||||
|
||||
$filterData = $request->except(['_method', '_token']);
|
||||
array_walk_recursive($filterData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL') . '/', '', $value);
|
||||
});
|
||||
array_walk_recursive($filterData, function (&$value) {
|
||||
$value = str_replace(env('APP_URL'), '', $value);
|
||||
});
|
||||
|
||||
$this->advertisementRepository->update($filterData, $id);
|
||||
$this->advertisementRepository->update($id, $filterData);
|
||||
|
||||
if ($request->ajax()) {
|
||||
return response()->json(['status' => true, 'message' => 'The Advertisement updated Successfully.'], 200);
|
||||
return response()->json(['status' => true, 'message' => 'The Advertisements updated Successfully.'], 200);
|
||||
}
|
||||
// return redirect()->route('advertisement.index')->with('success','The Advertisement updated Successfully.');
|
||||
return redirect()->route('advertisement.index')->with('success', 'The Advertisement updated successfully.');
|
||||
// return redirect()->route('advertisements.index')->with('success','The Advertisements updated Successfully.');
|
||||
return redirect()->route('advertisements.index')->with('success', 'The Advertisements updated successfully.');
|
||||
}
|
||||
|
||||
public function destroy(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdvertisementController::class, 'destroy', ' Advertisement destroy');
|
||||
createActivityLog(AdvertisementsController::class, 'destroy', ' Advertisements destroy');
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
$OperationNumber = getOperationNumber();
|
||||
@ -175,16 +176,16 @@ class AdvertisementController extends Controller
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(AdvertisementController::class, 'destroy', $e->getMessage());
|
||||
createErrorLog(AdvertisementsController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Advertisement Deleted Successfully.'], 200);
|
||||
return response()->json(['status' => true, 'message' => 'The Advertisements Deleted Successfully.'], 200);
|
||||
}
|
||||
public function toggle(Request $request, $id)
|
||||
{
|
||||
createActivityLog(AdvertisementController::class, 'destroy', ' Advertisement destroy');
|
||||
$data = Advertisement::findOrFail($id);
|
||||
createActivityLog(AdvertisementsController::class, 'destroy', ' Advertisements destroy');
|
||||
$data = Advertisements::findOrFail($id);
|
||||
$requestData = ['status' => ($data->status == 1) ? 0 : 1];
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
@ -193,10 +194,10 @@ class AdvertisementController extends Controller
|
||||
} catch (Exception $e) {
|
||||
DB::rollBack();
|
||||
Log::info($e->getMessage());
|
||||
createErrorLog(AdvertisementController::class, 'destroy', $e->getMessage());
|
||||
createErrorLog(AdvertisementsController::class, 'destroy', $e->getMessage());
|
||||
return response()->json(['status' => false, 'message' => $e->getMessage()], 500);
|
||||
}
|
||||
DB::commit();
|
||||
return response()->json(['status' => true, 'message' => 'The Advertisement Deleted Successfully.'], 200);
|
||||
return response()->json(['status' => true, 'message' => 'The Advertisements Deleted Successfully.'], 200);
|
||||
}
|
||||
}
|
@ -31,6 +31,7 @@ class MenuitemsController extends Controller
|
||||
['display' => "Provinces", 'value' => "tbl_provinces"],
|
||||
['display' => "Articles", 'value' => "tbl_articles"],
|
||||
['display' => "Teams", 'value' => "tbl_teams"],
|
||||
['display' => "Videos", 'value' => "tbl_videos"],
|
||||
|
||||
|
||||
['display' => "Custom", 'value' => ""],
|
||||
@ -59,6 +60,9 @@ class MenuitemsController extends Controller
|
||||
case 'tbl_teams':
|
||||
$menuType['values'] = json_encode(DB::select("select team_id as value,title as display from " . $menuType['value'] . " where status=1 Order by title"));
|
||||
break;
|
||||
case 'tbl_videos':
|
||||
$menuType['values'] = json_encode(DB::select("select video_id as value,title as display from " . $menuType['value'] . " where status=1 Order by title"));
|
||||
break;
|
||||
|
||||
default:
|
||||
$menuType['values'] = "";
|
||||
|
@ -110,7 +110,9 @@ class WebsiteController extends Controller
|
||||
|
||||
public function showVideos()
|
||||
{
|
||||
dd('test');
|
||||
$videos = Videos::where('status', 1)->orderBy('display_order')->paginate(7);
|
||||
// dd($videos->toArray());
|
||||
return view($this->path . '.video', compact('videos'));
|
||||
}
|
||||
|
||||
public function showAboutus($alias)
|
||||
|
@ -8,26 +8,19 @@ use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
|
||||
class Advertisement extends Model
|
||||
class Adcategories extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
protected $primaryKey = 'advertisement_id';
|
||||
protected $table = 'advertisement';
|
||||
protected $primaryKey = 'category_id';
|
||||
public $timestamps = true;
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'parent_id',
|
||||
'alias',
|
||||
'description',
|
||||
'image',
|
||||
'video',
|
||||
'link',
|
||||
'display_order',
|
||||
'status',
|
||||
'remarks',
|
||||
'created_by',
|
||||
'updated_by',
|
||||
'display_order',
|
||||
'createdBy',
|
||||
'updatedBy',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
|
53
app/Models/Advertisements.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?php
|
||||
namespace App\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
|
||||
class Advertisements extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
protected $primaryKey = 'advertisement_id';
|
||||
public $timestamps = true;
|
||||
protected $fillable =[
|
||||
'title',
|
||||
'section',
|
||||
'alias',
|
||||
'parent_advertisement',
|
||||
'thumb',
|
||||
'link',
|
||||
'display_order',
|
||||
'status',
|
||||
'remarks',
|
||||
'createdBy',
|
||||
'updatedBy',
|
||||
'created_at',
|
||||
'updated_at',
|
||||
|
||||
];
|
||||
|
||||
protected $appends = ['status_name'];
|
||||
|
||||
protected function getStatusNameAttribute()
|
||||
{
|
||||
return $this->status == 1 ? '<span class="badge text-bg-success-soft"> Active </span>' : '<span class="badge text-bg-danger-soft">Inactive</span>';
|
||||
}
|
||||
|
||||
protected function createdBy(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
|
||||
);
|
||||
}
|
||||
|
||||
protected function updatedBy(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn ($value) => User::find($value) ? User::find($value)->name : '',
|
||||
);
|
||||
}
|
||||
}
|
@ -19,6 +19,7 @@ class Videos extends Model
|
||||
'video_url',
|
||||
'image',
|
||||
'alias',
|
||||
'description',
|
||||
'status',
|
||||
'display_order',
|
||||
'createdBy',
|
||||
|
19
app/Repositories/AdCategoryRepository.php
Normal file
@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Adcategories;
|
||||
use App\Repositories\Interface\AdCategoriesInterface;
|
||||
|
||||
|
||||
class AdCategoryRepository implements AdCategoriesInterface
|
||||
{
|
||||
public function create(array $adCategoriesDetail)
|
||||
{
|
||||
return Adcategories::create($adCategoriesDetail);
|
||||
}
|
||||
public function update($adCategoryId, array $newDetails)
|
||||
{
|
||||
return Adcategories::where('category_id', $adCategoryId)->update($newDetails);
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@
|
||||
|
||||
namespace App\Repositories;
|
||||
|
||||
use App\Models\Advertisement;
|
||||
use App\Models\Advertisements;
|
||||
use App\Repositories\Interface\AdvertisementInterface;
|
||||
|
||||
|
||||
@ -11,25 +11,25 @@ class AdvertisementRepository implements AdvertisementInterface
|
||||
|
||||
public function getAll()
|
||||
{
|
||||
return Advertisement::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
return Advertisements::where('status', '<>', -1)->orderBy('display_order')->get();
|
||||
}
|
||||
|
||||
public function getAdvertisementById($advertisementId)
|
||||
{
|
||||
return Advertisement::where('advertisement_id', $advertisementId)->first();
|
||||
return Advertisements::where('advertisement_id', $advertisementId)->first();
|
||||
}
|
||||
|
||||
public function delete($advertisementId)
|
||||
{
|
||||
return Advertisement::where('advertisement_id', $advertisementId)->delete();
|
||||
return Advertisements::where('advertisement_id', $advertisementId)->delete();
|
||||
}
|
||||
|
||||
public function create(array $newData)
|
||||
{
|
||||
return Advertisement::create($newData);
|
||||
return Advertisements::create($newData);
|
||||
}
|
||||
public function update($advertisementId, array $newDetails)
|
||||
{
|
||||
return Advertisement::where('advertisement_id', $advertisementId)->update($newDetails);
|
||||
return Advertisements::where('advertisement_id', $advertisementId)->update($newDetails);
|
||||
}
|
||||
}
|
||||
|
9
app/Repositories/Interface/AdCategoriesInterface.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repositories\Interface;
|
||||
|
||||
interface AdCategoriesInterface
|
||||
{
|
||||
public function create(array $adCategoriesDetail);
|
||||
public function update($adCategoryId, array $newDetails);
|
||||
}
|
@ -50,7 +50,7 @@ return [
|
||||
'file' => [
|
||||
'folder_name' => 'files',
|
||||
'startup_view' => 'list',
|
||||
'max_size' => 50000, // size in KB
|
||||
'max_size' => 500000, // size in KB
|
||||
'thumb' => true,
|
||||
'thumb_width' => 80,
|
||||
'thumb_height' => 80,
|
||||
@ -66,7 +66,7 @@ return [
|
||||
'image' => [
|
||||
'folder_name' => 'photos',
|
||||
'startup_view' => 'grid',
|
||||
'max_size' => 50000, // size in KB
|
||||
'max_size' => 500000, // size in KB
|
||||
'thumb' => true,
|
||||
'thumb_width' => 80,
|
||||
'thumb_height' => 80,
|
||||
@ -176,5 +176,6 @@ return [
|
||||
*/
|
||||
'php_ini_overrides' => [
|
||||
'memory_limit' => '256M',
|
||||
|
||||
],
|
||||
];
|
||||
|
@ -11,14 +11,13 @@ return new class extends Migration
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('advertisement', function (Blueprint $table) {
|
||||
Schema::create('advertisements', function (Blueprint $table) {
|
||||
$table->id('advertisement_id');
|
||||
$table->string('title',255)->nullable();
|
||||
$table->integer('ad_categories_id')->nullable();
|
||||
$table->string('alias',255)->nullable();
|
||||
$table->integer('parent_advertisement');
|
||||
$table->text('description')->nullable();
|
||||
$table->string('image',255)->nullable();
|
||||
$table->string('video',255)->nullable();
|
||||
$table->string('thumb',255)->nullable();
|
||||
$table->string('link',255)->nullable();
|
||||
$table->integer('display_order')->default(1);
|
||||
$table->integer('status')->default(1);
|
||||
|
@ -0,0 +1,28 @@
|
||||
<?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::table('videos', function (Blueprint $table) {
|
||||
$table->text('description')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('videos', function (Blueprint $table) {
|
||||
$table->dropColumn(['description']);
|
||||
});
|
||||
}
|
||||
};
|
@ -0,0 +1,32 @@
|
||||
<?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('adcategories', function (Blueprint $table) {
|
||||
$table->id('category_id');
|
||||
$table->string('title')->nullable();
|
||||
$table->integer('status')->default(1);
|
||||
$table->integer('display_order')->default(1);
|
||||
$table->integer('createdBy')->nullable();
|
||||
$table->integer('updatedBy')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('adcategories');
|
||||
}
|
||||
};
|
@ -0,0 +1,28 @@
|
||||
<?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::table('adcategories', function (Blueprint $table) {
|
||||
$table->string('alias')->nullable()->after('title');
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::table('adcategories', function (Blueprint $table) {
|
||||
$table->dropColumn(['alias']);
|
||||
});
|
||||
}
|
||||
};
|
@ -86,12 +86,13 @@
|
||||
{{ CCMS::createMenuLink('News Categories', route('newscategories.index')) }}
|
||||
{{ CCMS::createMenuLink('News', route('news.index')) }}
|
||||
{{ CCMS::createMenuLink('Authors', route('authors.index')) }}
|
||||
{{ CCMS::createMenuLink('Advertisement', route('advertisement.index')) }}
|
||||
{{ CCMS::createMenuLink('Economy', route('economies.index')) }}
|
||||
{{ CCMS::createMenuLink('Videos', route('videos.index')) }}
|
||||
{{ CCMS::createMenuLink('Horoscope', route('horoscope.index')) }}
|
||||
{{ CCMS::createMenuLink('Artilces', route('articles.index')) }}
|
||||
{{ CCMS::createMenuLink('Teams', route('teams.index')) }}
|
||||
{{ CCMS::createMenuLink('Advertisements', route('advertisements.index')) }}
|
||||
{{ CCMS::createMenuLink('Ad Category', route('adcategories.index')) }}
|
||||
|
||||
</div>
|
||||
|
||||
|
21
resources/views/crud/generated/adcategories/create.blade.php
Normal file
@ -0,0 +1,21 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Ad-Category') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('adcategories.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('adcategories.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('adcategories.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
21
resources/views/crud/generated/adcategories/edit.blade.php
Normal file
@ -0,0 +1,21 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Ad-Category') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('adcategories.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('adcategories.update', [$data->category_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='category_id' value='{{ $data->category_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('adcategories.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
242
resources/views/crud/generated/adcategories/index.blade.php
Normal file
@ -0,0 +1,242 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Adcategories List') }}</h2>
|
||||
<a href="{{ route('adcategories.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_adcategories" data-url="{{ route('adcategories.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>
|
||||
@php
|
||||
$i = 1;
|
||||
@endphp
|
||||
@foreach ($data as $item)
|
||||
<tr data-id="{{ $item->category_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->category_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->category_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('adcategories.show', [$item->category_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('adcategories.edit', [$item->category_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('adcategories.toggle', [$item->category_id]) }}"
|
||||
class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('adcategories.destroy', [$item->category_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('adcategories.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
|
@ -3,15 +3,15 @@
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('advertisement.index')); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('adcategories.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Parent Advertisement : </b> <span>{{$data->parent_advertisement}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Description : </b> <span>{{$data->description}}</span></p><p><b>Image : </b> <span>{{$data->image}}</span></p><p><b>Video : </b> <span>{{$data->video}}</span></p><p><b>Link : </b> <span>{{$data->link}}</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>Created By : </b> <span>{{$data->created_by}}</span></p><p><b>Updated By : </b> <span>{{$data->updated_by}}</span></p><div class="d-flex justify-content-between">
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Status : </b> <span
|
||||
class="{{$data->status == 1 ? 'text-success' : 'text-danger'}}">{{$data->status == 1 ? 'Active' : 'Inactive'}}</span></p><p><b>Display Order : </b> <span>{{$data->display_order}}</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>
|
@ -1,247 +0,0 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Advertisement List") }}</h2>
|
||||
<a href="{{ route('advertisement.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_advertisement" data-url="{{ route('advertisement.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("Parent") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("image") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("video") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("link") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("created_by") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("updated_by") }}</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->advertisement_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">
|
||||
{!! getFieldData("tbl_advertisement", "title", "advertisement_id", $item->parent_id) !!}
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->advertisement_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->advertisement_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->image) }}</td>
|
||||
<td class="tb-col">{{ $item->video }}</td>
|
||||
<td class="tb-col">{{ $item->link }}</td>
|
||||
<td class="tb-col">{{ $item->created_by }}</td>
|
||||
<td class="tb-col">{{ $item->updated_by }}</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('advertisement.show',[$item->advertisement_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('advertisement.edit',[$item->advertisement_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('advertisement.toggle',[$item->advertisement_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('advertisement.destroy',[$item->advertisement_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('advertisement.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
|
||||
|
@ -3,31 +3,29 @@
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Advertisement') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('advertisement.index')); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('advertisements.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('advertisement.store') }}" id="storeCustomForm" method="POST">
|
||||
<form action="{{ route('advertisements.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_advertisement', 'title', 'advertisement_id', '', 'Parent Advertisement', 'parent_advertisement', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image', 'Image') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('video', 'video', 'Video') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('link', 'link', 'Link') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createCustomSelect('tbl_adcategories', 'title', 'category_id','', 'Category Id', 'ad_categories_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_advertisements', 'title', 'advertisement_id', '', 'Parent Advertisement', 'parent_advertisement', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb') }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks ', 'Remarks') }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('advertisement.index')); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('advertisements.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
@ -3,31 +3,30 @@
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Advertisement') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('advertisement.index')); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('advertisements.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{ route('advertisement.update', [$data->advertisement_id]) }}" id="updateCustomForm" method="POST">
|
||||
<form action="{{ route('advertisements.update', [$data->advertisement_id]) }}" id="updateCustomForm"
|
||||
method="POST">
|
||||
@csrf <input type=hidden name='advertisement_id' value='{{ $data->advertisement_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_advertisement', 'title', 'advertisement_id', $data->parent_advertisement, 'Parent Advertisement', 'parent_advertisement', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">
|
||||
{{ createTextarea('description', 'description ckeditor-classic', 'Description', $data->description) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image', 'Image', '', $data->image) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('video', 'video', 'Video', '', $data->video) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('link', 'link', 'Link', '', $data->link) }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createCustomSelect('tbl_adcategories', 'title', 'category_id',$data->ad_categories_id, 'Category Id', 'ad_categories_id', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_advertisements', 'title', 'advertisement_id', $data->parent_advertisement, 'Parent Advertisement', 'parent_advertisement', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('thumb', 'Thumb', '', $data->thumb) }}
|
||||
</div>
|
||||
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $data->remarks) }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('advertisement.index')); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('advertisements.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
256
resources/views/crud/generated/advertisements/index.blade.php
Normal file
@ -0,0 +1,256 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Advertisements List') }}</h2>
|
||||
<a href="{{ route('advertisements.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_advertisements" data-url="{{ route('advertisements.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('section') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Parent') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('thumb') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('link') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('createdBy') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('updatedBy') }}</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->advertisement_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">{{ $item->section }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->advertisement_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->advertisement_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_advertisements', 'title', 'advertisement_id', $item->parent_advertisement) !!}
|
||||
</td>
|
||||
<td class="tb-col">{{ showImageThumb($item->thumb) }}</td>
|
||||
<td class="tb-col">{{ $item->link }}</td>
|
||||
<td class="tb-col">{{ $item->createdBy }}</td>
|
||||
<td class="tb-col">{{ $item->updatedBy }}</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('advertisements.show', [$item->advertisement_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('advertisements.edit', [$item->advertisement_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('advertisements.toggle', [$item->advertisement_id]) }}"
|
||||
class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('advertisements.destroy', [$item->advertisement_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('advertisements.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
|
38
resources/views/crud/generated/advertisements/show.blade.php
Normal file
@ -0,0 +1,38 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('advertisements.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Section : </b> <span>{{ $data->section }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Parent Advertisement : </b> <span>{{ $data->parent_advertisement }}</span></p>
|
||||
<p><b>Thumb : </b> <span>{{ $data->thumb }}</span></p>
|
||||
<p><b>Link : </b> <span>{{ $data->link }}</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>
|
||||
<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
|
@ -1,18 +1,28 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Add Newscategories') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('newscategories.index')); ?>
|
||||
<h2 class="">{{ label('Add Newscategories') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('newscategories.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('newscategories.store')}}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title")}}
|
||||
</div><div class="col-lg-6">{{createText("nepali_title","nepali_title","Nepali Title")}}
|
||||
</div><div class="col-lg-6">{{createCustomSelect('tbl_newscategories', 'title', 'category_id', '', 'Parent Category','parent_category', 'form-control select2','status<>-1')}}</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks","remarks ","Remarks")}}
|
||||
</div> <br> <div class="col-md-12"><?php createButton("btn-primary btn-store","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('newscategories.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
||||
<form action="{{ route('newscategories.store') }}" id="storeCustomForm" method="POST">
|
||||
@csrf
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('title', 'title', 'Title') }}
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('nepali_title', 'nepali_title', 'Nepali Title') }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_newscategories', 'title', 'category_id', '', 'Parent Category', 'parent_category', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', 'remarks ', 'Remarks') }}
|
||||
</div> <br>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('newscategories.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
@ -1,18 +1,29 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2 class="">{{ label('Edit Newscategories') }}</h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('newscategories.index')); ?>
|
||||
<h2 class="">{{ label('Edit News Category') }}</h2>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('newscategories.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
<form action="{{route('newscategories.update',[$data->category_id])}}" id="updateCustomForm" method="POST" >
|
||||
@csrf <input type=hidden name='category_id' value='{{$data->category_id}}'/>
|
||||
<div class="row"><div class="col-lg-6">{{createText("title","title","Title",'',$data->title)}}
|
||||
</div><div class="col-lg-6">{{createText("nepali_title","nepali_title","Nepali Title",'',$data->nepali_title)}}
|
||||
</div><div class="col-lg-6">{{createCustomSelect('tbl_newscategories', 'title', 'category_id', $data->parent_category, 'Parent Category','parent_category', 'form-control select2','status<>-1')}}</div><div class="col-lg-12 pb-2">{{createPlainTextArea("remarks",'',"Remarks",$data->remarks)}}
|
||||
</div> <div class="col-md-12"><?php createButton("btn-primary btn-update","","Submit"); ?>
|
||||
<?php createButton("btn-primary btn-cancel","","Cancel",route('newscategories.index')); ?>
|
||||
</div> </form></div></div>
|
||||
@endsection
|
||||
<form action="{{ route('newscategories.update', [$data->category_id]) }}" id="updateCustomForm" method="POST">
|
||||
@csrf <input type=hidden name='category_id' value='{{ $data->category_id }}' />
|
||||
<div class="row">
|
||||
<div class="col-lg-6">{{ createText('title', 'title', 'Title', '', $data->title) }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createText('nepali_title', 'nepali_title', 'Nepali Title', '', $data->nepali_title) }}
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
{{ createCustomSelect('tbl_newscategories', 'title', 'category_id', $data->parent_category, 'Parent Category', 'parent_category', 'form-control select2', 'status<>-1') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createPlainTextArea('remarks', '', 'Remarks', $data->remarks) }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('newscategories.index')); ?>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
@ -1,239 +1,248 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label("Newscategories List") }}</h2>
|
||||
<a href="{{ route('newscategories.create') }}" class="btn btn-primary"><span>{{label("Create New")}}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_newscategories" data-url="{{ route('newscategories.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("nepali_title") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("alias") }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label("Parent") }}</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->category_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">{{ $item->nepali_title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{$item->category_id}}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}" id="alias_{{$item->category_id}}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData("tbl_newscategories", "title", "category_id", $item->parent_category) !!}
|
||||
</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('newscategories.show',[$item->category_id])}}" class="dropdown-item"><i class="ri-eye-fill align-bottom me-2 text-muted"></i> {{label("View")}}</a></li>
|
||||
<li><a href="{{route('newscategories.edit',[$item->category_id])}}" class="dropdown-item edit-item-btn"><i class="ri-pencil-fill align-bottom me-2 text-muted"></i> {{label("Edit")}}</a></li>
|
||||
<li>
|
||||
<a href="{{route('newscategories.toggle',[$item->category_id])}}" class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i> {{ ($item->status==1)?label('Unpublish'):label('Publish') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{route('newscategories.destroy',[$item->category_id])}}" class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i> {{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
</tr>
|
||||
<div class="card">
|
||||
<div class="card-header d-flex justify-content-between align-items-center">
|
||||
<h2>{{ label('Newscategories List') }}</h2>
|
||||
<a href="{{ route('newscategories.create') }}" class="btn btn-primary"><span>{{ label('Create New') }}</span></a>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table dataTable" id="tbl_newscategories" data-url="{{ route('newscategories.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('nepali_title') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('alias') }}</span></th>
|
||||
<th class="tb-col"><span class="overline-title">{{ label('Parent') }}</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->category_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">{{ $item->nepali_title }}</td>
|
||||
<td class="tb-col">
|
||||
<div class="alias-wrapper" data-id="{{ $item->category_id }}">
|
||||
<span class="alias">{{ $item->alias }}</span>
|
||||
<input type="text" class="alias-input d-none" value="{{ $item->alias }}"
|
||||
id="alias_{{ $item->category_id }}" />
|
||||
</div>
|
||||
<span class="badge badge-soft-primary change-alias-badge">change alias</span>
|
||||
</td>
|
||||
<td class="tb-col">
|
||||
{!! getFieldData('tbl_newscategories', 'title', 'category_id', $item->parent_category) !!}
|
||||
</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('newscategories.show', [$item->category_id]) }}"
|
||||
class="dropdown-item"><i
|
||||
class="ri-eye-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('View') }}</a></li>
|
||||
<li><a href="{{ route('newscategories.edit', [$item->category_id]) }}"
|
||||
class="dropdown-item edit-item-btn"><i
|
||||
class="ri-pencil-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Edit') }}</a></li>
|
||||
<li>
|
||||
<a href="{{ route('newscategories.toggle', [$item->category_id]) }}"
|
||||
class="dropdown-item toggle-item-btn" onclick="confirmToggle(this.href)">
|
||||
<i class="ri-article-fill align-bottom me-2 text-muted"></i>
|
||||
{{ $item->status == 1 ? label('Unpublish') : label('Publish') }}
|
||||
</a>
|
||||
|
||||
@endforeach
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ route('newscategories.destroy', [$item->category_id]) }}"
|
||||
class="dropdown-item remove-item-btn" onclick="confirmDelete(this.href)">
|
||||
<i class="ri-delete-bin-fill align-bottom me-2 text-muted"></i>
|
||||
{{ label('Delete') }}
|
||||
</a>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@push("css")
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/1.13.5/css/dataTables.bootstrap4.min.css">
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/rowreorder/1.4.0/css/rowReorder.dataTables.min.css">
|
||||
@endpush
|
||||
@push("js")
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
@push('js')
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/pdfmake.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/pdfmake/0.1.68/vfs_fonts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.13.5/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/2.4.1/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/rowreorder/1.4.0/js/dataTables.rowReorder.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
|
||||
|
||||
|
||||
<script>
|
||||
$(document).ready(function(e) {
|
||||
$('.change-alias-badge').on('click', function() {
|
||||
var aliasWrapper = $(this).prev('.alias-wrapper');
|
||||
var aliasSpan = aliasWrapper.find('.alias');
|
||||
var aliasInput = aliasWrapper.find('.alias-input');
|
||||
var isEditing = $(this).hasClass('editing');
|
||||
aliasInput.toggleClass("d-none");
|
||||
if (isEditing) {
|
||||
// Update alias text and switch to non-editing state
|
||||
var newAlias = aliasInput.val();
|
||||
aliasSpan.text(newAlias);
|
||||
aliasSpan.show();
|
||||
aliasInput.hide();
|
||||
$(this).removeClass('editing').text('Change Alias');
|
||||
var articleId = $(aliasWrapper).data('id');
|
||||
var ajaxUrl = "{{ route('newscategories.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);
|
||||
<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('newscategories.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');
|
||||
}
|
||||
});
|
||||
} 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')
|
||||
var mytable = $(".dataTable").DataTable({
|
||||
ordering: true,
|
||||
rowReorder: {
|
||||
//selector: 'tr'
|
||||
},
|
||||
data: {
|
||||
id_order: ids
|
||||
},
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(error);
|
||||
});
|
||||
|
||||
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;
|
||||
}
|
||||
});
|
||||
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 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 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>
|
||||
|
||||
|
||||
</script>
|
||||
@endpush
|
||||
|
@ -1,29 +1,38 @@
|
||||
@extends('backend.template')
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
@section('content')
|
||||
<div class='card'>
|
||||
<div class='card-header d-flex justify-content-between align-items-center'>
|
||||
<h2><?php echo label('View Details'); ?></h2>
|
||||
<?php createButton("btn-primary btn-cancel","","Back to List",route('newscategories.index')); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Back to List', route('newscategories.index')); ?>
|
||||
|
||||
</div>
|
||||
<div class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{$data->title}}</span></p><p><b>Nepali Title : </b> <span>{{$data->nepali_title}}</span></p><p><b>Alias : </b> <span>{{$data->alias}}</span></p><p><b>Parent Category : </b> <span>{{$data->parent_category}}</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 class='card-body'>
|
||||
|
||||
|
||||
|
||||
<p><b>Title : </b> <span>{{ $data->title }}</span></p>
|
||||
<p><b>Nepali Title : </b> <span>{{ $data->nepali_title }}</span></p>
|
||||
<p><b>Alias : </b> <span>{{ $data->alias }}</span></p>
|
||||
<p><b>Parent Category : </b> <span>{{ $data->parent_category }}</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
|
||||
@endSection
|
||||
|
@ -14,7 +14,9 @@
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('video_url', 'video_url', 'Video Url') }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image', 'Image') }}
|
||||
<div class="col-lg-12 pb-4">{{ createTextarea('description', 'description ckeditor-classic', 'Description') }}
|
||||
</div>
|
||||
<div class="col-lg-6 pb-2">{{ createImageInput('image', 'Image') }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-store', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('videos.index')); ?>
|
||||
|
@ -14,7 +14,9 @@
|
||||
</div>
|
||||
<div class="col-lg-6">{{ createText('video_url', 'video_url', 'Video Url', '', $data->video_url) }}
|
||||
</div>
|
||||
<div class="col-lg-12 pb-2">{{ createImageInput('image', 'Image', '', $data->image) }}
|
||||
<div class="col-lg-12 pb-4">{{ createTextarea('description', 'description ckeditor-classic', 'Description', $data->description) }}
|
||||
</div>
|
||||
<div class="col-lg-6 pb-2">{{ createImageInput('image', 'Image', '', $data->image) }}
|
||||
</div>
|
||||
<div class="col-md-12"><?php createButton('btn-primary btn-update', '', 'Submit'); ?>
|
||||
<?php createButton('btn-primary btn-cancel', '', 'Cancel', route('videos.index')); ?>
|
||||
|
@ -4,7 +4,7 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<a href="news-details.php">
|
||||
<img src="{{asset('hulaki/assets/img/ad/Kicks_Desktop_1230x100-px_new.jpg')}}" alt="image" class="img-fluid">
|
||||
<img src="{{asset('hulaki/assets/img/add/ads7.gif')}}" alt="image" class="img-fluid">
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -100,7 +100,7 @@
|
||||
</section>
|
||||
<section class="widget widget_featured_reports">
|
||||
<div class=" col-lg-10" style=" margin-left: 10%;">
|
||||
<img src="{{ asset('hulaki/assets/img/add/ads6.gif"') }} alt="image-fluid">
|
||||
<img src="{{ asset('hulaki/assets/img/add/ads6.gif') }}" alt="image-fluid">
|
||||
</div>
|
||||
</section>
|
||||
</aside>
|
||||
|
@ -20,7 +20,7 @@
|
||||
|
||||
<section class="widget widget_featured_reports mb-50">
|
||||
@foreach ($internationalNews as $type)
|
||||
@if ($type->alias == 'international' && $loop->first)
|
||||
@if ($type->alias == 'atararashhataraya' && $loop->first)
|
||||
@foreach ($type->news->take(1) as $item)
|
||||
<div class="single-featured-reports">
|
||||
<div class="featured-reports-image">
|
||||
@ -42,7 +42,7 @@
|
||||
|
||||
<div class="row">
|
||||
@foreach ($internationalNews as $type)
|
||||
@if ($type->alias == 'international' && $loop->first)
|
||||
@if ($type->alias == 'atararashhataraya')
|
||||
@foreach ($type->news->skip(1) as $item)
|
||||
<div class="col-lg-6">
|
||||
<div class="most-popular-post">
|
||||
|
@ -35,4 +35,5 @@
|
||||
@endif
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<!-- End Main News Area -->
|
@ -73,10 +73,9 @@
|
||||
<div class="col-lg-6">
|
||||
<nav class="navbar navbar-expand-sm navbar-light">
|
||||
<a class="navbar-brand" href="index.php">
|
||||
<img src="{{ asset('hulaki/assets/img/logo.gif') }}" class="black-logo" alt="image"
|
||||
<img src="<?php echo asset(SITEVARS->primary_logo); ?>" class="black-logo" alt="image"
|
||||
style="margin-left: -20px;max-width: 350px; height: auto; display: block;">
|
||||
<img src="{{ asset('hulaki/assets/img/logo.gif') }}" class="white-logo" alt="image"
|
||||
style="margin-left: -20px;">
|
||||
<img src="<?php echo asset(SITEVARS->secondary_logo); ?>" class="white-logo" alt="image" style="margin-left: -20px;">
|
||||
</a>
|
||||
</nav>
|
||||
</div>
|
||||
@ -198,6 +197,11 @@
|
||||
@endphp
|
||||
@break
|
||||
|
||||
@case('tbl_videos')
|
||||
@php
|
||||
$subMenu->link = route('showVideos') @endphp
|
||||
@break
|
||||
|
||||
@default
|
||||
@php
|
||||
$subMenu->link =
|
||||
|
103
resources/views/hulaki_khabar/video.blade.php
Normal file
@ -0,0 +1,103 @@
|
||||
@extends('hulaki_khabar.layout.layout')
|
||||
|
||||
@section('content')
|
||||
<div class="page-title-area">
|
||||
<div class="container">
|
||||
<div class="page-title-content">
|
||||
<h2>भिडियो</h2>
|
||||
<ul>
|
||||
<li><a href="index.html">होम पेज </a></li>
|
||||
<li>भिडियो</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Page Banner -->
|
||||
|
||||
<!-- Start Default News Area -->
|
||||
<section class="default-news-area ptb-50">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="single-video-item mb-50">
|
||||
@foreach ($videos->take(1) as $video)
|
||||
@if ($loop->first)
|
||||
<div class="row align-items-center">
|
||||
<div class="col-lg-4">
|
||||
<div class="video-news-image">
|
||||
<a href="news-details.php">
|
||||
<img src="{{ $video->image }}" alt="image">
|
||||
</a>
|
||||
|
||||
<a href="{{ $video->video_url }}" class="popup-youtube">
|
||||
<i class='bx bx-play-circle'></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-8">
|
||||
<div class="video-news-content mt-0">
|
||||
<h3>
|
||||
<a href="news-details.php">{{ $video->title }}</a>
|
||||
</h3>
|
||||
<p>{{ $video->description }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="row mb-20">
|
||||
@foreach ($videos->skip(1)->take(3) as $video)
|
||||
<div class="col-lg-4 col-md-4">
|
||||
<div class="single-video-item">
|
||||
<div class="video-news-image">
|
||||
<a href="news-details.php">
|
||||
<img src="{{ $video->image }}" alt="image">
|
||||
</a>
|
||||
|
||||
<a href="{{ $video->video_url }}" class="popup-youtube">
|
||||
<i class='bx bx-play-circle'></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="video-news-content">
|
||||
<h3>
|
||||
<a href="news-details.php">{{ $video->title }}</a>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
@foreach ($videos->skip(4)->take(3) as $video)
|
||||
<div class="col-lg-4 col-md-4">
|
||||
<div class="video-item mb-30">
|
||||
<div class="video-news-image">
|
||||
<a href="news-details.php">
|
||||
<img src="{{ $video->image }}" alt="image">
|
||||
</a>
|
||||
|
||||
<a href="{{ $video->video_url }}" class="popup-youtube">
|
||||
<i class='bx bx-play-circle'></i>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="video-news-content">
|
||||
<h3>
|
||||
<a href="news-details.php">{{ $video->title }}</a>
|
||||
</h3>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
{{ $videos->links('hulaki_khabar.pagination.hulaki', ['data' => $videos]) }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
15
routes/CRUDgenerated/route.adcategories.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
use App\Http\Controllers\AdcategoriesController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
Route::prefix("adcategories")->group(function () {
|
||||
Route::get('/', [AdcategoriesController::class, 'index'])->name('adcategories.index');
|
||||
Route::get('/create', [AdcategoriesController::class, 'create'])->name('adcategories.create');
|
||||
Route::post('/store', [AdcategoriesController::class, 'store'])->name('adcategories.store');
|
||||
Route::post('/sort', [AdcategoriesController::class, 'sort'])->name('adcategories.sort');
|
||||
Route::post('/updatealias', [AdcategoriesController::class, 'updatealias'])->name('adcategories.updatealias');
|
||||
Route::get('/show/{id}', [AdcategoriesController::class, 'show'])->name('adcategories.show');
|
||||
Route::get('/edit/{id}', [AdcategoriesController::class, 'edit'])->name('adcategories.edit') ;
|
||||
Route::post('/update/{id}', [AdcategoriesController::class, 'update'])->name('adcategories.update');
|
||||
Route::delete('/destroy/{id}', [AdcategoriesController::class, 'destroy'])->name('adcategories.destroy');
|
||||
Route::get('/toggle/{id}', [AdcategoriesController::class, 'toggle'])->name('adcategories.toggle');
|
||||
});
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
use App\Http\Controllers\AdvertisementController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
Route::prefix("advertisement")->group(function () {
|
||||
Route::get('/', [AdvertisementController::class, 'index'])->name('advertisement.index');
|
||||
Route::get('/create', [AdvertisementController::class, 'create'])->name('advertisement.create');
|
||||
Route::post('/store', [AdvertisementController::class, 'store'])->name('advertisement.store');
|
||||
Route::post('/sort', [AdvertisementController::class, 'sort'])->name('advertisement.sort');
|
||||
Route::post('/updatealias', [AdvertisementController::class, 'updatealias'])->name('advertisement.updatealias');
|
||||
Route::get('/show/{id}', [AdvertisementController::class, 'show'])->name('advertisement.show');
|
||||
Route::get('/edit/{id}', [AdvertisementController::class, 'edit'])->name('advertisement.edit') ;
|
||||
Route::post('/update/{id}', [AdvertisementController::class, 'update'])->name('advertisement.update');
|
||||
Route::delete('/destroy/{id}', [AdvertisementController::class, 'destroy'])->name('advertisement.destroy');
|
||||
Route::get('/toggle/{id}', [AdvertisementController::class, 'toggle'])->name('advertisement.toggle');
|
||||
});
|
15
routes/CRUDgenerated/route.advertisements.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
use App\Http\Controllers\AdvertisementsController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
Route::prefix("advertisements")->group(function () {
|
||||
Route::get('/', [AdvertisementsController::class, 'index'])->name('advertisements.index');
|
||||
Route::get('/create', [AdvertisementsController::class, 'create'])->name('advertisements.create');
|
||||
Route::post('/store', [AdvertisementsController::class, 'store'])->name('advertisements.store');
|
||||
Route::post('/sort', [AdvertisementsController::class, 'sort'])->name('advertisements.sort');
|
||||
Route::post('/updatealias', [AdvertisementsController::class, 'updatealias'])->name('advertisements.updatealias');
|
||||
Route::get('/show/{id}', [AdvertisementsController::class, 'show'])->name('advertisements.show');
|
||||
Route::get('/edit/{id}', [AdvertisementsController::class, 'edit'])->name('advertisements.edit') ;
|
||||
Route::post('/update/{id}', [AdvertisementsController::class, 'update'])->name('advertisements.update');
|
||||
Route::delete('/destroy/{id}', [AdvertisementsController::class, 'destroy'])->name('advertisements.destroy');
|
||||
Route::get('/toggle/{id}', [AdvertisementsController::class, 'toggle'])->name('advertisements.toggle');
|
||||
});
|
15
routes/route.adcategories.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
use App\Http\Controllers\AdcategoriesController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
Route::prefix("adcategories")->group(function () {
|
||||
Route::get('/', [AdcategoriesController::class, 'index'])->name('adcategories.index');
|
||||
Route::get('/create', [AdcategoriesController::class, 'create'])->name('adcategories.create');
|
||||
Route::post('/store', [AdcategoriesController::class, 'store'])->name('adcategories.store');
|
||||
Route::post('/sort', [AdcategoriesController::class, 'sort'])->name('adcategories.sort');
|
||||
Route::post('/updatealias', [AdcategoriesController::class, 'updatealias'])->name('adcategories.updatealias');
|
||||
Route::get('/show/{id}', [AdcategoriesController::class, 'show'])->name('adcategories.show');
|
||||
Route::get('/edit/{id}', [AdcategoriesController::class, 'edit'])->name('adcategories.edit') ;
|
||||
Route::post('/update/{id}', [AdcategoriesController::class, 'update'])->name('adcategories.update');
|
||||
Route::delete('/destroy/{id}', [AdcategoriesController::class, 'destroy'])->name('adcategories.destroy');
|
||||
Route::get('/toggle/{id}', [AdcategoriesController::class, 'toggle'])->name('adcategories.toggle');
|
||||
});
|
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
use App\Http\Controllers\AdvertisementController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
Route::prefix("advertisement")->group(function () {
|
||||
Route::get('/', [AdvertisementController::class, 'index'])->name('advertisement.index');
|
||||
Route::get('/create', [AdvertisementController::class, 'create'])->name('advertisement.create');
|
||||
Route::post('/store', [AdvertisementController::class, 'store'])->name('advertisement.store');
|
||||
Route::post('/sort', [AdvertisementController::class, 'sort'])->name('advertisement.sort');
|
||||
Route::post('/updatealias', [AdvertisementController::class, 'updatealias'])->name('advertisement.updatealias');
|
||||
Route::get('/show/{id}', [AdvertisementController::class, 'show'])->name('advertisement.show');
|
||||
Route::get('/edit/{id}', [AdvertisementController::class, 'edit'])->name('advertisement.edit') ;
|
||||
Route::post('/update/{id}', [AdvertisementController::class, 'update'])->name('advertisement.update');
|
||||
Route::delete('/destroy/{id}', [AdvertisementController::class, 'destroy'])->name('advertisement.destroy');
|
||||
Route::get('/toggle/{id}', [AdvertisementController::class, 'toggle'])->name('advertisement.toggle');
|
||||
});
|
15
routes/route.advertisements.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
use App\Http\Controllers\AdvertisementsController;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
Route::prefix("advertisements")->group(function () {
|
||||
Route::get('/', [AdvertisementsController::class, 'index'])->name('advertisements.index');
|
||||
Route::get('/create', [AdvertisementsController::class, 'create'])->name('advertisements.create');
|
||||
Route::post('/store', [AdvertisementsController::class, 'store'])->name('advertisements.store');
|
||||
Route::post('/sort', [AdvertisementsController::class, 'sort'])->name('advertisements.sort');
|
||||
Route::post('/updatealias', [AdvertisementsController::class, 'updatealias'])->name('advertisements.updatealias');
|
||||
Route::get('/show/{id}', [AdvertisementsController::class, 'show'])->name('advertisements.show');
|
||||
Route::get('/edit/{id}', [AdvertisementsController::class, 'edit'])->name('advertisements.edit') ;
|
||||
Route::post('/update/{id}', [AdvertisementsController::class, 'update'])->name('advertisements.update');
|
||||
Route::delete('/destroy/{id}', [AdvertisementsController::class, 'destroy'])->name('advertisements.destroy');
|
||||
Route::get('/toggle/{id}', [AdvertisementsController::class, 'toggle'])->name('advertisements.toggle');
|
||||
});
|
@ -32,5 +32,10 @@ Route::get('/contact',[WebsiteController::class,'showContact'])->name("contact")
|
||||
Route::post('/sendEmail',[WebsiteController::class,'sendEmail'])->name("sendEmail");
|
||||
|
||||
Route::get('/phpinfo', function() {
|
||||
phpinfo();
|
||||
$inipath = php_ini_loaded_file();
|
||||
if ($inipath) {
|
||||
echo 'Loaded php.ini: ' . $inipath;
|
||||
} else {
|
||||
echo 'A php.ini file is not loaded';
|
||||
}
|
||||
});
|
@ -102,12 +102,14 @@ Route::middleware('auth')->group(function () {
|
||||
require __DIR__ . '/route.newscategories.php';
|
||||
require __DIR__ . '/route.news.php';
|
||||
require __DIR__ . '/route.authors.php';
|
||||
require __DIR__ . '/route.advertisement.php';
|
||||
require __DIR__ . '/route.economies.php';
|
||||
require __DIR__ . '/route.videos.php';
|
||||
require __DIR__ . '/route.horoscope.php';
|
||||
require __DIR__ . '/route.articles.php';
|
||||
require __DIR__ . '/route.teams.php';
|
||||
require __DIR__ . '/route.advertisements.php';
|
||||
require __DIR__ . '/route.adcategories.php';
|
||||
|
||||
|
||||
});
|
||||
require __DIR__ . '/route.client.php';
|
||||
|
After Width: | Height: | Size: 483 KiB |
After Width: | Height: | Size: 1.4 MiB |
BIN
storage/app/public/hulaki/files/1/Ads/Combine_1140x140.gif
Normal file
After Width: | Height: | Size: 153 KiB |
After Width: | Height: | Size: 747 KiB |
After Width: | Height: | Size: 127 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/add.gif
Normal file
After Width: | Height: | Size: 1.2 MiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/add1.gif
Normal file
After Width: | Height: | Size: 174 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads1.gif
Normal file
After Width: | Height: | Size: 62 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads10.gif
Normal file
After Width: | Height: | Size: 31 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads2.jpg
Normal file
After Width: | Height: | Size: 1.4 MiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads3.jpg
Normal file
After Width: | Height: | Size: 361 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads4.jpg
Normal file
After Width: | Height: | Size: 360 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads5.jpg
Normal file
After Width: | Height: | Size: 523 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads6.gif
Normal file
After Width: | Height: | Size: 46 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads7.gif
Normal file
After Width: | Height: | Size: 15 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads8.jpg
Normal file
After Width: | Height: | Size: 761 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/add/ads9.jpg
Normal file
After Width: | Height: | Size: 563 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/asri-banner.jpg
Normal file
After Width: | Height: | Size: 78 KiB |
After Width: | Height: | Size: 496 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/ncell.gif
Normal file
After Width: | Height: | Size: 294 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/onlinekhabar_1230x100.jpg
Normal file
After Width: | Height: | Size: 110 KiB |
BIN
storage/app/public/hulaki/files/1/Ads/sidhartha_bank_ad.gif
Normal file
After Width: | Height: | Size: 65 KiB |
BIN
storage/app/public/hulaki/files/1/logo.gif
Normal file
After Width: | Height: | Size: 3.6 MiB |