Compare commits

..

No commits in common. "fd1100558dd253185afe552169d5f8ce43807104" and "2cfc54f56755da12b71bb5a5ca344105cfc47727" have entirely different histories.

13 changed files with 231 additions and 129 deletions

View File

@ -31,11 +31,13 @@ public function show($id)
$berita = Informasi::where('kategori_informasi', 'berita')
->where('id_informasi', $id)
->firstOrFail();
$recentBerita = Informasi::where('kategori_informasi', 'berita')
->where('id_informasi', '!=', $id)
->orderBy('tanggal_informasi', 'desc')
->limit(5)
->get();
return view('user.detail-berita', compact('berita', 'recentBerita'));
}
@ -52,4 +54,5 @@ public function hero()
return view('user.index', compact('beritaHero'));
}
}

View File

@ -12,6 +12,8 @@ class IndexController extends Controller
public function index()
{
$tahun = date('Y');
// Ambil data sampah per bulan
$dataSampah = Sampah::where('tahun', $tahun)
->orderBy('bulan')
->get();
@ -30,6 +32,7 @@ public function index()
$sisa[] = $d->sisa_sampah;
}
// Rekap total satu tahun
$rekap = [
'timbulan' => array_sum($timbulan),
'kelola' => array_sum($kelola),
@ -37,8 +40,10 @@ public function index()
'sisa' => array_sum($sisa),
];
// Data sampah terbaru untuk card
$sampah = Sampah::orderBy('tahun', 'desc')->first();
// Data TPS
$kategoriTps = KategoriTps::orderBy('id_kategori_tps')->get();
$tps = LokasiTps::all();

View File

@ -19,16 +19,20 @@ public function index()
return view('user.pengumuman', compact('pengumuman'));
}
public function show($id)
{
$pengumuman = Informasi::where('kategori_informasi','pengumuman')
->where('id_informasi',$id)
->firstOrFail();
$recentPengumuman = Informasi::where('kategori_informasi','pengumuman')
->where('id_informasi','!=',$id)
->orderBy('tanggal_informasi','desc')
->limit(5)
->get();
return view('user.detail-pengumuman', compact('pengumuman','recentPengumuman'));
}

View File

