<?php $__env->startSection('title', 'تخفیف محصولات'); ?>

<?php $__env->startSection('head'); ?>
    <link rel="stylesheet" href="<?php echo e(asset('assets/css/chosen.css')); ?>">
    <link rel="stylesheet" href="<?php echo e(asset('assets/css/chosen.min.css')); ?>">
    <meta name="csrf-token" content="<?php echo e(csrf_token()); ?>">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
    <script src="<?php echo e(asset('assets/js/chosen.jquery.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/chosen.jquery.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/js/jss/discount.js')); ?>"></script>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('main'); ?>
    <div style="margin-top: 30px" class="col-sm-5 col-sm-offset-5 content-home">
        <br>
        <h6>افزودن تخفیف</h6>
        <select id="product" name="product" data-placeholder="محصولات دارای تخفیف" class="chosen chosen-rtl" multiple="true"  style="width:290px;direction: ltr">
            <?php $__empty_1 = true; $__currentLoopData = $Product; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); $__empty_1 = false; ?>
                <option style=""  value="<?php echo e($product->id); ?>"><?php echo e($product->title); ?></option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); if ($__empty_1): ?>
            <?php endif; ?>
        </select><br><br>
        <br>
        <input type="text" id="price" class="form-control ltr text-right" size="40" placeholder="مقدار تخفیف به ریال">
        <br><button class="submit btn btn-wide btn-success">افزودن</button>
        <br><br>
        <?php $__empty_1 = true; $__currentLoopData = $Product; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); $__empty_1 = false; ?>
            <?php $pr = $product->Discount()->get();
            $sum = 0;
            foreach($pr as $p)
            {
                $sum+= $p->price;
            }
            echo $product->title.'<br>'.'مقدار تخفیف:'.$sum.'<br>';
            ?>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); if ($__empty_1): ?>
        <?php endif; ?>
        <h6>برداشتن تخفیف</h6>
        <select id="product2" name="product2" data-placeholder="انتخاب محصولات تخفیف دار" class="chosen chosen-rtl" multiple="true"  style="width:290px;direction: ltr">
            <?php $__empty_1 = true; $__currentLoopData = $Product; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getFirstLoop(); $__empty_1 = false; ?>
                <option style=""  value="<?php echo e($product->id); ?>"><?php echo e($product->title); ?></option>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getFirstLoop(); if ($__empty_1): ?>
            <?php endif; ?>
        </select><br>
        <br>
        <br><button class="delete btn btn-wide btn-success">حذف تخفیف</button>
    </div>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>