{{-- <!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Project List</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<style>
    .filter-form {
        background-color: #f8f9fa;
        padding: 20px;
        border-radius: .375rem;
        box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    }

    .filter-form input,
    .filter-form select {
        border-radius: .375rem;
        box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.1);
    }
</style>

<body>
    <div class="container mt-5">
        <h1 class="mb-4">Project List</h1>

        <!-- Filter Form -->
        <form action="{{ route('landingpage.index') }}" method="GET" class="filter-form mb-4">
            <div class="row">
                <!-- Filter Judul Project -->
                <div class="col-md-6 mb-3">
                    <label for="judul_project" class="form-label">Judul Project</label>
                    <input type="text" id="judul_project" name="judul_project" value="{{ request('judul_project') }}"
                        class="form-control">
                </div>

                <!-- Filter Bidang -->
                <div class="col-md-6 mb-3">
                    <label for="bidang" class="form-label">Bidang</label>
                    <select id="bidang" name="bidang"
                    class="form-select">
                    <option value="">Pilih Sub Sektor</option>
                    <option value="Aplikasi dan permainan" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Aplikasi dan permainan' ? 'selected' : '' }}>Aplikasi dan permainan</option>
                    <option value="Arsitektur" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Arsitektur' ? 'selected' : '' }}>Arsitektur</option>
                    <option value="Desain" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Desain' ? 'selected' : '' }}>Desain</option>
                    <option value="Film, video, dan animasi" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Film, video, dan animasi' ? 'selected' : '' }}>Film, video, dan animasi</option>
                    <option value="Fotografi" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Fotografi' ? 'selected' : '' }}>Fotografi</option>
                    <option value="Kriya" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Kriya' ? 'selected' : '' }}>Kriya</option>
                    <option value="Kuliner" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Kuliner' ? 'selected' : '' }}>Kuliner</option>
                    <option value="Mode" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Mode' ? 'selected' : '' }}>Mode</option>
                    <option value="Musik" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Musik' ? 'selected' : '' }}>Musik</option>
                    <option value="Penerbitan" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Penerbitan' ? 'selected' : '' }}>Penerbitan</option>
                    <option value="Periklanan" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Periklanan' ? 'selected' : '' }}>Periklanan</option>
                    <option value="Permainan rakyat" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Permainan rakyat' ? 'selected' : '' }}>Permainan rakyat</option>
                    <option value="Radio dan televisi" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Radio dan televisi' ? 'selected' : '' }}>Radio dan televisi</option>
                    <option value="Riset dan pengembangan" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Riset dan pengembangan' ? 'selected' : '' }}>Riset dan pengembangan</option>
                    <option value="Seni pertunjukan" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Seni pertunjukan' ? 'selected' : '' }}>Seni pertunjukan</option>
                    <option value="Seni rupa" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Seni rupa' ? 'selected' : '' }}>Seni rupa</option>
                    <option value="Software" {{ request('bidang_sub_sektor_ekonomi_kreatif') == 'Software' ? 'selected' : '' }}>Software</option>
                </select>
                </div>

                <!-- Filter Tanggal Mulai -->
                <div class="col-md-6 mb-3">
                    <label for="tanggal_mulai" class="form-label">Tanggal Mulai</label>
                    <input type="date" id="tanggal_mulai" name="tanggal_mulai" value="{{ request('tanggal_mulai') }}"
                        class="form-control">
                </div>

                <!-- Filter Tanggal Berakhir -->
                <div class="col-md-6 mb-3">
                    <label for="tanggal_berakhir" class="form-label">Tanggal Berakhir</label>
                    <input type="date" id="tanggal_berakhir" name="tanggal_berakhir"
                        value="{{ request('tanggal_berakhir') }}" class="form-control">
                </div>

                <!-- Filter Kategori -->
                <div class="col-md-6 mb-3">
                    <label for="kategori" class="form-label">Kategori</label>
                    <select id="kategori" name="kategori" class="form-select">
                        <option value="">Pilih Kategori</option>
                        <option value="Pelatihan" {{ request('kategori') == 'Pelatihan' ? 'selected' : '' }}>Pelatihan
                        </option>
                        <option value="Pendanaan" {{ request('kategori') == 'Pendanaan' ? 'selected' : '' }}>Pendanaan
                        </option>
                        <option value="Project" {{ request('kategori') == 'Project' ? 'selected' : '' }}>Project
                        </option>
                        <option value="Riset" {{ request('kategori') == 'Riset' ? 'selected' : '' }}>Riset</option>
                    </select>
                </div>

                <!-- Filter Batas Terima Tawaran -->
                <div class="col-md-6 mb-3">
                    <label for="batas_terima_tawaran" class="form-label">Batas Terima Tawaran</label>
                    <input type="date" id="batas_terima_tawaran" name="batas_terima_tawaran"
                        value="{{ request('batas_terima_tawaran') }}" class="form-control">
                </div>

                <div class="col-12">
                    <button type="submit" class="btn btn-primary w-100">Filter</button>
                </div>
            </div>
        </form>


        <div class="row">
            @foreach ($projects as $project)
                <div class="col-md-4 mb-4">
                    <div class="card">
                        @if ($project->foto_proyek)
                            <img src="{{ asset('storage/' . $project->foto_proyek) }}" class="card-img-top"
                                alt="{{ $project->judul_project }}">
                        @else
                            <img src="https://via.placeholder.com/400x200" class="card-img-top" alt="Placeholder Image">
                        @endif

                        <div class="card-body">
                            <h5 class="card-title">{{ $project->judul_project }}</h5>
                            <p class="card-text">{{ Str::words($project->latar_belakang, 100) }}</p>
                            <a href="{{ route('landingpage.show', $project->id) }}" class="btn btn-info">View</a>
                            </form>
                        </div>
                    </div>
                </div>
            @endforeach
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>

</html> --}}


