<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_purchaseadmin(Auth::user()->main_buyer_id);
                                ?>
                                 <?php
                                 $gmdetais  			= App\Helpers\CustomHelper::po_gmadmin(Auth::user()->main_buyer_id);
                                ?>

                                    <h3 class="box-head">Purchase Order Statistics</h3>
                                    <div class="row">
                                        <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/order_summary')); ?>">
                                            <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">
                                                   Pending Orders
                                                </div>
                                                <div class="box-value"><?php echo e($podetais['order_summary_pending']); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                        <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/order_summary_approved')); ?>">
                                            <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">
                                                    Approved Orders
                                                </div>
                                                <div class="box-value"><?php echo e($podetais['order_summary_approved']); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                        <div class="col-md-4">
                                            <a href="<?php echo e(url('/buyers/order_summary_rejected')); ?>">
                                            <div class="grid-box red">
                                                <div class="box-icon">
                                                    <img src="<?php echo e(url('assets/images/buy-d10.png')); ?>">
                                                </div>
                                                <div class="boxvalue-head">
                                                    Rejected Orders
                                                </div>
                                                <div class="box-value"><?php echo e($podetais['order_summary_rejected']); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                    </div>

                                    <h3 class="box-head">Register Sold Statistics</h3>
                                    <div class="row">
                                        <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/approveregsoldproducts')); ?>">
                                            <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">
                                                   Pending Verification
                                                </div>
                                                <div class="box-value"><?php echo e($pending_regsold_approve); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                        <div class="col-md-4">
                                        <a href="<?php echo e(url('/buyers/approveregsoldproducts')); ?>">
                                            <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">
                                                    Completed Verification
                                                </div>
                                                <div class="box-value"><?php echo e($approve_regsold_approve); ?></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($gmdetais['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($gmdetais['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($gmdetais['payment_summary_rejected']); ?></div>
                                            </div>
                                        </a>
                                        </div>
                                   
                                    </div>

    
                                </div>
                                <?php if(count($latestpo) != 0): ?>
                                <div class="row"> 
                                    <div class="col-md-12">
                                        <h3 class="sub-headings">Latest Purchase Orders</h3>
                                        <div class="tableBox wraper">
                                        <table class="display table">
                                            <thead>
                                               <tr>
                                                  <th>Order Id</th>
                                                  <th>Tender No</th>
                                                  <th>Created Date</th>
                                                  <th>Status </th>
                                               </tr>
                                            </thead>
                                            <tbody>
    
                                                <?php if(count($latestpo) > 0): ?> 
                                                <?php $__currentLoopData = $latestpo; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $po_list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    
                                                <?php if($po_list->po_status==0): ?>
                                                <tr  class='clickable-row' data-href='<?php echo e(url("buyers/order_summary")); ?>'>
                                                <?php elseif($po_list->po_status==1): ?>
                                                <tr  class='clickable-row' data-href='<?php echo e(url("buyers/order_summary_approved")); ?>'>
                                                <?php elseif($po_list->po_status==2): ?>
                                                <tr  class='clickable-row' data-href='<?php echo e(url("buyers/order_summary_rejected")); ?>'>
                                                <?php elseif($po_list->po_status==3): ?>
                                                    <tr  class='clickable-row' data-href='<?php echo e(url("buyers/order_summary_cancelled")); ?>'>
                                                <?php else: ?>
                                                <tr  class='clickable-row' data-href='#'>
                                                <?php endif; ?>
    
    
                                                    <td><?php echo e($po_list->orderid); ?></td>
                                                    <td><?php echo e($po_list->tender_number); ?></td>
                                                    <td><?php echo e(date('d-m-Y', strtotime($po_list->created_at))); ?></td>
                                                     <td> 
                                                        <?php if($po_list->po_status==0): ?>
                                                        <button class="status red">Pending</button>
                                                        <?php elseif($po_list->po_status==1): ?>
                                                        <button class="status green">Approved</button>            
                                                        <?php elseif($po_list->po_status==2): ?>
                                                        <button class="status red">Rejected</button>
                                                        <?php elseif($po_list->po_status==3): ?>
                                                        <button class="status red">Cancelled</button>
                                                         <?php else: ?>
                                                         <?php endif; ?>
                                                    </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($soldproductlist) != 0): ?>
                                <div class="row"> 
                                    <div class="col-md-12">
                                        <h3 class="sub-headings">Latest Register Sold</h3>
                                        <div class="tableBox wraper">
                                        <table class="display table">
                                            <thead>
                                               <tr>
                                                  <th>Order Id</th>
                                                  <th>Equipment Id</th>
                                                  <th>Product Name</th>
                                                  <th>Status </th>
                                               </tr>
                                            </thead>
                                            <tbody>
    
                                                <?php if(count($soldproductlist) > 0): ?> 
                                                <?php $__currentLoopData = $soldproductlist; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $sold_list): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    
                                           
                                                    <tr  class='clickable-row' data-href='<?php echo e(url("buyers/approveregsoldproducts")); ?>'>
                                               
                                                    <td><?php echo e($sold_list->order_id); ?></td>
                                                    <td><?php echo e($sold_list->po_product_itemsid); ?></td>
                                                    <td><?php echo e(ucfirst($sold_list->product_name)); ?></td>                                               
                                                     <td> 
                                                        <?php if($sold_list->uncheck_status==0): ?>
                                                        <button class="status red">Pending</button>
                                                        <?php elseif($sold_list->uncheck_status==1): ?>
                                                        <button class="status green">Completed</button>            
                                                        
                                                         <?php else: ?>
                                                         <?php endif; ?>
                                                    </td>
                                                </tr>
                                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php else: ?>
                                                <tr><td>No Datas 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"> 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/Gm_dashboard.blade.php ENDPATH**/ ?>