Compare commits

...

11 Commits

Author SHA1 Message Date
rahmagustin fd1100558d edit lapasitas 2026-04-20 06:34:02 +07:00
rahmagustin 1e7100d806 kapasitas 2 2026-04-19 19:54:37 +07:00
rahmagustin bafacc38c2 kapasitas 2026-04-19 19:48:10 +07:00
rahmagustin 0c1150e1a4 placeholder koordinat 2026-04-15 20:57:50 +07:00
rahmagustin 1798868133 validasi login 2 2026-04-15 15:22:40 +07:00
rahmagustin 782b51fbb3 tag pg 2026-04-07 22:34:42 +07:00
rahmagustin 48f525e8fc tag berita 2026-04-07 22:31:08 +07:00
rahmagustin 652b6c9f76 count tps 2026-04-07 21:59:50 +07:00
rahmagustin 252fd5a124 Merge branches 'main' and 'main' of https://github.com/rahmagustin/sig-tps 2026-04-07 21:55:10 +07:00
rahmagustin 7ff379e4db landing page 2026-04-07 21:53:58 +07:00
Lutfi Hakim a20e8fd844 fix nginx server_name 2026-03-31 17:33:00 +07:00
13 changed files with 129 additions and 231 deletions

View File

@ -10,49 +10,46 @@
class BeritaController extends Controller
{
/**
* Tampilkan semua berita
*/
public function index()
{
$berita = Informasi::where('kategori_informasi', 'berita')
->orderBy('tanggal_informasi', 'desc')
->paginate(6);
/**
* Tampilkan semua berita
*/
public function index()
{
$berita = Informasi::where('kategori_informasi', 'berita')
->orderBy('tanggal_informasi', 'desc')
->paginate(6);
return view('user.berita', compact('berita'));
}
return view('user.berita', compact('berita'));
}
/**
* Detail berita
*/
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'));
}
/**
* Detail berita
*/
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'));
}
/**
* Berita untuk hero slider
*/
public function hero()
{
$beritaHero = Informasi::where('kategori_informasi', 'berita')
->orderBy('tanggal_informasi', 'desc')
->take(3)
->get();
return view('user.index', compact('beritaHero'));
}
/**
* Berita untuk hero slider
*/
public function hero()
{
$beritaHero = Informasi::where('kategori_informasi', 'berita')
->orderBy('tanggal_informasi', 'desc')
->take(3)
->get();
return view('user.index', compact('beritaHero'));
}
}

View File

@ -10,61 +10,56 @@
class IndexController extends Controller
{
public function index()
{
$tahun = date('Y');
{
$tahun = date('Y');
$dataSampah = Sampah::where('tahun', $tahun)
->orderBy('bulan')
->get();
// Ambil data sampah per bulan
$dataSampah = Sampah::where('tahun', $tahun)
->orderBy('bulan')
->get();
$bulan = [];
$timbulan = [];
$kelola = [];
$daur = [];
$sisa = [];
$bulan = [];
$timbulan = [];
$kelola = [];
$daur = [];
$sisa = [];
foreach ($dataSampah as $d) {
$bulan[] = \Carbon\Carbon::create()->month($d->bulan)->translatedFormat('M');
$timbulan[] = $d->total_sampah;
$kelola[] = $d->total_kelola;
$daur[] = $d->total_daur_ulang;
$sisa[] = $d->sisa_sampah;
}
foreach ($dataSampah as $d) {
$bulan[] = \Carbon\Carbon::create()->month($d->bulan)->translatedFormat('M');
$timbulan[] = $d->total_sampah;
$kelola[] = $d->total_kelola;
$daur[] = $d->total_daur_ulang;
$sisa[] = $d->sisa_sampah;
$rekap = [
'timbulan' => array_sum($timbulan),
'kelola' => array_sum($kelola),
'daur' => array_sum($daur),
'sisa' => array_sum($sisa),
];
$sampah = Sampah::orderBy('tahun', 'desc')->first();
$kategoriTps = KategoriTps::orderBy('id_kategori_tps')->get();
$tps = LokasiTps::all();
$jumlahTps = LokasiTps::where('kategori_tps_id', 1)->count();
$jumlahTps3r = LokasiTps::where('kategori_tps_id', 2)->count();
$jumlahTpa = LokasiTps::where('kategori_tps_id', 3)->count();
return view('user.index', compact(
'sampah',
'kategoriTps',
'tps',
'jumlahTps',
'jumlahTps3r',
'jumlahTpa',
'bulan',
'timbulan',
'kelola',
'daur',
'sisa',
'rekap',
'tahun'
));
}
// Rekap total satu tahun
$rekap = [
'timbulan' => array_sum($timbulan),
'kelola' => array_sum($kelola),
'daur' => array_sum($daur),
'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();
$jumlahTps = LokasiTps::where('kategori_tps_id', 1)->count();
$jumlahTps3r = LokasiTps::where('kategori_tps_id', 2)->count();
$jumlahTpa = LokasiTps::where('kategori_tps_id', 3)->count();
return view('user.index', compact(
'sampah',
'kategoriTps',
'tps',
'jumlahTps',
'jumlahTps3r',
'jumlahTpa',
'bulan',
'timbulan',
'kelola',
'daur',
'sisa',
'rekap',
'tahun'
));
}
}

View File

@ -19,22 +19,18 @@ 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'));
}
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'));
}
public function hero()