@extends('landing page.main')
@section('content')
    <!-- Banner -->
    <div class="banner-area three">
        <div class="banner-shape">
            <img src="{{ asset('assetslixi/img/aggrement.png') }}" alt="Banner">
            <img src="{{ asset('assetslixi/img/home-one/banner-shape1.png') }}" alt="Shape">
            <img src="{{ asset('assetslixi/img/home-three/banner-shape1.png') }}" alt="Shape">
            <img src="{{ asset('assetslixi/img/home-one/banner-shape3.png') }}" alt="Shape">
            <img src="{{ asset('assetslixi/img/home-one/banner-shape4.png') }}" alt="Shape">
            <img src="{{ asset('assetslixi/img/home-one/banner-shape5.png') }}" alt="Shape">
            <img src="{{ asset('assetslixi/img/home-one/banner-shape6.png') }}" alt="Shape">
        </div>
        <div class="d-table">
            <div class="d-table-cell">
                <div class="container">
                    <div class="banner-text">
                        <h1><span>Matchmaking</span> Platform Collaborative</h1>
                        {{-- <p>Platform ini dapat memfasilitasi UMKM untuk terhubung dengan investor,
                            mitra kerjasama, dan sumber daya manusia yang dibutuhkan. </p> --}}

                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End Banner -->

    <!-- Counter -->
    <div class="counter-area three py-5 bg-light">
        <div class="counter-wrap">
            <div class="container">
                <h2 class="text-center mb-4">Statistik Pengguna</h2>
                <div class="row d-flex justify-content-center">
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $jumlah_pemerintah }}">00</span>
                                {{-- <span class="odometer" >10</span> --}}
                            </h3>
                            <p class="text-muted">Pemerintah</p>
                        </div>
                    </div>
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $jumlah_umkm }}">00</span>
                                {{-- <span class="odometer" >40</span> --}}
                            </h3>
                            <p class="text-muted">UMKM</p>
                        </div>
                    </div>
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $jumlah_komunitas }}">00</span>
                                {{-- <span class="odometer">15</span> --}}
                            </h3>
                            <p class="text-muted">Komunitas</p>
                        </div>
                    </div>
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $jumlah_akademisi }}">00</span>
                                {{-- <span class="odometer">20</span> --}}
                            </h3>
                            <p class="text-muted">Akademisi</p>
                        </div>
                    </div>
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $jumlah_investor }}">00</span>
                                {{-- <span class="odometer">20</span> --}}
                            </h3>
                            <p class="text-muted">Investor</p>
                        </div>
                    </div>
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $jumlah_penawaran_project_aktif }}">00</span>
                            </h3>
                            <p class="text-muted">Penawaran Program Berjalan</p>
                        </div>
                    </div>
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $jumlah_penawaran_project_coming_soon }}">00</span>
                            </h3>
                            <p class="text-muted">Penawaran Program Coming Soon</p>
                        </div>
                    </div>
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $total_permohonan_project_aktif }}">00</span>
                            </h3>
                            <p class="text-muted">Permohonan Program Berjalan</p>
                        </div>
                    </div>
                    <div class="col-6 col-md-4 col-lg-3 mb-4">
                        <div class="counter-item text-center p-4 border rounded shadow-sm">
                            <h3 class="display-4">
                                <span class="odometer" data-count="{{ $total_permohonan_project_coming_soon }}">00</span>
                            </h3>
                            <p class="text-muted">Permohonan Program Coming Soon</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- End Counter -->

    <!-- Choose -->
    <div class="choose-area two pt-100 pb-70">
        <div class="choose-shape">
            <img src="assetslixi/img/home-one/choose1.png" alt="Shape">
            <img src="assetslixi/img/home-one/banner-shape3.png" alt="Shape">
        </div>
        <div class="container">
            <div class="row align-items-center">
                <div class="col-lg-6">
                    <div class="choose-content">
                        <div class="about-img">
                            <img src="assetslixi/img/landing-page/tentang-1.png" alt="Choose">
                            <img src="assetslixi/img/landing-page/tentang-2.png" alt="Choose">
                        </div>
                    </div>
                </div>
                <div class="col-lg-6">
                    <div class="choose-contact">
                        <div class="section-title">
                            <span class="sub-title">Tentang</span>
                            <h2>Matchmaking</h2>
                        </div>
                        <p>Platform ini dirancang untuk memfasilitasi kolaborasi antara Pemerintah, Investor, Akademisi, UMKM, dan Komunitas. Melalui sinergi ini, berbagai pihak dapat saling bekerja sama dalam bidang pendanaan, pelatihan, dan riset, yang bertujuan meningkatkan potensi serta pertumbuhan bisnis UMKM.</p>
                        <a class="cmn-btn" href="/about">Selengkapnya</a>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- End Choose -->
    {{-- Pelatihan --}}
    <section class="service-area three pt-100 pb-70">
        <div class="container">
            <div class="section-title">
                <span class="sub-title">Pelatihan</span>
                <h2>Menampilkan data pelatihan</h2>
            </div>
            <div class="row">
                @foreach ($combinedProjectsPelatihan as $index => $pelatihan)
                    <div class="col-sm-6 col-lg-4">
                        <div class="service-item {{ $index % 3 === 0 ? '' : ($index % 3 === 1 ? 'two' : 'three') }}">
                            <div class="service-top">
                                @if ($index % 3 === 0)
                                    <img src="assetslixi/img/home-one/service1.png" alt="Service">
                                @elseif ($index % 3 === 1)
                                    <img src="assetslixi/img/home-one/service3.png" alt="Service">
                                @else
                                    <img src="assetslixi/img/home-one/service5.png" alt="Service">
                                @endif
                                <img src="{{ asset('storage/' . $pelatihan->foto_proyek) }}" alt="Service">
                            </div>
                            <h3>
                                <a href="{{ route('login') }}">{{ $pelatihan->judul_project }}</a>
                            </h3>
                            <!-- Opsi 1: Menggunakan limit yang lebih panjang -->
                            <p>{!! Str::words($pelatihan->latar_belakang . ' ' . $pelatihan->deskripsi_project, 20) !!}</p>

                            <!-- Opsi 2: Hanya menampilkan salah satu field -->
                            {{-- <!-- <p>{{ Str::words($pelatihan->latar_belakang, 20) }}</p> --> --}}

                            <!-- Opsi 3: Menampilkan keduanya secara terpisah -->
                            {{-- <!-- <p>{{ Str::words($pelatihan->latar_belakang, 20) }}</p> --}}
                                    {{-- <p>{{ Str::words($pelatihan->deskripsi_project, 20) }}</p> --> --}}

                            <!-- Opsi 4: Menggunakan fungsi words() -->
                            {{-- <!-- <p>{{ Str::words($pelatihan->latar_belakang . ' ' . $pelatihan->deskripsi_project, 20) }}</p> --> --}}

                            {{-- <a class="service-link" href="{{ route('login') }}">
                                Learn More
                                <i class='bx bx-right-arrow-alt'></i>
                            </a> --}}
                            <a href="{{ route('login') }}">
                                Selengkapnya
                                <i class='bx bx-right-arrow-alt'></i>
                            </a>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </section>

    <!-- Riset -->
    <section class="blog-area pt-100 pb-70">
        <div class="container">
            <div class="section-title">
                <span class="sub-title">Riset</span>
                <h2>Menampilkan Data Riset</h2>
            </div>
            <div class="row">
                @foreach ($combinedProjectsRiset as $riset)
                    <div class="col-sm-6 col-lg-4">
                        <div class="blog-item">
                            <a href="blog-details.html">
                                <img src="{{ asset('storage/' . $riset->foto_proyek) }}" alt="Blog">
                            </a>
                            <div class="blog-bottom">
                                <h3>
                                    <a href="{{ route('login') }}">{{ $riset->judul_project }}</a>
                                </h3>
                                <p>{!! Str::words($riset->latar_belakang . ' ' . $riset->deskripsi_project, 200) !!}</p>
                                <a class="blog-btn" href="{{ route('login') }}">
                                    Selengkapnya
                                    <i class='bx bx-right-arrow-alt'></i>
                                </a>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </section>
    <!-- End Riset -->

    <!-- Pendanaan -->
    <section class="blog-area pt-100 pb-70">
        <div class="container">
            <div class="section-title">
                <span class="sub-title">Pendanaan</span>
                <h2>Menampilkan Data Pendanaan</h2>
            </div>
            <div class="row">
                @foreach ($combinedProjectsPendanaan as $pendanaan)
                    <div class="col-sm-6 col-lg-4">
                        <div class="blog-item">
                            <a href="blog-details.html">
                                <img src="{{ asset('storage/' . $pendanaan->foto_proyek) }}" alt="Blog">
                            </a>
                            <div class="blog-bottom">
                                <h3>
                                    <a>{{ $pendanaan->judul_project }}</a>
                                </h3>
                                <p>{!! Str::words($pendanaan->latar_belakang . ' ' . $pendanaan->deskripsi_project, 20) !!}</p>
                                <a href="{{ route('login') }}">
                                    Selengkapnya
                                    <i class='bx bx-right-arrow-alt'></i>
                                </a>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </div>
    </section>
    <!-- End Blog -->
@endsection
