main
ilhamwara 2025-08-13 10:51:47 +07:00
parent 84c92d41a0
commit f7fc427836
17 changed files with 1010 additions and 135 deletions

View File

@ -0,0 +1,23 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use App\Models\Konten\Kegiatan;
class FrontController extends Controller
{
function index() {
$data['kegiatan'] = Kegiatan::orderBy('KegiatanId','DESC')->limit(5)->get();
return view('index',$data);
}
function sekolah() {
return view('sekolah');
}
function kegiatan() {
$data['kegiatan'] = Kegiatan::orderBy('KegiatanId','DESC')->paginate(8);
return view('kegiatan',$data);
}
function galeri() {
return view('galeri');
}
}

View File

@ -0,0 +1,130 @@
<?php
namespace App\Http\Controllers\Modules\Konten;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use App\Models\Konten\Galeri;
use App\Models\Konten\ImageGaleri;
class GaleriController extends Controller
{
private $template = 'modules.konten.galeri';
private $route = 'modules.konten.galeri';
private $title = 'Konten Galeri';
/**
* Display a listing of the resource.
*/
public function index()
{
$data['breadcrumbs'] = [
['name' => 'Dashboard','url' => url('dashboard')],
['name' => 'Konten'],
['name' => 'Galeri','active' => true],
];
$data['route'] = $this->route;
$data['title'] = $this->title;
return view($this->template.'.index',$data);
}
public function grid(Request $request)
{
$data = Galeri::all();
foreach ($data as $key => $row) {
$action = '';
if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){
$action .= '<a href="'.url('konten/galeri/update/'.encode_id($row->GaleriId)).'" data-toggle="tooltip" title="Edit Data" class="btn btn-xs btn-block btn-primary"><i class="fal fa-pencil text-white"></i></a>';
$action .= '<a href="#" data-href="'.url('konten/galeri/delete/'.encode_id($row->GaleriId)).'" data-toggle="tooltip" title="Hapus Data" class="remove_data btn btn-xs btn-block btn-danger"><i class="fal fa-trash text-white"></i></a>';
}
$_data[] = [
'no' => $key+1,
'id' => encode_id($row->GaleriId),
'judul' => $row->judul,
'action' => $action,
];
}
return response()->json($_data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['breadcrumbs'] = [
['name' => 'Dashboard','url' => url('dashboard')],
['name' => 'Konten'],
['name' => 'Galeri','url' => url('konten/galeri')],
['name' => 'Tambah Galeri','active' => true],
];
$data['route'] = $this->route;
$data['title'] = $this->title;
return view($this->template.'.form',$data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
//
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
$data['breadcrumbs'] = [
['name' => 'Dashboard','url' => url('dashboard')],
['name' => 'Konten'],
['name' => 'Galeri','url' => url('konten/galeri')],
['name' => 'Edit Galeri','active' => true],
];
$data['route'] = $this->route;
$data['title'] = $this->title;
$data['item'] = Galeri::find(decode_id($id));
return view($this->template.'.form',$data);
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, string $id)
{
}
/**
* Remove the specified resource from storage.
*/
public function delete($id)
{
$keyId = decode_id($id);
$form = Galeri::where('GaleriId',$keyId)->delete();
return response()->json(['success' => true,'message' => 'Berhasil update data','type' => 'success']);
}
}

View File

@ -0,0 +1,227 @@
<?php
namespace App\Http\Controllers\Modules\Konten;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\File;
use Carbon\Carbon;
use App\Models\Konten\Kegiatan;
class KegiatanController extends Controller
{
private $template = 'modules.konten.kegiatan';
private $route = 'modules.konten.kegiatan';
private $title = 'Konten Kegiatan';
/**
* Display a listing of the resource.
*/
public function index()
{
$data['breadcrumbs'] = [
['name' => 'Dashboard','url' => url('dashboard')],
['name' => 'Konten'],
['name' => 'Kegiatan','active' => true],
];
$data['route'] = $this->route;
$data['title'] = $this->title;
return view($this->template.'.index',$data);
}
public function grid(Request $request)
{
$data = Kegiatan::all();
foreach ($data as $key => $row) {
$action = '';
if((permission('is_create', $this->route.'.*','module',false)) || (permission('is_update', $this->route.'.*','module',false))){
$action .= '<a href="'.url('konten/kegiatan/update/'.encode_id($row->KegiatanId)).'" data-toggle="tooltip" title="Edit Data" class="btn btn-xs btn-block btn-primary"><i class="fal fa-pencil text-white"></i></a>';
$action .= '<a href="#" data-href="'.url('konten/kegiatan/delete/'.encode_id($row->KegiatanId)).'" data-toggle="tooltip" title="Hapus Data" class="remove_data btn btn-xs btn-block btn-danger"><i class="fal fa-trash text-white"></i></a>';
}
$_data[] = [
'no' => $key+1,
'id' => encode_id($row->KegiatanId),
'judul' => $row->judul,
'created_at' => dateTime($row->created_at),
'image' => '<image src="'.asset('uploads/'.$row->image).'" width="80">',
'action' => $action,
];
}
return response()->json($_data);
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
$data['breadcrumbs'] = [
['name' => 'Dashboard','url' => url('dashboard')],
['name' => 'Konten'],
['name' => 'Kegiatan','url' => url('konten/kegiatan')],
['name' => 'Tambah Kegiatan','active' => true],
];
$data['route'] = $this->route;
$data['title'] = $this->title;
return view($this->template.'.form',$data);
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
// dd($request->all());
try {
if(@$request->secure_id){
$keyId = decode_id($request->secure_id);
$keg = Kegiatan::find($keyId);
$keg->slug = \Str::slug($request->judul);
$keg->judul = $request->judul;
$keg->kategori = $request->kategori;
$keg->body = $request->body;
if (@$request->hasFile('image')) {
$file = $request->file('image');
$destinationPath = public_path('uploads/kegiatan');
$current = Carbon::now()->format('Y/m/d');
$path = $destinationPath . '/' . $current;
$fileName = $file->getClientOriginalName();
$fileMime = $file->getClientMimeType();
$fileExtension = $file->getClientOriginalExtension();
$fileSize = $file->getSize();
if(($fileExtension != 'jpg') && ($fileExtension != 'jpeg') && ($fileExtension != 'png')){
return redirect()->back()->with([
'message' => 'Maaf File Harus Berupa PNG,JPEG,JPG!',
'type' => "error"
]);
}
$newFilename = session('id').'_'.uniqid('file_') . '.' . $fileExtension;
if (!File::exists($path)) {
File::isDirectory($path) or File::makeDirectory($path, 0777, true, true);
}
$filePathTim = 'kegiatan/' . $current . '/' . $newFilename;
$uploaded = $file->move($path, $newFilename);
$keg->image = $filePathTim;
}
$keg->save();
}else{
$keg = new Kegiatan;
$keg->slug = \Str::slug($request->judul);
$keg->judul = $request->judul;
$keg->kategori = $request->kategori;
$keg->body = $request->body;
if (@$request->hasFile('image')) {
$file = $request->file('image');
$destinationPath = public_path('uploads/kegiatan');
$current = Carbon::now()->format('Y/m/d');
$path = $destinationPath . '/' . $current;
$fileName = $file->getClientOriginalName();
$fileMime = $file->getClientMimeType();
$fileExtension = $file->getClientOriginalExtension();
$fileSize = $file->getSize();
if(($fileExtension != 'jpg') && ($fileExtension != 'jpeg') && ($fileExtension != 'png')){
return redirect()->back()->with([
'message' => 'Maaf File Harus Berupa PNG,JPEG,JPG!',
'type' => "error"
]);
}
$newFilename = session('id').'_'.uniqid('file_') . '.' . $fileExtension;
if (!File::exists($path)) {
File::isDirectory($path) or File::makeDirectory($path, 0777, true, true);
}
$filePathTim = 'kegiatan/' . $current . '/' . $newFilename;
$uploaded = $file->move($path, $newFilename);
$keg->image = $filePathTim;
}
$keg->save();
}
return redirect()->back()->with([
'message' => 'Berhasil update data',
'type' => 'success',
]);
} catch (Exception $e) {
return redirect()->back()->with([
'message' => $e->getMessage(),
'type' => "error"
]);
}
}
/**
* Display the specified resource.
*/
public function show(string $id)
{
//
}
/**
* Show the form for editing the specified resource.
*/
public function edit(string $id)
{
$data['breadcrumbs'] = [
['name' => 'Dashboard','url' => url('dashboard')],
['name' => 'Konten'],
['name' => 'Kegiatan','url' => url('konten/kegiatan')],
['name' => 'Edit Kegiatan','active' => true],
];
$data['route'] = $this->route;
$data['title'] = $this->title;
$data['item'] = Kegiatan::find(decode_id($id));
return view($this->template.'.form',$data);
}
/**
* Update the specified resource in storage.
*/
public function update($id)
{
$data['breadcrumbs'] = [
['name' => 'Dashboard','url' => url('dashboard')],
['name' => 'Konten'],
['name' => 'Kegiatan','url' => url('konten/kegiatan')],
['name' => 'Tambah Kegiatan','active' => true],
];
$data['route'] = $this->route;
$data['title'] = $this->title;
$data['item'] = Kegiatan::find(decode_id($id));
$data['keyId'] = $id;
return view($this->template.'.form',$data);
}
/**
* Remove the specified resource from storage.
*/
public function delete($id)
{
$keyId = decode_id($id);
$form = Kegiatan::where('KegiatanId',$keyId)->delete();
return response()->json(['success' => true,'message' => 'Berhasil update data','type' => 'success']);
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Models\Konten;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Galeri extends Model
{
use HasFactory;
protected $table = 'galeri';
protected $primaryKey = 'GaleriId';
}

View File

@ -0,0 +1,19 @@
<?php
namespace App\Models\Konten;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ImageGaleri extends Model
{
use HasFactory;
protected $table = 'image_galeris';
protected $primaryKey = 'ImagegaleriId';
public function galeri()
{
return $this->belongsTo(\App\Models\Galeri::class,'galeri_id');
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Models\Konten;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Kegiatan extends Model
{
use HasFactory;
protected $table = 'kegiatan';
protected $primaryKey = 'KegiatanId';
}

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::create('kegiatan', function (Blueprint $table) {
$table->id('KegiatanId');
$table->string('slug')->nullable();
$table->string('judul')->nullable();
$table->text('body')->nullable();
$table->string('kategori')->nullable();
$table->string('image')->nullable();
$table->timestampsTz();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('kegiatans');
}
};

View File

@ -0,0 +1,29 @@
<?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('galeri', function (Blueprint $table) {
$table->id('GaleriId');
$table->string('judul')->nullable();
$table->text('deskripsi')->nullable();
$table->timestampsTz();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('galeris');
}
};

View File

@ -0,0 +1,30 @@
<?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('image_galeris', function (Blueprint $table) {
$table->id('ImagegaleriId');
$table->integer('galeri_id');
$table->timestampsTz();
$table->foreign('galeri_id')->references('GaleriId')->on('galeri')->onDelete('cascade');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('image_galeris');
}
};

View File

@ -171,58 +171,34 @@
<div class="flex flex-row gap-10">
<div class="w-full lg:w-2/3">
<div class="flex flex-col gap-3">
<img src="{{ asset('berita.png') }}" alt="" class="w-full lg:w-[100%]">
<img src="{{ asset('uploads/'.$kegiatan[0]->image) }}" alt="" class="w-full lg:w-[100%] rounded-[10px]">
<div class="flex flex-row gap-3 items-center">
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan Provinsi</span>
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan {{ $kegiatan[0]->kategori }}</span>
<span class="text-xs opacity-[50%]">{{ date('D',strtotime($kegiatan[0]->created_at)) }}, {{ date('d M Y',strtotime($kegiatan[0]->created_at)) }}</span>
</div>
<h4 class="text-2xl text-black font-bold mt-2">Kagiatan Program Sekolah Adiwiyata Provinsi SMPN 197</h4>
<p class="opacity-[50%]">
JAKARTA Sebanyak empat pelanggar Peraturan Daerah (Perda) Provinsi DKI Jakarta Nomor 2 Tahun 2005 tentang Pengendalian Pencemaran Udara menjalani sidang Tindak Pidana Ringan (Tipiring) di Pengadilan Negeri Jakarta Barat pada Selasa (29/7).
</p>
<a href="#section2" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<h4 class="text-2xl text-black font-bold mt-2">{{ $kegiatan[0]->judul }}</h4>
<div class="text-sm opacity-[50%]">
{!! substr(strip_tags($kegiatan[0]->body),0,1000) !!}
</div>
<a href="{{ url('kegiatan/'.$kegiatan[0]->slug) }}" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<span>Baca Selengkapnya</span> <x-lucide-arrow-right width="20" class="text-warning"/>
</a>
</div>
</div>
<div class="hidden lg:block w-1/3">
<div class="flex flex-col gap-3">
@foreach($kegiatan as $dataKeg)
<div class="flex items-center gap-3 flex-row border-b-1 border-b-[#eee] pb-3">
<div class="flex justify-end w-2/5">
<img src="{{ asset('SDN Ciracas 15.jpg') }}" class="rounded-[10px] ">
<img src="{{ asset('uploads/'.$dataKeg->image) }}" class="rounded-[10px] ">
</div>
<div class="flex flex-col gap-3 justify-center w-3/5">
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
<h4 class="text-xs text-black font-bold">Kagiatan Program Sekolah Adiwiyata SDN 15 Ciracas</h4>
</div>
</div>
<div class="flex items-center gap-3 flex-row border-b-1 border-b-[#eee] pb-3">
<div class="flex justify-end w-2/5">
<img src="{{ asset('sma 67.jpg') }}" class="rounded-[10px] ">
</div>
<div class="flex flex-col gap-3 justify-center w-3/5">
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
<h4 class="text-xs text-black font-bold">Kagiatan Program Sekolah Adiwiyata SMAN 67 Jakarta</h4>
</div>
</div>
<div class="flex items-center gap-3 flex-row border-b-1 border-b-[#eee] pb-3">
<div class="flex justify-end w-2/5">
<img src="{{ asset('man 2 jakarta.jpg') }}" class="rounded-[10px] ">
</div>
<div class="flex flex-col gap-3 justify-center w-3/5">
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
<h4 class="text-xs text-black font-bold">Kagiatan Program Sekolah Adiwiyata MAN 2 Jakarta</h4>
</div>
</div>
<div class="flex items-center gap-3 flex-row pb-3">
<div class="flex justify-end w-2/5">
<img src="{{ asset('SDN Pondok Kelapa 05.jpg') }}" class="rounded-[10px] ">
</div>
<div class="flex flex-col gap-3 justify-center w-3/5">
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
<h4 class="text-xs text-black font-bold">Kagiatan Program Sekolah Adiwiyata SDN 05 Pondok Kelapa</h4>
<span class="text-xs opacity-[50%]">{{ date('D',strtotime($dataKeg->created_at)) }}, {{ date('d M Y',strtotime($dataKeg->created_at)) }}</span>
<a href="{{ url('kegiatan/'.$dataKeg->slug) }}" class="text-xs text-black font-bold">{{ $dataKeg->judul }}</a>
</div>
</div>
@endforeach
</div>
</div>

View File

@ -90,90 +90,28 @@
</div>
<div class="flex flex-row">
<div class="grid grid-rows-1 md:grid-cols-3 lg:grid-cols-4 gap-5">
@foreach($kegiatan as $dataKeg)
<div class="p-3 border border-[#eaeaea] rounded-[10px] shadow-[2px_1px_5px_0px_rgba(0,0,0,0.10)]">
<div class="flex flex-col gap-3">
<img src="{{ asset('berita.png') }}" alt="" class="w-full object-cover rounded-sm h-40 lg:w-[100%]">
<img src="{{ asset('uploads/'.$dataKeg->image) }}" alt="" class="w-full object-cover rounded-sm h-40 lg:w-[100%]">
<div class="flex flex-row gap-3 items-center">
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan Provinsi</span>
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan {{ $dataKeg->kategori }}</span>
<span class="text-xs opacity-[50%]">{{ date('D',strtotime($dataKeg->created_at)) }}, {{ date('d M Y',strtotime($dataKeg->created_at)) }}</span>
</div>
<h4 class="text-md text-black font-bold mt-2">Kagiatan Program Sekolah Adiwiyata Provinsi SMPN 197</h4>
<p class="text-xs opacity-[50%]">
JAKARTA Sebanyak empat pelanggar Peraturan Daerah (Perda) Provinsi DKI Jakarta Nomor 2 Tahun 2005 tentang Pengendalian Pencemaran Udara
</p>
<a href="#section2" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<h4 class="text-md text-black font-bold mt-2">{{ $dataKeg->judul }}</h4>
<div class="text-xs opacity-[50%]">
{!! substr(strip_tags($dataKeg->body),0,200) !!}
</div>
<a href="{{ url('kegiatan/'.$dataKeg->slug) }}" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<span>Baca Selengkapnya</span> <x-lucide-arrow-right width="20" class="text-warning"/>
</a>
</div>
</div>
<div class="p-3 border border-[#eaeaea] rounded-[10px] shadow-[2px_1px_5px_0px_rgba(0,0,0,0.10)]">
<div class="flex flex-col gap-3">
<img src="{{ asset('SDN Ciracas 15.jpg') }}" class="w-full object-cover rounded-sm h-40 lg:w-[100%]">
<div class="flex flex-row gap-3 items-center">
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan Provinsi</span>
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
</div>
<h4 class="text-md text-black font-bold mt-2">Kagiatan Program Sekolah Adiwiyata SDN 15 Ciracas</h4>
<p class="text-xs opacity-[50%]">
JAKARTA Sebanyak empat pelanggar Peraturan Daerah (Perda) Provinsi DKI Jakarta Nomor 2 Tahun 2005 tentang Pengendalian Pencemaran Udara
</p>
<a href="#section2" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<span>Baca Selengkapnya</span> <x-lucide-arrow-right width="20" class="text-warning"/>
</a>
</div>
</div>
<div class="p-3 border border-[#eaeaea] rounded-[10px] shadow-[2px_1px_5px_0px_rgba(0,0,0,0.10)]">
<div class="flex flex-col gap-3">
<img src="{{ asset('sma 67.jpg') }}" class="w-full object-cover rounded-sm h-40 lg:w-[100%]">
<div class="flex flex-row gap-3 items-center">
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan Provinsi</span>
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
</div>
<h4 class="text-md text-black font-bold mt-2">Kagiatan Program Sekolah Adiwiyata SMAN 67 Jakarta</h4>
<p class="text-xs opacity-[50%]">
JAKARTA Sebanyak empat pelanggar Peraturan Daerah (Perda) Provinsi DKI Jakarta Nomor 2 Tahun 2005 tentang Pengendalian Pencemaran Udara
</p>
<a href="#section2" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<span>Baca Selengkapnya</span> <x-lucide-arrow-right width="20" class="text-warning"/>
</a>
</div>
</div>
<div class="p-3 border border-[#eaeaea] rounded-[10px] shadow-[2px_1px_5px_0px_rgba(0,0,0,0.10)]">
<div class="flex flex-col gap-3">
<img src="{{ asset('man 2 jakarta.jpg') }}" class="w-full object-cover rounded-sm h-40 lg:w-[100%]">
<div class="flex flex-row gap-3 items-center">
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan Provinsi</span>
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
</div>
<h4 class="text-md text-black font-bold mt-2">Kagiatan Program Sekolah Adiwiyata MAN 2 Jakarta</h4>
<p class="text-xs opacity-[50%]">
JAKARTA Sebanyak empat pelanggar Peraturan Daerah (Perda) Provinsi DKI Jakarta Nomor 2 Tahun 2005 tentang Pengendalian Pencemaran Udara
</p>
<a href="#section2" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<span>Baca Selengkapnya</span> <x-lucide-arrow-right width="20" class="text-warning"/>
</a>
</div>
</div>
<div class="p-3 border border-[#eaeaea] rounded-[10px] shadow-[2px_1px_5px_0px_rgba(0,0,0,0.10)]">
<div class="flex flex-col gap-3">
<img src="{{ asset('SDN Pondok Kelapa 05.jpg') }}" class="h-full w-full lg:w-[100%]">
<div class="flex flex-row gap-3 items-center">
<span class="p-2 bg-warning text-xs rounded-[10px] text-white">Kegiatan Provinsi</span>
<span class="text-xs opacity-[50%]">Jumat, 1 Agustus 2025</span>
</div>
<h4 class="text-md text-black font-bold mt-2">Kagiatan Program Sekolah Adiwiyata SDN 05 Pondok Kelapa</h4>
<p class="text-xs opacity-[50%]">
JAKARTA Sebanyak empat pelanggar Peraturan Daerah (Perda) Provinsi DKI Jakarta Nomor 2 Tahun 2005 tentang Pengendalian Pencemaran Udara
</p>
<a href="#section2" class="text-sm text-warning rounded-[10px] mx-auto md:mx-0 flex flex-row gap-3 ">
<span>Baca Selengkapnya</span> <x-lucide-arrow-right width="20" class="text-warning"/>
</a>
</div>
</div>
@endforeach
</div>
</div>
<div class="mt-10">
{!! $kegiatan->links() !!}
</div>
</section>
<section id="footer" class="bottom-0">

View File

@ -0,0 +1,90 @@
@extends('layouts.master')
@section('breadcrumbs')
<ol class="breadcrumb page-breadcrumb">
@foreach($breadcrumbs as $dataBread)
<li class="breadcrumb-item {{@$dataBread['active'] == true ? 'active' : ''}}">
@if(@$dataBread['url'])
<a href="{{@$dataBread['url']}}">{{$dataBread['name']}}</a>
@else
{{$dataBread['name']}}
@endif
</li>
@endforeach
</ol>
@endsection
@section('content')
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<i class="fal fa-align-justify"></i> {{$title}}
</div>
<form action="{{route($route.'.store')}}" method="POST" class="">
{{csrf_field()}}
<div class="card-body">
<div class="row">
<div class="col-md-12">
<input type="hidden" name="secure_id" value="{{@$keyId}}">
</div>
<div class="col-12 mb-3">
<div class="form-group">
<label class="col-xl-12 form-label" for="fname">Judul</label>
<div class="col-12 pr-1">
<input type="text" value="{{@$item->judul ? @$item->judul : old('judul')}}" name="judul" class="form-control @error('judul') is-invalid @enderror" placeholder="Masukan Judul" required>
@error('name')
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
@enderror
</div>
</div>
</div>
<div class="col-12 mb-3">
<div class="form-group">
<label class="col-xl-12 form-label" for="fname">Judul</label>
<div class="col-12 pr-1">
<textarea name="deskripsi" class="form-control @error('deskripsi') is-invalid @enderror" id="" cols="30" rows="10">{{@$item->deskripsi ? @$item->deskripsi : old('deskripsi')}}</textarea>
@error('name')
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
@enderror
</div>
</div>
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12 text-right">
<a href="{{route($route.'.index')}}" class="btn btn-danger"><i class="fal fa-times"></i> Batal</a>
<button type="submit" class="btn btn-success"><i class="fal fa-save"></i> Simpan</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('page-js')
<script type="text/javascript">
$(document).ready(function() {
$('.numberInput').on('input', function() {
this.value = this.value.replace(/[^0-9]/g, ''); // Hanya angka 0-9
});
$('#togglePassword').on('click', function() {
let passwordField = $('#password');
let icon = $(this).find('i');
// Cek apakah input saat ini bertipe password
if (passwordField.attr('type') === 'password') {
passwordField.attr('type', 'text'); // Ubah ke teks
icon.removeClass('fa-eye').addClass('fa-eye-slash'); // Ganti ikon
} else {
passwordField.attr('type', 'password'); // Ubah ke password
icon.removeClass('fa-eye-slash').addClass('fa-eye'); // Kembalikan ikon
}
});
});
</script>
@endsection

View File

@ -0,0 +1,111 @@
@extends('layouts.master')
@section('page-css')
@endsection
@section('breadcrumbs')
<ol class="breadcrumb page-breadcrumb">
@foreach($breadcrumbs as $dataBread)
<li class="breadcrumb-item {{@$dataBread['active'] == true ? 'active' : ''}}">
@if(@$dataBread['url'])
<a href="{{@$dataBread['url']}}">{{$dataBread['name']}}</a>
@else
{{$dataBread['name']}}
@endif
</li>
@endforeach
</ol>
@endsection
@section('content')
<div class="subheader">
<h1 class="subheader-title">
{{$title}}
</h1>
</div>
<div class="row">
<div class="col-lg-12">
<div id="panel-4" class="panel">
<div class="panel-container show">
<div class="panel-content">
<div id="toolbar">
<a href="{{route($route.'.create')}}" id="btn-add" class="btn btn-primary">
<i class="fal fa-plus"></i> Tambah Data
</a>
</div>
<table class="table w-100"
data-search="true"
data-toggle="table"
data-pagination="true"
data-toolbar="#toolbar"
data-show-refresh="false"
data-url="{{route($route.'.grid')}}"
data-ajax-options='{"xhrFields": {"withCredentials": true}}'
data-sort-name="ids"
data-sort-order="desc"
data-page-size="10"
data-id-field="id"
id="grid-data">
<thead class="bg-primary-light text-primary">
<tr>
<th data-field="action">#</th>
<th data-field="no">No</th>
<th data-field="judul">Judul</th>
<th data-field="created_at">Created At</th>
</tr>
</thead>
<tbody></tbody>
</table>
<!-- datatable end -->
</div>
</div>
</div>
</div>
</div>
@endsection
@section('page-js')
<script type="text/javascript">
$("#grid-data").on("click", ".remove_data", function() {
var base_url = $(this).attr('data-href');
var id = $(this).attr('data-id');
swal({
title: "Hapus Data!",
text: "Apa anda yakin ingin menghapus data ini ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Ya Hapus Sekarang",
cancelButtonText: "Tidak",
closeOnConfirm: true,
closeOnCancel: true
},
function(isConfirm) {
if(isConfirm){
request = $.ajax({
url: base_url,
xhrFields: {
withCredentials: true
},
type: "GET",
});
// Callback handler that will be called on success
request.done(function(response, textStatus, jqXHR){
console.log(response);
toastr.success("Berhasil Menhapus Data", 'Berhasil!', {positionClass: 'toast-bottom-right', containerId: 'toast-bottom-right'});
$('#grid-data').bootstrapTable('refresh');
});
// Callback handler that will be called on failure
request.fail(function (jqXHR, textStatus, errorThrown){
toastr.error(
"Gagal "+textStatus, errorThrown
);
});
}
});
return false;
});
</script>
@endsection

View File

@ -0,0 +1,128 @@
@extends('layouts.master')
@section('page-css')
<link href="https://cdn.jsdelivr.net/npm/summernote@0.9.0/dist/summernote.min.css" rel="stylesheet">
@endsection
@section('breadcrumbs')
<ol class="breadcrumb page-breadcrumb">
@foreach($breadcrumbs as $dataBread)
<li class="breadcrumb-item {{@$dataBread['active'] == true ? 'active' : ''}}">
@if(@$dataBread['url'])
<a href="{{@$dataBread['url']}}">{{$dataBread['name']}}</a>
@else
{{$dataBread['name']}}
@endif
</li>
@endforeach
</ol>
@endsection
@section('content')
<div class="row">
<div class="col-lg-12">
<div class="card">
<div class="card-header">
<i class="fal fa-align-justify"></i> {{$title}}
</div>
<form action="{{route($route.'.store')}}" method="POST" enctype="multipart/form-data">
{{csrf_field()}}
<div class="card-body">
<div class="row">
<div class="col-md-12">
<input type="hidden" name="secure_id" value="{{@$keyId}}">
</div>
<div class="col-12 mb-3">
<div class="form-group">
<label class="col-xl-12 form-label" for="fname">Judul</label>
<div class="col-12 pr-1">
<input type="text" value="{{@$item->judul ? @$item->judul : old('judul')}}" name="judul" class="form-control @error('judul') is-invalid @enderror" placeholder="Masukan Judul" required>
@error('judul')
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
@enderror
</div>
</div>
</div>
<div class="col-12 mb-3">
<div class="form-group">
<label class="col-xl-12 form-label" for="fname">Jenis Kegiatan</label>
<div class="col-12 pr-1">
<select required class="form-control @error('kategori') is-invalid @enderror" name="kategori" id="">
<option value="">-- PILIH JENIS KEGIATAN --</option>
<option {{ @$item->kategori == 'Kota' ? 'selected' : '' }} value="Kota">Kegiatan Kota</option>
<option {{ @$item->kategori == 'Provinsi' ? 'selected' : '' }} value="Provinsi">Kegiatan Provinsi</option>
<option {{ @$item->kategori == 'Nasional' ? 'selected' : '' }} value="Nasional">Kegiatan Nasional</option>
<option {{ @$item->kategori == 'Mandiri' ? 'selected' : '' }} value="Mandiri">Kegiatan Mandiri</option>
</select>
@error('kategori')
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
@enderror
</div>
</div>
</div>
<div class="col-12 mb-3">
<div class="form-group">
<label class="col-xl-12 form-label" for="fname">Deskripsi</label>
<div class="col-12 pr-1">
<textarea name="body" id="summernote" class="form-control @error('body') is-invalid @enderror" cols="30" rows="10" required>{{@$item->body ? @$item->body : old('body')}}</textarea>
@error('body')
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
@enderror
</div>
</div>
</div>
<div class="col-12 mb-3">
<div class="form-group">
<label class="col-xl-12 form-label" for="fname">Image</label>
<div class="col-12 pr-1">
<input type="file" accept=".png,.jpg,.jpeg" name="image" class="form-control @error('image') is-invalid @enderror">
@error('image')
<span class="invalid-feedback" style="display: block!important;"><strong>{{$message}}</strong></span>
@enderror
</div>
</div>
</div>
</div>
</div>
<div class="card-footer">
<div class="row">
<div class="col-md-12 text-right">
<a href="{{route($route.'.index')}}" class="btn btn-danger"><i class="fal fa-times"></i> Batal</a>
<button type="submit" class="btn btn-success"><i class="fal fa-save"></i> Simpan</button>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
@endsection
@section('page-js')
<!-- include summernote css/js -->
<script src="https://cdn.jsdelivr.net/npm/summernote@0.9.0/dist/summernote.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#summernote').summernote();
});
$(document).ready(function() {
$('.numberInput').on('input', function() {
this.value = this.value.replace(/[^0-9]/g, ''); // Hanya angka 0-9
});
$('#togglePassword').on('click', function() {
let passwordField = $('#password');
let icon = $(this).find('i');
// Cek apakah input saat ini bertipe password
if (passwordField.attr('type') === 'password') {
passwordField.attr('type', 'text'); // Ubah ke teks
icon.removeClass('fa-eye').addClass('fa-eye-slash'); // Ganti ikon
} else {
passwordField.attr('type', 'password'); // Ubah ke password
icon.removeClass('fa-eye-slash').addClass('fa-eye'); // Kembalikan ikon
}
});
});
</script>
@endsection

View File

@ -0,0 +1,112 @@
@extends('layouts.master')
@section('page-css')
@endsection
@section('breadcrumbs')
<ol class="breadcrumb page-breadcrumb">
@foreach($breadcrumbs as $dataBread)
<li class="breadcrumb-item {{@$dataBread['active'] == true ? 'active' : ''}}">
@if(@$dataBread['url'])
<a href="{{@$dataBread['url']}}">{{$dataBread['name']}}</a>
@else
{{$dataBread['name']}}
@endif
</li>
@endforeach
</ol>
@endsection
@section('content')
<div class="subheader">
<h1 class="subheader-title">
{{$title}}
</h1>
</div>
<div class="row">
<div class="col-lg-12">
<div id="panel-4" class="panel">
<div class="panel-container show">
<div class="panel-content">
<div id="toolbar">
<a href="{{route($route.'.create')}}" id="btn-add" class="btn btn-primary">
<i class="fal fa-plus"></i> Tambah Data
</a>
</div>
<table class="table w-100"
data-search="true"
data-toggle="table"
data-pagination="true"
data-toolbar="#toolbar"
data-show-refresh="false"
data-url="{{route($route.'.grid')}}"
data-ajax-options='{"xhrFields": {"withCredentials": true}}'
data-sort-name="ids"
data-sort-order="desc"
data-page-size="10"
data-id-field="id"
id="grid-data">
<thead class="bg-primary-light text-primary">
<tr>
<th data-field="action">#</th>
<th data-field="no">No</th>
<th data-field="judul">Judul</th>
<th data-field="image">Image</th>
<th data-field="created_at">Created At</th>
</tr>
</thead>
<tbody></tbody>
</table>
<!-- datatable end -->
</div>
</div>
</div>
</div>
</div>
@endsection
@section('page-js')
<script type="text/javascript">
$("#grid-data").on("click", ".remove_data", function() {
var base_url = $(this).attr('data-href');
var id = $(this).attr('data-id');
swal({
title: "Hapus Data!",
text: "Apa anda yakin ingin menghapus data ini ?",
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Ya Hapus Sekarang",
cancelButtonText: "Tidak",
closeOnConfirm: true,
closeOnCancel: true
},
function(isConfirm) {
if(isConfirm){
request = $.ajax({
url: base_url,
xhrFields: {
withCredentials: true
},
type: "GET",
});
// Callback handler that will be called on success
request.done(function(response, textStatus, jqXHR){
console.log(response);
toastr.success("Berhasil Menhapus Data", 'Berhasil!', {positionClass: 'toast-bottom-right', containerId: 'toast-bottom-right'});
$('#grid-data').bootstrapTable('refresh');
});
// Callback handler that will be called on failure
request.fail(function (jqXHR, textStatus, errorThrown){
toastr.error(
"Gagal "+textStatus, errorThrown
);
});
}
});
return false;
});
</script>
@endsection

View File

@ -23,6 +23,8 @@ use App\Http\Controllers\Modules\Usulan\CSAMController;
use App\Http\Controllers\Modules\Usulan\CSANController;
use App\Http\Controllers\Modules\Usulan\SuratController;
use App\Http\Controllers\Modules\Usulan\SKController;
use App\Http\Controllers\Modules\Konten\GaleriController;
use App\Http\Controllers\Modules\Konten\KegiatanController;
Route::get('dashboard',[HomeController::class,'dashboard'])->name('dashboard');
Route::get('dashboard/gridUsulan',[HomeController::class,'gridUsulan'])->name('gridUsulan');
@ -34,6 +36,23 @@ Route::post('getSekolahSK',[AjaxController::class,'getSekolahSK'])->name('getSek
Route::post('getSekolahUsulan',[AjaxController::class,'getSekolahUsulan'])->name('getSekolahUsulan');
Route::name('konten.')->prefix('konten')->group(function () {
Route::name('kegiatan.')->prefix('kegiatan')->group(function () {
Route::resource('/',KegiatanController::class);
Route::get('/update/{id?}',[KegiatanController::class,'update'])->name('update');
Route::get('/grid',[KegiatanController::class,'grid'])->name('grid');
Route::get('delete/{id?}',[KegiatanController::class,'delete'])->name('delete');
});
Route::name('galeri.')->prefix('galeri')->group(function () {
Route::resource('/',GaleriController::class);
Route::get('/grid',[GaleriController::class,'grid'])->name('grid');
Route::get('/update/{id?}',[GaleriController::class,'update'])->name('update');
Route::get('delete/{id?}',[GaleriController::class,'delete'])->name('delete');
});
});
Route::name('master.')->prefix('master')->group(function () {
Route::resource('indikator',IndikatorController::class);
Route::resource('komponen',KomponenController::class);

View File

@ -6,6 +6,7 @@ use App\Http\Controllers\Auth\CustomLoginController;
use App\Http\Controllers\Auth\CustomRegisterController;
use App\Http\Controllers\HomeController;
use App\Http\Controllers\AjaxController;
use App\Http\Controllers\FrontController;
/*
|--------------------------------------------------------------------------
@ -37,28 +38,10 @@ Route::middleware(Session::class)->name('modules.')->group(function () {
Route::get('logout',[CustomLoginController::class,'logout'])->name('logout');
});
Route::get('/', function () {
return view('index');
// return redirect('login');
});
Route::get('/sekolah', function () {
return view('sekolah');
// return redirect('login');
});
Route::get('/kegiatan', function () {
return view('kegiatan');
// return redirect('login');
});
Route::get('/galeri', function () {
return view('galeri');
// return redirect('login');
});
Route::get('/',[FrontController::class,'index'])->name('index');
Route::get('/sekolah',[FrontController::class,'sekolah'])->name('sekolah');
Route::get('/kegiatan',[FrontController::class,'kegiatan'])->name('kegiatan');
Route::get('/galeri',[FrontController::class,'galeri'])->name('galeri');
// Auth::routes();
// Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home');