@ -26,7 +26,7 @@ public function authorize(): bool
public function rules(): array
{
return [
'username' => ['required', 'string', 'regex:/^[a-z]+$/'],
'username' => ['required', 'string'],
'password' => ['required', 'string', 'min:8'],
];
}
@ -39,11 +39,10 @@ public function messages(): array
return [
'username.required' => 'Username wajib diisi.',
'username.string' => 'Username harus berupa teks.',
'username.regex' => 'Username hanya boleh huruf kecil (a-z) tanpa angka atau simbol.',
'password.required' => 'Password wajib diisi.',
'password.string' => 'Password harus berupa teks.',
'password.min' => 'Password minimal 8 karakter.',
'password.min' => 'Password minimal 6 karakter.',
];
}
@ -55,10 +54,7 @@ public function authenticate(): void
// Cek limit login (anti brute force)
$this->ensureIsNotRateLimited();
// Ambil username dalam bentuk huruf kecil (biar konsisten)
$username = strtolower($this->username);
// Jika dua-duanya kosong
// Jika dua-duanya kosong (optional tambahan biar lebih jelas)
if (!$this->username && !$this->password) {
throw ValidationException::withMessages([
'username' => 'Username dan password wajib diisi.',
@ -66,7 +62,7 @@ public function authenticate(): void
}
// Cek apakah username ada
$user = User::where('username', $username)->first();
$user = User::where('username', $this->username)->first();
if (!$user) {
throw ValidationException::withMessages([
'username' => 'Username tidak terdaftar.',
@ -75,7 +71,7 @@ public function authenticate(): void
// Cek password
if (!Auth::attempt([
'username' => $username,
'username' => $this->username,
'password' => $this->password,
])) {
RateLimiter::hit($this->throttleKey());

View File

@ -1,6 +1,6 @@
server {
listen 80;
server_name sig-tpsnganjuk.web.id;
server_name sig-tpsnganjuk.web.id
root /var/www/public;
index index.php index.html;

View File

@ -92,3 +92,4 @@ class="form-control file-upload-info"
</div>
</div>
@endsection

View File

@ -79,20 +79,16 @@ class="form-control @error('tahun_pembuatan') is-invalid @enderror"
{{-- KAPASITAS --}}
<div class="form-group">
<label>Kapasitas</label>
<div class="input-group">
<input type="text"
name="kapasitas_tps"
class="form-control @error('kapasitas_tps') is-invalid @enderror"
value="{{ old('kapasitas_tps') }}"
placeholder="Kapasitas TPS">
<div class="input-group-append">
<span class="input-group-text">ton/hari</span>
</div>
@error('kapasitas_tps')
<small class="text-danger">{{ $message }}</small>
@enderror
</div><br>
</div>
{{-- STATUS --}}
<div class="form-group">
@ -117,7 +113,7 @@ class="form-control @error('status_tps') is-invalid @enderror">
name="latitude"
class="form-control @error('latitude') is-invalid @enderror"
value="{{ old('latitude') }}"
placeholder="Contoh: 7°35'17.25&quot;S">
placeholder="Contoh: -7.623 atau 7°35'17.25&quot;S">
@error('latitude')
<small class="text-danger">{{ $message }}</small>
@ -131,7 +127,7 @@ class="form-control @error('latitude') is-invalid @enderror"
name="longitude"
class="form-control @error('longitude') is-invalid @enderror"
value="{{ old('longitude') }}"
placeholder="Contoh: 111°55'0.97&quot;E">
placeholder="Contoh: 111.980 atau 111°55'0.97&quot;E">
@error('longitude')
<small class="text-danger">{{ $message }}</small>

View File

@ -93,14 +93,9 @@ class="form-control @error('tahun_pembuatan') is-invalid @enderror"
<div class="form-group">
<label>Kapasitas TPS</label>
<div class="input-group">
<input type="number" name="kapasitas_tps"
class="form-control @error('kapasitas_tps') is-invalid @enderror"
value="{{ old('kapasitas_tps', $tps->kapasitas_tps) }}">
<div class="input-group-append">
<span class="input-group-text">ton/hari</span>
</div>
</div>
@error('kapasitas_tps')
<small class="text-danger">{{ $message }}</small>

View File

@ -33,6 +33,12 @@
<form class="pt-3" method="POST" action="{{ route('login') }}" novalidate>
@csrf
<!-- ERROR GLOBAL -->
{{-- @if ($errors->any())
<div class="alert alert-danger">
{{ $errors->first() }}
</div>
@endif --}}
<!-- USERNAME -->
<div class="form-group">

View File

@ -11,7 +11,8 @@
<nav class="breadcrumbs">
<ol>
<li><a href="{{ route('user.index') }}">Beranda</a></li>
<li class="current"><a href="{{ route('user.berita') }}">Berita</a></li>
<li><a href="{{ route('user.berita') }}">Berita</a></li>
<li class="current">Detail Berita</li>
</ol>
</nav>
</div>

View File

@ -10,7 +10,8 @@
<nav class="breadcrumbs">
<ol>
<li><a href="{{ route('user.index') }}">Beranda</a></li>
<li class="current"><a href="{{ route('user.pengumuman') }}">Pengumuman</a></li>
<li><a href="{{ route('user.pengumuman') }}">Pengumuman</a></li>
<li class="current">Detail Pengumuman</li>
</ol>
</nav>
</div>

View File

@ -26,6 +26,7 @@ function toDMS($decimal, $type = 'lat') {
<nav class="breadcrumbs">
<ol>
<li><a href="/">Beranda</a></li>
<li>Sebaran TPS</li>
<li class="current">Detail TPS</li>
</ol>
</nav>
@ -65,7 +66,7 @@ class="img-fluid h-100 w-100 rounded-start"
<div class="mb-3 col-md-6">
<small class="text-muted">Kapasitas</small>
<div class="fw-semibold">
{{ $tps->kapasitas_tps ?? '-' }} ton/hari
{{ $tps->kapasitas_tps ?? '-' }}
</div>
</div>

View File

@ -350,6 +350,8 @@ function icon(color) {
marker.tpsData = tps;
markers.push(marker);
});
/* ===== LEGEND KATEGORI (BALIK 😤) ===== */
var legend = L.control({
position: 'bottomleft'
});
@ -487,6 +489,96 @@ className: 'user-location'
</div>
</div>
</section>
<section id="faq" class="faq section">
<div class="container-fluid">
<div class="row gy-4 justify-content-center">
<div class="order-2 col-lg-7 d-flex flex-column justify-content-center order-lg-1">
<div class="text-center content px-xl-6" data-aos="fade-up" data-aos-delay="100">
<h3><span>Pertanyaan yang Sering </span><strong>Diajukan</strong></h3>
<p>
Berikut adalah beberapa pertanyaan yang sering diajukan oleh pengguna terkait
informasi, fitur, dan layanan pada website.
</p>
</div>
<div class="faq-container px-xl-5" data-aos="fade-up" data-aos-delay="200">
<!-- FAQ 1 -->
<div class="faq-item faq-active">
<i class="faq-icon bi bi-question-circle"></i>
<h3>Apa tujuan utama website ini?</h3>
<div class="faq-content">
<p>
Website ini bertujuan untuk menyediakan informasi yang akurat dan mudah diakses
oleh masyarakat mengenai lokasi dan data Tempat Pembuangan Sampah (TPS). Dengan adanya
website ini, diharapkan masyarakat dapat lebih memahami kondisi
TPS serta mendukung pengelolaan lingkungan yang lebih baik.
</p>
</div>
<i class="faq-toggle bi bi-chevron-right"></i>
</div><!-- End Faq item-->
<!-- FAQ 2 -->
<div class="faq-item">
<i class="faq-icon bi bi-question-circle"></i>
<h3>Bagaimana cara melihat peta sebaran TPS?</h3>
<div class="faq-content">
<p>
Peta sebaran TPS dapat dilihat melalui menu Sebaran TPS yang tersedia pada halaman utama
website. Peta tersebut bersifat interaktif dan menampilkan lokasi TPS berdasarkan
wilayah. Pengguna dapat mengklik setiap penanda lokasi untuk melihat detail informasi
seperti alamat TPS dan keterangan tambahan lainnya.
</p>
{{-- <p>
</p> --}}
</div>
<i class="faq-toggle bi bi-chevron-right"></i>
</div><!-- End Faq item-->
<!-- FAQ 3 -->
<div class="faq-item">
<i class="faq-icon bi bi-question-circle"></i>
<h3>Bagaimana cara mengadukan permasalahan TPS?</h3>
<div class="faq-content">
<p>
Pengaduan permasalahan TPS dapat dilakukan melalui menu Aduan TPS yang tersedia
pada website dengan mengisi formulir yang telah disediakan. Laporan yang masuk akan
diteruskan kepada pihak terkait untuk ditindaklanjuti
guna meningkatkan kualitas pengelolaan TPS.
</p>
</div>
<i class="faq-toggle bi bi-chevron-right"></i>
</div><!-- End Faq item-->
<!-- FAQ 4 -->
<div class="faq-item">
<i class="faq-icon bi bi-question-circle"></i>
<h3>Apakah website ini dapat diakses melalui perangkat mobile?</h3>
<div class="faq-content">
<p>
Ya, website ini dirancang secara responsif sehingga dapat diakses melalui
berbagai perangkat, termasuk smartphone dan tablet. Tampilan website akan menyesuaikan
ukuran layar perangkat pengguna tanpa
mengurangi fungsi dan informasi yang tersedia.
</p>
</div>
<i class="faq-toggle bi bi-chevron-right"></i>
</div><!-- End Faq item-->
</div>
</div>
</div>
</div>
<script>
document.addEventListener("DOMContentLoaded", () => {
document.querySelectorAll(".counter").forEach(el => {
@ -506,5 +598,6 @@ className: 'user-location'
});
});
</script>
</section>
@endsection