View File

@ -26,7 +26,7 @@ public function authorize(): bool
public function rules(): array
{
return [
'username' => ['required', 'string'],
'username' => ['required', 'string', 'regex:/^[a-z]+$/'],
'password' => ['required', 'string', 'min:8'],
];
}
@ -39,10 +39,11 @@ 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 6 karakter.',
'password.min' => 'Password minimal 8 karakter.',
];
}
@ -54,7 +55,10 @@ public function authenticate(): void
// Cek limit login (anti brute force)
$this->ensureIsNotRateLimited();
// Jika dua-duanya kosong (optional tambahan biar lebih jelas)
// Ambil username dalam bentuk huruf kecil (biar konsisten)
$username = strtolower($this->username);
// Jika dua-duanya kosong
if (!$this->username && !$this->password) {
throw ValidationException::withMessages([
'username' => 'Username dan password wajib diisi.',
@ -62,7 +66,7 @@ public function authenticate(): void
}
// Cek apakah username ada
$user = User::where('username', $this->username)->first();
$user = User::where('username', $username)->first();
if (!$user) {
throw ValidationException::withMessages([
'username' => 'Username tidak terdaftar.',
@ -71,7 +75,7 @@ public function authenticate(): void
// Cek password
if (!Auth::attempt([
'username' => $this->username,
'username' => $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,4 +92,3 @@ class="form-control file-upload-info"
</div>
</div>
@endsection

View File

@ -79,16 +79,20 @@ class="form-control @error('tahun_pembuatan') is-invalid @enderror"
{{-- KAPASITAS --}}
<div class="form-group">
<label>Kapasitas</label>
<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">
<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>
</div><br>
{{-- STATUS --}}
<div class="form-group">
@ -113,7 +117,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.623 atau 7°35'17.25&quot;S">
placeholder="Contoh: 7°35'17.25&quot;S">
@error('latitude')
<small class="text-danger">{{ $message }}</small>
@ -127,7 +131,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.980 atau 111°55'0.97&quot;E">
placeholder="Contoh: 111°55'0.97&quot;E">
@error('longitude')
<small class="text-danger">{{ $message }}</small>

View File

@ -93,9 +93,14 @@ class="form-control @error('tahun_pembuatan') is-invalid @enderror"
<div class="form-group">
<label>Kapasitas TPS</label>
<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">
<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,12 +33,6 @@
<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,8 +11,7 @@
<nav class="breadcrumbs">
<ol>
<li><a href="{{ route('user.index') }}">Beranda</a></li>
<li><a href="{{ route('user.berita') }}">Berita</a></li>
<li class="current">Detail Berita</li>
<li class="current"><a href="{{ route('user.berita') }}">Berita</a></li>
</ol>
</nav>
</div>

View File

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

View File

@ -26,7 +26,6 @@ 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>
@ -66,7 +65,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 ?? '-' }}
{{ $tps->kapasitas_tps ?? '-' }} ton/hari
</div>
</div>

View File

@ -350,8 +350,6 @@ function icon(color) {
marker.tpsData = tps;
markers.push(marker);
});
/* ===== LEGEND KATEGORI (BALIK 😤) ===== */
var legend = L.control({
position: 'bottomleft'
});
@ -489,96 +487,6 @@ 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 => {
@ -598,6 +506,5 @@ className: 'user-location'
});
});
</script>
</section>
@endsection