<?php $__env->startSection('title', trans('transaction.list')); ?>

<?php $__env->startSection('content'); ?>
<div class="panel panel-default">
    <div class="panel-heading">
        <?php echo e(Form::open(['method' => 'get','class' => 'form-inline pull-right'])); ?>

        <?php echo FormField::text('q', [
            'value' => request('q'),
            'label' => trans('transaction.search'),
            'class' => 'input-sm',
            'placeholder' => 'Ketik No. Invoice / Nama / Telp. Customer..',
            'style' => 'width:300px',
        ]); ?>

        <?php echo FormField::text('date', [
            'value' => request('date', $date),
            'label' => trans('app.date'),
            'class' => 'input-sm date-select',
            'placeholder' => 'yyyy-mm-dd',
        ]); ?>

        <?php echo e(Form::submit(trans('transaction.search'), ['class' => 'btn btn-sm'])); ?>

        <?php echo e(link_to_route('transactions.index', trans('app.reset'))); ?>

        <?php echo e(Form::close()); ?>

        <h3 class="panel-title" style="padding:6px 0">
            <?php echo e(trans('transaction.list')); ?> |
            <?php echo e(trans('app.total')); ?> : <?php echo e($transactions->total()); ?> <?php echo e(trans('transaction.transaction')); ?>

        </h3>
    </div>
    <div class="panel-body">
        <table class="table table-condensed">
            <thead>
                <tr>
                    <th><?php echo e(trans('app.table_no')); ?></th>
                    <th><?php echo e(trans('transaction.invoice_no')); ?></th>
                    <th><?php echo e(trans('app.date')); ?></th>
                    <th><?php echo e(trans('transaction.customer')); ?></th>
                    <th><?php echo e(trans('transaction.items_count')); ?></th>
                    <th class="text-right"><?php echo e(trans('transaction.total')); ?></th>
                    <th class="text-center"><?php echo e(trans('app.action')); ?></th>
                </tr>
            </thead>
            <tbody>
                <?php $__empty_1 = true; $__currentLoopData = $transactions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $transaction): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                <tr>
                    <td><?php echo e($transactions->firstItem() + $key); ?></td>
                    <td><?php echo e($transaction->invoice_no); ?></td>
                    <td><?php echo e($transaction->created_at->format('Y-m-d')); ?></td>
                    <td>
                        <?php echo e($transaction->customer['name']); ?>

                        <?php echo e($transaction->customer['phone'] ? '(' . $transaction->customer['phone'] . ')' : ''); ?>

                    </td>
                    <td><?php echo e($transaction->items_count); ?></td>
                    <td class="text-right"><?php echo e(format_rp($transaction->total)); ?></td>
                    <td class="text-center">
                        <?php echo e(link_to_route('transactions.show', trans('app.show'), $transaction->invoice_no)); ?> |
                        <?php echo e(link_to_route('transactions.receipt', trans('app.print'), $transaction->invoice_no)); ?>

                    </td>
                </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                <tr>
                    <td colspan="7">
                        Transaksi tidak ditemukan
                        <?php if(request('q')): ?>
                            dengan keyword <em class="strong"><?php echo e(request('q')); ?></em>
                        <?php endif; ?>
                        <?php if(request('date')): ?>
                            dan pada tanggal <em class="strong"><?php echo e(request('date')); ?></em>.
                        <?php endif; ?>
                    </td>
                </tr>
                <?php endif; ?>
            </tbody>
        </table>
        <div><?php echo str_replace('/?', '?', $transactions->appends(Request::except('page'))->render()); ?></div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('ext_css'); ?>
<?php echo Html::style(url('css/plugins/jquery.datetimepicker.css')); ?>

<?php $__env->stopSection(); ?>

<?php $__env->startPush('ext_js'); ?>
<?php echo Html::script(url('js/plugins/jquery.datetimepicker.js')); ?>

<?php $__env->stopPush(); ?>

<?php $__env->startSection('script'); ?>
<script>
(function() {
    $('.date-select').datetimepicker({
        timepicker: false,
        format:'Y-m-d',
        closeOnDateSelect: true
    });
})();
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\Users\Deni\Downloads\Compressed\Apotek candilkuya\grosir-obat-master\resources\views/transactions/index.blade.php ENDPATH**/ ?>