first change
This commit is contained in:
0
Modules/CourseFinder/app/Http/Controllers/.gitkeep
Normal file
0
Modules/CourseFinder/app/Http/Controllers/.gitkeep
Normal file
160
Modules/CourseFinder/app/Http/Controllers/CoopController.php
Normal file
160
Modules/CourseFinder/app/Http/Controllers/CoopController.php
Normal file
@@ -0,0 +1,160 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Modules\CourseFinder\Models\Coop;
|
||||
use Modules\CourseFinder\Services\CoopService;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
class CoopController extends Controller
|
||||
{
|
||||
protected $coopService;
|
||||
|
||||
public function __construct(CoopService $coopService)
|
||||
{
|
||||
$this->coopService = $coopService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(?int $id = null)
|
||||
{
|
||||
$isEditing = !is_null($id);
|
||||
$coop = $isEditing ? $this->coopService->getCoopById($id) : null;
|
||||
|
||||
if (request()->ajax()) {
|
||||
$model = Coop::query()->orderBy('order');
|
||||
|
||||
return DataTables::eloquent($model)
|
||||
->addIndexColumn()
|
||||
->setRowClass('tableRow')
|
||||
->editColumn('status', function (Coop $coop) {
|
||||
$status = $coop->status ? 'Published' : 'Draft';
|
||||
$color = $coop->status ? 'text-success' : 'text-danger';
|
||||
return "<p class='{$color}'>{$status}</p>";
|
||||
})
|
||||
->editColumn('link', function (Coop $coop) {
|
||||
return $coop->link ?? '-';
|
||||
})
|
||||
->addColumn('action', 'coursefinder::coop.datatable.action')
|
||||
->rawColumns(['image', 'action', 'status'])
|
||||
->toJson();
|
||||
}
|
||||
|
||||
return view('coursefinder::coop.index', [
|
||||
'coop' => $coop,
|
||||
'editable' => $isEditing ? true : false,
|
||||
'title' => $isEditing ? 'Edit Coop' : 'Add Coop',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$isEditing = $request->has('id');
|
||||
|
||||
$request->merge([
|
||||
'slug' => Str::slug($request->title),
|
||||
]);
|
||||
|
||||
if ($isEditing) {
|
||||
$validated = $request->validate([
|
||||
'title' => ['required', 'string', 'max:255', 'unique:coops,title,' . $request->id],
|
||||
'slug' => ['required', 'string'],
|
||||
'link' => ['nullable'],
|
||||
'image' => ['nullable', 'string'],
|
||||
]);
|
||||
|
||||
$coop = $this->coopService->updateCoop($request->id, coopData: $validated);
|
||||
flash()->success("Coop for {$coop->title} has been updated.");
|
||||
return to_route('coop.index');
|
||||
}
|
||||
|
||||
$maxOrder = Coop::max('order');
|
||||
$order = $maxOrder ? ++$maxOrder : 1;
|
||||
|
||||
$request->mergeIfMissing([
|
||||
'order' => $order,
|
||||
]);
|
||||
|
||||
$validated = $request->validate([
|
||||
'title' => ['required', 'string', 'unique:coops,title'],
|
||||
'slug' => ['required', 'string'],
|
||||
'link' => ['nullable'],
|
||||
'image' => ['nullable', 'string'],
|
||||
'order' => ['integer'],
|
||||
]);
|
||||
|
||||
$coop = $this->coopService->storeCoop($validated);
|
||||
flash()->success("Coop for {$coop->title} has been created.");
|
||||
return to_route('coop.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$coop = $this->coopService->deleteCoop($id);
|
||||
return response()->json(['status' => 200, 'message' => "Coop has been deleted."], 200);
|
||||
}
|
||||
|
||||
public function reorder(Request $request)
|
||||
{
|
||||
$coops = $this->coopService->getAllCategories();
|
||||
|
||||
foreach ($coops as $coop) {
|
||||
foreach ($request->order as $order) {
|
||||
if ($order['id'] == $coop->id) {
|
||||
$coop->update(['order' => $order['position']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return response(['status' => true, 'message' => 'Reordered successfully'], 200);
|
||||
}
|
||||
|
||||
public function toggle($id)
|
||||
{
|
||||
$coop = Coop::findOrFail($id);
|
||||
$coop->update(['status' => !$coop->status]);
|
||||
return response(['status' => 200, 'message' => 'Toggled successfully'], 200);
|
||||
}
|
||||
}
|
209
Modules/CourseFinder/app/Http/Controllers/ProgramController.php
Normal file
209
Modules/CourseFinder/app/Http/Controllers/ProgramController.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Maatwebsite\Excel\Facades\Excel;
|
||||
use Modules\CCMS\Models\Country;
|
||||
use Modules\CCMS\Models\Institution;
|
||||
use Modules\CCMS\Models\Test;
|
||||
use Modules\CourseFinder\Imports\ProgramImport;
|
||||
use Modules\CourseFinder\Models\Coop;
|
||||
use Modules\CourseFinder\Models\Program;
|
||||
use Modules\CourseFinder\Models\ProgramLevel;
|
||||
use Modules\CourseFinder\Models\RequiredDocument;
|
||||
use Modules\CourseFinder\Services\ProgramService;
|
||||
|
||||
class ProgramController extends Controller
|
||||
{
|
||||
protected $programService;
|
||||
|
||||
public function __construct(ProgramService $programService)
|
||||
{
|
||||
$this->programService = $programService;
|
||||
}
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(Request $request)
|
||||
{
|
||||
$data['title'] = 'Program List';
|
||||
$data['programs'] = $this->programService->findAll($request);
|
||||
$data['countryOptions'] = Country::where('status', 1)->pluck('title', 'id');
|
||||
|
||||
$data['institutionOptions'] = Institution::query()
|
||||
->when($request->filled('country_id'), function ($query) use ($request) {
|
||||
$query->where('country_id', $request->country_id);
|
||||
})
|
||||
->pluck('title', 'id');
|
||||
|
||||
$data['programLevelOptions'] = ProgramLevel::where('status', 1)->pluck('title', 'id');
|
||||
$data['intakeOptions'] = Program::INTAKE;
|
||||
$data['coopOptions'] = Coop::where('status', 1)->pluck('title', 'id');
|
||||
$data['testOptions'] = Test::where('status', 1)->where('parent_id', null)->pluck('title', 'id');
|
||||
$data['statusOptions'] = config('constants.page_status_options');
|
||||
|
||||
return view('coursefinder::program.index', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$data['title'] = 'Program Create';
|
||||
$data['editable'] = false;
|
||||
$data['intakeOptions'] = Program::INTAKE;
|
||||
$data['institutionOptions'] = Institution::where('status', 1)->pluck('title', 'id');
|
||||
$data['programLevelOptions'] = ProgramLevel::where('status', 1)->pluck('title', 'id');
|
||||
$data['testOptions'] = Test::where('status', 1)->where('parent_id', null)->pluck('title', 'id');
|
||||
$data['coopOptions'] = Coop::where('status', 1)->pluck('title', 'id');
|
||||
$data['requiredDocumentOptions'] = RequiredDocument::where('status', 1)->pluck('title', 'id');
|
||||
|
||||
return view('coursefinder::program.create', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
|
||||
$request->validate([
|
||||
'title' => 'required',
|
||||
]);
|
||||
|
||||
$input = $request->except(['prof_test_accepted']);
|
||||
|
||||
DB::transaction(function () use ($input, $request) {
|
||||
|
||||
$program = Program::create($input);
|
||||
|
||||
$attachData = [];
|
||||
|
||||
foreach ($request->prof_test_accepted as $item) {
|
||||
$attachData[$item['test_id']] = [
|
||||
'min_score' => $item['min_score'],
|
||||
'band_score' => $item['band_score'],
|
||||
];
|
||||
}
|
||||
|
||||
$program->tests()->sync($attachData);
|
||||
|
||||
flash()->success('Program has been created!');
|
||||
|
||||
});
|
||||
|
||||
return redirect()->route('program.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
$data['title'] = 'View Program';
|
||||
$data['program'] = Program::findOrFail($id);
|
||||
$data['intakeOptions'] = Program::INTAKE;
|
||||
return view('coursefinder::program.show', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
$data['title'] = 'Edit Program';
|
||||
$data['editable'] = true;
|
||||
$data['program'] = Program::findOrFail($id);
|
||||
$data['intakeOptions'] = Program::INTAKE;
|
||||
$data['institutionOptions'] = Institution::where('status', 1)->pluck('title', 'id');
|
||||
$data['programLevelOptions'] = ProgramLevel::where('status', 1)->pluck('title', 'id');
|
||||
$data['testOptions'] = Test::where('status', 1)->where('parent_id', null)->pluck('title', 'id');
|
||||
$data['coopOptions'] = Coop::where('status', 1)->pluck('title', 'id');
|
||||
$data['requiredDocumentOptions'] = RequiredDocument::where('status', 1)->pluck('title', 'id');
|
||||
return view('coursefinder::program.edit', $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
$input = $request->except(['prof_test_accepted']);
|
||||
|
||||
DB::transaction(function () use ($input, $request, $id) {
|
||||
$program = Program::findOrFail($id);
|
||||
$program->update($input);
|
||||
|
||||
$attachData = [];
|
||||
|
||||
foreach ($request->prof_test_accepted as $item) {
|
||||
$attachData[$item['test_id']] = [
|
||||
'min_score' => $item['min_score'],
|
||||
'band_score' => $item['band_score'],
|
||||
];
|
||||
}
|
||||
|
||||
$program->tests()->sync($attachData);
|
||||
|
||||
});
|
||||
|
||||
flash()->success('program has been updated!');
|
||||
|
||||
return redirect()->route('program.index')->withSuccess('Program has been updated!');
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
try {
|
||||
$program = Program::findOrFail($id);
|
||||
$program->delete();
|
||||
|
||||
flash()->success('Program has been deleted!');
|
||||
|
||||
} catch (\Throwable $th) {
|
||||
flash()->error($th->getMessage());
|
||||
}
|
||||
return response()->json(['status' => 200, 'message' => 'Program has been deleted!'], 200);
|
||||
|
||||
}
|
||||
|
||||
public function getProgramByInstitution(Request $request)
|
||||
{
|
||||
try {
|
||||
$program = Program::where(['institution_id' => $request->institution_id])
|
||||
->select('id', 'title')
|
||||
->get();
|
||||
return response()->json([
|
||||
'status' => true,
|
||||
'data' => $program,
|
||||
'msg' => 'Fetch',
|
||||
], 200);
|
||||
} catch (\Throwable $th) {
|
||||
return response()->json([
|
||||
'status' => false,
|
||||
'msg' => $th->getMessage(),
|
||||
], 500);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public function import(Request $request)
|
||||
{
|
||||
DB::beginTransaction();
|
||||
try {
|
||||
Excel::import(new ProgramImport(), $request->file('file')->store('temp'));
|
||||
DB::commit();
|
||||
return redirect()->back()->with('success', "Upload Succesfully");
|
||||
} catch (\Throwable $th) {
|
||||
DB::rollback();
|
||||
return redirect()->back()->with('error', $th->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Modules\CourseFinder\Models\ProgramLevel;
|
||||
use Modules\CourseFinder\Services\ProgramLevelService;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
class ProgramLevelController extends Controller
|
||||
{
|
||||
protected $programLevelService;
|
||||
|
||||
public function __construct(ProgramLevelService $programLevelService)
|
||||
{
|
||||
$this->programLevelService = $programLevelService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(?int $id = null)
|
||||
{
|
||||
$isEditing = !is_null($id);
|
||||
$programLevel = $isEditing ? $this->programLevelService->getProgramLevelById($id) : null;
|
||||
|
||||
if (request()->ajax()) {
|
||||
$model = ProgramLevel::query()->orderBy('order');
|
||||
|
||||
return DataTables::eloquent($model)
|
||||
->addIndexColumn()
|
||||
->setRowClass('tableRow')
|
||||
->editColumn('image', function (ProgramLevel $programLevel) {
|
||||
return $programLevel->getRawOriginal('image') ? "<img src='{$programLevel->image}' alt='{$programLevel->title}' class='rounded avatar-sm material-shadow ms-2 img-thumbnail'>" : '-';
|
||||
|
||||
})
|
||||
->editColumn('link', function (ProgramLevel $programLevel) {
|
||||
return $coop->link ?? '-';
|
||||
})
|
||||
->editColumn('status', function (ProgramLevel $programLevel) {
|
||||
$status = $programLevel->status ? 'Published' : 'Draft';
|
||||
$color = $programLevel->status ? 'text-success' : 'text-danger';
|
||||
return "<p class='{$color}'>{$status}</p>";
|
||||
})
|
||||
->addColumn('action', 'coursefinder::programLevel.datatable.action')
|
||||
->rawColumns(['image', 'action', 'status'])
|
||||
->toJson();
|
||||
}
|
||||
|
||||
return view('coursefinder::programLevel.index', [
|
||||
'programLevel' => $programLevel,
|
||||
'editable' => $isEditing ? true : false,
|
||||
'title' => $isEditing ? 'Edit Program Level' : 'Add Program Level',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$isEditing = $request->has('id');
|
||||
|
||||
$request->merge([
|
||||
'slug' => Str::slug($request->title),
|
||||
]);
|
||||
|
||||
if ($isEditing) {
|
||||
$validated = $request->validate([
|
||||
'title' => ['required', 'string', 'max:255', 'unique:program_levels,title,' . $request->id],
|
||||
'slug' => ['required', 'string'],
|
||||
'link' => ['nullable'],
|
||||
'image' => ['nullable', 'string'],
|
||||
]);
|
||||
|
||||
$programLevel = $this->programLevelService->updateProgramLevel($request->id, programLevelData: $validated);
|
||||
flash()->success("Program Level for {$programLevel->title} has been updated.");
|
||||
return to_route('programLevel.index');
|
||||
}
|
||||
|
||||
$maxOrder = ProgramLevel::max('order');
|
||||
$order = $maxOrder ? ++$maxOrder : 1;
|
||||
|
||||
$request->mergeIfMissing([
|
||||
'order' => $order,
|
||||
]);
|
||||
|
||||
$validated = $request->validate([
|
||||
'title' => ['required', 'string', 'unique:program_levels,title'],
|
||||
'slug' => ['required', 'string'],
|
||||
'link' => ['nullable'],
|
||||
'image' => ['nullable', 'string'],
|
||||
'order' => ['integer'],
|
||||
]);
|
||||
|
||||
$programLevel = $this->programLevelService->storeProgramLevel($validated);
|
||||
flash()->success("Program Level for {$programLevel->title} has been created.");
|
||||
return to_route('programLevel.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$programLevel = $this->programLevelService->deleteProgramLevel($id);
|
||||
return response()->json(['status' => 200, 'message' => "Program Level has been deleted."], 200);
|
||||
}
|
||||
|
||||
public function reorder(Request $request)
|
||||
{
|
||||
$programLevels = $this->programLevelService->getAllCategories();
|
||||
|
||||
foreach ($programLevels as $programLevel) {
|
||||
foreach ($request->order as $order) {
|
||||
if ($order['id'] == $programLevel->id) {
|
||||
$programLevel->update(['order' => $order['position']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return response(['status' => true, 'message' => 'Reordered successfully'], 200);
|
||||
}
|
||||
|
||||
public function toggle($id)
|
||||
{
|
||||
$programLevel = ProgramLevel::findOrFail($id);
|
||||
$programLevel->update(['status' => !$programLevel->status]);
|
||||
return response(['status' => 200, 'message' => 'Toggled successfully'], 200);
|
||||
}
|
||||
}
|
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Http\Controllers;
|
||||
|
||||
use App\Http\Controllers\Controller;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Str;
|
||||
use Modules\CourseFinder\Models\RequiredDocument;
|
||||
use Modules\CourseFinder\Services\RequiredDocumentService;
|
||||
use Yajra\DataTables\Facades\DataTables;
|
||||
|
||||
class RequiredDocumentController extends Controller
|
||||
{
|
||||
protected $requiredDocumentService;
|
||||
|
||||
public function __construct(RequiredDocumentService $requiredDocumentService)
|
||||
{
|
||||
$this->requiredDocumentService = $requiredDocumentService;
|
||||
}
|
||||
|
||||
/**
|
||||
* Display a listing of the resource.
|
||||
*/
|
||||
public function index(?int $id = null)
|
||||
{
|
||||
$isEditing = !is_null($id);
|
||||
$requiredDocument = $isEditing ? $this->requiredDocumentService->getRequiredDocumentById($id) : null;
|
||||
|
||||
if (request()->ajax()) {
|
||||
$model = RequiredDocument::query()->orderBy('order');
|
||||
|
||||
return DataTables::eloquent($model)
|
||||
->addIndexColumn()
|
||||
->setRowClass('tableRow')
|
||||
->editColumn('image', function (RequiredDocument $requiredDocument) {
|
||||
return $requiredDocument->getRawOriginal('image') ? "<img src='{$requiredDocument->image}' alt='{$requiredDocument->title}' class='rounded avatar-sm material-shadow ms-2 img-thumbnail'>" : '-';
|
||||
|
||||
})
|
||||
->editColumn('link', function (RequiredDocument $requiredDocument) {
|
||||
return $coop->link ?? '-';
|
||||
})
|
||||
->editColumn('status', function (RequiredDocument $requiredDocument) {
|
||||
$status = $requiredDocument->status ? 'Published' : 'Draft';
|
||||
$color = $requiredDocument->status ? 'text-success' : 'text-danger';
|
||||
return "<p class='{$color}'>{$status}</p>";
|
||||
})
|
||||
->addColumn('action', 'coursefinder::requiredDocument.datatable.action')
|
||||
->rawColumns(['image', 'action', 'status'])
|
||||
->toJson();
|
||||
}
|
||||
|
||||
return view('coursefinder::requiredDocument.index', [
|
||||
'requiredDocument' => $requiredDocument,
|
||||
'editable' => $isEditing ? true : false,
|
||||
'title' => $isEditing ? 'Edit Required Document' : 'Add Required Document',
|
||||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for creating a new resource.
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Store a newly created resource in storage.
|
||||
*/
|
||||
public function store(Request $request)
|
||||
{
|
||||
$isEditing = $request->has('id');
|
||||
|
||||
$request->merge([
|
||||
'slug' => Str::slug($request->title),
|
||||
]);
|
||||
|
||||
if ($isEditing) {
|
||||
$validated = $request->validate([
|
||||
'title' => ['required', 'string', 'max:255', 'unique:required_documents,title,' . $request->id],
|
||||
'slug' => ['required', 'string'],
|
||||
'link' => ['nullable'],
|
||||
'image' => ['nullable', 'string'],
|
||||
]);
|
||||
|
||||
$requiredDocument = $this->requiredDocumentService->updateRequiredDocument($request->id, requiredDocumentData: $validated);
|
||||
flash()->success("Required Document for {$requiredDocument->title} has been updated.");
|
||||
return to_route('requiredDocument.index');
|
||||
}
|
||||
|
||||
$maxOrder = RequiredDocument::max('order');
|
||||
$order = $maxOrder ? ++$maxOrder : 1;
|
||||
|
||||
$request->mergeIfMissing([
|
||||
'order' => $order,
|
||||
]);
|
||||
|
||||
$validated = $request->validate([
|
||||
'title' => ['required', 'string', 'unique:required_documents,title'],
|
||||
'slug' => ['required', 'string'],
|
||||
'link' => ['nullable'],
|
||||
'image' => ['nullable', 'string'],
|
||||
'order' => ['integer'],
|
||||
]);
|
||||
|
||||
$requiredDocument = $this->requiredDocumentService->storeRequiredDocument($validated);
|
||||
flash()->success("Required Document for {$requiredDocument->title} has been created.");
|
||||
return to_route('requiredDocument.index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the specified resource.
|
||||
*/
|
||||
public function show($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Show the form for editing the specified resource.
|
||||
*/
|
||||
public function edit($id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the specified resource in storage.
|
||||
*/
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the specified resource from storage.
|
||||
*/
|
||||
public function destroy($id)
|
||||
{
|
||||
$requiredDocument = $this->requiredDocumentService->deleteRequiredDocument($id);
|
||||
return response()->json(['status' => 200, 'message' => "Required Document has been deleted."], 200);
|
||||
}
|
||||
|
||||
public function reorder(Request $request)
|
||||
{
|
||||
$requiredDocuments = $this->requiredDocumentService->getAllCategories();
|
||||
|
||||
foreach ($requiredDocuments as $requiredDocument) {
|
||||
foreach ($request->order as $order) {
|
||||
if ($order['id'] == $requiredDocument->id) {
|
||||
$requiredDocument->update(['order' => $order['position']]);
|
||||
}
|
||||
}
|
||||
}
|
||||
return response(['status' => true, 'message' => 'Reordered successfully'], 200);
|
||||
}
|
||||
|
||||
public function toggle($id)
|
||||
{
|
||||
$requiredDocument = RequiredDocument::findOrFail($id);
|
||||
$requiredDocument->update(['status' => !$requiredDocument->status]);
|
||||
return response(['status' => 200, 'message' => 'Toggled successfully'], 200);
|
||||
}
|
||||
}
|
33
Modules/CourseFinder/app/Imports/ProgramImport.php
Normal file
33
Modules/CourseFinder/app/Imports/ProgramImport.php
Normal file
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Imports;
|
||||
|
||||
use Illuminate\Support\Collection;
|
||||
use Maatwebsite\Excel\Concerns\ToCollection;
|
||||
use Maatwebsite\Excel\Concerns\WithHeadingRow;
|
||||
use Maatwebsite\Excel\Imports\HeadingRowFormatter;
|
||||
use Modules\CourseFinder\Models\Program;
|
||||
|
||||
class ProgramImport implements ToCollection, WithHeadingRow
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
HeadingRowFormatter::default('none');
|
||||
}
|
||||
/**
|
||||
* @param Collection $collection
|
||||
*/
|
||||
public function collection(Collection $collection)
|
||||
{
|
||||
foreach ($collection as $key => $request) {
|
||||
if (is_null($request['code'])) {
|
||||
continue;
|
||||
}
|
||||
$request['status'] = 1;
|
||||
$request['intakes'] = $request['intake'] ? explode(",", $request['intake']) : null;
|
||||
|
||||
unset($request['intake']);
|
||||
Program::create($request->toArray());
|
||||
}
|
||||
}
|
||||
}
|
29
Modules/CourseFinder/app/Models/Coop.php
Normal file
29
Modules/CourseFinder/app/Models/Coop.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\CourseFinder\Database\Factories\CoopFactory;
|
||||
|
||||
class Coop extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'description',
|
||||
'link',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
}
|
86
Modules/CourseFinder/app/Models/Program.php
Normal file
86
Modules/CourseFinder/app/Models/Program.php
Normal file
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Modules\CCMS\Models\Institution;
|
||||
use Modules\CCMS\Models\Test;
|
||||
|
||||
class Program extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
use \Staudenmeir\EloquentJsonRelations\HasJsonRelationships;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'code',
|
||||
'description',
|
||||
'institution_id',
|
||||
'programlevel_id',
|
||||
'coop_id',
|
||||
'year',
|
||||
'psw',
|
||||
'prospects',
|
||||
'intakes',
|
||||
'required_documents',
|
||||
'application_open',
|
||||
'application_deadline',
|
||||
'fee',
|
||||
'scholarship',
|
||||
'level',
|
||||
'program_url',
|
||||
'status',
|
||||
'remarks',
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
|
||||
public const INTAKE = [
|
||||
1 => 'January',
|
||||
2 => 'February',
|
||||
3 => 'March',
|
||||
4 => 'April',
|
||||
5 => 'May',
|
||||
6 => 'June',
|
||||
7 => 'July',
|
||||
8 => 'August',
|
||||
9 => 'September',
|
||||
10 => 'October',
|
||||
11 => 'November',
|
||||
12 => 'December',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'intakes' => 'array',
|
||||
'required_documents' => 'json',
|
||||
'prof_test_accepted' => 'object',
|
||||
'level' => 'object',
|
||||
];
|
||||
|
||||
public function institution()
|
||||
{
|
||||
return $this->belongsTo(Institution::class, 'institution_id');
|
||||
}
|
||||
|
||||
public function programLevel()
|
||||
{
|
||||
return $this->belongsTo(ProgramLevel::class, 'programlevel_id');
|
||||
}
|
||||
|
||||
public function tests(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(Test::class, 'programs_tests', 'program_id', 'test_id')->withPivot('id', 'min_score', 'band_score')->withTimestamps();
|
||||
}
|
||||
|
||||
public function requiredDocuments()
|
||||
{
|
||||
return $this->belongsToJson(RequiredDocument::class, 'required_documents');
|
||||
}
|
||||
}
|
29
Modules/CourseFinder/app/Models/ProgramLevel.php
Normal file
29
Modules/CourseFinder/app/Models/ProgramLevel.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
// use Modules\CourseFinder\Database\Factories\ProgramLevelFactory;
|
||||
|
||||
class ProgramLevel extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'description',
|
||||
'link',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
}
|
38
Modules/CourseFinder/app/Models/RequiredDocument.php
Normal file
38
Modules/CourseFinder/app/Models/RequiredDocument.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Models;
|
||||
|
||||
use App\Traits\CreatedUpdatedBy;
|
||||
use Illuminate\Database\Eloquent\Casts\Attribute;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
// use Modules\CourseFinder\Database\Factories\RequiredDocumentFactory;
|
||||
|
||||
class RequiredDocument extends Model
|
||||
{
|
||||
use HasFactory, CreatedUpdatedBy;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*/
|
||||
protected $fillable = [
|
||||
'title',
|
||||
'slug',
|
||||
'link',
|
||||
'image',
|
||||
|
||||
'status',
|
||||
'order',
|
||||
|
||||
'createdby',
|
||||
'updatedby',
|
||||
];
|
||||
|
||||
protected function image(): Attribute
|
||||
{
|
||||
return Attribute::make(
|
||||
get: fn($value) => asset($value),
|
||||
);
|
||||
}
|
||||
}
|
0
Modules/CourseFinder/app/Models/Scopes/.gitkeep
Normal file
0
Modules/CourseFinder/app/Models/Scopes/.gitkeep
Normal file
0
Modules/CourseFinder/app/Providers/.gitkeep
Normal file
0
Modules/CourseFinder/app/Providers/.gitkeep
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Nwidart\Modules\Traits\PathNamespace;
|
||||
|
||||
class CourseFinderServiceProvider extends ServiceProvider
|
||||
{
|
||||
use PathNamespace;
|
||||
|
||||
protected string $name = 'CourseFinder';
|
||||
|
||||
protected string $nameLower = 'coursefinder';
|
||||
|
||||
/**
|
||||
* Boot the application events.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
$this->registerCommands();
|
||||
$this->registerCommandSchedules();
|
||||
$this->registerTranslations();
|
||||
$this->registerConfig();
|
||||
$this->registerViews();
|
||||
$this->loadMigrationsFrom(module_path($this->name, 'database/migrations'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the service provider.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->app->register(EventServiceProvider::class);
|
||||
$this->app->register(RouteServiceProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register commands in the format of Command::class
|
||||
*/
|
||||
protected function registerCommands(): void
|
||||
{
|
||||
// $this->commands([]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register command Schedules.
|
||||
*/
|
||||
protected function registerCommandSchedules(): void
|
||||
{
|
||||
// $this->app->booted(function () {
|
||||
// $schedule = $this->app->make(Schedule::class);
|
||||
// $schedule->command('inspire')->hourly();
|
||||
// });
|
||||
}
|
||||
|
||||
/**
|
||||
* Register translations.
|
||||
*/
|
||||
public function registerTranslations(): void
|
||||
{
|
||||
$langPath = resource_path('lang/modules/'.$this->nameLower);
|
||||
|
||||
if (is_dir($langPath)) {
|
||||
$this->loadTranslationsFrom($langPath, $this->nameLower);
|
||||
$this->loadJsonTranslationsFrom($langPath);
|
||||
} else {
|
||||
$this->loadTranslationsFrom(module_path($this->name, 'lang'), $this->nameLower);
|
||||
$this->loadJsonTranslationsFrom(module_path($this->name, 'lang'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Register config.
|
||||
*/
|
||||
protected function registerConfig(): void
|
||||
{
|
||||
$this->publishes([module_path($this->name, 'config/config.php') => config_path($this->nameLower.'.php')], 'config');
|
||||
$this->mergeConfigFrom(module_path($this->name, 'config/config.php'), $this->nameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Register views.
|
||||
*/
|
||||
public function registerViews(): void
|
||||
{
|
||||
$viewPath = resource_path('views/modules/'.$this->nameLower);
|
||||
$sourcePath = module_path($this->name, 'resources/views');
|
||||
|
||||
$this->publishes([$sourcePath => $viewPath], ['views', $this->nameLower.'-module-views']);
|
||||
|
||||
$this->loadViewsFrom(array_merge($this->getPublishableViewPaths(), [$sourcePath]), $this->nameLower);
|
||||
|
||||
$componentNamespace = $this->module_namespace($this->name, $this->app_path(config('modules.paths.generator.component-class.path')));
|
||||
Blade::componentNamespace($componentNamespace, $this->nameLower);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the services provided by the provider.
|
||||
*/
|
||||
public function provides(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
private function getPublishableViewPaths(): array
|
||||
{
|
||||
$paths = [];
|
||||
foreach (config('view.paths') as $path) {
|
||||
if (is_dir($path.'/modules/'.$this->nameLower)) {
|
||||
$paths[] = $path.'/modules/'.$this->nameLower;
|
||||
}
|
||||
}
|
||||
|
||||
return $paths;
|
||||
}
|
||||
}
|
30
Modules/CourseFinder/app/Providers/EventServiceProvider.php
Normal file
30
Modules/CourseFinder/app/Providers/EventServiceProvider.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Providers;
|
||||
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event handler mappings for the application.
|
||||
*
|
||||
* @var array<string, array<int, string>>
|
||||
*/
|
||||
protected $listen = [];
|
||||
|
||||
/**
|
||||
* Indicates if events should be discovered.
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected static $shouldDiscoverEvents = true;
|
||||
|
||||
/**
|
||||
* Configure the proper event listeners for email verification.
|
||||
*/
|
||||
protected function configureEmailVerification(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
50
Modules/CourseFinder/app/Providers/RouteServiceProvider.php
Normal file
50
Modules/CourseFinder/app/Providers/RouteServiceProvider.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
protected string $name = 'CourseFinder';
|
||||
|
||||
/**
|
||||
* Called before routes are registered.
|
||||
*
|
||||
* Register any model bindings or pattern based filters.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
parent::boot();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the routes for the application.
|
||||
*/
|
||||
public function map(): void
|
||||
{
|
||||
$this->mapApiRoutes();
|
||||
$this->mapWebRoutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "web" routes for the application.
|
||||
*
|
||||
* These routes all receive session state, CSRF protection, etc.
|
||||
*/
|
||||
protected function mapWebRoutes(): void
|
||||
{
|
||||
Route::middleware('web')->group(module_path($this->name, '/routes/web.php'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the "api" routes for the application.
|
||||
*
|
||||
* These routes are typically stateless.
|
||||
*/
|
||||
protected function mapApiRoutes(): void
|
||||
{
|
||||
Route::middleware('api')->prefix('api')->name('api.')->group(module_path($this->name, '/routes/api.php'));
|
||||
}
|
||||
}
|
0
Modules/CourseFinder/app/Services/.gitkeep
Normal file
0
Modules/CourseFinder/app/Services/.gitkeep
Normal file
49
Modules/CourseFinder/app/Services/CoopService.php
Normal file
49
Modules/CourseFinder/app/Services/CoopService.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Services;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\CourseFinder\Models\Coop;
|
||||
|
||||
class CoopService
|
||||
{
|
||||
|
||||
public function getAllCategories()
|
||||
{
|
||||
$query = Coop::query();
|
||||
return $query->get();
|
||||
}
|
||||
|
||||
public function storeCoop(array $coopData): Coop
|
||||
{
|
||||
return DB::transaction(function () use ($coopData) {
|
||||
$coop = Coop::create($coopData);
|
||||
|
||||
return $coop;
|
||||
});
|
||||
}
|
||||
|
||||
public function getCoopById(int $id)
|
||||
{
|
||||
return Coop::findOrFail($id);
|
||||
}
|
||||
|
||||
public function updateCoop(int $id, array $coopData)
|
||||
{
|
||||
$coop = $this->getCoopById($id);
|
||||
|
||||
return DB::transaction(function () use ($coop, $coopData) {
|
||||
$coop->update($coopData);
|
||||
return $coop;
|
||||
});
|
||||
}
|
||||
|
||||
public function deleteCoop(int $id)
|
||||
{
|
||||
return DB::transaction(function () use ($id) {
|
||||
$coop = $this->getCoopById($id);
|
||||
$coop->delete();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
49
Modules/CourseFinder/app/Services/ProgramLevelService.php
Normal file
49
Modules/CourseFinder/app/Services/ProgramLevelService.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Services;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\CourseFinder\Models\ProgramLevel;
|
||||
|
||||
class ProgramLevelService
|
||||
{
|
||||
|
||||
public function getAllCategories()
|
||||
{
|
||||
$query = ProgramLevel::query();
|
||||
return $query->get();
|
||||
}
|
||||
|
||||
public function storeProgramLevel(array $programLevelData): ProgramLevel
|
||||
{
|
||||
return DB::transaction(function () use ($programLevelData) {
|
||||
$programLevel = ProgramLevel::create($programLevelData);
|
||||
|
||||
return $programLevel;
|
||||
});
|
||||
}
|
||||
|
||||
public function getProgramLevelById(int $id)
|
||||
{
|
||||
return ProgramLevel::findOrFail($id);
|
||||
}
|
||||
|
||||
public function updateProgramLevel(int $id, array $programLevelData)
|
||||
{
|
||||
$programLevel = $this->getProgramLevelById($id);
|
||||
|
||||
return DB::transaction(function () use ($programLevel, $programLevelData) {
|
||||
$programLevel->update($programLevelData);
|
||||
return $programLevel;
|
||||
});
|
||||
}
|
||||
|
||||
public function deleteProgramLevel(int $id)
|
||||
{
|
||||
return DB::transaction(function () use ($id) {
|
||||
$programLevel = $this->getProgramLevelById($id);
|
||||
$programLevel->delete();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
54
Modules/CourseFinder/app/Services/ProgramService.php
Normal file
54
Modules/CourseFinder/app/Services/ProgramService.php
Normal file
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Services;
|
||||
|
||||
use Modules\CourseFinder\Models\Program;
|
||||
|
||||
class ProgramService
|
||||
{
|
||||
public function findAll($request)
|
||||
{
|
||||
return Program::when($request, function ($query) use ($request) {
|
||||
if ($request->filled('country_id')) {
|
||||
$query->whereRelation('institution', 'country_id', $request->country_id);
|
||||
}
|
||||
|
||||
if ($request->filled('institution_id')) {
|
||||
$query->where("institution_id", $request->institution_id);
|
||||
}
|
||||
|
||||
if ($request->filled('programlevel_id')) {
|
||||
$query->where("programlevel_id", $request->programlevel_id);
|
||||
}
|
||||
|
||||
if ($request->filled('intake_id')) {
|
||||
$intakeId = $request->intake_id;
|
||||
$query->whereJsonContains('intake', $intakeId);
|
||||
}
|
||||
|
||||
if ($request->filled('status')) {
|
||||
$query->where('status', $request->status);
|
||||
}
|
||||
|
||||
if ($request->filled('search')) {
|
||||
$search = $request->search;
|
||||
$query->where('keywords', 'like', "%{$search}%");
|
||||
}
|
||||
|
||||
if ($request->filled('location')) {
|
||||
$location = $request->location;
|
||||
$query->where('location', 'like', "%{$location}%");
|
||||
}
|
||||
|
||||
})->latest()->paginate(10)->withQueryString();
|
||||
}
|
||||
|
||||
public function pluck(callable $query = null)
|
||||
{
|
||||
$baseQuery = Program::query();
|
||||
if (is_callable($query)) {
|
||||
$query($baseQuery);
|
||||
}
|
||||
return $baseQuery->pluck('title', 'id');
|
||||
}
|
||||
}
|
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Services;
|
||||
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Modules\CourseFinder\Models\RequiredDocument;
|
||||
|
||||
class RequiredDocumentService
|
||||
{
|
||||
|
||||
public function getAllCategories()
|
||||
{
|
||||
$query = RequiredDocument::query();
|
||||
return $query->get();
|
||||
}
|
||||
|
||||
public function storeRequiredDocument(array $requiredDocumentData): RequiredDocument
|
||||
{
|
||||
return DB::transaction(function () use ($requiredDocumentData) {
|
||||
$requiredDocument = RequiredDocument::create($requiredDocumentData);
|
||||
|
||||
return $requiredDocument;
|
||||
});
|
||||
}
|
||||
|
||||
public function getRequiredDocumentById(int $id)
|
||||
{
|
||||
return RequiredDocument::findOrFail($id);
|
||||
}
|
||||
|
||||
public function updateRequiredDocument(int $id, array $requiredDocumentData)
|
||||
{
|
||||
$requiredDocument = $this->getRequiredDocumentById($id);
|
||||
|
||||
return DB::transaction(function () use ($requiredDocument, $requiredDocumentData) {
|
||||
$requiredDocument->update($requiredDocumentData);
|
||||
return $requiredDocument;
|
||||
});
|
||||
}
|
||||
|
||||
public function deleteRequiredDocument(int $id)
|
||||
{
|
||||
return DB::transaction(function () use ($id) {
|
||||
$requiredDocument = $this->getRequiredDocumentById($id);
|
||||
$requiredDocument->delete();
|
||||
return true;
|
||||
});
|
||||
}
|
||||
}
|
30
Modules/CourseFinder/composer.json
Normal file
30
Modules/CourseFinder/composer.json
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"name": "nwidart/coursefinder",
|
||||
"description": "",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Nicolas Widart",
|
||||
"email": "n.widart@gmail.com"
|
||||
}
|
||||
],
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [],
|
||||
"aliases": {
|
||||
|
||||
}
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Modules\\CourseFinder\\": "app/",
|
||||
"Modules\\CourseFinder\\Database\\Factories\\": "database/factories/",
|
||||
"Modules\\CourseFinder\\Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Modules\\CourseFinder\\Tests\\": "tests/"
|
||||
}
|
||||
}
|
||||
}
|
0
Modules/CourseFinder/config/.gitkeep
Normal file
0
Modules/CourseFinder/config/.gitkeep
Normal file
5
Modules/CourseFinder/config/config.php
Normal file
5
Modules/CourseFinder/config/config.php
Normal file
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'name' => 'CourseFinder',
|
||||
];
|
0
Modules/CourseFinder/database/factories/.gitkeep
Normal file
0
Modules/CourseFinder/database/factories/.gitkeep
Normal file
0
Modules/CourseFinder/database/migrations/.gitkeep
Normal file
0
Modules/CourseFinder/database/migrations/.gitkeep
Normal file
@@ -0,0 +1,36 @@
|
||||
<?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('required_documents', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->longText('description')->nullable();
|
||||
$table->string('link')->nullable();
|
||||
$table->string('image')->nullable();
|
||||
$table->integer('status')->nullable()->default(1);
|
||||
$table->integer('order')->nullable();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('required_documents');
|
||||
}
|
||||
};
|
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('coops', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->string('link')->nullable();
|
||||
$table->longText('description')->nullable();
|
||||
$table->integer('status')->nullable()->default(1);
|
||||
$table->integer('order')->nullable();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('coops');
|
||||
}
|
||||
};
|
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('program_levels', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->string('link')->nullable();
|
||||
$table->longText('description')->nullable();
|
||||
$table->integer('status')->nullable()->default(1);
|
||||
$table->integer('order')->nullable();
|
||||
$table->integer('createdby')->nullable();
|
||||
$table->integer('updatedby')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('program_levels');
|
||||
}
|
||||
};
|
@@ -0,0 +1,71 @@
|
||||
<?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('programs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('title')->nullable();
|
||||
$table->string('slug')->nullable();
|
||||
$table->string('code')->nullable();
|
||||
$table->text('description')->nullable();
|
||||
$table->unsignedInteger('institution_id')->nullable();
|
||||
$table->unsignedInteger('programlevel_id')->nullable();
|
||||
$table->unsignedInteger('coop_id')->nullable();
|
||||
$table->string('year')->nullable();
|
||||
$table->string('psw')->nullable();
|
||||
$table->text('prospects')->nullable();
|
||||
$table->json('intakes')->nullable();
|
||||
$table->json('required_documents')->nullable();
|
||||
|
||||
$table->string('application_open')->nullable();
|
||||
$table->string('application_deadline')->nullable();
|
||||
$table->string('fee')->nullable();
|
||||
$table->string('scholarship')->nullable();
|
||||
$table->json('level')->nullable();
|
||||
$table->string('program_url')->nullable();
|
||||
$table->unsignedInteger('createdby')->nullable();
|
||||
$table->unsignedInteger('updatedby')->nullable();
|
||||
$table->text('remarks')->nullable();
|
||||
$table->boolean('status')->default(1);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('programs_tests', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedInteger('program_id')->nullable();
|
||||
$table->unsignedInteger('test_id')->nullable();
|
||||
$table->string('min_score')->nullable();
|
||||
$table->string('band_score')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('programs_qualifications', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->unsignedInteger('program_id')->nullable();
|
||||
$table->string('level')->nullable();
|
||||
$table->string('faculty')->nullable();
|
||||
$table->string('score')->nullable();
|
||||
$table->string('year')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('programs');
|
||||
Schema::dropIfExists('programs_tests');
|
||||
Schema::dropIfExists('programs_qualifications');
|
||||
}
|
||||
};
|
0
Modules/CourseFinder/database/seeders/.gitkeep
Normal file
0
Modules/CourseFinder/database/seeders/.gitkeep
Normal file
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\CourseFinder\Database\Seeders;
|
||||
|
||||
use Illuminate\Database\Seeder;
|
||||
|
||||
class CourseFinderDatabaseSeeder extends Seeder
|
||||
{
|
||||
/**
|
||||
* Run the database seeds.
|
||||
*/
|
||||
public function run(): void
|
||||
{
|
||||
// $this->call([]);
|
||||
}
|
||||
}
|
11
Modules/CourseFinder/module.json
Normal file
11
Modules/CourseFinder/module.json
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
"name": "CourseFinder",
|
||||
"alias": "coursefinder",
|
||||
"description": "",
|
||||
"keywords": [],
|
||||
"priority": 0,
|
||||
"providers": [
|
||||
"Modules\\CourseFinder\\Providers\\CourseFinderServiceProvider"
|
||||
],
|
||||
"files": []
|
||||
}
|
15
Modules/CourseFinder/package.json
Normal file
15
Modules/CourseFinder/package.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"dev": "vite",
|
||||
"build": "vite build"
|
||||
},
|
||||
"devDependencies": {
|
||||
"axios": "^1.1.2",
|
||||
"laravel-vite-plugin": "^0.7.5",
|
||||
"sass": "^1.69.5",
|
||||
"postcss": "^8.3.7",
|
||||
"vite": "^4.0.0"
|
||||
}
|
||||
}
|
0
Modules/CourseFinder/resources/assets/js/app.js
Normal file
0
Modules/CourseFinder/resources/assets/js/app.js
Normal file
0
Modules/CourseFinder/resources/assets/sass/app.scss
Normal file
0
Modules/CourseFinder/resources/assets/sass/app.scss
Normal file
0
Modules/CourseFinder/resources/views/.gitkeep
Normal file
0
Modules/CourseFinder/resources/views/.gitkeep
Normal file
@@ -0,0 +1,27 @@
|
||||
{{ html()->form('POST', route('coop.store'))->class('needs-validation')->attributes(['novalidate'])->open() }}
|
||||
|
||||
@isset($coop)
|
||||
{{ html()->hidden('id', $coop->id) }}
|
||||
@endisset
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="mb-3">
|
||||
{{ html()->label('Title')->for('title') }}
|
||||
{{ html()->span('*')->class('text-danger') }}
|
||||
{{ html()->text('title')->value($coop->title ?? old('title'))->class('form-control')->placeholder('Enter Title')->required() }}
|
||||
{{ html()->div('Please enter a title.')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ html()->label('Link')->for('link') }}
|
||||
{{ html()->text('link')->value($coop->link ?? old('link'))->class('form-control')->placeholder('Enter Related Link') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<x-form-buttons :href="route('coop.index')" :label="isset($coop) ? 'Update' : 'Create'" />
|
||||
</div>
|
||||
</div>
|
||||
{{ html()->form()->close() }}
|
@@ -0,0 +1,10 @@
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
<a href="{{ route('coop.index', $id) }}" class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
|
||||
<a data-link="{{ route('coop.toggle', $id) }}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Toggle" data-status="{{ $status == 1 ? 'Draft' : 'Published' }}"
|
||||
class="link-info fs-15 toggle-item"><i class="{{ $status == 1 ? 'ri-toggle-line' : 'ri-toggle-fill' }}"></i></a>
|
||||
|
||||
<a href="javascript:void(0);" data-link="{{ route('coop.destroy', $id) }}" class="link-danger fs-15 remove-item"><i
|
||||
class="ri-delete-bin-line"></i>
|
||||
</a>
|
||||
</div>
|
48
Modules/CourseFinder/resources/views/coop/index.blade.php
Normal file
48
Modules/CourseFinder/resources/views/coop/index.blade.php
Normal file
@@ -0,0 +1,48 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<x-dashboard.breadcumb :title="$title" />
|
||||
@if ($errors->any())
|
||||
<x-flash-message type="danger" :messages="$errors->all()" />
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-xl-3">
|
||||
<div class="card profile-card">
|
||||
@include('coursefinder::coop.add-coop-form')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-xl-8 col-lg-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
@php
|
||||
$columns = [
|
||||
[
|
||||
'title' => 'S.N',
|
||||
'data' => 'DT_RowIndex',
|
||||
'name' => 'DT_RowIndex',
|
||||
'orderable' => false,
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
],
|
||||
['title' => 'Name', 'data' => 'title', 'name' => 'title'],
|
||||
['title' => 'Link', 'data' => 'link', 'name' => 'link'],
|
||||
['title' => 'Status', 'data' => 'status', 'name' => 'status'],
|
||||
[
|
||||
'title' => 'Action',
|
||||
'data' => 'action',
|
||||
'orderable' => false,
|
||||
'searchable' => false,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<x-data-table-script :route="route('coop.index')" :reorder="route('coop.reorder')" :columns="$columns" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
7
Modules/CourseFinder/resources/views/index.blade.php
Normal file
7
Modules/CourseFinder/resources/views/index.blade.php
Normal file
@@ -0,0 +1,7 @@
|
||||
@extends('coursefinder::layouts.master')
|
||||
|
||||
@section('content')
|
||||
<h1>Hello World</h1>
|
||||
|
||||
<p>Module: {!! config('coursefinder.name') !!}</p>
|
||||
@endsection
|
@@ -0,0 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
|
||||
<title>CourseFinder Module - {{ config('app.name', 'Laravel') }}</title>
|
||||
|
||||
<meta name="description" content="{{ $description ?? '' }}">
|
||||
<meta name="keywords" content="{{ $keywords ?? '' }}">
|
||||
<meta name="author" content="{{ $author ?? '' }}">
|
||||
|
||||
<!-- Fonts -->
|
||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
||||
|
||||
{{-- Vite CSS --}}
|
||||
{{-- {{ module_vite('build-coursefinder', 'resources/assets/sass/app.scss') }} --}}
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@yield('content')
|
||||
|
||||
{{-- Vite JS --}}
|
||||
{{-- {{ module_vite('build-coursefinder', 'resources/assets/js/app.js') }} --}}
|
||||
</body>
|
@@ -0,0 +1,10 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<x-dashboard.breadcumb :title="$title" />
|
||||
|
||||
{{ html()->form('POST')->route('program.store')->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data', 'onkeydown' => "return event.key != 'Enter';"])->open() }}
|
||||
@include('coursefinder::program.partials.form')
|
||||
{{ html()->form()->close() }}
|
||||
</div>
|
||||
@endsection
|
10
Modules/CourseFinder/resources/views/program/edit.blade.php
Normal file
10
Modules/CourseFinder/resources/views/program/edit.blade.php
Normal file
@@ -0,0 +1,10 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<x-dashboard.breadcumb :title="$title" />
|
||||
|
||||
{{ html()->modelForm($program, 'PUT')->route('program.update', $program->id)->class(['needs-validation'])->attributes(['novalidate', 'enctype' => 'multipart/form-data', 'onkeydown' => "return event.key != 'Enter';"])->open() }}
|
||||
@include('coursefinder::program.partials.form')
|
||||
{{ html()->closeModelForm() }}
|
||||
</div>
|
||||
@endsection
|
292
Modules/CourseFinder/resources/views/program/index.blade.php
Normal file
292
Modules/CourseFinder/resources/views/program/index.blade.php
Normal file
@@ -0,0 +1,292 @@
|
||||
@extends('layouts.app')
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<x-dashboard.breadcumb :title="$title" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
@include('coursefinder::program.partials.filter')
|
||||
</div>
|
||||
<div class="col-md-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<div class="row justify-content-between align-items-center g-2">
|
||||
<div class="col-sm-auto">
|
||||
<h5 class="card-title mb-0">Explore Programs</h5>
|
||||
</div>
|
||||
<div class="col-sm-auto ms-auto">
|
||||
<div class="list-grid-nav hstack gap-1">
|
||||
<a href="{{ route('program.create') }}" class="btn btn-sm btn-primary float-end">Add</a>
|
||||
|
||||
<button type="button" id="dropdownMenuLink1" data-bs-toggle="dropdown"
|
||||
aria-expanded="false"
|
||||
class="btn btn-sm btn-soft-info btn-icon material-shadow-none fs-14"><i
|
||||
class="ri-more-2-fill"></i></button>
|
||||
<ul class="dropdown-menu" aria-labelledby="dropdownMenuLink1" style=""
|
||||
data-popper-placement="bottom-start">
|
||||
<li><a class="dropdown-item" href="{{ route('program.import') }}"
|
||||
data-bs-toggle="modal" data-bs-target="#myModal">Import</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--end col-->
|
||||
</div>
|
||||
<!--end row-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@forelse ($programs as $item)
|
||||
<div class="card product ribbon-box material-shadow border shadow-none">
|
||||
<div class="card-body bg-white">
|
||||
<div class="ribbon {{ $item->status == 1 ? 'ribbon-success' : 'ribbon-danger' }} round-shape fs-6 fw-normal"
|
||||
style="z-index:999">
|
||||
{{ config('constants.page_status_options')[$item->status] }}</div>
|
||||
<div class="row gy-3">
|
||||
<div class="col-sm-auto align-self-center">
|
||||
<div class="avatar-xl bg-light flex-shrink-0 rounded p-1">
|
||||
<img src="{{ $item->institution?->image }}" alt="Institution Logo"
|
||||
style="height: 115px; width:100%; object-fit:contain; object-position:center; mix-blend-mode:multiply;">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm">
|
||||
<h2 class="fs-16 text-primary">
|
||||
<a class="link-primary link-underline-opacity-0"
|
||||
href="{{ route('program.show', $item->id) }}">
|
||||
{{ $item->title }}
|
||||
</a>
|
||||
</h2>
|
||||
|
||||
<h5 class="fs-13">
|
||||
<a href="{{ $item->program_url }}" class="text-dark link-underline-opacity-0"
|
||||
target="_blank">
|
||||
<p class="text-muted">{{ $item->institution?->title }}</p>
|
||||
</a>
|
||||
</h5>
|
||||
|
||||
<ul class="list-inline d-flex flex-wrap gap-2">
|
||||
<li class="list-inline-item">
|
||||
Code: <span class="fw-medium">{{ !empty($item->code) ? $item->code : 'N/A' }}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="list-inline-item">
|
||||
Fee: <span class="fw-medium">{{ !empty($item->fee) ? $item->fee : 'N/A' }}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="list-inline-item">
|
||||
Scholarship: <span
|
||||
class="fw-medium">{{ !empty($item->scholarship) ? $item->scholarship : 'N/A' }}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="list-inline-item">
|
||||
Program: <span
|
||||
class="fw-medium">{{ !empty($item->programlevel?->title) ? $item->programlevel?->title : 'N/A' }}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li class="list-inline-item">
|
||||
Duration: <span
|
||||
class="fw-medium">{{ !empty($item->year) ? $item->year : 'N/A' }}
|
||||
</span>
|
||||
</li>
|
||||
|
||||
@if (!empty($item->psw))
|
||||
<li class="list-inline-item">
|
||||
PSW: <span class="fw-medium">{{ !empty($item->psw) ? $item->psw : 'N/A' }}
|
||||
</span>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
|
||||
|
||||
@if (!empty($item->coop?->title))
|
||||
<li class="list-inline-item">
|
||||
COOP: <span
|
||||
class="fw-medium">{{ !empty($item->coop?->title) ? $item->coop?->title : 'N/A' }}
|
||||
</span>
|
||||
</li>
|
||||
@endif
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-sm-auto">
|
||||
<div class="text-lg-end">
|
||||
@foreach ($item->tests as $index => $test)
|
||||
<div class="d-flex">
|
||||
<div class="flex-shrink-0">
|
||||
<i class="ri-checkbox-circle-fill text-primary"></i>
|
||||
</div>
|
||||
<div class="ms-2 flex-grow">
|
||||
<span class="text-muted">{{ $test->title }}:</span>
|
||||
{{ $test->pivot?->min_score }}
|
||||
({{ $test->pivot?->band_score }})
|
||||
</div>
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- card body -->
|
||||
<div class="card-footer">
|
||||
<div class="row align-items-center gy-3">
|
||||
<div class="col-sm">
|
||||
<div class="d-flex my-n1 align-items-center flex-wrap">
|
||||
<div class="me-5">
|
||||
<div>
|
||||
@if (!empty($item->intakes))
|
||||
<span class="fs-12">Intake:</span>
|
||||
@forelse ($item->intakes as $value)
|
||||
<span class="fs-13 text-muted mb-0 text-center"><span
|
||||
class="badge bg-success p-2">{{ $intakeOptions[$value] }}</span></span>
|
||||
@empty
|
||||
<span class="fs-13 text-muted mb-0 text-center"><span
|
||||
class="badge bg-danger p-2">N/A</span></span>
|
||||
@endforelse
|
||||
@endif
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-sm-auto">
|
||||
<div class="d-flex align-items-center text-muted gap-3">
|
||||
|
||||
<a href="{{ route('program.show', $item->id) }}" class="link-secondary fs-20 ms-5"
|
||||
data-bs-toggle="tooltip" data-bs-trigger="hover" data-bs-placement="bottom"
|
||||
data-bs-original-title="View">
|
||||
<i class="ri-eye-line align-middle"></i>
|
||||
</a>
|
||||
|
||||
<a href="{{ route('program.edit', $item->id) }}" class="link-primary fs-20"
|
||||
data-bs-toggle="tooltip" data-bs-trigger="hover" data-bs-placement="bottom"
|
||||
data-bs-original-title="Edit">
|
||||
<i class="ri-pencil-line align-middle"></i>
|
||||
</a>
|
||||
|
||||
<a class="link-danger fs-20 remove-btn" data-bs-toggle="modal"
|
||||
href="javascript:void(0)" data-link="{{ route('program.destroy', $item->id) }}"
|
||||
data-id="{{ $item->id }}">
|
||||
<i class="ri-delete-line align-middle"></i>
|
||||
</a>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card footer -->
|
||||
</div>
|
||||
@empty
|
||||
<h4 class="my-5 text-center">No results found...</h4>
|
||||
@endforelse
|
||||
{{ $programs->links() }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="myModal" class="modal fade" tabindex="-1" aria-labelledby="myModalLabel" aria-hidden="false"
|
||||
style="display: none;">
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="myModalLabel">Program Import</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"> </button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<div class="col-lg-6">
|
||||
<form action="{{ route('program.import') }}" method="post" enctype="multipart/form-data">
|
||||
@csrf
|
||||
<div class="form-group">
|
||||
<div class="form-control-wrap mb-1">
|
||||
<input class="form-control" id="formFileLg" type="file" name="file"
|
||||
accept=".xlsx, .xls, .csv" required>
|
||||
</div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-md float-right mt-3">Upload</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-6">
|
||||
<div class="card text-center">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title">Sample Sheet</h5>
|
||||
<p class="card-text text-danger">Note: Do not change sheet header.
|
||||
</p>
|
||||
<a href="{{ asset('samples/CourseSample.xlsx') }}" class="btn btn-secondary btn-md">Download
|
||||
Sample</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div><!-- /.modal-content -->
|
||||
</div><!-- /.modal-dialog -->
|
||||
</div><!-- /.modal -->
|
||||
</div>
|
||||
@endsection
|
||||
@push('js')
|
||||
<script>
|
||||
$('body').on('click', '.remove-btn', function(e) {
|
||||
e.preventDefault();
|
||||
let url = $(this).data('link');
|
||||
let id = $(this).data('id');
|
||||
var that = $(this);
|
||||
Swal.fire({
|
||||
title: 'Are you sure?',
|
||||
text: "You won't be able to revert this!",
|
||||
icon: 'warning',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#3085d6',
|
||||
cancelButtonColor: '#d33',
|
||||
confirmButtonText: 'Yes, delete it!'
|
||||
}).then((result) => {
|
||||
if (result.isConfirmed) {
|
||||
$.ajax({
|
||||
url: url,
|
||||
type: 'DELETE',
|
||||
headers: {
|
||||
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
|
||||
},
|
||||
data: {
|
||||
id: id
|
||||
},
|
||||
success: function(response) {
|
||||
that.closest('.card').remove();
|
||||
toastr.success('Remove');
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$(document).on('change', '.countryDropdown', function() {
|
||||
const selectedCountryId = $(this).val();
|
||||
const url = '{{ route('institution.getInstitutionsByCountry') }}' + '?country_id=' +
|
||||
selectedCountryId;
|
||||
$('.institutionDropdown').empty();
|
||||
|
||||
$.get(url, function(response) {
|
||||
$('.institutionDropdown').append($('<option>', {
|
||||
value: '',
|
||||
text: 'Select',
|
||||
}));
|
||||
$.each(response.data, (index, institution) => {
|
||||
$('.institutionDropdown').append($('<option>', {
|
||||
value: institution.id,
|
||||
text: institution.title,
|
||||
}));
|
||||
});
|
||||
}).fail(function(error) {
|
||||
console.error("Error fetching institutions:", error);
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
@@ -0,0 +1,19 @@
|
||||
<ul class="list-inline hstack mb-0 gap-2">
|
||||
|
||||
<li class="list-inline-item edit" data-bs-toggle="tooltip" data-bs-trigger="hover" data-bs-placement="bottom" title="Edit">
|
||||
<a href="{{ route('program.edit', $id) }}" class="text-primary d-inline-block edit-item-btn">
|
||||
<i class="ri-pencil-fill fs-16"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-inline-item" data-bs-toggle="tooltip" data-bs-trigger="hover" data-bs-placement="bottom" title="Download">
|
||||
<a href="#" title="Download" class="text-info d-inline-block">
|
||||
<i class="ri-download-line fs-16"></i>
|
||||
</a>
|
||||
</li>
|
||||
<li class="list-inline-item" data-bs-toggle="tooltip" data-bs-trigger="hover" data-bs-placement="bottom" title="Remove">
|
||||
<a class="text-danger d-inline-block remove-item-btn" data-bs-toggle="modal"
|
||||
data-link="{{ route('program.destroy', $id) }}" data-id="{{ $id }}">
|
||||
<i class="ri-delete-bin-5-fill fs-16"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
@@ -0,0 +1,141 @@
|
||||
{{ html()->form('GET')->route('program.index')->class(['filter-form'])->attributes(['id' => 'filter-form'])->open() }}
|
||||
<div class="sticky-card">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="d-flex">
|
||||
<div class="flex-grow-1">
|
||||
<h5 class="fs-16">Filter</h5>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<a href="{{ request()->route()->named('program.index') ? route('program.index') : url('course-finder') }}" class="text-decoration-underline">Clear
|
||||
All</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body m-0 p-0">
|
||||
<div class="p-2">
|
||||
<p class="text-muted text-uppercase fs-11 fw-medium mb-2">By Keyword</p>
|
||||
{{ html()->text('search')->value(request('search'))->placeholder('Search Program')->class('form-control') }}
|
||||
</div>
|
||||
|
||||
<div class="p-2">
|
||||
{{ html()->text('location')->value(request('location'))->placeholder('Search Location')->class('form-control') }}
|
||||
</div>
|
||||
<div class="accordion accordion-flush filter-accordion">
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="flush-headingBrands">
|
||||
<button class="accordion-button bg-transparent shadow-none" type="button"
|
||||
data-bs-toggle="collapse" data-bs-target="#flush-collapseBrands" aria-expanded="true"
|
||||
aria-controls="flush-collapseBrands">
|
||||
<span class="text-muted text-uppercase fs-12 fw-medium">By Destination</span>
|
||||
<span class="badge bg-success rounded-pill filter-badge ms-1 align-middle"></span>
|
||||
</button>
|
||||
</h2>
|
||||
|
||||
<div id="flush-collapseBrands" class="accordion-collapse show collapse"
|
||||
aria-labelledby="flush-headingBrands">
|
||||
<div class="accordion-body text-body pt-0">
|
||||
<div class="d-flex flex-column gap-3">
|
||||
<div>
|
||||
<p class="text-muted text-uppercase fs-11 fw-medium mb-2">By Country</p>
|
||||
{{ html()->select('country_id', $countryOptions)->value(request('country_id'))->placeholder('Select')->class('form-select choices-select countryDropdown') }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="text-muted text-uppercase fs-11 fw-medium mb-2">By Institution</p>
|
||||
{{ html()->select('institution_id', $institutionOptions)->value(request('institution_id'))->placeholder('Select')->class('form-select institutionDropdown') }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="text-muted text-uppercase fs-11 fw-medium mb-2">By Course Level</p>
|
||||
{{ html()->select('programlevel_id', $programLevelOptions)->value(request('programlevel_id'))->placeholder('Select')->class('form-select choices-select') }}
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<p class="text-muted text-uppercase fs-11 fw-medium mb-2">By Intake</p>
|
||||
{{ html()->select('intake_id', $intakeOptions)->value(request('intake_id'))->placeholder('Select')->class('form-select choices-select') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end accordion-item -->
|
||||
</div>
|
||||
|
||||
@php
|
||||
$statusList = config('constants.page_status_options');
|
||||
$hasClass = false;
|
||||
$hasStatus = false;
|
||||
|
||||
if (request()->has('class_id')) {
|
||||
$hasClass = true;
|
||||
}
|
||||
|
||||
if (request()->has('status')) {
|
||||
$hasStatus = true;
|
||||
}
|
||||
|
||||
@endphp
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="flush-headingClass">
|
||||
<button class="accordion-button {{ $hasClass ?: 'collapsed' }} bg-transparent shadow-none"
|
||||
type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseClass"
|
||||
aria-expanded="{{ $hasClass ? 'true' : 'false' }}" aria-controls="flush-collapseClass">
|
||||
<span class="text-muted text-uppercase fs-12 fw-medium">By Score</span>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="flush-collapseClass" class="accordion-collapse {{ $hasClass ? 'show' : '' }} collapse"
|
||||
aria-labelledby="flush-headingClass">
|
||||
<div class="accordion-body text-body pt-1">
|
||||
<div class="d-flex flex-column gap-2">
|
||||
<div class="mb-2">
|
||||
{{ html()->select('test_id', $testOptions)->value(request('test_id'))->placeholder('Select')->class('form-select choices-select') }}
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="formCost d-flex align-items-center gap-2">
|
||||
<input class="form-control form-control-sm" type="text" name="min_score"
|
||||
placeholder="Min score" value="{{ request('min_score') }}" /> <span
|
||||
class="fw-semibold text-muted">to</span> <input
|
||||
class="form-control form-control-sm" type="text" name="max_score"
|
||||
placeholder="Max score" value="{{ request('max_score') }}" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header" id="flush-headingStatus">
|
||||
<button class="accordion-button {{ $hasStatus ?: 'collapsed' }} bg-transparent shadow-none"
|
||||
type="button" data-bs-toggle="collapse" data-bs-target="#flush-collapseStatus"
|
||||
aria-expanded="{{ $hasStatus ? 'true' : 'false' }}" aria-controls="flush-collapseStatus">
|
||||
<span class="text-muted text-uppercase fs-12 fw-medium">By Status</span>
|
||||
</button>
|
||||
</h2>
|
||||
<div id="flush-collapseStatus" class="accordion-collapse {{ $hasStatus ? 'show' : '' }} collapse"
|
||||
aria-labelledby="flush-headingStatus">
|
||||
<div class="accordion-body text-body pt-1">
|
||||
<div class="d-flex flex-column gap-2">
|
||||
<div>
|
||||
{{ html()->select('status', $statusOptions)->value(request('status'))->placeholder('Select Status')->class('form-select choices-select') }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer d-none d-lg-block">
|
||||
<div class="d-flex justify-content-end gap-2">
|
||||
<button type="submit" class="btn btn-success"><i class="ri-filter-2-line align-bottom"></i>
|
||||
Filter</button>
|
||||
<a href="{{ request()->route()->named('program.index') ? route('program.index') : url('course-finder') }}" class="btn btn-danger"><i
|
||||
class="ri-refresh-line align-bottom"></i>
|
||||
Reset</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--end row-->
|
||||
{{ html()->form()->close() }}
|
@@ -0,0 +1,415 @@
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="card-title mb-0">Course Information</h6>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<ul class="list-inline card-toolbar-menu d-flex align-items-center mb-0">
|
||||
<li class="list-inline-item">
|
||||
<a class="minimize-card align-middle" data-bs-toggle="collapse"
|
||||
href="#collapse-personal" role="button" aria-expanded="true"
|
||||
aria-controls="collapseExample2">
|
||||
<i class="mdi mdi-plus plus align-middle"></i>
|
||||
<i class="mdi mdi-minus minus align-middle"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body show collapse" id="collapse-personal">
|
||||
<div class="row gy-3">
|
||||
<div class="col-md-8">
|
||||
{{ html()->label('Title')->class('form-label') }}
|
||||
{{ html()->span('*')->class('text-danger') }}
|
||||
{{ html()->text('title')->class('form-control')->placeholder('Enter Program Title')->required() }}
|
||||
{{ html()->div('Please enter program title')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Code')->class('form-label')->for('code') }}
|
||||
{{ html()->text('code')->class('form-control')->placeholder('Enter Program Code') }}
|
||||
{{ html()->div('Please enter code')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Institution')->class('form-label')->for('institution_id') }}
|
||||
{{ html()->span('*')->class('text-danger') }}
|
||||
{{ html()->select('institution_id', $institutionOptions)->placeholder('Select')->class('form-select choices-select')->required() }}
|
||||
{{ html()->div('Please select institution')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Level')->class('form-label')->for('programlevel_id') }}
|
||||
{{ html()->span('*')->class('text-danger') }}
|
||||
{{ html()->select('programlevel_id', $programLevelOptions)->placeholder('Select')->class('form-select choices-select')->required() }}
|
||||
{{ html()->div('Please select program level')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{{ html()->label('Cooperative Program (Co op)')->class('form-label')->for('coop_id') }}
|
||||
{{ html()->select('coop_id', $coopOptions)->placeholder('Select')->class('form-select choices-select') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Description')->class('form-label')->for('description') }}
|
||||
{{ html()->textarea('description')->class('form-control ckeditor-classic') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-8">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="card-title mb-0">Other Information</h6>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<ul class="list-inline card-toolbar-menu d-flex align-items-center mb-0">
|
||||
<li class="list-inline-item">
|
||||
<a class="minimize-card align-middle" data-bs-toggle="collapse"
|
||||
href="#collapse-preference" role="button" aria-expanded="true"
|
||||
aria-controls="collapseExample2">
|
||||
<i class="mdi mdi-plus plus align-middle"></i>
|
||||
<i class="mdi mdi-minus minus align-middle"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body show collapse" id="collapse-preference">
|
||||
<div class="row gy-3">
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Duration (Year)')->class('form-label')->for('year') }}
|
||||
{{ html()->span('*')->class('text-danger') }}
|
||||
{{ html()->text('year')->class('form-control')->placeholder('Program Duration')->required() }}
|
||||
{{ html()->div('Please enter program duration')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('PSW')->class('form-label')->for('psw') }}
|
||||
{{ html()->text('psw')->class('form-control')->placeholder('Enter PSW') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Fee')->class('form-label')->for('fee') }}
|
||||
{{ html()->text('fee')->class('form-control')->placeholder('Program Fee') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Scholarship')->class('form-label')->for('scholarship') }}
|
||||
{{ html()->text('scholarship')->class('form-control')->placeholder('Scholarship offered') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Open Date')->class('form-label')->for('application_open') }}
|
||||
{{ html()->date('application_open')->class('form-control')->placeholder('Enter application open') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{{ html()->label('Close Date')->class('form-label')->for('application_deadline') }}
|
||||
{{ html()->date('application_deadline')->class('form-control')->placeholder('Enter application close') }}
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
{{ html()->label('Prospect')->class('form-label')->for('prospects') }}
|
||||
{{ html()->textarea('prospects')->class('form-control') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="card-title mb-0">Qualification Requirements</h6>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<ul class="list-inline card-toolbar-menu d-flex align-items-center mb-0">
|
||||
<li class="list-inline-item">
|
||||
<a class="minimize-card collapsed align-middle" data-bs-toggle="collapse"
|
||||
href="#collapse-preparation" role="button" aria-expanded="false"
|
||||
aria-controls="collapseExample2">
|
||||
<i class="mdi mdi-plus plus align-middle"></i>
|
||||
<i class="mdi mdi-minus minus align-middle"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body show collapse" id="collapse-preparation">
|
||||
<div class="table-responsive">
|
||||
<table class="table-borderless table-nowrap table-sm table" id="qualificationTable">
|
||||
<thead class="table-primary text-center">
|
||||
<tr>
|
||||
<th scope="col" width=30%>Level</th>
|
||||
<th scope="col" width=30%>Faculty</th>
|
||||
<th scope="col" width=15%>Score/GPA</th>
|
||||
<th scope="col" width=15%>Year</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($editable)
|
||||
@if ($program->level)
|
||||
@forelse ($program->level as $key => $item)
|
||||
@include('coursefinder::program.partials.qualification-form', [
|
||||
'numInc' => $key,
|
||||
'value' => $item,
|
||||
])
|
||||
@empty
|
||||
@endforelse
|
||||
@else
|
||||
@include('coursefinder::program.partials.qualification-form', [
|
||||
'numInc' => 0,
|
||||
])
|
||||
|
||||
@endif
|
||||
@else
|
||||
@include('coursefinder::program.partials.qualification-form', [
|
||||
'numInc' => 0,
|
||||
])
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="card-title mb-0">Proficiency Test Requirements</h6>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<ul class="list-inline card-toolbar-menu d-flex align-items-center mb-0">
|
||||
<li class="list-inline-item">
|
||||
<a class="minimize-card collapsed align-middle" data-bs-toggle="collapse"
|
||||
href="#collapse-proficiency" role="button" aria-expanded="false"
|
||||
aria-controls="collapseExample2">
|
||||
<i class="mdi mdi-minus minus align-middle"></i>
|
||||
<i class="mdi mdi-plus plus align-middle"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body show collapse" id="collapse-proficiency">
|
||||
<div class="table-responsive">
|
||||
<table class="table-borderless table-nowrap table-sm table" id="proficiency-table">
|
||||
<thead class="table-primary text-center">
|
||||
<tr>
|
||||
<th scope="col" width=30%>Prof Test</th>
|
||||
<th scope="col" width=30%>Min Score</th>
|
||||
<th scope="col" width=30%>Band Score</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if ($editable)
|
||||
@forelse ($program->tests as $key => $item)
|
||||
@include('coursefinder::program.partials.proficiency-form', [
|
||||
'numInc' => $key,
|
||||
'value' => $item,
|
||||
])
|
||||
@empty
|
||||
@include('coursefinder::program.partials.proficiency-form', [
|
||||
'numInc' => 0,
|
||||
])
|
||||
@endforelse
|
||||
@else
|
||||
@include('coursefinder::program.partials.proficiency-form', [
|
||||
'numInc' => 0,
|
||||
])
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
<div class="mb-3 text-end">
|
||||
<a href="{{ route('program.index') }}" class="btn btn-danger w-sm">Cancel</a>
|
||||
<button type="submit" class="btn btn-success w-sm">Save</button>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="card-title mb-0">Program URL</h6>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<ul class="list-inline card-toolbar-menu d-flex align-items-center mb-0">
|
||||
<li class="list-inline-item">
|
||||
<a class="minimize-card align-middle" data-bs-toggle="collapse" href="#collapse-url"
|
||||
role="button" aria-expanded="true" aria-controls="collapseExample2">
|
||||
<i class="mdi mdi-plus plus align-middle"></i>
|
||||
<i class="mdi mdi-minus minus align-middle"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body show collapse" id="collapse-url">
|
||||
<div class="col-md-12">
|
||||
{{ html()->textarea('program_url')->class('form-control')->required()->rows(4)->placeholder('https://www.example.com') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
<div class="card">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="card-title mb-0">Intake Information</h6>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<ul class="list-inline card-toolbar-menu d-flex align-items-center mb-0">
|
||||
<li class="list-inline-item">
|
||||
<a class="minimize-card align-middle" data-bs-toggle="collapse"
|
||||
href="#collapse-followUp" role="button" aria-expanded="true"
|
||||
aria-controls="collapseExample2">
|
||||
<i class="mdi mdi-plus plus align-middle"></i>
|
||||
<i class="mdi mdi-minus minus align-middle"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body show collapse" id="collapse-followUp">
|
||||
<div class="d-flex flex-row flex-wrap gap-2">
|
||||
@foreach ($intakeOptions as $index => $item)
|
||||
<div class="form-check form-check-success">
|
||||
{{ html()->checkbox('intakes[]', $editable && in_array($index, $program->intakes) ? true : false)->id('permission_' . $index)->value($index)->class('form-check-input child-checkbox') }}
|
||||
{{ html()->label($item)->for('permission_' . $index)->class('form-check-label ms-1') }}
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
<div class="card bg-white">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="card-title mb-0">Document Requirements</h6>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<ul class="list-inline card-toolbar-menu d-flex align-items-center mb-0">
|
||||
<li class="list-inline-item">
|
||||
<a class="minimize-card align-middle" data-bs-toggle="collapse"
|
||||
href="#collapse-documents" role="button" aria-expanded="true"
|
||||
aria-controls="collapseExample2">
|
||||
<i class="mdi mdi-plus plus align-middle"></i>
|
||||
<i class="mdi mdi-minus minus align-middle"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body show collapse" id="collapse-documents">
|
||||
<div class="d-flex flex-column flex-wrap gap-2">
|
||||
@foreach ($requiredDocumentOptions as $index => $item)
|
||||
<div class="form-check form-check-info">
|
||||
{{ html()->checkbox('required_documents[]', $editable && in_array($index, $program->required_documents ?? []))->id('doc_' . $index)->value($index)->class('form-check-input child-checkbox') }}
|
||||
{{ html()->label($item)->for('doc_' . $index)->class('form-check-label') }}
|
||||
</div>
|
||||
@endforeach
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
<div class="card bg-white">
|
||||
<div class="card-header">
|
||||
<div class="d-flex align-items-center">
|
||||
<div class="flex-grow-1">
|
||||
<h6 class="card-title mb-0">Keywords</h6>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<ul class="list-inline card-toolbar-menu d-flex align-items-center mb-0">
|
||||
<li class="list-inline-item">
|
||||
<a class="minimize-card align-middle" data-bs-toggle="collapse"
|
||||
href="#collapse-documents" role="button" aria-expanded="true"
|
||||
aria-controls="collapseExample2">
|
||||
<i class="mdi mdi-plus plus align-middle"></i>
|
||||
<i class="mdi mdi-minus minus align-middle"></i>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-body show collapse" id="collapse-documents">
|
||||
<div class="d-flex flex-column flex-wrap gap-2">
|
||||
{{ html()->text('keywords')->class('form-control')->attributes([
|
||||
'data-choices' => 'true',
|
||||
'data-choices-removeItem' => 'true',
|
||||
'data-choices-create' => 'true',
|
||||
'multiple' => true,
|
||||
]) }}
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@push('js')
|
||||
<script>
|
||||
let numInc = 0;
|
||||
|
||||
const cloneRow = (element) => {
|
||||
let newRow = $(element).closest('tr').clone();
|
||||
numInc++;
|
||||
newRow.find('input, select').each(function() {
|
||||
let name = $(this).attr('name');
|
||||
name = name.replace(/\[\d+\]/, '[' + numInc + ']');
|
||||
$(this).attr('name', name);
|
||||
});
|
||||
|
||||
newRow.find('input').val('');
|
||||
$(element).parents('table').find('tbody').append(newRow);
|
||||
}
|
||||
|
||||
const removeRow = (element) => {
|
||||
count = $(element).closest('tbody').find('tr').length;
|
||||
console.log(count);
|
||||
|
||||
if (count > 1) {
|
||||
$(element).closest('tr').remove();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@endpush
|
@@ -0,0 +1,25 @@
|
||||
<tr class="clone-proficiency">
|
||||
<td>
|
||||
{{ html()->select('prof_test_accepted[' . $numInc . '][test_id]', $testOptions)->class('form-select')->placeholder('Select')->value($value->id ?? null)->required() }}
|
||||
{{ html()->div('Please choose test')->class('invalid-feedback') }}
|
||||
|
||||
</td>
|
||||
|
||||
<td class="d-flex flex-column gap-2">
|
||||
{{ html()->text('prof_test_accepted[' . $numInc . '][min_score]')->class('form-control numeric')->value($value->pivot?->min_score ?? null)->placeholder('Min Score') }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ html()->text('prof_test_accepted[' . $numInc . '][band_score]')->class('form-control numeric')->value($value->pivot?->band_score ?? null)->placeholder('Band Score') }}
|
||||
</td>
|
||||
|
||||
<td class="align-middle">
|
||||
<div class="hstack gap-2">
|
||||
<a href="javascript:void(0)" class="btn btn-sm btn-secondary fw-medium" onclick="cloneRow(this)"><i
|
||||
class="ri-add-fill align-middle"></i></a>
|
||||
<a href="javascript:void(0)" class="btn btn-sm btn-danger" onclick="removeRow(this)"><i
|
||||
class="ri-subtract-line align-middle"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
@@ -0,0 +1,28 @@
|
||||
<tr class="qualification-level">
|
||||
<td>
|
||||
{{ html()->text('level[' . $numInc . '][level]')->class('form-control')->placeholder('Qualification Level')->value($value->level ?? null)->required() }}
|
||||
{{ html()->div('Please enter level')->class('invalid-feedback') }}
|
||||
|
||||
</td>
|
||||
|
||||
<td class="d-flex flex-column gap-2">
|
||||
{{ html()->text('level[' . $numInc . '][faculty]')->class('form-control')->value($value->faculty ?? null)->placeholder('Faculty') }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ html()->text('level[' . $numInc . '][score]')->class('form-control')->value($value->score ?? null)->placeholder('Score') }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ html()->text('level[' . $numInc . '][year]')->class('form-control')->value($value->year ?? null)->placeholder('Year') }}
|
||||
</td>
|
||||
<td class="align-middle">
|
||||
<div class="hstack gap-2">
|
||||
<a href="javascript:void(0)" onclick="cloneRow(this)" class="btn btn-sm btn-secondary fw-medium"><i
|
||||
class="ri-add-fill align-middle"></i></a>
|
||||
<a href="javascript:void(0)" class="btn btn-sm btn-danger" onclick="removeRow(this)">
|
||||
<i class="ri-subtract-line align-middle"></i>
|
||||
</a>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
301
Modules/CourseFinder/resources/views/program/show.blade.php
Normal file
301
Modules/CourseFinder/resources/views/program/show.blade.php
Normal file
@@ -0,0 +1,301 @@
|
||||
@extends('layouts.app')
|
||||
@push('css')
|
||||
@endpush
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<x-dashboard.breadcumb :title="$title" />
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="card bg-white">
|
||||
<div class="card-body">
|
||||
<div class="row mb-3">
|
||||
<div class="col-md">
|
||||
<div class="row align-items-center g-3">
|
||||
<div class="col-md-auto">
|
||||
<div class="avatar-md">
|
||||
<div class="avatar-title rounded-circle bg-white">
|
||||
<img src="{{ $program->institution?->image }}"
|
||||
alt="Institution Logo" class="avatar-sm">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md">
|
||||
<div>
|
||||
<h4 class="fw-bold">{{ $program->title }}</h4>
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
<div><i class="ri-building-line me-1 align-bottom"></i> <span
|
||||
class="fw-medium"><a href="{{ $program->program_url }}"
|
||||
target="_blank">
|
||||
{{ $program->institution?->title }}</a></span>
|
||||
</div>
|
||||
<div class="vr"></div>
|
||||
<div>City : <span class="fw-medium">{{ $program->institution?->location ?? 'N/A' }}</span></div>
|
||||
<div class="vr"></div>
|
||||
<div>Code : <span class="fw-medium">{{ $program->code }}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-auto">
|
||||
<div class="hstack flex-wrap gap-1">
|
||||
<a href="{{ route('program.edit', $program->id) }}"
|
||||
class="btn btn-info btn-sm text-white">
|
||||
<i class="ri-edit-line"></i> Edit
|
||||
</a>
|
||||
<a href="{{ route('program.index') }}" class="btn btn-danger btn-sm text-white">
|
||||
Program List
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<div class="tab-content text-muted">
|
||||
<div class="tab-pane fade show active" id="project-overview" role="tabpanel">
|
||||
<div class="row">
|
||||
<div class="col-xl-9 col-lg-8">
|
||||
<div class="card bg-white">
|
||||
<div class="card-body">
|
||||
<div class="text-muted">
|
||||
<h5 class="card-title mb-0">Summary</h6>
|
||||
<div class="border-top border-top-dashed mt-4 pt-3">
|
||||
<div class="row gy-3">
|
||||
<div class="col-lg-3 col-sm-6">
|
||||
<div>
|
||||
<p class="text-uppercase fw-medium mb-2">Program Level :</p>
|
||||
<h5 class="fs-15 mb-0">{{ $program->programLevel?->title }}</h5>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3 col-sm-6">
|
||||
<div>
|
||||
<p class="text-uppercase fw-medium mb-2">Duration :</p>
|
||||
<h5 class="fs-15 mb-0">{{ $program->year }}</h5>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-6">
|
||||
<div>
|
||||
<p class="text-uppercase fw-medium mb-2">PSW :</p>
|
||||
<div class="badge bg-danger fs-12">{{ $program->psw }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-3 col-sm-6">
|
||||
<div>
|
||||
<p class="text-uppercase fw-medium mb-2">PROSPECTS :</p>
|
||||
<div class="badge bg-primary fs-12">{{ $program->prospects }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3 col-sm-6">
|
||||
<div>
|
||||
<p class="text-uppercase fw-medium mb-2">Tution Fee :</p>
|
||||
<div class="badge bg-warning fs-12">{{ $program->fee }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-3 col-sm-6">
|
||||
<div>
|
||||
<p class="text-uppercase fw-medium mb-2">Scholarship :</p>
|
||||
<div class="badge bg-info fs-12">{{ $program->scholarship }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h6 class="fw-semibold text-uppercase my-4">Keywords</h6>
|
||||
{!! $program->keywords !!}
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
<div class="card bg-white">
|
||||
<div class="card-header">
|
||||
<h5 class="card-title mb-0">Qualification Required </h5>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="display table-sm table-bordered table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th scope="col">S.N</th>
|
||||
<th scope="col">Level</th>
|
||||
<th scope="col">Faculty</th>
|
||||
<th scope="col">Score</th>
|
||||
<th scope="col">Pass out</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($program->level as $index => $item)
|
||||
<tr>
|
||||
<td scope="row">{{ $index++ }}</td>
|
||||
<td scope="row">{{ $item->level }}</td>
|
||||
<td>{{ $item->faculty }}</td>
|
||||
<td>{{ $item->score }}</td>
|
||||
<td>{{ $item->year }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card bg-white">
|
||||
<div class="card-header align-items-center d-flex">
|
||||
<h5 class="card-title flex-grow-1 mb-0">Proficiency Test </h5>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table-sm table">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th scope="col">S.N</th>
|
||||
<th scope="col">Test Required</th>
|
||||
<th scope="col">Min Score</th>
|
||||
<th scope="col">Band Score</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach ($program->tests as $index => $item)
|
||||
<tr>
|
||||
<td scope="row">{{ $index++ }}</td>
|
||||
<td scope="row">{{ $item->title }}</td>
|
||||
<td>{{ $item->pivot?->min_score }}</td>
|
||||
<td>{{ $item->pivot?->band_score }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
<!-- ene col -->
|
||||
<div class="col-xl-3 col-lg-4">
|
||||
<div class="card">
|
||||
<div class="card-header align-items-center d-flex border-bottom-dashed">
|
||||
<h4 class="card-title flex-grow-1 mb-0">Status</h4>
|
||||
<div class="flex-shrink-0">
|
||||
<span
|
||||
class="badge fw-bold fs-6 {{ $program->status == 1 ? 'text-bg-success' : 'text-bg-danger' }}">{{ config('constants.page_status_options')[$program->status] }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
<div class="card bg-white">
|
||||
<div class="card-header align-items-center d-flex border-bottom-dashed">
|
||||
<h4 class="card-title flex-grow-1 mb-0">Website</h4>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<a href="{{ $program->program_url }}"
|
||||
target="_blank">{{ $program->program_url }}</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card bg-white">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-4">Intake</h5>
|
||||
<div class="d-flex fs-16 flex-wrap gap-2">
|
||||
@foreach ($program->intakes as $value)
|
||||
<span class="fs-13 text-muted mb-0 text-center"><span
|
||||
class="badge bg-success p-2">{{ $intakeOptions[$value] }}</span></span>
|
||||
@endforeach
|
||||
</div>
|
||||
<div class="mb-3 mt-3 border border-dashed"></div>
|
||||
<div data-simplebar style="height: 60px;" class="mx-n3 px-3">
|
||||
<div class="vstack gap-3">
|
||||
<div class="d-flex align-items-center">
|
||||
|
||||
<div class="flex-grow-1">
|
||||
<h5 class="fs-13 mb-0">Intake Open Date</h5>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
<div class="text-info fw-bold fs-6">
|
||||
{{ $program->application_open }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end member item -->
|
||||
<div class="d-flex align-items-center">
|
||||
|
||||
<div class="flex-grow-1">
|
||||
<h5 class="fs-13 mb-0">Intake Deadline</h5>
|
||||
</div>
|
||||
<div class="flex-shrink-0">
|
||||
<div class="d-flex align-items-center gap-1">
|
||||
<div class="fs-6 fw-bold text-danger">
|
||||
{{ $program->application_deadline }}</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end member item -->
|
||||
|
||||
</div>
|
||||
<!-- end list -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
<div class="card bg-white">
|
||||
<div class="card-header align-items-center d-flex border-bottom-dashed">
|
||||
<h4 class="card-title flex-grow-1 mb-0">Required Documents</h4>
|
||||
</div>
|
||||
|
||||
<div class="card-body">
|
||||
<div class="">
|
||||
<ul class="vstack gap-2 ps-4">
|
||||
@foreach ($program->requiredDocuments as $item)
|
||||
<li class="text-primary p-0">{{ $item->title }}</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!-- end card body -->
|
||||
</div>
|
||||
<!-- end card -->
|
||||
|
||||
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
<!-- end row -->
|
||||
</div>
|
||||
<!-- end tab pane -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<!-- end col -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endsection
|
@@ -0,0 +1,27 @@
|
||||
{{ html()->form('POST', route('programLevel.store'))->class('needs-validation')->attributes(['novalidate'])->open() }}
|
||||
|
||||
@isset($programLevel)
|
||||
{{ html()->hidden('id', $programLevel->id) }}
|
||||
@endisset
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="mb-3">
|
||||
{{ html()->label('Title')->for('title') }}
|
||||
{{ html()->span('*')->class('text-danger') }}
|
||||
{{ html()->text('title')->value($programLevel->title ?? old('title'))->class('form-control')->placeholder('Enter Title')->required() }}
|
||||
{{ html()->div('Please enter a title.')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ html()->label('Description')->for('description') }}
|
||||
{{ html()->textarea('description')->value($programLevel->description ?? old('description'))->class('form-control')->rows(5)->placeholder('Enter Description') }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<x-form-buttons :href="route('programLevel.index')" :label="isset($programLevel) ? 'Update' : 'Create'" />
|
||||
</div>
|
||||
</div>
|
||||
{{ html()->form()->close() }}
|
@@ -0,0 +1,10 @@
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
<a href="{{ route('programLevel.index', $id) }}" class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
|
||||
<a data-link="{{ route('programLevel.toggle', $id) }}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Toggle" data-status="{{ $status == 1 ? 'Draft' : 'Published' }}"
|
||||
class="link-info fs-15 toggle-item"><i class="{{ $status == 1 ? 'ri-toggle-line' : 'ri-toggle-fill' }}"></i></a>
|
||||
|
||||
<a href="javascript:void(0);" data-link="{{ route('programLevel.destroy', $id) }}" class="link-danger fs-15 remove-item"><i
|
||||
class="ri-delete-bin-line"></i>
|
||||
</a>
|
||||
</div>
|
@@ -0,0 +1,46 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
@if ($errors->any())
|
||||
<x-flash-message type="danger" :messages="$errors->all()" />
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-xl-3">
|
||||
<div class="card profile-card">
|
||||
@include('coursefinder::programLevel.add-program-level-form')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-xl-8 col-lg-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
@php
|
||||
$columns = [
|
||||
[
|
||||
'title' => 'S.N',
|
||||
'data' => 'DT_RowIndex',
|
||||
'name' => 'DT_RowIndex',
|
||||
'orderable' => false,
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
],
|
||||
['title' => 'Name', 'data' => 'title', 'name' => 'title'],
|
||||
['title' => 'Status', 'data' => 'status', 'name' => 'status'],
|
||||
[
|
||||
'title' => 'Action',
|
||||
'data' => 'action',
|
||||
'orderable' => false,
|
||||
'searchable' => false,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<x-data-table-script :route="route('programLevel.index')" :reorder="route('programLevel.reorder')" :columns="$columns" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
@@ -0,0 +1,32 @@
|
||||
{{ html()->form('POST', route('requiredDocument.store'))->class('needs-validation')->attributes(['novalidate'])->open() }}
|
||||
|
||||
@isset($requiredDocument)
|
||||
{{ html()->hidden('id', $requiredDocument->id) }}
|
||||
@endisset
|
||||
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="mb-3">
|
||||
{{ html()->label('Document Title')->for('title') }}
|
||||
{{ html()->span('*')->class('text-danger') }}
|
||||
{{ html()->text('title')->value($requiredDocument->title ?? old('title'))->class('form-control')->placeholder('Enter Title')->required() }}
|
||||
{{ html()->div('Please enter a title.')->class('invalid-feedback') }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ html()->label('Link')->for('link') }}
|
||||
{{ html()->text('link')->value($requiredDocument->link ?? old('link'))->class('form-control')->placeholder('Enter Related Link') }}
|
||||
</div>
|
||||
|
||||
<div class="mb-3">
|
||||
{{ html()->label('Sample Document')->class('form-label')->for('image') }}
|
||||
<x-image-input :editable="$editable" id="image" name="image" :data="$editable ? $requiredDocument->getRawOriginal('image') : null" :multiple="false" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<x-form-buttons :href="route('requiredDocument.index')" :label="isset($requiredDocument) ? 'Update' : 'Create'" />
|
||||
</div>
|
||||
</div>
|
||||
{{ html()->form()->close() }}
|
@@ -0,0 +1,10 @@
|
||||
<div class="hstack flex-wrap gap-3">
|
||||
<a href="{{ route('requiredDocument.index', $id) }}" class="link-success fs-15 edit-item-btn"><i class="ri-edit-2-line"></i></a>
|
||||
|
||||
<a data-link="{{ route('requiredDocument.toggle', $id) }}" data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-title="Toggle" data-status="{{ $status == 1 ? 'Draft' : 'Published' }}"
|
||||
class="link-info fs-15 toggle-item"><i class="{{ $status == 1 ? 'ri-toggle-line' : 'ri-toggle-fill' }}"></i></a>
|
||||
|
||||
<a href="javascript:void(0);" data-link="{{ route('requiredDocument.destroy', $id) }}" class="link-danger fs-15 remove-item"><i
|
||||
class="ri-delete-bin-line"></i>
|
||||
</a>
|
||||
</div>
|
@@ -0,0 +1,49 @@
|
||||
@extends('layouts.app')
|
||||
|
||||
@section('content')
|
||||
<div class="container-fluid">
|
||||
<x-dashboard.breadcumb :title="$title" />
|
||||
@if ($errors->any())
|
||||
<x-flash-message type="danger" :messages="$errors->all()" />
|
||||
@endif
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-4 col-xl-3">
|
||||
<div class="card profile-card">
|
||||
@include('coursefinder::requiredDocument.add-required-document-form')
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-xl-8 col-lg-9">
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
@php
|
||||
$columns = [
|
||||
[
|
||||
'title' => 'S.N',
|
||||
'data' => 'DT_RowIndex',
|
||||
'name' => 'DT_RowIndex',
|
||||
'orderable' => false,
|
||||
'searchable' => false,
|
||||
'sortable' => false,
|
||||
],
|
||||
['title' => 'Sample', 'data' => 'image', 'name' => 'image'],
|
||||
['title' => 'Name', 'data' => 'title', 'name' => 'title'],
|
||||
['title' => 'Link', 'data' => 'link', 'name' => 'link'],
|
||||
['title' => 'Status', 'data' => 'status', 'name' => 'status'],
|
||||
[
|
||||
'title' => 'Action',
|
||||
'data' => 'action',
|
||||
'orderable' => false,
|
||||
'searchable' => false,
|
||||
],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<x-data-table-script :route="route('requiredDocument.index')" :reorder="route('requiredDocument.reorder')" :columns="$columns" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
0
Modules/CourseFinder/routes/.gitkeep
Normal file
0
Modules/CourseFinder/routes/.gitkeep
Normal file
18
Modules/CourseFinder/routes/api.php
Normal file
18
Modules/CourseFinder/routes/api.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
/*
|
||||
*--------------------------------------------------------------------------
|
||||
* API Routes
|
||||
*--------------------------------------------------------------------------
|
||||
*
|
||||
* Here is where you can register API routes for your application. These
|
||||
* routes are loaded by the RouteServiceProvider within a group which
|
||||
* is assigned the "api" middleware group. Enjoy building your API!
|
||||
*
|
||||
*/
|
||||
|
||||
Route::middleware(['auth:sanctum'])->prefix('v1')->group(function () {
|
||||
//
|
||||
});
|
41
Modules/CourseFinder/routes/web.php
Normal file
41
Modules/CourseFinder/routes/web.php
Normal file
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Route;
|
||||
use Modules\CourseFinder\Http\Controllers\CoopController;
|
||||
use Modules\CourseFinder\Http\Controllers\ProgramController;
|
||||
use Modules\CourseFinder\Http\Controllers\ProgramLevelController;
|
||||
use Modules\CourseFinder\Http\Controllers\RequiredDocumentController;
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Web Routes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here is where you can register web routes for your application. These
|
||||
| routes are loaded by the RouteServiceProvider within a group which
|
||||
| contains the "web" middleware group. Now create something great!
|
||||
|
|
||||
*/
|
||||
|
||||
Route::group(['middleware' => ['web', 'auth', 'permission'], 'prefix' => 'admin/'], function () {
|
||||
|
||||
Route::post('required-document/reorder', [RequiredDocumentController::class, 'reorder'])->name('requiredDocument.reorder');
|
||||
Route::get('required-document/toggle/{id}', [RequiredDocumentController::class, 'toggle'])->name('requiredDocument.toggle');
|
||||
Route::get('required-document/{id?}', [RequiredDocumentController::class, 'index'])->name('requiredDocument.index');
|
||||
Route::resource('required-document', RequiredDocumentController::class)->names('requiredDocument')->only(['store', 'edit', 'destroy']);
|
||||
|
||||
Route::post('program-level/reorder', [ProgramLevelController::class, 'reorder'])->name('programLevel.reorder');
|
||||
Route::get('program-level/toggle/{id}', [ProgramLevelController::class, 'toggle'])->name('programLevel.toggle');
|
||||
Route::get('program-level/{id?}', [ProgramLevelController::class, 'index'])->name('programLevel.index');
|
||||
Route::resource('program-level', ProgramLevelController::class)->names('programLevel')->only(['store', 'edit', 'destroy']);
|
||||
|
||||
Route::post('coop/reorder', [CoopController::class, 'reorder'])->name('coop.reorder');
|
||||
Route::get('coop/toggle/{id}', [CoopController::class, 'toggle'])->name('coop.toggle');
|
||||
Route::get('coop/{id?}', [CoopController::class, 'index'])->name('coop.index');
|
||||
Route::resource('coop', CoopController::class)->names('coop')->only(['store', 'edit', 'destroy']);
|
||||
|
||||
Route::post('program/reorder', [ProgramController::class, 'reorder'])->name('program.reorder');
|
||||
Route::post('program/import', [ProgramController::class, 'import'])->name('program.import');
|
||||
Route::get('program/toggle/{id}', [ProgramController::class, 'toggle'])->name('program.toggle');
|
||||
Route::resource('program', ProgramController::class)->names('program');
|
||||
});
|
26
Modules/CourseFinder/vite.config.js
Normal file
26
Modules/CourseFinder/vite.config.js
Normal file
@@ -0,0 +1,26 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import laravel from 'laravel-vite-plugin';
|
||||
|
||||
export default defineConfig({
|
||||
build: {
|
||||
outDir: '../../public/build-coursefinder',
|
||||
emptyOutDir: true,
|
||||
manifest: true,
|
||||
},
|
||||
plugins: [
|
||||
laravel({
|
||||
publicDirectory: '../../public',
|
||||
buildDirectory: 'build-coursefinder',
|
||||
input: [
|
||||
__dirname + '/resources/assets/sass/app.scss',
|
||||
__dirname + '/resources/assets/js/app.js'
|
||||
],
|
||||
refresh: true,
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
//export const paths = [
|
||||
// 'Modules/CourseFinder/resources/assets/sass/app.scss',
|
||||
// 'Modules/CourseFinder/resources/assets/js/app.js',
|
||||
//];
|
Reference in New Issue
Block a user