Done
This commit is contained in:
parent
66818a062b
commit
728c9f531f
Binary file not shown.
|
@ -17,10 +17,19 @@ class AdminDataKursusController extends Controller
|
|||
// ADMIN FADIAS TUKANG SERVER
|
||||
public function dataKursus()
|
||||
{
|
||||
// Mengambil semua data kursus dari model DataKursus
|
||||
$courses = DataKursus::all();
|
||||
|
||||
// Mengambil gambar untuk setiap course, jika ada
|
||||
foreach ($courses as $course) {
|
||||
$course->imageNames = $course->img_konten ? json_decode($course->img_konten, true) : [];
|
||||
}
|
||||
|
||||
// Mengirim data courses dengan gambar ke view
|
||||
return view('admin.dataKursusAdmin', ['courses' => $courses]);
|
||||
}
|
||||
|
||||
|
||||
public function create()
|
||||
{
|
||||
return view('admin.tambahDataKursusAdmin');
|
||||
|
@ -40,7 +49,8 @@ public function store(Request $request)
|
|||
'lokasi' => 'required',
|
||||
'latitude' => 'nullable', // Ubah aturan validasi
|
||||
'longitude' => 'nullable', // Ubah aturan validasi
|
||||
'img_konten.*' => 'file|mimes:jpeg,png,jpg|max:2048',
|
||||
'popular' => 'required', // Ubah aturan validasi
|
||||
'img_konten.*' => 'required|file|mimes:jpeg,png,jpg|max:2048',
|
||||
]);
|
||||
|
||||
// Cek apakah validasi gagal
|
||||
|
@ -70,6 +80,7 @@ public function store(Request $request)
|
|||
'lokasi' => $request->lokasi,
|
||||
'latitude' => $request->latitude, // Menyimpan nilai latitude bebas
|
||||
'longitude' => $request->longitude, // Menyimpan nilai longitude bebas
|
||||
'popular' => $request->popular, // Menyimpan nilai longitude bebas
|
||||
'img_konten' => json_encode($imgKontenPaths),
|
||||
]);
|
||||
|
||||
|
@ -96,52 +107,59 @@ public function edit($id)
|
|||
|
||||
public function update(Request $request, $id)
|
||||
{
|
||||
// Validasi request
|
||||
$request->validate([
|
||||
'nama_kursus' => 'required|string|max:255',
|
||||
'deskripsi' => 'required|string',
|
||||
'img' => 'nullable|image|max:2048',
|
||||
'img_konten.*' => 'nullable|image|max:2048',
|
||||
'latitude' => 'required|numeric',
|
||||
'longitude' => 'nullable|numeric',
|
||||
'paket' => 'nullable|string',
|
||||
'metode' => 'nullable|string',
|
||||
'fasilitas' => 'nullable|string',
|
||||
'lokasi' => 'nullable|string',
|
||||
]);
|
||||
try {
|
||||
$request->validate([
|
||||
'nama_kursus' => 'required|string|max:255',
|
||||
'deskripsi' => 'required|string',
|
||||
'img' => 'nullable|image|max:2048',
|
||||
'img_konten.*' => 'nullable|image|max:2048',
|
||||
'latitude' => 'required|numeric',
|
||||
'longitude' => 'nullable|numeric',
|
||||
'popular' => 'required|string',
|
||||
'paket' => 'nullable|string',
|
||||
'metode' => 'nullable|string',
|
||||
'fasilitas' => 'nullable|string',
|
||||
'lokasi' => 'nullable|string',
|
||||
]);
|
||||
|
||||
// Ambil record DataKursus berdasarkan ID-nya
|
||||
$dataKursus = DataKursus::findOrFail($id);
|
||||
// Ambil record DataKursus berdasarkan ID-nya
|
||||
$dataKursus = DataKursus::findOrFail($id);
|
||||
|
||||
// Update fields
|
||||
$dataKursus->nama_kursus = $request->input('nama_kursus');
|
||||
$dataKursus->deskripsi = $request->input('deskripsi');
|
||||
$dataKursus->latitude = $request->input('latitude');
|
||||
$dataKursus->longitude = $request->input('longitude');
|
||||
$dataKursus->paket = $request->input('paket');
|
||||
$dataKursus->metode = $request->input('metode');
|
||||
$dataKursus->fasilitas = $request->input('fasilitas');
|
||||
$dataKursus->lokasi = $request->input('lokasi');
|
||||
// Update fields
|
||||
$dataKursus->nama_kursus = $request->input('nama_kursus');
|
||||
$dataKursus->deskripsi = $request->input('deskripsi');
|
||||
$dataKursus->latitude = $request->input('latitude');
|
||||
$dataKursus->longitude = $request->input('longitude');
|
||||
$dataKursus->popular = $request->input('popular');
|
||||
$dataKursus->paket = $request->input('paket');
|
||||
$dataKursus->metode = $request->input('metode');
|
||||
$dataKursus->fasilitas = $request->input('fasilitas');
|
||||
$dataKursus->lokasi = $request->input('lokasi');
|
||||
|
||||
// Handle single image upload
|
||||
if ($request->hasFile('img')) {
|
||||
$dataKursus->img = $request->file('img')->store('images', 'public');
|
||||
}
|
||||
|
||||
// Handle multiple image uploads
|
||||
if ($request->hasFile('img_konten')) {
|
||||
$images = [];
|
||||
foreach ($request->file('img_konten') as $file) {
|
||||
$images[] = $file->store('images', 'public');
|
||||
// Handle single image upload
|
||||
if ($request->hasFile('img')) {
|
||||
$dataKursus->img = $request->file('img')->store('images', 'public');
|
||||
}
|
||||
$dataKursus->img_konten = json_encode($images);
|
||||
|
||||
// Handle multiple image uploads
|
||||
if ($request->hasFile('img_konten')) {
|
||||
$images = [];
|
||||
foreach ($request->file('img_konten') as $file) {
|
||||
$images[] = $file->store('images', 'public');
|
||||
}
|
||||
$dataKursus->img_konten = json_encode($images);
|
||||
}
|
||||
|
||||
// Save updated record
|
||||
$dataKursus->save();
|
||||
|
||||
// Redirect with success message
|
||||
return redirect()->route('admin.dataKursus')->with('success', 'Data berhasil diperbarui.');
|
||||
} catch (\Exception $e) {
|
||||
dd($e->getMessage());
|
||||
}
|
||||
// Validasi request
|
||||
|
||||
// Save updated record
|
||||
$dataKursus->save();
|
||||
|
||||
// Redirect with success message
|
||||
return redirect()->route('admin.dataKursus')->with('success', 'Data berhasil diperbarui.');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -11,12 +11,21 @@ class PengunjungController extends Controller
|
|||
// PENGUNJUNG
|
||||
public function home()
|
||||
{
|
||||
$landingpage = DataKursus::inRandomOrder()->limit(3)->get();
|
||||
// Ambil 3 data yang populer dari tabel DataKursus
|
||||
$landingpage = DataKursus::where('popular', 'Popular')
|
||||
->limit(3)
|
||||
->get();
|
||||
|
||||
// Potong deskripsi agar hanya terdiri dari 22 kata
|
||||
foreach ($landingpage as $item) {
|
||||
$item->deskripsi = \Illuminate\Support\Str::words($item->deskripsi, 22, '...');
|
||||
}
|
||||
|
||||
// Kembalikan view dengan data yang sudah diproses
|
||||
return view('user.home', compact('landingpage'));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -61,7 +70,7 @@ public function rute(string $id)
|
|||
$ruteTerdekat = DataKursus::find($id);
|
||||
|
||||
// Jika data tidak ditemukan, bisa menampilkan halaman error atau redirect
|
||||
|
||||
|
||||
|
||||
return view('user.rute', compact('ruteTerdekat'));
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@ class DataKursus extends Model
|
|||
'lokasi',
|
||||
'latitude',
|
||||
'longitude', // Pastikan nama kolom sesuai dengan migrasi
|
||||
'popular', // Pastikan nama kolom sesuai dengan migrasi
|
||||
'img_konten'
|
||||
];
|
||||
|
||||
|
|
|
@ -25,6 +25,7 @@ public function definition(): array
|
|||
'lokasi' => fake()->city,
|
||||
'latitude' => fake()->latitude,
|
||||
'longitude' => fake()->longitude,
|
||||
'popular' => 'Tidak',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ public function up()
|
|||
$table->longText('lokasi');
|
||||
$table->string('latitude');
|
||||
$table->string('longitude');
|
||||
$table->string('popular');
|
||||
$table->json('img_konten')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
|
|
@ -1,35 +1,16 @@
|
|||
<x-adminlayout>
|
||||
<div class="w-full pt-10 pb-6 px-6">
|
||||
<div class="w-full pt-4 pb-6 px-4">
|
||||
<div class="flex flex-col rounded-2xl overflow-hidden bg-white">
|
||||
<!-- Bagian atas menampilkan satu gambar secara acak -->
|
||||
<div class="relative">
|
||||
@if ($randomLandingPage)
|
||||
@if ($randomLandingPage->img)
|
||||
<div class="relative group">
|
||||
<img src="{{ asset('storage/' . $randomLandingPage->img) }}"
|
||||
class="object-cover w-full max-h-[600px] rounded-2xl" alt="Gambar">
|
||||
<div
|
||||
class="absolute inset-0 bg-black bg-opacity-30 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity">
|
||||
<p class="text-white text-lg font-semibold">{{ $randomLandingPage->nama_kursus }}</p>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="flex items-center justify-center h-[600px] bg-gray-200 rounded-t-2xl">
|
||||
<p class="text-gray-600">Tidak ada gambar yang tersedia.</p>
|
||||
</div>
|
||||
@endif
|
||||
@else
|
||||
<div class="py-10 flex col-span-3">
|
||||
<div class="bg-[#EBFEA1] w-full poppins-extrabold m-auto flex items-center justify-center p-2">
|
||||
<p>Tidak Tersedia Kursus</p>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
<div class="flex m-auto justify-center items-center responsive-container">
|
||||
<img src="{{ asset('img/Rectangle 227.png') }}" class="w-full h-full" alt="">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Bagian bawah menampilkan maksimal 6 gambar secara acak -->
|
||||
<div class="py-4">
|
||||
<div class="grid grid-cols-5 gap-4">
|
||||
<div class="py-2">
|
||||
<div class="grid grid-cols-5 gap-2">
|
||||
@if ($randomLandingPages->isNotEmpty())
|
||||
@foreach ($randomLandingPages as $page)
|
||||
<div
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
<tr>
|
||||
<th scope="col" class="px-6 py-3">No</th>
|
||||
<th scope="col" class="px-6 py-3">Nama Kursus</th>
|
||||
<th scope="col" class="px-6 py-3">Deskripsi</th>
|
||||
{{-- <th scope="col" class="px-6 py-3">Deskripsi</th> --}}
|
||||
<th scope="col" class="px-6 py-3">Popular</th>
|
||||
<th scope="col" class="px-6 py-3">Gambar</th>
|
||||
<th scope="col" class="px-6 py-3">Aksi</th>
|
||||
</tr>
|
||||
|
@ -31,16 +32,24 @@ class="justify-center items-center px6 py-4 font-medium text-gray-900 whitespac
|
|||
<td class="px-6 py-4 m-auto">
|
||||
{{ $course->nama_kursus }}
|
||||
</td>
|
||||
{{-- <td class="px-6 py-4 m-auto">
|
||||
{{ Str::limit($course->deskripsi, 20, '...') }}
|
||||
|
||||
</td> --}}
|
||||
<td class="px-6 py-4 m-auto">
|
||||
{{ $course->deskripsi }}
|
||||
{{ $course->popular }}
|
||||
</td>
|
||||
<td class="px-6 py-4 m-auto">
|
||||
<img src="{{ asset('storage/' . $course->img) }}"
|
||||
class="w-72 h-14 shadow-md shadow-gray-500 object-cover" alt="">
|
||||
class="w-72 h-44 shadow-md shadow-gray-500 object-cover" alt="">
|
||||
</td>
|
||||
<td class="justify-center items-center px6 py-4">
|
||||
<div class="m-auto space-x-2 flex justify-center">
|
||||
|
||||
<button data-modal-target="modal-detail{{ $course->id }}"
|
||||
data-modal-toggle="modal-detail{{ $course->id }}"
|
||||
class="font-medium shadow-md shadow-gray-600 hover:bg-[#3F6A6B] text-white py-2 px-4 bg-[#4F7F81] rounded-xl">
|
||||
Detail
|
||||
</button>
|
||||
<a href="/admin/{{ $course->id }}/edit-kursus"
|
||||
class="font-medium shadow-md shadow-gray-600 hover:bg-[#3F6A6B] text-white py-2 px-4 bg-[#4F7F81] rounded-xl">
|
||||
Edit
|
||||
|
@ -152,6 +161,38 @@ class="fixed top-4 left-1/2 transform -translate-x-1/2 bg-green-50 text-green-80
|
|||
}
|
||||
});
|
||||
</script>
|
||||
<!-- Main modal -->
|
||||
|
||||
|
||||
<div id="modal-detail{{ $course->id }}" tabindex="-1" aria-hidden="true"
|
||||
class="hidden overflow-y-auto fixed top-0 right-0 left-0 z-50 flex justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl xl:max-w-5xl max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
|
||||
<!-- Modal header -->
|
||||
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
|
||||
<h2 class="text-lg font-semibold">Detail Gambar</h2>
|
||||
</div>
|
||||
<!-- Modal body -->
|
||||
<div class="p-4 md:p-5">
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-4">
|
||||
@if (!empty($course->imageNames))
|
||||
@foreach ($course->imageNames as $img_konten)
|
||||
<div class="border border-slate-300 rounded-md p-2">
|
||||
<img src="{{ asset('storage/' . $img_konten) }}"
|
||||
class="w-full h-auto object-contain" alt="Image">
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<p>Tidak ada gambar yang tersedia.</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal footer -->
|
||||
<div class="flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600">
|
||||
<button data-modal-hide="modal-detail{{ $course->id }}" type="button"
|
||||
class="py-2.5 px-5 ms-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">Oke</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</x-adminlayout>
|
||||
|
|
|
@ -15,12 +15,28 @@
|
|||
@csrf
|
||||
<div class="grid gap-6 mb-6 md:grid-cols-2">
|
||||
<!-- Nama Kursus -->
|
||||
<div>
|
||||
<label for="nama_kursus" class="block mb-2 text-sm font-medium text-gray-900">Nama
|
||||
Kursus</label>
|
||||
<input type="text" id="nama_kursus" name="nama_kursus"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"
|
||||
placeholder="Kampung Inggris LC - Language Center" required />
|
||||
<div class="grid gap-6 md:grid-cols-2">
|
||||
<div>
|
||||
<label for="nama_kursus" class="block mb-2 text-sm font-medium text-gray-900">Nama
|
||||
Kursus</label>
|
||||
<input type="text" id="nama_kursus" name="nama_kursus"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"
|
||||
placeholder="Kampung Inggris LC - Language Center" required />
|
||||
</div>
|
||||
<div>
|
||||
<form class="max-w-sm mx-auto">
|
||||
<label for="countries"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Pilih
|
||||
Popular</label>
|
||||
<select id="popular" name="popular"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
<option value="Tidak">Tidak</option>
|
||||
<option value="Popular">Popular</option>
|
||||
</select>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!-- File Upload -->
|
||||
|
|
|
@ -17,15 +17,33 @@
|
|||
<div class="grid gap-6 mb-6 md:grid-cols-2">
|
||||
|
||||
<!-- Nama Kursus -->
|
||||
<div>
|
||||
<label for="nama_kursus" class="block mb-2 text-sm font-medium text-gray-900">Nama
|
||||
Kursus</label>
|
||||
<input type="text" id="nama_kursus"
|
||||
value="{{ old('nama_kursus', $dataKursus->nama_kursus) }}" name="nama_kursus"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"
|
||||
placeholder="Kampung Inggris LC - Language Center" required />
|
||||
<div class="grid gap-6 md:grid-cols-2">
|
||||
<div>
|
||||
|
||||
<label for="nama_kursus" class="block mb-2 text-sm font-medium text-gray-900">Nama
|
||||
Kursus</label>
|
||||
<input type="text" id="nama_kursus"
|
||||
value="{{ old('nama_kursus', $dataKursus->nama_kursus) }}" name="nama_kursus"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5"
|
||||
placeholder="Kampung Inggris LC - Language Center" required />
|
||||
</div>
|
||||
<div>
|
||||
<label for="countries"
|
||||
class="block mb-2 text-sm font-medium text-gray-900 dark:text-white">Pilih
|
||||
Popular</label>
|
||||
<select id="countries" name="popular"
|
||||
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-blue-500 focus:border-blue-500 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-blue-500 dark:focus:border-blue-500">
|
||||
<option selected>{{ $dataKursus->popular }}</option>
|
||||
@if ($dataKursus->popular === 'popular')
|
||||
<option value="Tidak">Tidak</option>
|
||||
@else
|
||||
<option value="popular">Popular</option>
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- File Upload -->
|
||||
<div>
|
||||
<label for="file_input" class="block mb-2 text-sm font-medium text-gray-900">Upload File</label>
|
||||
|
|
|
@ -5,23 +5,29 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container flex justify-end items-center pb-16">
|
||||
<div id="default-carousel" class="relative w-full" data-carousel="slide">
|
||||
<div class="container flex justify-center items-center pb-16">
|
||||
|
||||
<section id="gambarutama">
|
||||
<div class="h-auto w-full ">
|
||||
<img src=" {{ asset('storage/' . $data->img) }}" alt="" class="h-auto w-full">
|
||||
</div>
|
||||
|
||||
</section>
|
||||
|
||||
{{-- <div id="default-carousel" class="relative w-full" data-carousel="slide">
|
||||
<!-- Carousel wrapper -->
|
||||
<div
|
||||
class="relative h-48 sm:h-[250px] md:h-[350px] lg:h-[450px] xl:h-[500px] 2xl:h-[600px] overflow-hidden rounded-lg">
|
||||
<div class="relative h-56 md:h-96 overflow-hidden rounded-lg">
|
||||
@if (!empty($imageNames) && count($imageNames) > 0)
|
||||
@foreach ($imageNames as $index => $img_konten)
|
||||
<div class="hidden duration-1000 ease-in-out" data-carousel-item>
|
||||
<img src="{{ asset('storage/' . $img_konten) }}"
|
||||
class="absolute block w-full -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2"
|
||||
alt="...">
|
||||
<div class="{{ $index === 0 ? 'block' : 'hidden' }} duration-1000 ease-in-out"
|
||||
data-carousel-item>
|
||||
<img src="{{ asset('storage/' . $img_konten) }}" class="w-full h-auto object-contain"
|
||||
alt="Image {{ $index + 1 }}">
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="hidden duration-1000 ease-in-out" data-carousel-item>
|
||||
<img src="https://via.placeholder.com/600x400"
|
||||
class="absolute block w-full -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2"
|
||||
<div class="block duration-1000 ease-in-out" data-carousel-item>
|
||||
<img src="https://via.placeholder.com/600x400" class="w-full h-auto object-contain"
|
||||
alt="No image available">
|
||||
</div>
|
||||
@endif
|
||||
|
@ -31,17 +37,17 @@ class="absolute block w-full -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2"
|
|||
<div class="absolute z-30 flex -translate-x-1/2 bottom-5 left-1/2 space-x-3 rtl:space-x-reverse">
|
||||
@if (!empty($imageNames) && count($imageNames) > 0)
|
||||
@for ($i = 0; $i < count($imageNames); $i++)
|
||||
<button type="button" class="w-3 h-3 rounded-full"
|
||||
<button type="button"
|
||||
class="w-3 h-3 rounded-full {{ $i === 0 ? 'bg-blue-500' : 'bg-gray-300' }}"
|
||||
aria-current="{{ $i === 0 ? 'true' : 'false' }}" aria-label="Slide {{ $i + 1 }}"
|
||||
data-carousel-slide-to="{{ $i }}"></button>
|
||||
@endfor
|
||||
@else
|
||||
<button type="button" class="w-3 h-3 rounded-full" aria-current="true"
|
||||
<button type="button" class="w-3 h-3 rounded-full bg-gray-300" aria-current="true"
|
||||
aria-label="No slides available"></button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Slider controls -->
|
||||
<button type="button"
|
||||
class="absolute top-0 start-0 z-30 flex items-center justify-center h-full px-4 cursor-pointer group focus:outline-none"
|
||||
|
@ -61,29 +67,71 @@ class="inline-flex items-center justify-center w-10 h-10 rounded-full bg-white/3
|
|||
class="absolute top-0 end-0 z-30 flex items-center justify-center h-full px-4 cursor-pointer group focus:outline-none"
|
||||
data-carousel-next>
|
||||
<span
|
||||
class="inline-flex items-center justify-center w-10 h-10 rounded-full bg-white/30 group-hover:bg-white/50 group-focus:ring-4 group-focus:ring-white group-focus:outline-none">
|
||||
<svg class="w-4 h-4 text-white rtl:rotate-180" aria-hidden="true"
|
||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
|
||||
class="inline-flex items-center justify-center w-10 h-10 rounded-full bg-white/30 group-hover:bg-white/50 group-focus:ring-4 group-focus:ring-white group-focus:outline-none">
|
||||
<svg class="w-4 h-4 text-white rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||
fill="none" viewBox="0 0 6 10">
|
||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||
d="m1 9 4-4-4-4" />
|
||||
</svg>
|
||||
<span class="sr-only">Next</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</div> --}}
|
||||
</div>
|
||||
|
||||
<div class="container">
|
||||
<p class="poppins-medium text-3xl xl:text-4xl text-black pb-4">Kampung Inggris LC - Language Center </p>
|
||||
<a href="/kursus/{{ $data->id }}/rute" target="_blank"
|
||||
class="poppins-regular py-2 px-4 bg-[#4F7F81] text-white rounded-xl text-xl shadow-xl">Rute Terdekat</a>
|
||||
<button data-modal-target="default-modal-detail-gambar" data-modal-toggle="default-modal-detail-gambar"
|
||||
class="poppins-regular py-2 px-4 bg-[#4F7F81] text-white rounded-xl text-xl shadow-xl">Detail</button>
|
||||
|
||||
|
||||
<!-- Main modal -->
|
||||
<div id="default-modal-detail-gambar" tabindex="-1" aria-hidden="true"
|
||||
class="hidden overflow-y-auto overflow-x-hidden fixed top-0 right-0 left-0 z-50 justify-center items-center w-full md:inset-0 h-[calc(100%-1rem)] max-h-full">
|
||||
<div class="relative p-4 w-full max-w-2xl xl:max-w-5xl max-h-full">
|
||||
<!-- Modal content -->
|
||||
<div class="relative bg-white rounded-lg shadow dark:bg-gray-700">
|
||||
<!-- Modal header -->
|
||||
<div class="flex items-center justify-between p-4 md:p-5 border-b rounded-t dark:border-gray-600">
|
||||
<img src="" alt="">
|
||||
</div>
|
||||
<!-- Modal body -->
|
||||
<div class="p-4 md:p-5 space-y-4">
|
||||
<div class="relative overflow-hidden rounded-lg gap-4 space-y-4 ">
|
||||
@if (!empty($imageNames) && count($imageNames) > 0)
|
||||
@foreach ($imageNames as $index => $img_konten)
|
||||
<div class="border border-slate-300 rounded-md p-4">
|
||||
<img src="{{ asset('storage/' . $img_konten) }}"
|
||||
class="w-full h-auto object-contain" alt="Image {{ $index + 1 }}">
|
||||
</div>
|
||||
@endforeach
|
||||
@else
|
||||
<div class="block duration-1000 ease-in-out" data-carousel-item>
|
||||
<img src="https://via.placeholder.com/600x400" class="w-full h-auto object-contain"
|
||||
alt="No image available">
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal footer -->
|
||||
<div class="flex items-center p-4 md:p-5 border-t border-gray-200 rounded-b dark:border-gray-600">
|
||||
<button data-modal-hide="default-modal-detail-gambar" type="button"
|
||||
class="py-2.5 px-5 ms-3 text-sm font-medium text-gray-900 focus:outline-none bg-white rounded-lg border border-gray-200 hover:bg-gray-100 hover:text-blue-700 focus:z-10 focus:ring-4 focus:ring-gray-100 dark:focus:ring-gray-700 dark:bg-gray-800 dark:text-gray-400 dark:border-gray-600 dark:hover:text-white dark:hover:bg-gray-700">Oke</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<p class="text-black text-2xl pt-10 xl:pt-16 poppins-semibold">Deskripsi</p>
|
||||
<p class="poppins-regular text-black text-2xl pb-2 max-w-7xl">
|
||||
{{ $data->deskripsi }}
|
||||
</p>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-20 py-14">
|
||||
|
||||
<div class="max-w-max space-y-2">
|
||||
<div
|
||||
class="grid grid-cols-1 lg:grid-cols-3 gap-4 lg:gap-20 py-10">
|
||||
<div class="w-auto xl:max-w-max space-y-2">
|
||||
<p class="poppins-semibold text-2xl text-black underline">
|
||||
Paket
|
||||
</p>
|
||||
|
@ -91,7 +139,7 @@ class="poppins-regular py-2 px-4 bg-[#4F7F81] text-white rounded-xl text-xl shad
|
|||
{!! $data->paket !!}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="max-w-max space-y-2">
|
||||
<div class="w-auto xl:max-w-max space-y-2">
|
||||
<p class="poppins-semibold text-2xl text-black underline">
|
||||
Metode Pembelajaran
|
||||
</p>
|
||||
|
@ -105,7 +153,7 @@ class="poppins-regular py-2 px-4 bg-[#4F7F81] text-white rounded-xl text-xl shad
|
|||
{!! $data->fasilitas !!}
|
||||
</h1>
|
||||
</div>
|
||||
<div class="max-w-max space-y-2">
|
||||
<div class="w-auto xl:max-w-max space-y-2">
|
||||
<p class="poppins-semibold text-2xl text-black underline">
|
||||
Lokasi
|
||||
</p>
|
||||
|
@ -115,6 +163,7 @@ class="poppins-regular py-2 px-4 bg-[#4F7F81] text-white rounded-xl text-xl shad
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</x-layout>
|
||||
|
|
|
@ -43,83 +43,4 @@ class="w-full h-56 sm:h-64 md:h-96 lg:h-[500px] xl:h-[650px] max-w-4xl rounded-l
|
|||
@endforeach
|
||||
});
|
||||
</script>
|
||||
</x-layout>
|
||||
|
||||
|
||||
|
||||
|
||||
{{-- <x-layout>
|
||||
<style>
|
||||
#map {
|
||||
height: 400px;
|
||||
/* Tinggi default */
|
||||
max-width: 100%;
|
||||
}
|
||||
</style>
|
||||
<div class="container flex">
|
||||
<div class="py-10 bg-white">
|
||||
<div class="bg-[#EBFEA1] poppins-extrabold m-auto flex items-center justify-center p-2">
|
||||
<p>Halaman ini berisi tentang kursus di Pare!</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="pb-10">
|
||||
<div id="map"
|
||||
class="w-full h-56 sm:h-64 md:h-96 lg:h-[500px] xl:h-[650px] max-w-4xl rounded-lg shadow-lg"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet/dist/leaflet.css" />
|
||||
<script src="https://unpkg.com/leaflet/dist/leaflet.js"></script>
|
||||
<script>
|
||||
const map = L.map('map').setView([-7.7523414, 112.1700522], 15);
|
||||
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
attribution: '© OpenStreetMap contributors'
|
||||
}).addTo(map);
|
||||
|
||||
const markers = [
|
||||
@foreach ($latilongti as $latilongti)
|
||||
{
|
||||
// coords: [{{ $latilongti->latitude }}, {{ $latilongti->longitude }}],
|
||||
// popupText: '{{ $latilongti->nama_kursus }}',
|
||||
// href: '{{ route('admin.dataKursus') }}'
|
||||
|
||||
|
||||
coords: [-8.1537943,113.7333205],
|
||||
popupText: 'anjai',
|
||||
href: '#'
|
||||
},
|
||||
@endforeach
|
||||
];
|
||||
|
||||
markers.forEach(marker => {
|
||||
L.marker(marker.coords).addTo(map).bindPopup(marker.popupText);
|
||||
});
|
||||
|
||||
function onLocationFound(e) {
|
||||
const userIcon = L.icon({
|
||||
iconUrl: 'https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.7.1/images/marker-icon-red.png',
|
||||
iconSize: [25, 41],
|
||||
iconAnchor: [12, 41],
|
||||
popupAnchor: [1, -34]
|
||||
});
|
||||
|
||||
const userMarker = L.marker(e.latlng, {
|
||||
icon: userIcon
|
||||
}).addTo(map);
|
||||
userMarker.bindPopup("You are here").openPopup();
|
||||
|
||||
map.setView(e.latlng, 15);
|
||||
}
|
||||
|
||||
function onLocationError(e) {
|
||||
alert("Unable to retrieve your location.");
|
||||
}
|
||||
|
||||
if (navigator.geolocation) {
|
||||
navigator.geolocation.getCurrentPosition(onLocationFound, onLocationError);
|
||||
} else {
|
||||
alert("Geolocation is not supported by this browser.");
|
||||
}
|
||||
</script>
|
||||
</x-layout> --}}
|
||||
</x-layout>
|
|
@ -10,6 +10,8 @@
|
|||
Route::middleware('auth')->group(function () {
|
||||
// ADMIN
|
||||
Route::get('/admin/dashboard', [AdminDashboardController::class, 'index'])->name('admin.home'); // SHOW DASHBOARD
|
||||
|
||||
|
||||
Route::get('/admin/data-kursus', [AdminDataKursusController::class, 'dataKursus'])->name('admin.dataKursus'); //SHOW DATA
|
||||
Route::get('/admin/create-data', [AdminDataKursusController::class, 'create'])->name('admin.create'); // SHOW TAMBAH DATA
|
||||
Route::get('/admin/{id}/edit-kursus', [AdminDataKursusController::class, 'edit'])->name('admin.edit'); // SHOW EDIT DATA
|
||||
|
|
|
@ -9,8 +9,8 @@ export default {
|
|||
theme: {
|
||||
container: {
|
||||
padding: {
|
||||
DEFAULT: "1rem",
|
||||
sm: "1rem",
|
||||
DEFAULT: "0rem",
|
||||
sm: "0rem",
|
||||
lg: "2rem",
|
||||
xl: "3rem",
|
||||
"2xl": "0rem",
|
||||
|
|
Loading…
Reference in New Issue