<div class="row">
    <div class="col-sm-12">
        <div class="page-title-box"><h2 class="page-title">Outlet Stock Transfers</h2></div>
    </div>
</div>
<div class="row">
    <div class="col-sm-12">
        <div class="card">
            <div class="card-body">
                <a href="<?= $this->base ?>/dashboard/create_stock_transfer" class="btn btn-primary mb-3">+ Create Transfer</a>
                <div class="table-responsive">
                    <table id="example" class="display table table-hover table-condensed" cellspacing="0" width="100%">
                        <thead><tr><th>#</th><th>Transfer ID</th><th>From</th><th>To</th><th>Created By</th><th>Status</th><th>Created</th><th>Action</th></tr></thead>
                        <tbody>
                        <?php $x=1; foreach($transfers as $t): $d=$t["Stock_transfer"]; ?>
                            <tr>
                                <td><?= $x++ ?></td><td><?= h($d["transfer_id"]) ?></td>
                                <td><?= h($d["transfer_from"]) ?></td><td><?= h($d["transfer_to"]) ?></td>
                                <td><?= h($d["created_by"]) ?></td>
                                <td><?php $s=$d["status"]; echo $s==1?"<span class=\"badge badge-success\">Completed</span>":"$s"; ?></td>
                                <td><?= date("d-m-Y", strtotime($d["created"])) ?></td>
                                <td><a href="<?= $this->base ?>/dashboard/view_stock_transfer_detail/<?= $d["id"] ?>" class="btn btn-sm btn-info">View</a></td>
                            </tr>
                        <?php endforeach; ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
