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

     ?>
     <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/show-daily-report')); ?>" 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">Filter</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 Offers
                         </div>
                         <div class="card-body ">
                             <div class="table-responsive">
                                 <table class="table table-bordered table-sm table-striped w-100" id="example2">
                                     <thead>



                                         <th>Date</th>
                                         <th>Offer</th>
                                         <th>Countries</th>
                                         <th>Browsers</th>
                                         <th>IP Address</th>
                                         <th>Device</th>

                                         <th>Smartlink(ID)</th>
                                         <th>Source</th>
                                         <th>SID</th>
                                         <th>SID2</th>
                                         <th>SID3</th>
                                         <th>SID4</th>
                                         <th>SID5</th>



                                         <th>Clicks</th>
                                         <th>Leads</th>
                                         <th>Earnings</th>
                                         <th>CR</th>
                                         <th>CVR</th>
                                         <th>ECPM</th>

                                     </thead>
                                     <tbody>
                                         <?php
                                         $click = 0;
                                         $leads = 0;
                                         $earnings = 0;
                                         ?>

                                         <?php $__currentLoopData = $qry; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                             <?php $click += $q->clicks;
                                             $leads += $q->leads;
                                             $earnings += $q->earnings; ?>
                                             <tr>

                                                 <td><?php echo e($q->created_at); ?></td>
                                                 <td><?php echo e($q->offer_name); ?>(<?php echo e($q->offer_id); ?>)</td>
                                                 <td><?php echo e($q->countries); ?></td>
                                                 <td>
                                                     <?php if($q->browser == 'OPERA MINI'): ?>
                                                         <i class="fab fa-opera text-danger" title="Opera"></i>
                                                     <?php elseif($q->browser == 'Chrome'): ?>
                                                         <i class="fadeIn animated fab fa-chrome " title="Chrome"></i>
                                                     <?php elseif($q->browser == 'Firefox'): ?>
                                                         <i class="fadeIn animated fab fa-firefox" title="Firefox"></i>
                                                     <?php elseif($q->browser == 'Internet Explorer'): ?>
                                                         <i class="fab fa-internet-explorer" title="Internet Explorer"></i>
                                                     <?php elseif($q->browser == 'Safari'): ?>
                                                         <i class="fadeIn animated fab fa-safari" title="Safari"></i>
                                                     <?php elseif($q->browser == 'EDGE'): ?>
                                                         <i class="fadeIn animated fab fa-edge" title="Edge"></i>
                                                     <?php endif; ?>
                                                 </td>
                                                 <td><?php echo e($q->ip_address); ?></td>
                                                 <?php if($q->key_==null): ?>
                                                 <td>

                                                     <?php if($q->ua_target == 'Windows'): ?>
                                                         <i class="fab fa-windows" title="Windows"></i>
                                                     <?php elseif($q->ua_target == 'Mac'): ?>
                                                         <i class="fadeIn animated fas fa-laptop" title="Mac"></i>
                                                     <?php elseif($q->ua_target == 'Iphone'): ?>
                                                         <i class="fadeIn animated fas fa-mobile" title="Iphone"></i>
                                                     <?php elseif($q->ua_target == 'Ipad'): ?>
                                                         <i class="fas fa-mobile-alt" title="Ipad"></i>
                                                     <?php elseif($q->ua_target == 'Android'): ?>
                                                         <i class="fadeIn animated fab fa-android" title="Android"></i>
                                                     <?php endif; ?>
                                                 </td>
                                                 <td style="background:#F2F2F2;"></td>
                                                 <td>
                                                    <?php if($q->source==null): ?>
                                                     Direct Visitor
                                                    <?php else: ?>
                                                        <?php echo e($q->source); ?>

                                                    <?php endif; ?>
                                                 </td>

                                                 <td><?php echo e($q->sid); ?></td>
                                                 <td><?php echo e($q->sid2); ?></td>
                                                 <td><?php echo e($q->sid3); ?></td>
                                                 <td><?php echo e($q->sid4); ?></td>
                                                 <td><?php echo e($q->sid5); ?></td>
                                                <?php else: ?>
                                                 <td>

                                                     <?php if($q->ua_target == 'Windows'): ?>
                                                         <i class="fab fa-windows" title="Windows"></i>
                                                     <?php elseif($q->ua_target == 'Mac'): ?>
                                                         <i class="fadeIn animated fas fa-laptop" title="Mac"></i>
                                                     <?php elseif($q->ua_target == 'Iphone'): ?>
                                                         <i class="fadeIn animated fas fa-mobile" title="Iphone"></i>
                                                     <?php elseif($q->ua_target == 'Ipad'): ?>
                                                         <i class="fa-mobile-alt" title="Ipad"></i>
                                                     <?php elseif($q->ua_target == 'Android'): ?>
                                                         <i class="fadeIn animated fab fa-android" title="Android"></i>
                                                     <?php endif; ?>
                                                 </td>

                                                 <td><?php echo e((!empty($q->smartlink))?$q->smartlink:'--'); ?>

                                               </td>

                                                 <td style="background:#F2F2F2;"></td>
                                                 <td style="background:#F2F2F2;"></td>
                                                 <td style="background:#F2F2F2;"></td>
                                                 <td style="background:#F2F2F2;"></td>
                                                 <td style="background:#F2F2F2;"></td>
                                                 <td style="background:#F2F2F2;"></td>

                                                 <?php endif; ?>


                                                 <td><b><?php echo e($q->clicks); ?></b></td>
                                                 <td><b><?php echo e($q->leads); ?></b></td>
                                                 <td><b>€ <?php echo e(round($q->earnings, 2)); ?></b></td>

                                                 <td> <b><?php echo e($q->leads == 0 ? 0 : $q->clicks / $q->leads); ?>%</b></td>
                                                 <td> <b><?php echo e($q->leads == 0 ? 0 : round(($q->leads / $q->clicks)*100, 2)); ?>%</b></td>
                                                 <td> <b><?php echo e($q->leads == 0 ? 0 : round(($q->earnings / $q->leads) * 1000, 2)); ?></b>
                                                 </td>
                                             </tr>
                                         <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                     </tbody>
                                     <tfoot>
                                         <tr>
                                             <td></td>

                                             <td></td>
                                             <td></td>
                                             <td></td>
                                             <td></td>
                                             <td></td>
                                             <td></td>

                                             <td> </td>
                                             <td> </td>
                                             <td> </td>
                                             <td> </td>
                                             <td></td>
                                             <td><b> Total = </b></td>

                                             <td><b><?php echo e($click); ?></b></td>
                                             <td><b><?php echo e($leads); ?></b></td>
                                             <td><b>€ <?php echo e(round($earnings, 2)); ?></b></td>
                                             <td><b><?php echo e($click * 100); ?>%</b></td>
                                             <td> <b><?php echo e($leads == 0 ? 0 : round(($leads / $click)*100,2)); ?>%</b></td>
                                             <td> <b>€ <?php echo e($leads == 0 ? 0 : round(($earnings / $leads) * 1000, 2)); ?></b> </td>

                                         </tr>
                                     </tfoot>
                                 </table>

                             </div>
                             <?php echo $qry->links(); ?>

                         </div>
                     </div>
                 </div>
             </div>
             <!--		<div class="row">-->
             <!--			<div class="col-12 col-lg-12">-->
             <!--				<div class="card radius-10">-->
             <!--						<div class="card-header">-->
             <!--	 				Report By Date-->
             <!--	 			</div>-->
             <!--					<div class="card-body ">-->
             <!--						<div class="table-responsive">-->
             <!--					<table class="table" id="example">-->
             <!--						<thead>-->


             <!--							<th>Date</th>-->
             <!--								<th>Offer</th>-->
             <!--									<th>Countries</th>-->
             <!--									<th>Browsers</th>-->
             <!--									<th>Ip Address</th>-->

             <!--							<th>Clicks</th>-->
             <!--							<th>Leads</th>-->
             <!--							<th>Earnings</th>-->


             <!--						</thead>-->
             <!--						<tbody>-->
             <!--							<?php $__currentLoopData = $qry1; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $q): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
    -->
             <!--							<tr>-->

             <!--								<td><?php echo e($q->created_at); ?></td>-->
             <!--								<td><?php echo e($q->offer_id); ?></td>-->
             <!--								<td><?php echo e($q->countries); ?></td>-->
             <!--									<td><?php echo e($q->browser); ?></td>-->
             <!--										<td><?php echo e($q->ip_address); ?></td>-->
             <!--								<td><?php echo e($q->clicks); ?></td>-->
             <!--								<td><?php echo e($q->leads); ?></td>-->
             <!--								<td>$<?php echo e(round($q->earnings, 2)); ?></td>-->
             <!--							</tr>-->
             <!--
    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>-->
             <!--						</tbody>-->
             <!--					</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/ayixmwuy/public_html/aff/backend/resources/views/publisher/daily_report.blade.php ENDPATH**/ ?>