<?php
/*
 * *************************************************
 * Copyright (C) 2021 Earworks.                    *
 * Codeigniter Project Template Modification       *
 * Please contact our email for more information : *
 * contact@earworks.co.id                          *
 * *************************************************
 */

defined('BASEPATH') OR exit('No direct script access allowed');
$this->load->library('qr');
?>
<?php if ($absen->count() > 0): ?>
    <table>
        <?php foreach ($absen as $res) : ?>
            <?php
            $qrfile = QRPATH . $res->slug . '.png';
            $url = base_url('../absen/index/' . $res->slug);
            if (!is_file($qrfile)) {
                Qr::png($url, $qrfile, QR_ECLEVEL_H, 10, 4);
            }
            $img = base_url('../img/qr/' . $res->slug . '.png');
            ?>
            <tr>
                <td>
                    <?= $res->nama ?><br />
                    <?= $url ?>
                </td>
                <td><img src="<?= $img ?>" style="width:200px;height:auto;" /></td>
            </tr>
        <?php endforeach; ?>
    </table>
<?php endif; ?>
