<style>
    .percircle.big {
        font-size: 141px !important;
    }
    .percircle {
        position: relative;
        width: 140px !important;
        height: 140px !important;
    }    
      
    </style>
    
    
    <?php $__env->startSection('content'); ?>
          <div class="common-content">
              <div class="page-content">
                    <div class="page-heading">
                        <div class="headings">
                            <h6>My Dashboard</h6>
                        </div>
                    </div>
                  
                    <div class="dashboard-cnts">
                        <div class="row">
                            <div class="col-12 blink">
                                <div class="bid-stats buyers">
                                         <?php 
                                if(!empty($userdata->name)){
                                    $val2 = '1';
                                }else{
                                    $val2 = '0';
                                }
                                
                                if(!empty($userdata->email)){
                                    $val3 = '1';
                                }else{
                                    $val3 = '0';
                                }
                                
                                if(!empty($userdata->phone_no)){
                                    $val4 = '1';
                                }else{
                                    $val4 = '0';
                                }
                                
                                
                                if(!empty($userdata->address)){
                                    $val5 = '1';
                                }else{
                                    $val5 = '0';
                                }
                                
                                
                                if(!empty($userdata->state)){
                                    $val6 = '1';
                                }else{
                                    $val6 = '0';
                                }
                                
                                if(!empty($userdata->city)){
                                    $val7 = '1';
                                }else{
                                    $val7 = '0';
                                }
                                
                                if(!empty($userdata->zipcode)){
                                    $val8 = '1';
                                }else{
                                    $val8 = '0';
                                }
                                
                                if(!empty($userdata->contact_name)){
                                    $val9 = '1';
                                }else{
                                    $val9 = '0';
                                }
                                
                                if(!empty($userdata->contact_phone_no)){
                                    $val10 = '1';
                                }else{
                                    $val10 = '0';
                                }
                                
                                if((Auth::user()->user_type == '1')||(Auth::user()->user_type == '5')||(Auth::user()->user_type == '6')||(Auth::user()->user_type == '4')){
                                    if(!empty($userdata->buyer_type)){
                                    $val11 = '1';
                                    }else{
                                        $val11 = '0';
                                    }
                                 }elseif(Auth::user()->user_type == '2'){
                                    if(!empty($userdata->vendor_type)){
                                    $val11 = '1';
                                    }else{
                                        $val11 = '0';
                                    }
                                 }
                                 
                                 if(!empty($userdata->description)){
                                    $val12 = '1';
                                    }else{
                                        $val12 = '0';
                                    }                        
                                 $total = round(($val2+$val3+$val4+$val5+$val6+$val7+$val8+$val9+$val10+$val11+$val12)*100/11); 
                                //print_r($total);                       
                                ?>
                                <?php if($total < 100): ?>                   
                                <?php endif; ?>
                                    <h3 class="box-head">Pre-Requisites Statistics</h3>
                                    <div class="row">
                                        <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/prerequisites_order')); ?>">
                                            <div class="grid-box blue">
                                                <div class="box-icon">
                                                    <img src="<?php echo e(url('assets/images/buy-d12.png')); ?>">
                                                </div>
                                                <div class="boxvalue-head">
                                                  All Pre-Requisites Ready
                                                </div>
                                                <div class="box-value"><?php echo e($ready); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                        <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/prerequisites_order')); ?>">
                                            <div class="grid-box green">
                                                <div class="box-icon">
                                                    <img src="<?php echo e(url('assets/images/buy-d11.png')); ?>">
                                                </div>
                                                <div class="boxvalue-head">
                                                    Pre-Requisites Pending
                                                </div>
                                                <div class="box-value"><?php echo e($notready); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                    
                                    </div>

                                    <h3 class="box-head">Installation Statistics</h3>
                                    <div class="row">
                                        <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/received_products_biomedical')); ?>">
                                            <div class="grid-box blue">
                                                <div class="box-icon">
                                                    <img src="<?php echo e(url('assets/images/buy-d12.png')); ?>">
                                                </div>
                                                <div class="boxvalue-head">
                                                   Installation Pending
                                                </div>
                                                <div class="box-value"><?php echo e($installation_pending); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                        <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/received_products_biomedical')); ?>">
                                            <div class="grid-box green">
                                                <div class="box-icon">
                                                    <img src="<?php echo e(url('assets/images/buy-d11.png')); ?>">
                                                </div>
                                                <div class="boxvalue-head">
                                                  Installation Completed
                                                </div>
                                                <div class="box-value"><?php echo e($installation_done); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                    
                                    </div>
                                    <?php
                                        $hosdetails  			= App\Helpers\CustomHelper::hospitadetails(Auth::user()->main_buyer_id);
                                    ?>
                                    <h3 class="box-head">Complaint Statistics</h3>
                                    <div class="row comp-statics">
                                        <div class="col-md-4">
                                            <a href="<?php echo e(url('/buyers/complaint_status')); ?>">
                                            <div class="grid-box  comp-st1">
                                                <div class="box-icon">
                                                    <img src="<?php echo e(url('assets/images/buy-d4.png')); ?>">
                                                </div>
                                                <div class="boxvalue-head">
                                                    Pending Complaints
                                                </div>
                                                <div class="box-value "><?php echo e($hosdetails['pendingcomplaints_bio']); ?></div>
                                            </div>
                                         </a>
                                        </div>
                                        <div class="col-md-4">

                                            <a href="<?php echo e(url('/buyers/complaint_status')); ?>">
                                            <div class="grid-box  comp-st2">
                                                <div class="box-icon">
                                                    <img src="<?php echo e(url('assets/images/buy-d5.png')); ?>">
                                                </div>
                                                <div class="boxvalue-head">
                                                    Resolved Complaints
                                                </div>
                                                <div class="box-value "><?php echo e($hosdetails['pendingcomplaints_bio']); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                        <div class="col-md-4">
                                            <a href="<?php echo e(url('/buyers/complaint_status')); ?>">
                                            <div class="grid-box  comp-st3">
                                                <div class="box-icon">
                                                    <img src="<?php echo e(url('assets/images/buy-d6.png')); ?>">
                                                </div>
                                                <div class="boxvalue-head">
                                                    Closed Complaints
                                                </div>
                                                <div class="box-value "><?php echo e($hosdetails['complaintclosed_bio']); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                    </div>

                                    <?php if(count($preorder) != 0): ?>
                                    <div class="row"> 
                                        <div class="col-md-12">
                                            <h3 class="sub-headings">Pre-Requisites</h3>
                                            <div class="tableBox wraper">
                                            <table class="display table">
                                                <thead>
                                                   <tr>
                                                      <th>Order Id</th>
                                                      <th>Tentative Date</th>
                                                      <th>Product Name</th>
                                                     
                                                      <th>Status </th>
                                                   </tr>
                                                </thead>
                                                <tbody>
                                                    
                                                    <?php if(count($preorder) > 0): ?> 
                                                    <?php $__currentLoopData = $preorder; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $po_list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        
                                                    <tr  class='clickable-row' data-href='<?php echo e(url("buyers/prerequisites_order")); ?>'>
                                                   
        
                                                  
                                                        <td><?php echo e($po_list->po_id); ?></td>
                                                        <td><?php echo e($po_list->delivery_date); ?></td>
                                                        <td><?php echo e(ucfirst($po_list->product_name)); ?></td>
                                                        
                                                         <td> 
                                                            <?php if($po_list->requites_ready == true): ?>
                                                            <button class="status green">All Pre-Requisites Ready</button>
                                                              
                                                            <?php else: ?>
                                                            <button class="status red">Pre-Requisites Not Ready</button>
                                                            <?php endif; ?>
                                                        </td>
                                                    </tr>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    <?php else: ?>
                                                    <tr><td>No Data Available</td></tr>
                                                    <?php endif; ?>
                                                      
                                                   
                                                   
                                                </tbody>
                                            </table>
                                            </div>
                                        </div> 
                                    </div>
        
                                    <?php endif; ?>

                                    <?php if(count($installation) != 0): ?>
                                    <div class="row"> 
                                        <div class="col-md-12">
                                            <h3 class="sub-headings">Installation Details</h3>
                                            <div class="tableBox wraper">
                                            <table class="display table">
                                                <thead>
                                                   <tr>
                                                      <th>Order Id</th>
                                                      <th>Equipment Id</th>
                                                      <th>Product Name</th>
                                                      <th>Department Name</th>
                                                      <th>Status </th>
                                                   </tr>
                                                </thead>
                                                <tbody>
                                                    
                                                    <?php if(count($installation) > 0): ?> 
                                                    <?php $__currentLoopData = $installation; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $summary): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
        
                                                    <tr  class='clickable-row' data-href='<?php echo e(url("buyers/received_products_biomedical")); ?>'>
                                                   
        
                                                  
                                                        <td><?php echo e($summary->po_id); ?></td>
                                                        <td><?php echo e($summary->id); ?></td>
                                                        <td><?php echo e(ucfirst($summary->product_name)); ?></td>
                                                        <td><?php echo e(ucfirst($summary->departmentname)); ?></td>

                                                         <td> 
                                                            <?php if($summary->installation_request==1): ?>
                                                            <button class="status red">Installation Pending</button>
                                                            <?php endif; ?>  
                                                            <?php if($summary->installation_request==2): ?>
                                                            <button class="status green">Installation Completed</button>
                                                            <?php endif; ?>
                                                        </td>
                                                    </tr>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                    <?php else: ?>
                                                    <tr><td>No Data Available</td></tr>
                                                    <?php endif; ?>
                                                </tbody>
                                            </table>
                                            </div>
                                        </div> 
                                    </div>
                                <?php endif; ?>
                            <?php
							 $rescomplaints  			= App\Helpers\CustomHelper::latestcomplaints();

							?>
						<?php if(count($complaint_status)!=0): ?>
                            
                            <div class="row"> 
                                <div class="col-md-12">
                                    <h3 class="sub-headings">Complaint Details</h3>
                                    <div class="tableBox wraper">
                                    <table class="display table">
                                        <thead>
                                           <tr>
										      <th>Complaint Id</th>
                                              <th>Product Code</th>
                                              <th>Product Name</th>
                                              <th>Vendor Name</th>
                                              <th>Status</th>
                                              <th>Updated Date</th> 
                                           </tr>
                                        </thead>
                                        <tbody>
										<?php $__currentLoopData = $complaint_status; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $latestcomplaints): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <tr  class='clickable-row' data-href='<?php echo e(url("buyers/complaint_status")); ?>'>
											     <?php if($latestcomplaints->type=='approve'): ?>
													   <?php
														$pname  			= App\Helpers\CustomHelper::product_name($latestcomplaints->product_id);
													   ?>
													   <?php
														$pdetails  			= App\Helpers\CustomHelper::vendorproduct_details($latestcomplaints->product_id);
														$modelno 			= $pdetails->product_code;
													   ?>
												 <?php else: ?>
													 <?php
													   $pname  			= App\Helpers\CustomHelper::product_existing_name($latestcomplaints->existing_product_id);
													 ?>
													  <?php
													  $modelno 			= $latestcomplaints->product_code_existing;
													 ?>
												 <?php endif; ?>
											
											    <td><?php echo e($latestcomplaints->id); ?></td>
                                                <td><?php echo e($modelno); ?></td>
                                                <td><a href="<?php echo e(url('buyers/asset_management')); ?>"><?php echo e(ucfirst($pname)); ?></a></td>
                                                <td><?php echo e(ucfirst($latestcomplaints->vendorname)); ?></td>
                                                <td>
												<?php if($latestcomplaints->status==0): ?><button class="status red">Pending</button>
												<?php elseif($latestcomplaints->status==3): ?>
												 <button class="status green">Submit service charge</button>
												<?php elseif($latestcomplaints->status==2): ?>
												<button class="status red">Rejected</button>
												<?php elseif($latestcomplaints->status==4): ?>
												<button class="status green" style="cursor: inherit;">Approved, waiting for the assignment of service engineer</button>
												<?php elseif($latestcomplaints->status==1): ?>
												<button class="status green">Approved</button>
												<?php elseif($latestcomplaints->status==5): ?>
												<button class="status green">Complaint resolved</button>
												<?php elseif($latestcomplaints->status==6): ?>
												<button class="status orange">Under observation</button>
												<?php elseif($latestcomplaints->status==7): ?>
												<button class="status grey">Closed</button>
												<?php elseif($latestcomplaints->status==8): ?>
												<button class="status grey">Complaint Accepted</button>
												<?php elseif($latestcomplaints->status==10): ?>
												<button class="status grey">Complaint Reopened</button>
												<?php elseif($latestcomplaints->status==9): ?>
												<button class="status grey">Complaint Rejected</button>
												<?php else: ?> <button class="status green"> Done</button><?php endif; ?>
												</td>
                                                <td>
												<?php if($latestcomplaints->status==0): ?>
                                                <?php echo e(date('d-m-Y', strtotime($latestcomplaints->date))); ?>

													
												<?php else: ?>
												    <?php $m =explode(" ",$latestcomplaints->updated_at)?>
													<?php echo e($m[0]); ?>

											    <?php endif; ?>
													
												
												</td>
                                            </tr>
                                         <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>   
                                        </tbody>
                                    </table>
                                    </div> 
                                </div> 
                            </div>
						<?php endif; ?>










                                   


                                    
























                                    
                               
        
                                  
                                    








    
                                </div>
                                
      
    <?php $__env->stopSection(); ?>
    <?php $__env->startSection('scripts'); ?>
    <script>
        <?php if(Session::has('message')): ?>
              swal({
                title: "",
                text: "<?php echo e(Session::get('message')); ?>",
                type: "success",
                showCancelButton: false,
                dangerMode: false,
                confirmButtonText: 'OK',
        
            });
        <?php endif; ?>
        
        </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/bio_dashboard.blade.php ENDPATH**/ ?>