Compare commits
No commits in common. "fd1100558dd253185afe552169d5f8ce43807104" and "2cfc54f56755da12b71bb5a5ca344105cfc47727" have entirely different histories.
fd1100558d
...
2cfc54f567
|
|
@ -10,46 +10,49 @@
|
|||
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();
|
||||
/**
|
||||
* 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'));
|
||||
}
|
||||
|
||||
return view('user.index', compact('beritaHero'));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,56 +10,61 @@
|
|||
class IndexController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$tahun = date('Y');
|
||||
$dataSampah = Sampah::where('tahun', $tahun)
|
||||
->orderBy('bulan')
|
||||
->get();
|
||||
{
|
||||
$tahun = date('Y');
|
||||
|
||||
$bulan = [];
|
||||
$timbulan = [];
|
||||
$kelola = [];
|
||||
$daur = [];
|
||||
$sisa = [];
|
||||
// Ambil data sampah per bulan
|
||||
$dataSampah = Sampah::where('tahun', $tahun)
|
||||
->orderBy('bulan')
|
||||
->get();
|
||||
|
||||
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;
|
||||
}
|
||||
$bulan = [];
|
||||
$timbulan = [];
|
||||
$kelola = [];
|
||||
$daur = [];
|
||||
$sisa = [];
|
||||
|
||||
$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'
|
||||
));
|
||||
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 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'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -19,18 +19,22 @@ 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()
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -92,3 +92,4 @@ class="form-control file-upload-info"
|
|||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
<input type="text"
|
||||
name="kapasitas_tps"
|
||||
class="form-control @error('kapasitas_tps') is-invalid @enderror"
|
||||
value="{{ old('kapasitas_tps') }}"
|
||||
placeholder="Kapasitas TPS">
|
||||
|
||||
@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"S">
|
||||
placeholder="Contoh: -7.623 atau 7°35'17.25"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"E">
|
||||
placeholder="Contoh: 111.980 atau 111°55'0.97"E">
|
||||
|
||||
@error('longitude')
|
||||
<small class="text-danger">{{ $message }}</small>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
<input type="number" name="kapasitas_tps"
|
||||
class="form-control @error('kapasitas_tps') is-invalid @enderror"
|
||||
value="{{ old('kapasitas_tps', $tps->kapasitas_tps) }}">
|
||||
|
||||
@error('kapasitas_tps')
|
||||
<small class="text-danger">{{ $message }}</small>
|
||||
|
|
|
|||
|
|
@ -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">
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue