 <?php $__env->startSection('content'); ?>
     
     <style>
     </style>
     <div class="page-content-wrapper">
         <div class="page-content">

             <div class="card radius-10 mb-3">

                 <div class="card-body">
                     <form action="<?php echo e(url('publisher/report-by-country')); ?>" method="get">
                        <div class="row">
                                <div class="col-lg-3">

                                    <div class="form-group">
                                        <label>From Date</label>
                                        <input type="date" name="from_date" value="<?php echo e(substr($from_date, 0, 10)); ?>"
                                            class="form-control">
                                    </div>
                                </div>
                                <div class="col-lg-3">
                                    <div class="form-group">
                                        <label>To Date</label>
                                        <input class="form-control" value="<?php echo e(substr($to_date, 0, 10)); ?>" name="to_date"
                                            type="date">
                                    </div>
                                </div>

                                <div class="col-lg-2">
                                    <button class="btn btn-primary" type="submit" style="margin-top: 28px">Search</button>
                                </div>
                            </div>
                     </form>
                 </div>
             </div>

             <!--end row-->
             <div class="row">
                 <div class="col-12 col-lg-12">
                     <div class="card radius-10">
                         <div class="card-header">
                             Report By Country
                         </div>
                         <div class="card-body ">
                             <div class="table-responsive">
                             <table class="table table-bordered table-sm table-striped w-100" id="example2">
                             <thead>


                                    <th>Country</th>
                                    <th>Total Clicks</th>
                                    <th>Total leads</th>
                                    <th>Total Earnings</th>
                                    <th>EPC</th>
                                    <th>CR</th>


                                    </thead>
                                    <tbody>
                                    
                                    <?php if($qry): ?>
                                    <?php $__currentLoopData = $qry; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <?php 
                                         ?>
                                        <tr>
                                            <td><?php echo e($q->tcountry); ?></td>
                                            <td><?php echo e($q->clicks); ?></td>
                                            <td><?php echo e($q->leads); ?></td>
                                            <td>$<?php echo e(round($q->earnings,2)); ?></td>
                                            <td>$<?php echo e(round($q->earnings/($q->clicks?$q->clicks:1),2)); ?></td>
                                            <td><?php echo e(round(($q->clicks/($q->leads?$q->leads:1))*100,2)); ?>%</td>
                                        </tr>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php endif; ?>
                                    </tbody>
                                    <tfoot>
                                    <tr>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                        <td></td>
                                    </tr>
                                    </tfoot>
                                    </table>

                             </div>
                         </div>
                     </div>
                 </div>
             </div>
            

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

<?php echo $__env->make('publisher.layout.dashboard', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/topsmar1/aff.topsmartlink.com/backend/resources/views/publisher/report-by-country.blade.php ENDPATH**/ ?>