<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; ?>
                            <?php
                             $podetais  			= App\Helpers\CustomHelper::po_accountsadmin(Auth::user()->main_buyer_id);
                            ?>
                          
                          <h3 class="box-head">Account Statistics</h3>

                          <div class="row">
                           <a href="<?php echo e(url('/buyers/manage_payments_approved')); ?>"> <div class="col-md-4">
                                <div class="grid-box blue gridboX">
                                    <div class="box-icon">
                                        <img src="<?php echo e(url('assets/images/buy-d12.png')); ?>">
                                    </div>
                                    <div class="boxvalue-head">
                                       Total Purchase Order Approved By GM
                                    </div>
                                    <div class="box-value box-valueX">₹<?php echo e(number_format($podetais['total_purchase'],2)); ?></div>
                                </div></a>
                            </div>
                            
                            <div class="col-md-4">
                            <a href="<?php echo e(url('/buyers/manage_payments_rejected')); ?>">            
                                <div class="grid-box red gridboX">
                                    <div class="box-icon">
                                        <img src="<?php echo e(url('assets/images/buy-d10.png')); ?>">
                                    </div>
                                    <div class="boxvalue-head">
                                        Total Purchase Order Rejected By GM
                                    </div>
                                    <div class="box-value box-valueX">₹<?php echo e(number_format($podetais['total_purchase_reject'],2)); ?></div>
                                </div>
                            </a>
                            </div>
                            <div class="col-md-4">
                            <a href="<?php echo e(url('/buyers/account_summary')); ?>">  
                                <div class="grid-box green gridboX">
                                    <div class="box-icon">
                                        <img src="<?php echo e(url('assets/images/buy-d11.png')); ?>">
                                    </div>
                                    <div class="boxvalue-head">
                                        Total Paid Amount
                                    </div>
                                    <div class="box-value box-valueX">₹<?php echo e(number_format($podetais['total_paid'],2)); ?></div>
                                </div>
                            </a>
                            </div>
                        </div>

                          
                                <h3 class="box-head">PBG Statistics</h3>
                                <div class="row">
                                   
                                    <div class="col-md-4">
                                    <a href="<?php echo e(url('/buyers/manage_pbg')); ?>">    
                                        <div class="grid-box blue gridboX">
                                            <div class="box-icon">
                                                <img src="<?php echo e(url('assets/images/pbg1.png')); ?>">
                                            </div>
                                            <div class="boxvalue-head">
                                               Pending PBG
                                            </div>
                                            <div class="box-value box-valueX"><?php echo e($podetais['pbg_summary_pending']); ?></div>
                                        </div>
                                    </a>
                                    </div>
                             
                               
                                    <div class="col-md-4">
                                    <a href="<?php echo e(url('/buyers/manage_pbg_approved')); ?>">  
                                        <div class="grid-box green gridboX">
                                            <div class="box-icon">
                                                <img src="<?php echo e(url('assets/images/pbg2.png')); ?>">
                                            </div>
                                            <div class="boxvalue-head">
                                                Approved PBG
                                            </div>
                                            <div class="box-value box-valueX"><?php echo e($podetais['pbg_summary_approved']); ?></div>
                                        </div>
                                    </a>
                                    </div>
                               
                                 
                                    <div class="col-md-4">
                                    <a href="<?php echo e(url('/buyers/manage_pbg_rejected')); ?>"> 
                                        <div class="grid-box red gridboX">
                                            <div class="box-icon">
                                                <img src="<?php echo e(url('assets/images/pbg3.png')); ?>">
                                            </div>
                                            <div class="boxvalue-head">
                                                Rejected PBG
                                            </div>
                                            <div class="box-value box-valueX"><?php echo e($podetais['pbg_summary_rejected']); ?></div>
                                        </div>
                                    </a>
                                    </div>
                               
                                </div>
                                <h3 class="box-head">Payment Statistics</h3>

                                <div class="row">
                               
                                    <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/manage_payments_pending')); ?>">
                                        <div class="grid-box blue gridboX">
                                            <div class="box-icon">
                                                <img src="<?php echo e(url('assets/images/ps1.png')); ?>">
                                            </div>
                                            <div class="boxvalue-head">
                                               Pending Payment Approved By GM
                                            </div>
                                            <div class="box-value box-valueX"><?php echo e($podetais['payment_summary_pending']); ?></div>
                                        </div>
                                    </a>
                                    </div>
                                
                               
                                    <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/manage_payments_approved')); ?>">
                                        <div class="grid-box green gridboX">
                                            <div class="box-icon">
                                                <img src="<?php echo e(url('assets/images/ps2.png')); ?>">
                                            </div>
                                            <div class="boxvalue-head">
                                               Payment Approved
                                            </div>
                                            <div class="box-value box-valueX"><?php echo e($podetais['payment_summary_approved']); ?></div>
                                        </div>
                                    </a>
                                    </div>
                               
                                
                                    <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/manage_payments_rejected')); ?>">
                                        <div class="grid-box red gridboX">
                                            <div class="box-icon">
                                                <img src="<?php echo e(url('assets/images/ps3.png')); ?>">
                                            </div>
                                            <div class="boxvalue-head">
                                                Payment Rejected
                                            </div>
                                            <div class="box-value box-valueX"><?php echo e($podetais['payment_summary_rejected']); ?></div>
                                        </div>
                                    </a>
                                    </div>
                               
                                </div>

                            </div>
                            <?php if(count($latestpbg) != 0): ?>
                            <div class="row"> 
                                <div class="col-md-12">
                                    <h3 class="sub-headings">PBG</h3>
                                    <div class="tableBox wraper">
                                    <table class="display table">
                                        <thead>
                                           <tr>
                                              <th>PBG Id</th>
                                              <th>Order Id</th>
											  <th>PBG Number</th>
                                              <th>Expiry Date</th>
                                              <th>Status </th>
                                           </tr>
                                        </thead>
                                        <tbody>
                                            
                                            <?php if(count($latestpbg) > 0): ?> 
                                            <?php $__currentLoopData = $latestpbg; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $po_list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

                                            <?php if($po_list->status==0): ?>
                                            <tr  class='clickable-row' data-href='<?php echo e(url("buyers/manage_pbg")); ?>'>
                                            <?php elseif($po_list->status==1): ?>
                                            <tr  class='clickable-row' data-href='<?php echo e(url("buyers/manage_pbg_approved")); ?>'>
                                            <?php elseif($po_list->status==2): ?>
                                            <tr  class='clickable-row' data-href='<?php echo e(url("buyers/manage_pbg_rejected")); ?>'>
                                            <?php else: ?>
                                            <tr  class='clickable-row' data-href='#'>
                                            <?php endif; ?>




                                          
                                                <td><?php echo e($po_list->pbgid); ?></td>
                                                <td><?php echo e($po_list->po_id); ?></td>
                                                <td><?php echo e(ucfirst($po_list->pbg_number)); ?></td>
                                                <td> <?php echo e(date('d-m-Y', strtotime($po_list->expiry_date))); ?></td>
                                                 <td> 
                                                    <?php if($po_list->status==0): ?>
                                                    <button class="status red">Pending</button>
                                                    <?php elseif($po_list->status==1): ?>
                                                    <button class="status green">Approved</button>
                                                    <?php elseif($po_list->status==2): ?>
                                                    <button class="status red">Rejected</button>
                                                    <?php else: ?>
                                                    <?php endif; ?>
												</td>
                                            </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <?php else: ?>
                                            <tr><td>No PBG Available</td></tr>
                                            <?php endif; ?>
                                              
                                           
                                           
                                        </tbody>
                                    </table>
                                    </div>
                                </div> 
                            </div>

                            <?php endif; ?>

                            <?php if(count($payments) != 0): ?>
                            <div class="row"> 
                                <div class="col-md-12">
                                    <h3 class="sub-headings">Calculate Payments</h3>
                                    <div class="tableBox wraper">
                                    <table class="display table">
                                        <thead>
                                           <tr>
                                              <th>Account id</th>
                                              <th>Order Id</th>
											  <th>Equipment Id</th>
                                              <th>Status </th>  
                                           </tr>
                                        </thead>
                                        <tbody>

                                            <?php if(count($payments) > 0): ?> 
                                            <?php $__currentLoopData = $payments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $payments): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>



                                            <?php if($payments->status==0): ?>
                                                <tr class='clickable-row' data-href='<?php echo e(url("buyers/manage_payments_pending")); ?>'>
                                            <?php endif; ?>
                                            <?php if($payments->status==1): ?>
                                                <tr class='clickable-row' data-href='<?php echo e(url("buyers/manage_payments_pending")); ?>'>
                                            <?php endif; ?>
                                            <?php if($payments->status==2): ?>
                                                <tr class='clickable-row' data-href='<?php echo e(url("buyers/manage_payments_approved")); ?>'>
                                            <?php endif; ?>
                                            <?php if($payments->status==3): ?>
                                            <tr class='clickable-row' data-href='<?php echo e(url("buyers/manage_payments_rejected")); ?>'>
                                            <?php endif; ?>
                                               
                                                <td>

                                                    <?php echo e($payments->id); ?>


                                                </td>
                                                <td><?php echo e($payments->order_id); ?></td>
                                                <td><?php echo e($payments->po_product_itemsid); ?></td>
                                               
                                                 <td> 
                                                    <?php if($payments->status==1): ?>
                                                    <button class="status red">Pending</button>
                                                    <?php elseif($payments->status==0): ?>
                                                    <button class="status red">Not yet calculate</button>
                                                    <?php elseif($payments->status==1): ?>
                                                    <button class="status green">Send to GM</button>
                                                    <?php elseif($payments->status==2): ?>
                                                    <button class="status green">Approved</button>
                                                    <?php elseif($payments->status==3): ?>
                                                    <button class="status red">Rejected</button>
                                                    <?php else: ?>
                                                    <?php endif; ?>
												</td>
                                            
                                            </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                            <?php else: ?>
                                            <tr><td>No Payments Available</td></tr>
                                            <?php endif; ?>
                                              
                                           
                                           
                                        </tbody>
                                    </table>
                                    </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/buyers/Aa_dashboard.blade.php ENDPATH**/ ?>