<div class="modal fade" id="projectModal" data-bs-backdrop="static" data-bs-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
  <div class="modal-dialog modal-md">
    <div class="modal-content">
      <div class="modal-header border-0 alert-info p-2">
        <h5 class="modal-title fw-bold fs-6" id="staticBackdropLabel">Edit Project</h5>
        <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
      </div>
      <div class="modal-body">
        <!-- Form !-->
        <form method="POST" action="<?= base_url('administrator/redd/update-project') ?>" enctype="multipart/form-data">
            <?= csrf_field(); ?>
            <input type="hidden" name="id" >
            <input type="hidden" name="client_id" >
            <div class="row">
                <div class="col-md-12">
                    <div class="alert alert-success">
                    <div class="input-group">
                        <label class="form-label  fw-bold mb-0">Project ID*</label>
                    <input type="text" name="project_number" class="form-control" required>
                    </div>
                    </div>
                </div>
                <div class="col-md-12 mb-3">
                <label class="form-label fw-bold mb-0">Project Name*</label>
                <input type="text" name="name" class="form-control" required>
            </div>
            <div class="col-md-6 mb-3">
                <label class="form-label fw-bold small mb-0">Project Area / Size* <small class="text-muted fw-normal">(Hectares - Ha)</small></label>
                <input type="number" name="size" step="any" class="form-control" required>
            </div>
            <div class="col-md-6 mb-3">
                <label class="form-label fw-bold mb-0">Project Validator</label>
                <input type="text" name="project_validator" class="form-control">
            </div>     

            <div class="col-md-12 mb-3">
                <label class="form-label fw-bold mb-0">Location / Address*</label>
                <textarea name="location_description" class="form-control"></textarea>
            </div>

            <div class="col-md-12 mb-3">
                <label for="district_id" class="form-label small  fw-bold mb-0">District*</label>
                <select name="district_id" id="district_id" class="form-select" required>
                    <option value="">Select District</option>
                    <?php foreach($districts as $c):?>
                        <option value="<?= $c['district_id']; ?>"><?= $c['district_name'];?></option>
                    <?php endforeach;?>
                </select>
            </div>
            <div class="col-md-6 mb-3">
                <label for="county_id" class="form-label small  fw-bold mb-0">County</label>
                <select name="county_id" id="county_id" class="form-select">
                    <option value="">Select County</option>
                </select>
            </div>
            <div class="col-md-6 mb-3">
                <label for="subcounty_id" class="form-label small fw-bold mb-0">Subcounty</label>
                <select name="subcounty_id" id="subcounty_id" class="form-select">
                    <option value="">Select Subcounty</option>
                </select>
            </div>
            <div class="col-md-6 mb-3">
                <label for="parish_id" class="form-label small fw-bold mb-0">Parish</label>
                <select name="parish_id" id="parish_id" class="form-select">
                    <option value="">Select Parish</option>
                </select>
            </div>
            <div class="col-md-6 mb-3">
                <label for="village_id" class="form-label small fw-bold mb-0">Village</label>
                <select name="village_id" id="village_id" class="form-select">
                    <option value="">Select Village</option>
                </select>
            </div>
            <div class="col-md-6 mb-3">
                <label class="form-label fw-bold small mb-0">Latitude</label>
                <input type="number" name="geo_lat" step="any" class="form-control">
            </div>
            <div class="col-md-6 mb-3">
                <label class="form-label fw-bold small mb-0">Longitude</label>
                <input type="number" name="geo_long" step="any" class="form-control">
            </div>
            <div class="col-md-12 mb-3">
                <label class="form-label  fw-bold mb-0">Draw Forest Boundary</label>
                <div id="addProjectMap" style="height: 400px; max-width:100%; border:1px solid #ccc;"></div>
                <input type="hidden" name="boundary_file" id="boundaryGeoJson">
            </div>

            <div class="col-md-12">
                <label class="form-label  fw-bold mb-0">Description</label>
                <textarea name="project_description" rows="3" class="form-control"></textarea>
            </div>
            </div>
        <!-- End Form !-->
      </div>
      <div class="modal-footer border-0">
        <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
        <button type="submit" class="btn btn-danger sbtn">Update Project</button>
      </div>
      </form>
    </div>
  </div>
</div>