<?php
/*
 * Copyright (c) 2018 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->title = $this->lang->line('guest');
$this->load->add_map($this->load->title);
?>
<?php 
//echo form_open_multipart('backoffice/import/visitor');
//echo '<input type="file" name="files"/>';
//echo '<input type="submit" value="submit">';
//echo form_close();
//echo form_open_multipart('backoffice/import/company');
//echo '<input type="file" name="files"/>';
//echo '<input type="submit" value="submit">';
//echo form_close();
?>
<div class="pull-right" style="margin-top: -50px; width: 250px; margin-right: 129px;">
    <a href="<?php echo base_url('backoffice/export/allregister') ?>" class="btn btn-primary" style="background-color: #000000; border-color: #404040;">
        Export Register
    </a>
</div>
<div class="pull-right" style="margin-top: -50px; width: 250px;">
    <div class="dropdown">
        <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown" style="background-color: #000000; border-color: #404040;">
            Export Data Register
            <span class="caret"></span>
        </button>
        <ul class="dropdown-menu">
            <?php foreach ($card as $k => $v) : ?>
                <li><a href="<?php echo base_url('backoffice/export/register/' . $k) ?>">Kartu <?php echo $v ?></a></li>
            <?php endforeach; ?>
        </ul>
    </div>
</div>

<div class="portlet light bordered">
    <div class="portlet-body">
        <table class="table table-striped table-bordered table-hover dt-responsive dataTable no-footer dtr-inline collapsed" style="width: 100%">
            <thead>
                <tr>
                    <th class="all sorting">
                        No.
                    </th>
                    <th class="all sorting">
                        <?php echo $this->lang->line('visitorname') ?>
                    </th>
                    <th class="all sorting">
                        <?php echo $this->lang->line('companyname') ?>
                    </th>
                    <th class="all sorting">
                        <?php echo $this->lang->line('dealername') ?>
                    </th>
                    <th class="all sorting">
                        <?php echo $this->lang->line('cardtype') ?>
                    </th>
                    <th class="min-phone1 sorting">
                        <?php echo $this->lang->line('kategori') ?>
                    </th>
                    <th class="min-phone1 sorting">
                        <?php echo $this->lang->line('offroad') ?>
                    </th>
                    <th class="min-phone1 sorting">
                        <?php echo $this->lang->line('onroad') ?>
                    </th>
                    <th class="min-phone1 sorting">
                        <?php echo $this->lang->line('testdrive') ?>
                    </th>
                    <th class="all sorting">
                        <?php echo $this->lang->line('registertime') ?>
                    </th>
                </tr>
            </thead>
            <tbody>
                <?php
                $category = array(
                    1 => 'Coorporate',
                    2 => 'Media',
                    3 => 'Internal'
                );
                ?>
                <?php foreach ($data as $k => $v) : ?>
                    <tr>
                        <td><?php echo $k + 1 ?></td>
                        <td><?php echo $v['name'] ?></td>
                        <td><?php echo $v['company'] ?></td>
                        <td><?php echo $v['dealer'] ?></td>
                        <td><?php echo $v['cardname'] ?></td>
                        <td><?php echo $category[$v['type']] ?></td>
                        <td><?php echo $v['offroad'] ?></td>
                        <td><?php echo $v['onroad'] ?></td>
                        <td><?php echo $v['testdrive'] ?></td>
                        <td><?php echo date('d/m/y H:i', $v['created']) ?></td>
                    </tr>
                <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>