<!-- Main content -->
<?php if (isset($component)) { $__componentOriginal566f40242755341fef381206827a6570 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal566f40242755341fef381206827a6570 = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.admin.contents','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('admin.contents'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?>
     <?php $__env->slot('title', null, []); ?> <?php echo e($data['title']); ?> <?php $__env->endSlot(); ?>
     <?php $__env->slot('menuOpen', null, []); ?> <?php echo e($data['menuOpen']); ?>  <?php $__env->endSlot(); ?>
     <?php $__env->slot('menuActive', null, []); ?> <?php echo e($data['menuActive']); ?>  <?php $__env->endSlot(); ?>
     <?php $__env->slot('page', null, []); ?> <?php echo e($data['page']); ?> <?php $__env->endSlot(); ?>
     <?php $__env->slot('head', null, []); ?> 

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


    <section class="content">

        <!-- Default box -->
        <div class="row">
            <div class="col-lg-8">
                <?php if (isset($component)) { $__componentOriginal88b0e6813f5b80100a19437aa80e29ba = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal88b0e6813f5b80100a19437aa80e29ba = $attributes; } ?>
<?php $component = Illuminate\View\AnonymousComponent::resolve(['view' => 'components.message','data' => []] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('message'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(Illuminate\View\AnonymousComponent::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes([]); ?> <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal88b0e6813f5b80100a19437aa80e29ba)): ?>
<?php $attributes = $__attributesOriginal88b0e6813f5b80100a19437aa80e29ba; ?>
<?php unset($__attributesOriginal88b0e6813f5b80100a19437aa80e29ba); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal88b0e6813f5b80100a19437aa80e29ba)): ?>
<?php $component = $__componentOriginal88b0e6813f5b80100a19437aa80e29ba; ?>
<?php unset($__componentOriginal88b0e6813f5b80100a19437aa80e29ba); ?>
<?php endif; ?>
                <div class="card card-primary card-outline">
                    <div class="card-header">
                        <h3 class="card-title"><i class="fa fa-server text-primary"></i> <?php echo e($data['page']); ?></h3>
                    </div>
                    <div class="card-body">
                        <table class="table table-bordered table-hover myTable tab">
                            <thead>
                                <tr>
                                    <th width="5%">No</th>
                                    <th>Nama Toko / Perusahaan</th>
                                    <th>No Telp-</th>
                                    <th>Alamat</th>
                                    <th>Tgl. Input</th>
                                    <th width="20%">Opsi</th>
                                </tr>
                            </thead>
                            <tbody id="view">
                                <?php $__empty_1 = true; $__currentLoopData = $supplier; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td class="text-center"><?php echo e($no++); ?></td>
                                        <td><?php echo e($s->nm_supplier); ?></td>
                                        <td><?php echo e($s->hp_supplier); ?></td>
                                        <td><?php echo e($s->alamat_supplier); ?></td>
                                        <td><?php echo e(tgl_inf($s->created_at)); ?> </td>
                                        <td class="text-center">
                                            <button class="btn btn-primary btn-sm mb-0 mt-0 edit"
                                                data-id="<?php echo e($s->id); ?>" data-toggle="modal"
                                                data-target="#edit<?php echo e($s->id); ?>">
                                                <i class="fa fa-edit mr-2"></i> Edit
                                            </button>
                                            <button class="btn btn-danger btn-sm mb-0 mt-0 hapus"
                                                data-id="<?php echo e($s->id); ?>" data-nm="<?php echo e($s->nm_supplier); ?>">
                                                <i class="fa fa-trash mr-1"></i> Hapus
                                            </button>

                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr>
                                        <td colspan="10" class="text-center">Data masih kosong</td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>

            <div class="col-lg-4">
                <div class="card card-primary card-outline">
                    <div class="card-header">
                        <h3 class="card-title "><i class="fa fa-database text-primary"></i> Input <?php echo e($data['page']); ?>

                        </h3>
                    </div>
                    <form action="<?php echo e(route('supplier.store')); ?>" method="post">
                        <div class="card-body">
                            <?php echo csrf_field(); ?>
                            <div class="form-group">
                                <label>Nama Toko / Perusahaan</label>
                                <input type="text" name="nm_supplier" class="form-control"
                                    placeholder="Nama Toko / Perusahaan" autofocus required
                                    value="<?php echo e(old('nm_supplier')); ?>">
                                <?php $__errorArgs = ['nm_supplier'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <small class="text-danger mt-2">
                                        <?php echo e($message); ?>

                                    </small>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="form-group">
                                <label>No Telp-</label>
                                <input type="text" name="hp_supplier" class="form-control" placeholder="No Telp-"
                                    required value="<?php echo e(old('hp_supplier')); ?>">
                                <?php $__errorArgs = ['hp_supplier'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <small class="text-danger mt-2">
                                        <?php echo e($message); ?>

                                    </small>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>

                            <div class="form-group">
                                <label>Alamat</label>
                                <textarea name="alamat_supplier" id="" placeholder="Alamat.." class="form-control"><?php echo e(old('alamat_supplier')); ?></textarea>
                                <?php $__errorArgs = ['alamat_supplier'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <small class="text-danger mt-2">
                                        <?php echo e($message); ?>

                                    </small>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>

                        </div>
                        <div class="card-footer">
                            <button type="reset" class="btn btn-default"><i class="fa fa-sync-alt"></i>
                                Reset</button>
                            <button class="btn btn-primary float-right"><i class="fa fa-save"></i> Simpan</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <!-- /.card -->

    </section>

    <?php $__currentLoopData = $supplier; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $u): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        <div class="modal fade" id="edit<?php echo e($u->id); ?>">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header bg-primary ">
                        <h4 class="modal-title">Edit Data</h4>
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <form action="<?php echo e(route('supplier.edit')); ?>" method="POST">
                        <div class="modal-body">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('put'); ?>
                            <input type="hidden" name="id" id="" value="<?php echo e($u->id); ?>">
                            <input type="hidden" name="hplama" id="" value="<?php echo e($u->hp_supplier); ?>">
                            <div class="form-group">
                                <label>Nama Toko / Perusahaan</label>
                                <input type="text" name="nm_supplier" class="form-control"
                                    placeholder="Nama Toko / Perusahaan" autofocus required
                                    value="<?php echo e($u->nm_supplier); ?>">
                                <?php $__errorArgs = ['nm_supplier'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <small class="text-danger mt-2">
                                        <?php echo e($message); ?>

                                    </small>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>
                            <div class="form-group">
                                <label>No Telp-</label>
                                <input type="text" name="hp_supplier" class="form-control" placeholder="No Telp-"
                                    required value="<?php echo e($u->hp_supplier); ?>">
                                <?php $__errorArgs = ['hp_supplier'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <small class="text-danger mt-2">
                                        <?php echo e($message); ?>

                                    </small>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>

                            <div class="form-group">
                                <label>Alamat</label>
                                <textarea name="alamat_supplier" id="" placeholder="Alamat.." class="form-control"><?php echo e($u->alamat_supplier); ?></textarea>
                                <?php $__errorArgs = ['alamat_supplier'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                    <small class="text-danger mt-2">
                                        <?php echo e($message); ?>

                                    </small>
                                <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                            </div>

                        </div>
                        <div class="modal-footer justify-content-between">
                            <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
                            <button type="submit" class="btn btn-primary"><i class="fa fa-save"></i> Simpan</button>
                        </div>
                    </form>
                </div>
                <!-- /.modal-content -->
            </div>
            <!-- /.modal-dialog -->
        </div>
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

     <?php $__env->slot('foot', null, []); ?> 

        <script src="<?php echo e(asset('')); ?>assets/admin/plugins/sweetalert2/sweetalert2.all.min.js"></script>
        <script>
            $('#view').on('click', '.hapus', function() {
                var id = $(this).attr('data-id');
                var nama = $(this).attr('data-nm');

                Swal.fire({
                    title: "Apa anda yakin?",
                    text: "Supplier  ( " + nama +
                        " ) & data yang berkaitan dengan Supplier tersebut akan di hapus!",
                    icon: "warning",
                    showCancelButton: true,
                    confirmButtonColor: "#3085d6",
                    cancelButtonColor: "#d33",
                    confirmButtonText: "Ya, Hapus!"
                }).then((result) => {
                    if (result.isConfirmed) {
                        document.location.href = "delete-supplier/" + id;
                    }
                });

            });
        </script>
     <?php $__env->endSlot(); ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal566f40242755341fef381206827a6570)): ?>
<?php $attributes = $__attributesOriginal566f40242755341fef381206827a6570; ?>
<?php unset($__attributesOriginal566f40242755341fef381206827a6570); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal566f40242755341fef381206827a6570)): ?>
<?php $component = $__componentOriginal566f40242755341fef381206827a6570; ?>
<?php unset($__componentOriginal566f40242755341fef381206827a6570); ?>
<?php endif; ?>
<?php /**PATH /Applications/XAMPP/xamppfiles/htdocs/e-CommerceLv11/resources/views/admin/supplier/supplier.blade.php ENDPATH**/ ?>