<?php $__env->startSection('title', 'Master Paket'); ?>

<?php $__env->startSection('content-page'); ?>

    <div class="">
        <div class="page-title">
            <div class="title_left">
                <h3>
                    <?php echo $__env->yieldContent('title'); ?>
                </h3>
            </div>
        </div>

        <div class="clearfix"></div>

        <?php if(session('success')): ?>
            <div class="alert alert-success text-uppercase">
                <strong>Berhasil</strong>, <?php echo session('success'); ?>

            </div>
        <?php elseif(session('error')): ?>
            <div class="alert alert-danger text-uppercase">
                <strong>Gagal</strong>, <?php echo session('error'); ?>

            </div>
        <?php endif; ?>

        <div class="row">
            <?php if($code == "001"): ?>
            <?php $__currentLoopData = $masterpaket; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <div class="col-md-4 col-sm-12 col-xs-12">
                    <div class="x_panel">
                        <div class="x_content">
                            <center>
                                <div class="x_title">
                                    <h2>
                                        <?php echo e($item['nama_paket']); ?>

                                    </h2>
                                    <div class="clearfix"></div>
                                </div>
                            </center>
                            <p>
                                Nama Paket : <?php echo e($item['nama_paket']); ?>

                                <br>
                                Limit User : <?php echo e($item['limit_user']); ?>

                                <br>
                                Limit Kontak : <?php echo e($item['limit_contact']); ?>

                                <br>
                                Harga Dasar : Rp. <?php echo e(number_format($item['amount'])); ?>

                                <br>
                                Mengikuti : <?php echo e($item['durationDate']); ?> Hari
                            </p>
                            <div class="form-group">
                                <button onclick="detailPaket(<?php echo e($item['id_master_paket_organization']); ?>, `<?php echo e($code); ?>`)" type="button"
                                    class="btn btn-primary btn-sm text-uppercase btn-block" data-toggle="modal"
                                    data-target=".bs-example-modal-lg">
                                    <i class="fa fa-edit" style="margin-right: 5px"></i> Beli Paket Baru
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            <?php else: ?>
            <div class="col-md-4 col-sm-12 col-xs-12">
                <div class="x_panel">
                    <div class="x_content">
                        <center>
                            <div class="x_title">
                                <h2>
                                    <?php echo e($masterpaket['nama_paket']); ?>

                                </h2>
                                <div class="clearfix"></div>
                            </div>
                        </center>
                        <p>
                            Nama Paket : <?php echo e($masterpaket['nama_paket']); ?>

                            <br>
                            Limit User : <?php echo e($masterpaket['limit_user']); ?>

                            <br>
                            Limit Kontak : <?php echo e($masterpaket['limit_contact']); ?>

                            <br>
                            Harga Dasar : Rp. <?php echo e(number_format($masterpaket['amount'])); ?>

                            <br>
                            Mengikuti : <?php echo e($masterpaket['duration_date']); ?> Hari
                        </p>
                        <div class="form-group">
                            <button onclick="detailPaket(<?php echo e($masterpaket['id_master_paket_organization']); ?>, `<?php echo e($code); ?>`)" type="button"
                                class="btn btn-primary btn-sm text-uppercase btn-block" data-toggle="modal"
                                data-target=".bs-example-modal-lg">
                                <i class="fa fa-edit" style="margin-right: 5px"></i> Beli Paket Baru
                            </button>
                        </div>
                    </div>
                </div>
            </div>
            <?php endif; ?>
        </div>
    </div>

    <div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true">
        <div class="modal-dialog modal-lg">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">
                        <span aria-hidden="true">×</span>
                    </button>
                    <h4 class="modal-title" id="myModalLabel">
                        <i class="fa fa-edit"></i> Beli Paket Baru
                    </h4>
                </div>
                <div id="modal-content-data">

                </div>
            </div>
        </div>
    </div>

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

<?php $__env->startSection('component-js'); ?>

    <script type="text/javascript">
        function detailPaket(id_master_paket_organization, code) {
            $.ajax({
                url: "<?php echo e(url('/pages/master/paket')); ?>" + "/" + id_master_paket_organization + "/" + code + "/get-data",
                type: "GET",
                success: function(response) {
                    $("#modal-content-data").html(response)
                },
                error: function(error) {
                    console.log(error);
                }
            })
        }
    </script>

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

<?php echo $__env->make('pages.layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH E:\XNS\Deployment\Dashboard-New-Ecommerce\resources\views/pages/master/paket/index.blade.php ENDPATH**/ ?>