<style>
    .company-logo img {
    margin-top: 0px !important;
    width: 100%;
    height: 175px !important;
    object-fit: cover !important;
}
 .approving-dealer .quote-btns > div {
    width: 50%;
    margin-right: 7px !important;
} 
    
  .quote-btns > div a, .quote-btns > div button {
    width: 100%;
}  
 .quote-btns > div a button {
    border-radius: 8px;
}   
.dealer-details {
    padding: 20px 20px 10px 20px !important;
}    
  img.placeh.img-fluid {
    object-fit: contain !important;
}  
  
</style>


<?php $__env->startSection('content'); ?>
<div class="common-content">
          <div class="page-content">
                <div class="page-heading">
                    <div class="headings">
                        <h6>Group Buyer Requests</h6>
                    </div>
                </div>

                <?php if(count($all_request)): ?>
                <h4>Pending Buyer Requests</h6>
              
                <div class="dashboard-cnts">
                 
                    <div class="row">
                        <input name="_token" type="hidden" id="token_gbuyer" value="<?php echo e(csrf_token()); ?>"> 
                    <?php $__currentLoopData = $all_request; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$requests): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                            <div class="approving-dealer">
                                <div class="company-logo">
					<?php if(!empty($requests->pro_pic)): ?>
                                    		<img src="<?php echo e(url('user_files')); ?>/<?php echo e($requests->pro_pic); ?>">
					<?php else: ?>
						<img class="placeh" src="<?php echo e(url('assets/images/1200px-No-Image-Placeholder.svg.png')); ?>">
					<?php endif; ?>
                                </div>
                                <div class="dealer-details">
                                    <h3  class="company-name"><?php echo e($requests->name); ?></h3>
                                    <ul>
                                        <?php if($requests->address!=''): ?>
                                        <li>
                                            <i class="fas fa-map-marker-alt"></i>
                                            <span><?php echo e($requests->address); ?></span>
                                        </li>
                                        <?php endif; ?>
                                        <li>
                                            <i class="fas fa-phone-alt"></i>
                                            <span><?php echo e($requests->phone_no); ?></span>
                                        </li>
                                       <!-- <li>
                                            <i class="fas fa-envelope"></i>
                                            <span class="web">www.hopkinsmedicine.org</span>
                                        </li> -->
                                    </ul>
                                <div class="quote-btns">
                                     
                                    <div style="margin: 0 0px 7px;">
                                        <a href="#"><button onclick="acceptgroupbuyer(<?php echo e($requests->groupbuyer_id); ?>,<?php echo e($requests->individualbuyer_id); ?>)" class="btn common-btn green-btn"><i class="far fa-check-circle" aria-hidden="true"></i> Approve</button></a>
                                    </div>
                                    <div style="margin: 0 0px 7px;">
                                        <a href="#"><button onclick="rejectgroupbuyer(<?php echo e($requests->groupbuyer_id); ?>,<?php echo e($requests->individualbuyer_id); ?>)" class="btn common-btn red-btn"><i class="fas fa-ban" aria-hidden="true"></i> Reject</button></a>
                                    </div>
                              </div>
                                </div>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
             
                </div>

                <?php endif; ?>

                <?php if(count($approved_request)): ?>


                <h4>Approved Buyer Requests</h6>
                <div class="dashboard-cnts">
                 
                    
                    <div class="row">
                        <input name="_token" type="hidden" id="token_gbuyer" value="<?php echo e(csrf_token()); ?>"> 
                    <?php $__currentLoopData = $approved_request; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$requests): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="col-lg-4 col-md-6 col-sm-12 col-xs-12">
                            <div class="approving-dealer">
                                <div class="company-logo">
					<?php if(!empty($requests->pro_pic)): ?>
                                    		<img src="<?php echo e(url('user_files')); ?>/<?php echo e($requests->pro_pic); ?>">
					<?php else: ?>
						<img class="placeh" src="<?php echo e(url('assets/images/1200px-No-Image-Placeholder.svg.png')); ?>">
					<?php endif; ?>
                                </div>
                                <div class="dealer-details">
                                    <h3  class="company-name"><?php echo e($requests->name); ?></h3>
                                    <ul>
                                        <?php if($requests->address!=''): ?>
                                        <li>
                                            <i class="fas fa-map-marker-alt"></i>
                                            <span><?php echo e($requests->address); ?></span>
                                        </li>
                                        <?php endif; ?>
                                        <li>
                                            <i class="fas fa-phone-alt"></i>
                                            <span><?php echo e($requests->phone_no); ?></span>
                                        </li>
                                       <!-- <li>
                                            <i class="fas fa-envelope"></i>
                                            <span class="web">www.hopkinsmedicine.org</span>
                                        </li> -->
                                    </ul>
                                
                                </div>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>
             
                </div>
            <?php endif; ?>



          </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('scripts'); ?>
<script>

    function acceptgroupbuyer(groupbuyerid,individualbuyerid){
          
            var data = {
                _token: $('#token_gbuyer').val(),
                groupbuyerid:groupbuyerid,
                individualbuyerid:individualbuyerid
               
            }

            $.ajax({
                url: 'https://www.meddbot.com/gbuyeraccept',
                type: "POST",
                data: data,
                success: function (res) {

                    console.log();
                    if(res==1){
                        swal({
								title: "",
								text: "Successfully Approved!",
								type: "success"
							},function () {
								location.reload();
							});
                    }

                }

            });

    }

function rejectgroupbuyer(groupbuyerid,individualbuyerid){

    var data = {
        _token: $('#token_gbuyer').val(),
        groupbuyerid:groupbuyerid,
        individualbuyerid:individualbuyerid
    
    }

    $.ajax({
        url: 'https://www.meddbot.com/gbuyerreject',
        type: "POST",
        data: data,
        success: function (res) {

            console.log();
            if(res==1){
                swal({
                        title: "",
                        text: "Successfully Rejected!",
                        type: "success"
                    },function () {
                        location.reload();
                    });
            }

        }

    });

}




</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/meddbot/public_html/resources/views/buyers/groupbuyerrequest.blade.php ENDPATH**/ ?>