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
|
// ADMIN FADIAS TUKANG SERVER
|
||||||
public function dataKursus()
|
public function dataKursus()
|
||||||
{
|
{
|
||||||
|
// Mengambil semua data kursus dari model DataKursus
|
||||||
$courses = DataKursus::all();
|
$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]);
|
return view('admin.dataKursusAdmin', ['courses' => $courses]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function create()
|
public function create()
|
||||||
{
|
{
|
||||||
return view('admin.tambahDataKursusAdmin');
|
return view('admin.tambahDataKursusAdmin');
|
||||||
|
@ -40,7 +49,8 @@ public function store(Request $request)
|
||||||
'lokasi' => 'required',
|
'lokasi' => 'required',
|
||||||
'latitude' => 'nullable', // Ubah aturan validasi
|
'latitude' => 'nullable', // Ubah aturan validasi
|
||||||
'longitude' => '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
|
// Cek apakah validasi gagal
|
||||||
|
@ -70,6 +80,7 @@ public function store(Request $request)
|
||||||
'lokasi' => $request->lokasi,
|
'lokasi' => $request->lokasi,
|
||||||
'latitude' => $request->latitude, // Menyimpan nilai latitude bebas
|
'latitude' => $request->latitude, // Menyimpan nilai latitude bebas
|
||||||
'longitude' => $request->longitude, // Menyimpan nilai longitude bebas
|
'longitude' => $request->longitude, // Menyimpan nilai longitude bebas
|
||||||
|
'popular' => $request->popular, // Menyimpan nilai longitude bebas
|
||||||
'img_konten' => json_encode($imgKontenPaths),
|
'img_konten' => json_encode($imgKontenPaths),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -96,7 +107,7 @@ public function edit($id)
|
||||||
|
|
||||||
public function update(Request $request, $id)
|
public function update(Request $request, $id)
|
||||||
{
|
{
|
||||||
// Validasi request
|
try {
|
||||||
$request->validate([
|
$request->validate([
|
||||||
'nama_kursus' => 'required|string|max:255',
|
'nama_kursus' => 'required|string|max:255',
|
||||||
'deskripsi' => 'required|string',
|
'deskripsi' => 'required|string',
|
||||||
|
@ -104,6 +115,7 @@ public function update(Request $request, $id)
|
||||||
'img_konten.*' => 'nullable|image|max:2048',
|
'img_konten.*' => 'nullable|image|max:2048',
|
||||||
'latitude' => 'required|numeric',
|
'latitude' => 'required|numeric',
|
||||||
'longitude' => 'nullable|numeric',
|
'longitude' => 'nullable|numeric',
|
||||||
|
'popular' => 'required|string',
|
||||||
'paket' => 'nullable|string',
|
'paket' => 'nullable|string',
|
||||||
'metode' => 'nullable|string',
|
'metode' => 'nullable|string',
|
||||||
'fasilitas' => 'nullable|string',
|
'fasilitas' => 'nullable|string',
|
||||||
|
@ -118,6 +130,7 @@ public function update(Request $request, $id)
|
||||||
$dataKursus->deskripsi = $request->input('deskripsi');
|
$dataKursus->deskripsi = $request->input('deskripsi');
|
||||||
$dataKursus->latitude = $request->input('latitude');
|
$dataKursus->latitude = $request->input('latitude');
|
||||||
$dataKursus->longitude = $request->input('longitude');
|
$dataKursus->longitude = $request->input('longitude');
|
||||||
|
$dataKursus->popular = $request->input('popular');
|
||||||
$dataKursus->paket = $request->input('paket');
|
$dataKursus->paket = $request->input('paket');
|
||||||
$dataKursus->metode = $request->input('metode');
|
$dataKursus->metode = $request->input('metode');
|
||||||
$dataKursus->fasilitas = $request->input('fasilitas');
|
$dataKursus->fasilitas = $request->input('fasilitas');
|
||||||
|
@ -142,6 +155,11 @@ public function update(Request $request, $id)
|
||||||
|
|
||||||
// Redirect with success message
|
// Redirect with success message
|
||||||
return redirect()->route('admin.dataKursus')->with('success', 'Data berhasil diperbarui.');
|
return redirect()->route('admin.dataKursus')->with('success', 'Data berhasil diperbarui.');
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
dd($e->getMessage());
|
||||||
|
}
|
||||||
|
// Validasi request
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -11,15 +11,24 @@ class PengunjungController extends Controller
|
||||||
// PENGUNJUNG
|
// PENGUNJUNG
|
||||||
public function home()
|
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) {
|
foreach ($landingpage as $item) {
|
||||||
$item->deskripsi = \Illuminate\Support\Str::words($item->deskripsi, 22, '...');
|
$item->deskripsi = \Illuminate\Support\Str::words($item->deskripsi, 22, '...');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Kembalikan view dengan data yang sudah diproses
|
||||||
return view('user.home', compact('landingpage'));
|
return view('user.home', compact('landingpage'));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public function kursus()
|
public function kursus()
|
||||||
{
|
{
|
||||||
$data_kursus = DataKursus::all();
|
$data_kursus = DataKursus::all();
|
||||||
|
|
|
@ -21,6 +21,7 @@ class DataKursus extends Model
|
||||||
'lokasi',
|
'lokasi',
|
||||||
'latitude',
|
'latitude',
|
||||||
'longitude', // Pastikan nama kolom sesuai dengan migrasi
|
'longitude', // Pastikan nama kolom sesuai dengan migrasi
|
||||||
|
'popular', // Pastikan nama kolom sesuai dengan migrasi
|
||||||
'img_konten'
|
'img_konten'
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
@ -25,6 +25,7 @@ public function definition(): array
|
||||||
'lokasi' => fake()->city,
|
'lokasi' => fake()->city,
|
||||||
'latitude' => fake()->latitude,
|
'latitude' => fake()->latitude,
|
||||||
'longitude' => fake()->longitude,
|
'longitude' => fake()->longitude,
|
||||||
|
'popular' => 'Tidak',
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ public function up()
|
||||||
$table->longText('lokasi');
|
$table->longText('lokasi');
|
||||||
$table->string('latitude');
|
$table->string('latitude');
|
||||||
$table->string('longitude');
|
$table->string('longitude');
|
||||||
|
$table->string('popular');
|
||||||
$table->json('img_konten')->nullable();
|
$table->json('img_konten')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
|
@ -1,35 +1,16 @@
|
||||||
<x-adminlayout>
|
<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">
|
<div class="flex flex-col rounded-2xl overflow-hidden bg-white">
|
||||||
<!-- Bagian atas menampilkan satu gambar secara acak -->
|
<!-- Bagian atas menampilkan satu gambar secara acak -->
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
@if ($randomLandingPage)
|
<div class="flex m-auto justify-center items-center responsive-container">
|
||||||
@if ($randomLandingPage->img)
|
<img src="{{ asset('img/Rectangle 227.png') }}" class="w-full h-full" alt="">
|
||||||
<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>
|
||||||
</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>
|
|
||||||
|
|
||||||
<!-- Bagian bawah menampilkan maksimal 6 gambar secara acak -->
|
<!-- Bagian bawah menampilkan maksimal 6 gambar secara acak -->
|
||||||
<div class="py-4">
|
<div class="py-2">
|
||||||
<div class="grid grid-cols-5 gap-4">
|
<div class="grid grid-cols-5 gap-2">
|
||||||
@if ($randomLandingPages->isNotEmpty())
|
@if ($randomLandingPages->isNotEmpty())
|
||||||
@foreach ($randomLandingPages as $page)
|
@foreach ($randomLandingPages as $page)
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -14,7 +14,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col" class="px-6 py-3">No</th>
|
<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">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">Gambar</th>
|
||||||
<th scope="col" class="px-6 py-3">Aksi</th>
|
<th scope="col" class="px-6 py-3">Aksi</th>
|
||||||
</tr>
|
</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">
|
<td class="px-6 py-4 m-auto">
|
||||||
{{ $course->nama_kursus }}
|
{{ $course->nama_kursus }}
|
||||||
</td>
|
</td>
|
||||||
|
{{-- <td class="px-6 py-4 m-auto">
|
||||||
|
{{ Str::limit($course->deskripsi, 20, '...') }}
|
||||||
|
|
||||||
|
</td> --}}
|
||||||
<td class="px-6 py-4 m-auto">
|
<td class="px-6 py-4 m-auto">
|
||||||
{{ $course->deskripsi }}
|
{{ $course->popular }}
|
||||||
</td>
|
</td>
|
||||||
<td class="px-6 py-4 m-auto">
|
<td class="px-6 py-4 m-auto">
|
||||||
<img src="{{ asset('storage/' . $course->img) }}"
|
<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>
|
||||||
<td class="justify-center items-center px6 py-4">
|
<td class="justify-center items-center px6 py-4">
|
||||||
<div class="m-auto space-x-2 flex justify-center">
|
<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"
|
<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">
|
class="font-medium shadow-md shadow-gray-600 hover:bg-[#3F6A6B] text-white py-2 px-4 bg-[#4F7F81] rounded-xl">
|
||||||
Edit
|
Edit
|
||||||
|
@ -152,6 +161,38 @@ class="fixed top-4 left-1/2 transform -translate-x-1/2 bg-green-50 text-green-80
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
</script>
|
</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>
|
</x-adminlayout>
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
@csrf
|
@csrf
|
||||||
<div class="grid gap-6 mb-6 md:grid-cols-2">
|
<div class="grid gap-6 mb-6 md:grid-cols-2">
|
||||||
<!-- Nama Kursus -->
|
<!-- Nama Kursus -->
|
||||||
|
<div class="grid gap-6 md:grid-cols-2">
|
||||||
<div>
|
<div>
|
||||||
<label for="nama_kursus" class="block mb-2 text-sm font-medium text-gray-900">Nama
|
<label for="nama_kursus" class="block mb-2 text-sm font-medium text-gray-900">Nama
|
||||||
Kursus</label>
|
Kursus</label>
|
||||||
|
@ -22,6 +23,21 @@
|
||||||
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"
|
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 />
|
placeholder="Kampung Inggris LC - Language Center" required />
|
||||||
</div>
|
</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 -->
|
<!-- File Upload -->
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -17,7 +17,9 @@
|
||||||
<div class="grid gap-6 mb-6 md:grid-cols-2">
|
<div class="grid gap-6 mb-6 md:grid-cols-2">
|
||||||
|
|
||||||
<!-- Nama Kursus -->
|
<!-- Nama Kursus -->
|
||||||
|
<div class="grid gap-6 md:grid-cols-2">
|
||||||
<div>
|
<div>
|
||||||
|
|
||||||
<label for="nama_kursus" class="block mb-2 text-sm font-medium text-gray-900">Nama
|
<label for="nama_kursus" class="block mb-2 text-sm font-medium text-gray-900">Nama
|
||||||
Kursus</label>
|
Kursus</label>
|
||||||
<input type="text" id="nama_kursus"
|
<input type="text" id="nama_kursus"
|
||||||
|
@ -25,6 +27,22 @@
|
||||||
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"
|
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 />
|
placeholder="Kampung Inggris LC - Language Center" required />
|
||||||
</div>
|
</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 -->
|
<!-- File Upload -->
|
||||||
<div>
|
<div>
|
||||||
|
|
|
@ -5,23 +5,29 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container flex justify-end items-center pb-16">
|
<div class="container flex justify-center items-center pb-16">
|
||||||
<div id="default-carousel" class="relative w-full" data-carousel="slide">
|
|
||||||
|
<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 -->
|
<!-- Carousel wrapper -->
|
||||||
<div
|
<div class="relative h-56 md:h-96 overflow-hidden rounded-lg">
|
||||||
class="relative h-48 sm:h-[250px] md:h-[350px] lg:h-[450px] xl:h-[500px] 2xl:h-[600px] overflow-hidden rounded-lg">
|
|
||||||
@if (!empty($imageNames) && count($imageNames) > 0)
|
@if (!empty($imageNames) && count($imageNames) > 0)
|
||||||
@foreach ($imageNames as $index => $img_konten)
|
@foreach ($imageNames as $index => $img_konten)
|
||||||
<div class="hidden duration-1000 ease-in-out" data-carousel-item>
|
<div class="{{ $index === 0 ? 'block' : 'hidden' }} duration-1000 ease-in-out"
|
||||||
<img src="{{ asset('storage/' . $img_konten) }}"
|
data-carousel-item>
|
||||||
class="absolute block w-full -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2"
|
<img src="{{ asset('storage/' . $img_konten) }}" class="w-full h-auto object-contain"
|
||||||
alt="...">
|
alt="Image {{ $index + 1 }}">
|
||||||
</div>
|
</div>
|
||||||
@endforeach
|
@endforeach
|
||||||
@else
|
@else
|
||||||
<div class="hidden duration-1000 ease-in-out" data-carousel-item>
|
<div class="block duration-1000 ease-in-out" data-carousel-item>
|
||||||
<img src="https://via.placeholder.com/600x400"
|
<img src="https://via.placeholder.com/600x400" class="w-full h-auto object-contain"
|
||||||
class="absolute block w-full -translate-x-1/2 -translate-y-1/2 top-1/2 left-1/2"
|
|
||||||
alt="No image available">
|
alt="No image available">
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@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">
|
<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)
|
@if (!empty($imageNames) && count($imageNames) > 0)
|
||||||
@for ($i = 0; $i < count($imageNames); $i++)
|
@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 }}"
|
aria-current="{{ $i === 0 ? 'true' : 'false' }}" aria-label="Slide {{ $i + 1 }}"
|
||||||
data-carousel-slide-to="{{ $i }}"></button>
|
data-carousel-slide-to="{{ $i }}"></button>
|
||||||
@endfor
|
@endfor
|
||||||
@else
|
@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>
|
aria-label="No slides available"></button>
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<!-- Slider controls -->
|
<!-- Slider controls -->
|
||||||
<button type="button"
|
<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"
|
class="absolute top-0 start-0 z-30 flex items-center justify-center h-full px-4 cursor-pointer group focus:outline-none"
|
||||||
|
@ -62,28 +68,70 @@ class="absolute top-0 end-0 z-30 flex items-center justify-center h-full px-4 cu
|
||||||
data-carousel-next>
|
data-carousel-next>
|
||||||
<span
|
<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">
|
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"
|
<svg class="w-4 h-4 text-white rtl:rotate-180" aria-hidden="true" xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 6 10">
|
fill="none" viewBox="0 0 6 10">
|
||||||
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2"
|
||||||
d="m1 9 4-4-4-4" />
|
d="m1 9 4-4-4-4" />
|
||||||
</svg>
|
</svg>
|
||||||
<span class="sr-only">Next</span>
|
<span class="sr-only">Next</span>
|
||||||
</span>
|
</span>
|
||||||
</button>
|
</button>
|
||||||
|
</div> --}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<p class="poppins-medium text-3xl xl:text-4xl text-black pb-4">Kampung Inggris LC - Language Center </p>
|
<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"
|
<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>
|
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="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">
|
<p class="poppins-regular text-black text-2xl pb-2 max-w-7xl">
|
||||||
{{ $data->deskripsi }}
|
{{ $data->deskripsi }}
|
||||||
</p>
|
</p>
|
||||||
<div class="grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 gap-20 py-14">
|
<div
|
||||||
|
class="grid grid-cols-1 lg:grid-cols-3 gap-4 lg:gap-20 py-10">
|
||||||
<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">
|
<p class="poppins-semibold text-2xl text-black underline">
|
||||||
Paket
|
Paket
|
||||||
</p>
|
</p>
|
||||||
|
@ -91,7 +139,7 @@ class="poppins-regular py-2 px-4 bg-[#4F7F81] text-white rounded-xl text-xl shad
|
||||||
{!! $data->paket !!}
|
{!! $data->paket !!}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</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">
|
<p class="poppins-semibold text-2xl text-black underline">
|
||||||
Metode Pembelajaran
|
Metode Pembelajaran
|
||||||
</p>
|
</p>
|
||||||
|
@ -105,7 +153,7 @@ class="poppins-regular py-2 px-4 bg-[#4F7F81] text-white rounded-xl text-xl shad
|
||||||
{!! $data->fasilitas !!}
|
{!! $data->fasilitas !!}
|
||||||
</h1>
|
</h1>
|
||||||
</div>
|
</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">
|
<p class="poppins-semibold text-2xl text-black underline">
|
||||||
Lokasi
|
Lokasi
|
||||||
</p>
|
</p>
|
||||||
|
@ -115,6 +163,7 @@ class="poppins-regular py-2 px-4 bg-[#4F7F81] text-white rounded-xl text-xl shad
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</x-layout>
|
</x-layout>
|
||||||
|
|
|
@ -44,82 +44,3 @@ class="w-full h-56 sm:h-64 md:h-96 lg:h-[500px] xl:h-[650px] max-w-4xl rounded-l
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
</x-layout>
|
</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> --}}
|
|
||||||
|
|
|
@ -10,6 +10,8 @@
|
||||||
Route::middleware('auth')->group(function () {
|
Route::middleware('auth')->group(function () {
|
||||||
// ADMIN
|
// ADMIN
|
||||||
Route::get('/admin/dashboard', [AdminDashboardController::class, 'index'])->name('admin.home'); // SHOW DASHBOARD
|
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/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/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
|
Route::get('/admin/{id}/edit-kursus', [AdminDataKursusController::class, 'edit'])->name('admin.edit'); // SHOW EDIT DATA
|
||||||
|
|
|
@ -9,8 +9,8 @@ export default {
|
||||||
theme: {
|
theme: {
|
||||||
container: {
|
container: {
|
||||||
padding: {
|
padding: {
|
||||||
DEFAULT: "1rem",
|
DEFAULT: "0rem",
|
||||||
sm: "1rem",
|
sm: "0rem",
|
||||||
lg: "2rem",
|
lg: "2rem",
|
||||||
xl: "3rem",
|
xl: "3rem",
|
||||||
"2xl": "0rem",
|
"2xl": "0rem",
|
||||||
|
|
Loading…
Reference in New Issue