<?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');
Ci::set_title('ABSENSI');
?> 

<h1 class="page-title">
    <?= Ci::$title ?>
    <hr class="hiasan-judul blue" />
</h1>
<br /><br />
<style type="text/css">
    .text-left {
        text-align:left !important;
    }
</style>
<div class="row">
    <div class="col-sm-8 col-sm-offset-2">
        <?= form_open('dashboard/visitor-check?redir=' . urlencode(current_url() . url_query())) ?>
        <div class="row">
            <div class="col-sm-8 col-sm-offset-2">
                <div class="form-group">
                    <?=
                    form_input('scan_code', '', [
                        'class' => 'form-control text-center',
                        'autofocus' => 'autofocus',
                        'placeholder' => lang('scan_code'),
                        'style' => 'padding:20px 0px;'
                    ])
                    ?>
                </div>
                <div class="form-group">
                    <div class="mt-checkbox-inline">
                        <label class="mt-checkbox">
                            <?= form_checkbox('souvenir', '1', true) ?>
                            <?= lang('souvenir') ?>
                            <span></span>
                        </label>
                    </div>
                </div>

                <div class="form-group">
                    <?= form_submit('submit', lang('Submit'), ['class' => 'btn btn-primary btn-block']) ?>
                </div>
            </div>
        </div>
        <div class="form-horizontal" style="display:none;">
            <div class="form-group">
                <?= lang('name', [], 'name', ['class' => 'col-sm-3 control-label text-left']) ?>
                <div class="col-sm-9">
                    <div class="form-control"  disabled="disabled">
                        <?= $user ? $user['profile']['name'] : '-' ?>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <?= lang('absen', [], 'absen', ['class' => 'col-sm-3 control-label text-left']) ?>
                <div class="col-sm-9">
                    <div class="form-control" disabled="disabled">
                        <?= $user_absen ? $user_absen->absen->nama : '-' ?>
                    </div>
                </div>
            </div>
        </div>
        <?= form_close() ?>
        <div style="text-align: center;">
            <a href="<?= base_url('dashboard/history') ?>" class="btn btn-link">History</a>
             <a href="<?= base_url('dashboard/visitor-list') ?>" class="btn btn-link">Visitor List</a>
        </div>
    </div>
</div>
<?php
Ci::set_script(<<<EOD
     var page_script = function () {
        var the;
        return {
            init: function () {
                the = this;
            }
        };
    }();
    $(document).ready(function () {
        page_script.init();
    });
EOD
    , 'embed');
