<?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">
                            <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'){
                                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';
                                }
                             }
                             elseif(Auth::user()->user_type == '3'){
                               
                                $val11 = '1';
                                
                             }
                             
                             if(!empty($userdata->description)){
                                $val12 = '1';
                                }else{
                                    $val12 = '0';
                                }
                             
                             $total = round(($val2+$val3+$val4+$val5+$val6+$val7+$val8+$val9+$val10+$val11+$val12)*100/11);


                            // echo $val2.''.$val3.' '.$val4.' '.$val5.' '.$val6.' '.$val7.' '.$val8.' '.$val9.' '.$val10.' '.$val11.' '.$val12;
                           ?>

                       
                                <?php if(Auth::user()->user_status==0): ?>
                                <div style="background-color:red;text-align:center;margin:auto;font-size: 14px;     padding: 8px;color: #fff;    font-weight: 200;    border-radius: 5px 5px 5px 5px; "><b>You can perform the further process only after the Administrator has activated your account</b></div>

                                <?php endif; ?>
                     
                            </br>

                     <?php if(Auth::user()->user_status==1): ?>        

                            <?php if($total < 100): ?>
                                <div style="background-color:red;text-align:center;margin:auto;font-size: 14px;     padding: 8px;color: #fff;    font-weight: 200;    border-radius: 5px 5px 5px 5px; "><b>Your Profile is incomplete . Please <a href="<?php echo e(url('userprofile')); ?>">click here</a> to complete your profile.</b></div>
                            <?php endif; ?>
                            
                            <?php if($bid_count != $sold_count): ?>
                                <div style="background-color:orange;text-align:center;margin:auto;font-size: 14px;     padding: 8px;color: #000;    font-weight: 200;    border-radius: 5px 5px 5px 5px; "><b>Registration of sold product is pending. Please do with in 10 days to avoid account deactivation.<a href="<?php echo e(url('vendors/orderlists')); ?>">Click here</a></b></div>
                            <?php endif; ?>
                                <div class="box-head">Bid Statistics </div>
                                <div class="row vendorDashs vender-values">
                                    <div class="col-md-4">
                                        <a href="<?php echo e(url('vendors/myquotes')); ?>">
                                        <div class="grid-box">
                                            <div class="vend-flex">
                                                <div class="img-boxs">
                                                    <img src="<?php echo e(url('assets/images/icons/v_ic-1.png')); ?>">
                                                </div>
                                                <div class="conts-box">
                                                    <div class="boxvalue-head">
                                                        <label>No. of Bids</label>
                                                        <div class="box-value  value-v"><?php echo e(count($totalbids)); ?></div>
                                                    </div>

                                                    <div class="boxvalue-head">
                                                        <label>Value</label>
                                                        <div class="box-value value-v"><?php echo e($bidsparticipatedsum); ?></div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="boxBotoms">
                                                Participated
                                            </div>
                                        </div>
                                    </a>
                                    </div>
                                    
                                    
                                    <div class="col-md-4">
                                        <a href="<?php echo e(url('vendors/myquotes')); ?>">
                                        <div class="grid-box">
                                            <div class="vend-flex">
                                                <div class="img-boxs">
                                                    <img src="<?php echo e(url('assets/images/icons/v_ic-2.png')); ?>">
                                                </div>
                                                <div class="conts-box">
                                                    <div class="boxvalue-head">
                                                        <label>No. of Bids</label>
                                                        <div class="box-value"><?php echo e(count($totalbids)); ?></div>
                                                    </div>

                                                    <div class="boxvalue-head">
                                                        <label>Value</label>
                                                        <div class="box-value"><?php echo e($bidswonsum); ?></div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="boxBotoms">
                                                Won
                                            </div>
                                        </div>
                                    </a>
                                    </div>
                                    
                                    <div class="col-md-4">
                                        <a href="<?php echo e(url('vendors/myquotes')); ?>">
                                        <div class="grid-box">
                                            <div class="vend-flex">
                                                <div class="img-boxs">
                                                    <img src="<?php echo e(url('assets/images/icons/v_ic-3.png')); ?>">
                                                </div>
                                                <div class="conts-box">
                                                    <div class="boxvalue-head">
                                                        <label>No. of Bids</label>
                                                        <div class="box-value"><?php echo e(count($totalbids)); ?></div>
                                                    </div>

                                                    <div class="boxvalue-head">
                                                        <label>Value</label>
                                                        <div class="box-value"><?php echo e(count($bidslost)); ?></div>
                                                    </div>
                                                </div>
                                            </div>
                                            <div class="boxBotoms">
                                                Lost
                                            </div>
                                        </div>
                                    </a>


                                    </div>
                                    
                                </div>
                                <h3 class="box-head">Inspection Statistics</h3>
                                <div class="row comp-statics">
                                    <div class="col-md-4">
                                        <a href="<?php echo e(url('/vendors/inspection_date_process_pending')); ?>">
                                        <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 Inspection Date
                                            </div>
                                            <div class="box-value "><?php echo e($inspection_pending_count); ?></div>
                                        </div>
                                     </a>
                                    </div>
                                    <div class="col-md-4">

                                        <a href="<?php echo e(url('/vendors/inspection_date_process_approved')); ?>">
                                        <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">
                                               Approved Inspection Date
                                            </div>
                                            <div class="box-value "><?php echo e($inspection_approved_count); ?></div>
                                        </div>
                                    </a>
                                    </div>
                                    <div class="col-md-4">
                                        <a href="<?php echo e(url('/vendors/inspection_date_process_rejected')); ?>">
                                        <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">
                                                Rejected Inspection Date
                                            </div>
                                            <div class="box-value "><?php echo e($inspection_rejected_count); ?></div>
                                        </div>
                                    </a>
                                    </div>
                                </div>

















                            </div>
                        </div>
                    </div>
                    <!-- Bid-statistics-END -->
                  <?php if(count($orderdetails)!= 0): ?>  
                    <div class="row"> 
                        <div class="col-md-12">
                            <h3 class="sub-headings">New orders</h3>
                             <div class="tableBox wraper">
                                    <table id="example" class="display table">
                                        <thead>
                                           <tr>
                                              <th>Product Code</th>
                                              <th>Product Name</th>
                                              <th>Buyer Name</th>
                                              <th>Status</th> 
                                              <th>Ordered Date</th>
                                              
                                           </tr>
                                        </thead>
                                        <tbody>
                                             <?php if(count($orderdetails) > 0): ?>
                                             <?php $__currentLoopData = $orderdetails; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $orders): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <tr>
                                                <td><?php echo e($orders->product_code); ?></td>
                                                <td><?php echo e($orders->product_name); ?> </td>
                                                <td><?php echo e($orders->name); ?> </td>
                                                
                                                <td><?php if($orders->bid_status == '4'): ?>
                                                <span class="status grey">Order Placed</span>
                                                <?php elseif($orders->bid_status == '5'): ?>
                                                <span class="status green">Dispatched</span>
                                                <?php elseif($orders->bid_status == '13'): ?>
                                                <span class="status blue">In Production</span>
                                                <?php elseif($orders->bid_status == '14'): ?>
                                                <span class="status blue">In Packaging</span>
                                                <?php endif; ?></td>
                                                <td><?php echo e(date('d-m-Y', strtotime($orders->ordered_date))); ?></td>
                                            </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <?php else: ?>
                                            <tr><td>No Orders available</td></tr>
                                            <?php endif; ?>
                                        </tbody>
                                    </table>
                              </div>
                          </div> 
                     </div>
					 <?php endif; ?>

                     <?php if(count($inspectionlist) !=0): ?>
										
                     <div class="row"> 
                          <div class="col-md-12">
                              <h3 class="sub-headings">Inspection  Details</h3>
                              <div class="tableBox wraper">
                                   <div class="hack1">
                                       <div id="example_wrapper" class="hack2">
                                           <table id="example" class="display table">
                                       <thead>
                                          <tr>
                                             <th>Order Id</th>
                                             <th>Equipment Id</th>
                                             <th>Product Name</th>
                                             <th>Inspection Date</th>
                                             <th class="w-180" >Status</th>
                                            
                                          </tr>
                                       </thead>
                                       <tbody>
                                       
                                       <?php $__currentLoopData = $inspectionlist; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                       
                                             <?php if($list->inspection_date_status==1): ?>
                                                <tr  class='clickable-row' data-href='<?php echo e(url('vendors/inspection_date_process_pending')); ?>'>
                                             <?php endif; ?>  

                                             <?php if($list->inspection_date_status==2): ?>
                                             <tr  class='clickable-row' data-href='<?php echo e(url('vendors/inspection_date_process_approved')); ?>'>
                                             <?php endif; ?>

                                             <?php if($list->inspection_date_status==3): ?>
                                             <tr  class='clickable-row' data-href='<?php echo e(url('vendors/inspection_date_process_rejected')); ?>'>
                                             <?php endif; ?>

                                              <td><?php echo e($list->po_id); ?></td>
                                               <td><?php echo e($list->id); ?></td>
                                               <td><?php echo e(ucfirst($list->product_name)); ?></td>
                                               <td><?php echo e($list->inspection_date); ?> </td>
                                               
                                               <td>
                                               <?php if($list->inspection_date_status==1): ?><button class="status red">Pending</button>
                                               <?php elseif($list->inspection_date_status==2): ?>
                                                <button class="status green">Approved</button>
                                               <?php elseif($list->inspection_date_status==3): ?>
                                               <button class="status red">Rejected</button>
                                               <?php else: ?> <button class="status green"> Done</button><?php endif; ?>
                                                </td>
                                              
                                           </tr>
                                       <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                          
                                       </tbody>
                                   </table>
                                       </div>
                                  </div>
                              </div> 
                           </div> 
                      </div>
                      <?php endif; ?>

                    <!-- Order Details TABLE-END -->
										<?php
											$rescomplaintscount  			= App\Helpers\CustomHelper::vendorcomplaints();
					
										?>	
										<?php
											$rescomplaints  			= App\Helpers\CustomHelper::latestvendorcomplaints();
				
										?>
					<?php if(count($rescomplaints['latestcomplaints']) !=0): ?>
										
                      <div class="row"> 
                           <div class="col-md-12">
                               <h3 class="sub-headings">Complaints  Details</h3>
                               <div class="tableBox wraper">
                                    <div class="hack1">
                                        <div id="example_wrapper" class="hack2">
                                            <table id="example" class="display table">
                                        <thead>
                                           <tr>
										      <th>Complaint Id</th>
                                              <th>Product code</th>
                                              <th>Product Name</th>
                                              <th>Buyer Name</th>
                                              <th>posted date</th>
                                              <th class="w-180" >Status</th>
                                              <th>&nbsp;</th>
                                           </tr>
                                        </thead>
                                        <tbody>
										
										<?php $__currentLoopData = $rescomplaints['latestcomplaints']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $latestcomplaints): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
										
												<?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; ?>
										
										
										
                                                 <tr  class='clickable-row' data-href='<?php echo e(url('vendors/view_complaint/'.$latestcomplaints->id)); ?>'>
											    <td><?php echo e($latestcomplaints->id); ?></td>
                                                <td><?php echo e($modelno); ?></td>
                                                <td><?php echo e(ucfirst($pname)); ?></td>
                                                <td><?php echo e(ucfirst($latestcomplaints->customername)); ?> </td>
                                                <td>
                                                    <?php echo e(date('d-m-Y', strtotime($latestcomplaints->date))); ?>

                                                </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>
                                               
                                            </tr>
										<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                           
                                        </tbody>
                                    </table>
                                        </div>
                                   </div>
                               </div> 
                            </div> 
                       </div>
					   <?php endif; ?>
                       <!-- Complaint Details TABLE-END -->
                    
                    
                         <!-- <h3 class="sub-headings">Our Partners</h3>
                        <div class="partner-ships"> 
                            <div class="row">
                                <div class="col-md-4">
                                    <div class="partner-box">
                                        <div class="partner-logo">
                                            <img src="<?php echo e(url('assets/images/hospital.jpg')); ?>">
                                        </div>
                                        <div class="partner-details">
                                            <h6>Newlife Hospital</h6>
                                            <p><i class="fas fa-map-marker-alt"></i> 2nd Street, New York</p>
                                            <div class="rating">
                                                <span class="fa fa-star checked"></span>
                                                <span class="fa fa-star checked"></span>
                                                <span class="fa fa-star checked"></span>
                                                <span class="fa fa-star"></span>
                                                <span class="fa fa-star"></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-md-4">
                                    <div class="partner-box">
                                        <div class="partner-logo">
                                            <img src="<?php echo e(url('assets/images/hospital.jpg')); ?>">
                                        </div>
                                        <div class="partner-details">
                                            <h6>Newlife Hospital</h6>
                                            <p><i class="fas fa-map-marker-alt"></i> 2nd Street, New York</p>
                                            <div class="rating">
                                                <span class="fa fa-star checked"></span>
                                                <span class="fa fa-star checked"></span>
                                                <span class="fa fa-star checked"></span>
                                                <span class="fa fa-star"></span>
                                                <span class="fa fa-star"></span>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div> 
                        </div>
                    
                </div>
          </div> -->

          <?php endif; ?>
          <?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/vendors/dashboard.blade.php ENDPATH**/ ?>