

<?php $__env->startSection('title'); ?>
    Agent Information
<?php $__env->stopSection(); ?>

<?php $__env->startSection('style'); ?>
    <link rel="stylesheet" type="text/css" href="<?php echo e(asset('/css/ovcard.css')); ?>">
    <style>
    td {
        word-break: break-all !important;
    }
    </style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('content'); ?>
    <!-- Content Wrapper. Contains page content -->
    <div class="content-wrapper" >
        <!-- Content Header (Page header) -->
        <section class="content-header">
            <h1>
                <span class="fa fa-info"></span> Agent Information
            </h1>
            <ol class="breadcrumb">
                <li><a href="#"><i class="fa fa-cog"></i> Admin Panel</a></li>
                <li class="active">Agent Information</li>
            </ol>
        </section>

        <!-- Main content -->
        <section class="content" style=" padding-bottom: 60%;">
            <div class="page-header">
                <a href="<?php echo e(route('agents')); ?>" class="btn btn-primary"><i class="fa fa-backward"></i> Back</a>
            </div>
            <div class="col-md-3">
                <div class="text-center">
                    <span class="fa fa-user-circle fa-5x"></span>
                </div>
                <br>
                
                <ul class="list-group">
                    <li class="list-group-item">Agent Code : <span class="text-primary"><?php echo e(strtoupper($agent->code) ?? ''); ?></span></li>
                    <li class="list-group-item">Full Name : <span class="text-primary"><?php echo e($agent->fullname ?? ''); ?></span></li>
                    <li class="list-group-item">Address : <span class="text-primary"><?php echo e($agent->address ?? ''); ?></span></li>
                    <li class="list-group-item">Email : <span class="text-primary"><?php echo e($agent->email_ad ?? ''); ?></span></li>
                    <li class="list-group-item">Contact No. : <span class="text-primary"><?php echo e($agent->contact_no ?? ''); ?></span></li>
                    <li class="list-group-item">Team : <span class="text-primary"><?php echo e($agent->team->name ?? ''); ?></span></li>
                    <li class="list-group-item">Position : <span class="text-primary"><?php echo e($agent->position ?? ''); ?></span></li>
                    <li class="list-group-item">C/A Balance : <span class="text-primary"><?php echo e(number_format($ca_bal,2) ?? 0); ?></span></li>
                    
                    
                    
                </ul>

                <!-- Modal -->
                

            </div>

            <div class="col-lg-4">
              <div class="panel panel-default">
                    <div class="panel-heading"></div>
                    <div class="panel-body">
                        <main class="main">
                            <div class="main-overview">
                              <div class="overviewCard">
                                <div class="overviewCard-icon overviewCard-icon--document">
                                   <i class="fa fa-line-chart"></i>
                                </div>
                                <div class="overviewCard-description">Sales Count
                                  
                                  <div style="text-align: right"><strong><?php echo e($stats[0]->cnt_sales ?? 0); ?></strong></div>
                                  <!--<p class="overviewCard-subtitle">Share </p> -->
                                </div>
                              </div>
                            </div>
                          </main>
                    </div>
              </div>
          </div>
          <div class="col-lg-4">
            <div class="panel panel-default">
                  <div class="panel-heading"></div>
                  <div class="panel-body">
                      <main class="main">
                          <div class="main-overview">
                            <div class="overviewCard">
                              <div class="overviewCard-icon overviewCard-icon--calendar">
                                 <i class="fa fa-pie-chart"></i>
                              </div>
                              <div class="overviewCard-description">Total Sales
                                
                                <div style="text-align: right"><strong><?php echo e(number_format($stats[0]->ttl_sales,2) ?? 0); ?></strong></div>
                                <!--<p class="overviewCard-subtitle">Chili Cookoff</p> -->
                              </div>
                            </div>
                          </div>
                        </main>
                  </div>
            </div>
        </div>

          <div class="col-lg-4">
              <div class="panel panel-default">
                    <div class="panel-heading"></div>
                    <div class="panel-body">
                        <main class="main">
                            <div class="main-overview">
                              <div class="overviewCard">
                                <div class="overviewCard-icon overviewCard-icon--calendar">
                                   <i class="fa fa-rouble"></i>
                                </div>
                                <div class="overviewCard-description">Cash Advances
                                  
                                  <div style="text-align: right"><strong><?php echo e(number_format($ca_amount,2) ?? 0); ?></strong></div>
                                  <!--<p class="overviewCard-subtitle">Share </p> -->
                                </div>
                              </div>
                            </div>
                        </main>
                    </div>
              </div>
          </div>
          <div class="col-lg-4">
            <div class="panel panel-default">
                  <div class="panel-heading"></div>
                  <div class="panel-body">
                      <main class="main">
                          <div class="main-overview">
                            <div class="overviewCard">
                              <div class="overviewCard-icon overviewCard-icon--mail">
                                 <i class="fa fa-credit-card"></i>
                              </div>
                              <div class="overviewCard-description">C/A Payments
                                
                                 <div style="text-align: right"><strong><?php echo e(number_format($ca_pay,2) ?? 0); ?></strong></div>
                                  <!--<p class="overviewCard-subtitle">Chili Cookoff</p> -->
                              </div>
                            </div>
                          </div>
                      </main>
                  </div>
            </div>
        </div>

          <div class="col-lg-4">
              <div class="panel panel-default">
                    <div class="panel-heading"></div>
                    <div class="panel-body">
                        <main class="main">
                            <div class="main-overview">
                              <div class="overviewCard">
                                <div class="overviewCard-icon overviewCard-icon--generic">
                                   <i class="fa fa-area-chart"></i>
                                </div>
                                <div class="overviewCard-description">Release Count
                                  <?php if($agent->position=="Sales Executive"): ?>
                                    <div style="text-align: right"><strong><?php echo e($stats[0]->cnt_releases ?? 0); ?></strong></div>
                                  <?php else: ?>
                                    <div style="text-align: right"><strong><?php echo e($stats[0]->um_cnt_releases ?? 0); ?></strong></div>
                                  <?php endif; ?>
                                  <!--<p class="overviewCard-subtitle">Share </p> -->
                                </div>
                              </div>
                              <?php if($agent->position=="Sales Executive"): ?>
                              <?php else: ?>
                                  <div class="overviewCard">
                                    <div class="overviewCard-icon overviewCard-icon--photo">
                                       <i class="fa fa-money"></i>
                                    </div>
                                    <div class="overviewCard-description">Total Releases
                                      <div style="text-align: right"><strong><?php echo e(number_format($stats[0]->agent_net_comm+$stats[0]->um_net_comm,2) ?? 0); ?></strong></div>
                                        <!--<p class="overviewCard-subtitle">Chili Cookoff</p> -->
                                    </div>
                                  </div>
                              <?php endif; ?>
                            </div>
                        </main>
                    </div>
              </div>
          </div>
          <div class="col-lg-4">
              <div class="panel panel-default">
                    <div class="panel-heading"></div>
                    <div class="panel-body">
                        <main class="main">
                            <div class="main-overview">
                                <div class="overviewCard">
                                      <div class="overviewCard-icon overviewCard-icon--document">
                                         <i class="fa fa-money"></i>
                                      </div>
                                      <div class="overviewCard-description">Sales Executive
                                        <div style="text-align: right"><strong><?php echo e(number_format($stats[0]->agent_net_comm,2) ?? 0); ?></strong></div>
                                        <?php if($stats[0]->agent_net_comm == 0): ?>
                                        <?php else: ?>
                                            <div style="text-align: right"><a href="<?php echo e(route('agents.releases',[$agent->id])); ?>"><i class="fa fa-eye"> Details</i></a></div>
                                            <!--<p class="overviewCard-subtitle">Chili Cookoff</p> -->
                                        <?php endif; ?>
                                      </div>
                                </div>

                                <?php if($agent->position=="Sales Executive"): ?>
                                <?php else: ?>
                                <div class="overviewCard">
                                  <div class="overviewCard-icon overviewCard-icon--calendar">
                                     <i class="fa fa-money"></i>
                                  </div>
                                  <div class="overviewCard-description">Unit Manager
                                    <div style="text-align: right"><strong><?php echo e(number_format($stats[0]->um_net_comm,2) ?? 0); ?></strong></div>
                                     <?php if($stats[0]->um_net_comm == 0): ?>
                                     <?php else: ?>
                                        <div style="text-align: right"><a href="<?php echo e(route('agents.um_releases',[$agent->id])); ?>"><i class="fa fa-eye"> Details</i></a></div>
                                        <!--<p class="overviewCard-subtitle">Chili Cookoff</p> -->
                                     <?php endif; ?>
                                    </div>
                                </div>
                                <?php endif; ?>
                            </div>
                        </main>
                    </div>
              </div>
          </div>
            

        </section>
        <?php if(Session('info')): ?>
            <div class="row">
            <div class="col-md-6 col-md-offset-3 text-center">
            <div class="tem alert alert-success navbar-fixed-bottom"><span class="glyphicon glyphicon-ok-circle"></span> <?php echo e(Session('info')); ?></div>
            </div>
            </div>
        <?php endif; ?>

        

    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('admin.layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>