<!DOCTYPE html>
<!-- Created by CodingLab |www.youtube.com/CodingLabYT-->
<html lang="en" dir="ltr">
    <head>
        <!-- Required meta tags -->
      <meta charset="utf-8">
      <meta content="width=device-width, initial-scale=1.0" name="viewport">
      <title>Augmenting Intelligence to Buy, Sell and Manage|Meddbot</title>
      <meta content="" name="description">
      <meta content="" name="keywords">
    
      <!-- Favicons -->
      <link rel="icon" href="<?php echo e(url('assets/img/favicon.png')); ?>" type="image/png" sizes="16x16">
          
        <!-- Google Font -->
        <link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400;600;700;800&display=swap" rel="stylesheet">
    
        <!-- Bootstrap CSS -->
<!--        <link rel="stylesheet" href="<?php echo e(url('assets/css/bootstrap.min.css')); ?>">-->
        
        <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0/dist/css/bootstrap.min.css" rel="stylesheet" >
        <link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.css" rel="stylesheet" />
    
        <!-- font awesome js -->
        <script src="https://kit.fontawesome.com/c026154490.js" crossorigin="anonymous"></script>
    
        <link rel="stylesheet" href="<?php echo e(url('assets/css/chosen.css')); ?>" type="text/css">
          
        <!-- Custom CSS -->
       
        <link rel="stylesheet" href="<?php echo e(url('assets/css/style_new.css')); ?>">
    
        <!--swal css -->
        
       
       
       
     <style>
         
      footer {
    position: absolute;
    bottom: 0;
    width: 100%;
}   
         
         input#submit {
    background: #008793;
    color: #fff;
    padding: 3px 10px;
    border: 0;
    border-radius: 2px;
}
    label.error{
        color:red;
    }
    
    .disabled {
        pointer-events:none; 
        opacity:0.6; 
    }
    
    .img-prew{
    width: 100px;
    height: 100px;
    margin-top: -95px;
    border-radius: 50%;
    margin-left: -5px;
           }
    .post-imgPrw{
    height: 50px;
    margin-left: 10px;
    width: 50px;
    margin-top: 0px;
           }   
           
    
    .invalid-feedback {
      display:block;
    }
    .image img {
        width: 247px;
        height: 271px;
        object-fit: cover;
    }
    label.error{
            color: red !important;
            font-size: 12px !important;
            font-weight: 500;
          }
    </style>
    
     <?php echo $__env->yieldContent('styles'); ?>
    
      </head>
   <style>

    </style>
<body>
    
    <main>
        <div class="sidebar ">
            <button class="close menu-icon only-mobile"><i class="fa fa-times" aria-hidden="true"></i></button>
            <a href="index.html">
                <div class="company-logo">
                    <img src="<?php echo e(url('assetsnew/img/logowhite.png')); ?>">
                </div>
            </a>
            
            <?php echo $__env->make('include.menu_new', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
        </div>
        <div class="home-section">
            <?php echo $__env->make('include.header_new', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
			<section>
                <input name="_token" type="hidden" id="token_student" value="<?php echo e(csrf_token()); ?>">
                <div class="content">
    
                    <?php if(Session::has('message')): ?>
                    <div class="alert alert-primary" role="alert">
                        Sucessfully Added
                      </div>
    
                    <?php endif; ?>
           
          
                <div class="row">
                    <div class="col-lg-5 d-flex align-items-center">
                        <select id="buyer"  name="buyer[]" data-placeholder="Choose a hospital..." class="chosen-select form-control mr-5" multiple style="width:350px;" tabindex="4">
                            <option value=""></option> 
                            
                                <?php $__currentLoopData = $allbuyers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $buyerlist): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <option value="<?php echo e($buyerlist['id']); ?>"><?php echo e($buyerlist['name']); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </select>
                        <input type="submit" name="submit" id="submit" class="btn">
                    </div>
                    <span style="color:red" id="buyererror"></span>
                    
                    <div class="col-lg-2">
<!--                        <input type="submit" name="submit" id="submit" class="btn">-->
                    </div>
                </div>
      
          </div> 
     </section>
            
            
            <footer>
                <span>Copyright © 2021, Meddbot</span>
            </footer>
        </div>
    </main>
  
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-MrcW6ZMFYlzcLA8Nl+NtUVF0sA7MsXsP1UyJoMp4YLEuNSfAP+JcXn/tWtIaxVXM" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>

    <script src="<?php echo e(URL::to('assets/js/validation/jquery.validate.min.js')); ?>"> </script>
    <script src="<?php echo e(URL::to('assets/js/validation/additional-methods.js')); ?>"></script>
    <script src="<?php echo e(url('assets/css/chosen.jquery.min.js')); ?>"></script>  

    <?php echo $__env->make('include.script_new', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    

    <script>
       $(document).on("click", "#submit", function (form,e) {
       
        var count = $("#buyer :selected").length;

         if(count==0){
             $("#buyererror").html("This field is required");
             
         }
         else{
            $("#buyererror").html(" ");
            var selected = $("#buyer :selected").map((_, e) => e.value).get();
           
                var data = {
                _token: $('#token_student').val(),
                buyer:selected,
               
            }
            $.ajax({
                url: 'https://www.meddbot.com/buyers/buyerrequest',
                type: "POST",
                data: data,
                success: function (res) {

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

                }

            });

           
         }
        
      });
    </script>

<script>
    $(".chosen-select").chosen();
    $('button').click(function(){
            $(".chosen-select").val('').trigger("chosen:updated");
    });
</script>
    <script>
           $(".menu-icon").click(function(){
             $(".sidebar").toggleClass("open");
          });
   </script>
  
</body>
</html>
<?php /**PATH /home/meddbot/public_html/resources/views/buyers/assign_buyer.blade.php ENDPATH**/ ?>