<form action="" method="get">
    <?php $request = \Config\Services::request() ?>
    <div class="row mb-2">
        <div class="col-md-4">
            <select name="posisi" id="posisi" class="form-control">
                <option value="">-- Tampilkan Semua --</option>
                <?php foreach ($posisi as $posisi) : ?>
                    <?php if ($request->getVar('posisi') == $posisi['id_karir']) : ?>
                       <option value="<?= $request->getVar('posisi')?>" selected><?= $posisi['judul_karir']?></option> 
                    <?php else : ?>
                       <option value="<?= $posisi['id_karir'] ?>"><?= $posisi['judul_karir']?></option>
                    <?php endif ?>
                <?php endforeach ?>
            </select>

        </div>
        <div class="col-md-4">
            <button class="btn btn-outline-info" type="submit" name="submit">Cari</button>
        </div>
    </div>
</form>
<table class="table table-bordered" id="example1">
    <thead>
        <tr>
            <th width="5%">No</th>
            <th width="30%">Posisi</th>
            <th width="30%">Nama lengkap</th>
            <th>No Whatsapp</th>
            <th width="15%">Aksi</th>
        </tr>
    </thead>
    <tbody>
        <?php $no = 1;

        foreach ($berita as $berita) { ?>
            <tr>
                <td><?= $no ?></td>
                <td>
                    <?= $berita['judul_karir'] ?>
                </td>
                <td>
                    <?= $berita['nama'] ?>
                </td>
                <td>
                    <?= $berita['nowa'] ?>
                </td>
                <td style="text-align:center">
                    <a href="<?= base_url('admin/karir/unduh/' . $berita['cv']) ?>" class="btn btn-outline-dark btn-sm btn-block"><i class="fa fa-download"></i> Unduh CV</a>
                </td>
            </tr>
        <?php $no++;
        } ?>
    </tbody>
</table>