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

<style>
.new-col {
background-color: #fff !important;
}
.new-col:hover{
color:#000 !important;
}
.pagination > .active > a, .pagination > .active > a:focus, .pagination > .active > a:hover, .pagination > .active > span, .pagination > .active > span:focus, .pagination > .active > span:hover
{
 background-color: #D2D6DE;
 border-color:#D2D6DE;
}
</style>

<div class="content-wrapper merchant-right-side">
	<!-- Content Header (Page header) -->
<!-- 	<section class="content-header"> -->
<!-- 		<h1> -->
<!-- 			Dashboard  -->
<!-- 		</h1> -->
<!-- 		<ol class="breadcrumb"> -->
<!-- 			<li><a href="#"><i class="fa fa-dashboard"></i> Home</a></li> -->
<!-- 			<li class="active">Dashboard</li> -->
<!-- 		</ol> -->
<!-- 	</section> -->
	
	

	<!-- Main content -->
	<section class="content">
	 <div class="row">
            
            <div class="col-md-12">
            	<div class="box no_border">
            		<h1 style="padding: 15px 0 15px; margin-bottom: 20px; text-align:center; margin-top: 0;">Welcome to Your Dashboard</h1>
           	</div>
            </div>
            
          </div>

	
		<!-- Small boxes (Stat box) -->
	  <div class="row">
            <div class="col-md-4">
            	<div class="small-box new-col">
                <div class="inner">
                  <!--<h3><?php echo count($data['cards']); ?></h3>-->
                  <p style="width:160px">Total Members: <strong><?php echo count($data['cards']); ?></strong></p>
		  <p style="width:160px">New Members Joined in the Last 30 Days: <strong><?php echo count($data['customer']); ?></strong></p>
                </div>
                <div class="icon">
                  <img src="<?php echo asset('assets/img/TotalLoyaltyCardHolders.png'); ?>" alt="User Image" style="height:100px; weidth:100px;">
                </div>
                
              </div>
            </div>
            
           

		<div class="col-md-4">
                                <div class="small-box new-col">
                                        <div class="inner">
                                          <!--<h3><?php echo $data['total']; ?></h3>-->
                                          <p style="width:160px"><?php if($loyalty->loyalty_type==2): ?> Total Credits Given: <?php else: ?> Total Stamps Given:  <?php endif; ?> <strong><?php echo number_format($data['total']); ?></strong></p>
					<a href="<?php echo url('merchant/appuser2'); ?>"><input type="button" class="btn btn-primary" name="view report" value="View Report"></a>

                                        </div>
                                        <div class="icon">
                                          <img src="<?php echo asset('assets/img/TotalPointsGivenOutByTheClients.png'); ?>" alt="User Image" style="height:100px; weidth:100px;">
                                        </div>
                                </div>
                </div>
                <div class="col-md-4">
                                <div class="small-box new-col">
                                    <div class="inner">
                                      <!--<h3><?php echo $data['dif']; ?></h3>-->
                                      <p style="width:160px"><?php if($loyalty->loyalty_type==2): ?> Total Credits Redeemed: <?php else: ?> Total Stamps Redeemed:  <?php endif; ?><strong><?php echo number_format($data['dif']); ?></strong></p>
					<a href="<?php echo url('merchant/reportpointredeem'); ?>"><input type="button" class="btn btn-primary" name="view report" value="View Report"></a>
                                    </div>
                                    <div class="icon">
                                      <img src="<?php echo asset('assets/img/TotalPointsRedeemed.png'); ?>" alt="User Image" style="height:100px; weidth:100px;">
                                    </div>
                                </div>
                </div>

	   </div>

<!-- Start new analystics -->
	<div class="row">

                
                
                
                
                	
	</div>

	<div class="row">
                <div class="col-md-4">
                                <div class="small-box new-col">
                                    <div class="inner">
                                        <p style="width:160px">Male: <strong><?php echo round($data['ml']); ?>%</strong></p>
                                        <p style="width:160px">Female: <strong><?php echo round($data['fm']); ?>%</strong></p>
                                      <!--<p style="width:160px">Male-Female Breakup of Loyalty Card Holders</p>-->
                                    </div>
                                    <div class="icon">
                                      <img src="<?php echo asset('assets/img/MaleFemaleDistribution.png'); ?>" alt="User Image" style="height:100px; weidth:100px;">

                                    </div>
                                </div>
                </div>
                
                <div class="col-md-4">
                                <div class="small-box new-col">
                                    <div class="inner">
                                        <p style="width:160px">Below 18 years: <strong><?php echo round($data['a18']); ?>%</strong></p>
                                        <p style="width:160px">18-30 years: <strong><?php echo round($data['a30']); ?>%</strong></p>
                                        <p style="width:160px">30-45 years: <strong><?php echo round($data['a45']); ?>%</strong></p>
                                        <p style="width:160px">Above 45 years: <strong><?php echo round($data['aa']); ?>%</strong></p>                                      <!--<p style="width:160px">Age Wise Breakup of Loyalty Card Holders</p>-->
                                    </div>
                                    <div class="icon">
                                      <img src="<?php echo asset('assets/img/AgeWiseBreakupOfLoyaltyCardHolders.png'); ?>" alt="User Image" style="height:100px; weidth:100px;">

                                    </div>
                                </div>
                </div>
		<div class="col-md-4">
                                <div class="small-box new-col">
                                    <div class="inner">
                                      <!--<h3><?php echo count($data['rewards']); ?></h3>-->
                                      <p style="width:160px">Total Rewards Verified: <strong><?php echo count($data['rewards']); ?></strong></p>
                                    <a href="<?php echo url('merchant/reportRewardClaim'); ?>"><input type="button" class="btn btn-primary" name="view report" value="View Report"></a>
                                    </div>
                                    <div class="icon">
                                      <img src="<?php echo asset('assets/img/TotalRewardsRedeemedAtAnOutlet.png'); ?>" alt="User Image" style="height:100px; weidth:100px;">
                                    </div>
                                </div>
                </div>

	</div>

	<div class="row">
<div class="col-xs-12">
			<div class="box box-primary box-solid" >
				    <div class="box-header with-border" >
                        <center><h3 class="box-title" style="font-weight: bold; ">Top 10 Visitors - upto 31st August,2017</h3></center>
                        <div class="box-tools pull-right">
                    <button class="btn btn-box-tool" data-widget="collapse" style="color: white"><i class="fa fa-minus"></i></button>
                  </div>
                    </div>
					<div class="box-body">
						<?php if(count($totalvisit) == 0): ?>
						<p class='notice'><?php echo trans('admin::users.pages.no_record_found'); ?></p>
						<?php else: ?>

						<table id="topVisit" class="table table-bordered table-striped">
							<thead>
								<tr>
									<th>Name</th>
									<th>Mobile Number</th>
									<th>Total Visits</th>
								
								</tr>
							</thead>
							<tbody>
								<?php foreach( $totalvisit as $tot ): ?>
								<tr>
									<td><?php echo $tot->Name; ?></td>
									<td><a href="<?php echo url('merchant/appuser/views/'.$tot->user_id.'/'.$authUser->id); ?>"><?php echo $tot->mobile; ?></a></td>
									<td><?php echo $tot->tw_month; ?></td>																	
								</tr>
								<?php endforeach; ?>
							</tbody>
						</table>
						<?php endif; ?>
					</div>
				</div>
			<br>
			<div class="box box-primary box-solid" >
				    <div class="box-header with-border" >
                        <center><h3 class="box-title" style="font-weight: bold; ">Top 10 Spenders - upto 31st August,2017</h3></center>
                        <div class="box-tools pull-right">
                    <button class="btn btn-box-tool" data-widget="collapse" style="color: white"><i class="fa fa-minus"></i></button>
                  </div>
                    </div>
					<div class="box-body">
						<?php if(count($totalbilling) == 0): ?>
						<p class='notice'><?php echo trans('admin::users.pages.no_record_found'); ?></p>
						<?php else: ?>

						<table id="topVisit1" class="table table-bordered table-striped">
							<thead>
								<tr>
									<th>Name</th>
									<th>Mobile Number</th>
									<th>Total Spend</th>
								
								</tr>
							</thead>
							<tbody>
								<?php foreach( $totalbilling as $tot1 ): ?>


								<tr>
									<td><?php echo $tot1->Name; ?></td>
									<td><a href="<?php echo url('merchant/appuser/views/'.$tot1->user_id.'/'.$authUser->id); ?>"><?php echo $tot1->mobile; ?></a></td>
									<td><?php echo $tot1->tw_month; ?></td>									
																		
								</tr>
								<?php endforeach; ?>
							</tbody>
						</table>
						<?php endif; ?>
					</div>
				</div>
<br>
				<div class="box box-primary box-solid" >
				    <div class="box-header with-border" >
                        <center><h3 class="box-title" style="font-weight: bold; ">Upcoming Birthdays of your members in the next 15 days</h3></center>
                        <div class="box-tools pull-right">
                    <button class="btn btn-box-tool" data-widget="collapse" style="color: white"><i class="fa fa-minus"></i></button>
                  </div>
                    </div>
					<div class="box-body">
						<?php if(count($birthday) == 0): ?>
						<p class='notice'><?php echo trans('admin::users.pages.no_record_found'); ?></p>
						<?php else: ?>

						<table id="birthday" class="table table-bordered table-striped">
							<thead>
								<tr>
									<th>Name</th>
									<th>DOB</th>
									<th>Email</th>
									<th>Mobile</th>
                  							<!-- <th>Date</th> -->
								</tr>
							</thead>
							<tbody>
								<?php foreach( $birthday as $bir ): ?>
								<tr>
									<td><?php echo $bir->name; ?></td>
									<!--<td><?php echo $bir->dob; ?></td>-->
									<td><?php echo date('jS  F', strtotime($bir->dob)); ?></td>
									<td><?php echo $bir->email; ?></td>
									<td><a href="<?php echo url('merchant/appuser/views/'.$bir->id.'/'.$authUser->id); ?>"><?php echo $bir->mobile; ?></a></td>									
																		
								</tr>
								<?php endforeach; ?>
							</tbody>
						</table>
						<?php endif; ?>
					</div>
				</div>
			<br>
			                        <div class="box box-primary box-solid" >
                            <div class="box-header with-border" >
                                <center><h3 class="box-title" style="font-weight: bold; ">Upcoming Anniversaries of your members in the next 15 days</h3></center>
                                <div class="box-tools pull-right">
                            <button class="btn btn-box-tool" data-widget="collapse" style="color: white"><i class="fa fa-minus"></i></button>
                          </div>
                            </div>
                            <div class="box-body">
                                <?php if(count($anniversary) == 0): ?>
                                <p class='notice'><?php echo trans('admin::users.pages.no_record_found'); ?></p>
                                <?php else: ?>
        
                                <table id="anniversary" class="table table-bordered table-striped">
                                    <thead>
                                        <tr>
                                            <th>Name</th>
                                            <th>DOA</th>
                                            <th>Email</th>
                                            <th>Mobile</th>
                                                    <!-- <th>Date</th> -->
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php foreach( $anniversary as $aan ): ?>
                                        <tr>
                                            <td><?php echo $aan->name; ?></td>
                                            <!--<td><?php echo $aan->anniversary_date; ?></td>-->
					    <td><?php echo date('jS  F', strtotime($aan->anniversary_date)); ?></td>
                                            <td><?php echo $aan->email; ?></td>
                                            <td><a href="<?php echo url('merchant/appuser/views/'.$aan->id.'/'.$authUser->id); ?>"><?php echo $aan->mobile; ?></a></td>									
                                                                                
                                        </tr>
                                        <?php endforeach; ?>
                                    </tbody>
                                </table>
                                <?php endif; ?>
                            </div>
                        </div>
</div>
	</div>

	


            
            <div class="col-md-4">
<!--             	<div class="box box-danger"> -->
<!--                     <div class="box-header with-border"> -->
<!--                       <h3 class="box-title">Top 5 Customers</h3> -->
                      
                    </div><!-- /.box-header -->
<!--                     <div class="box-body no-padding"> -->
<!--                       <ul class="users-list clearfix"> -->
<!--                         <li> -->
<!--                           <img src="<?php echo asset('assets/img/user1-128x128.jpg'); ?>" alt="User Image"> -->
<!--                           <a class="users-list-name" href="#" id="overlayTriggerfour">Alexander Pierce</a> -->
<!--                           <span class="users-list-date">Today</span> -->
<!--                         </li> -->
<!--                         <li> -->
<!--                           <img src="<?php echo asset('assets/img/user8-128x128.jpg'); ?>" alt="User Image"> -->
<!--                           <a class="users-list-name" href="#">Norman</a> -->
<!--                           <span class="users-list-date">Yesterday</span> -->
<!--                         </li> -->
<!--                         <li> -->
<!--                           <img src="<?php echo asset('assets/img/user7-128x128.jpg'); ?>" alt="User Image"> -->
<!--                           <a class="users-list-name" href="#">Jane</a> -->
<!--                           <span class="users-list-date">12 Jan</span> -->
<!--                         </li> -->
<!--                         <li> -->
<!--                           <img src="<?php echo asset('assets/img/user6-128x128.jpg'); ?>" alt="User Image"> -->
<!--                           <a class="users-list-name" href="#">John</a> -->
<!--                           <span class="users-list-date">12 Jan</span> -->
<!--                         </li> -->
<!--                         <li> -->
<!--                           <img src="<?php echo asset('assets/img/user2-160x160.jpg'); ?>" alt="User Image"> -->
<!--                           <a class="users-list-name" href="#">Alexander</a> -->
<!--                           <span class="users-list-date">13 Jan</span> -->
<!--                         </li> -->
                        
                      </ul><!-- /.users-list -->
                    </div><!-- /.box-body -->
                    
<!--                   </div> -->
          </div>
            
          </div>
		<!-- Main row -->
	
		<!-- /.row (main row) -->

	</section>
	<!-- /.content -->
</div>

    <?php $__env->startSection('scripts'); ?>
<script type="text/javascript">

$('#birthday').DataTable({

    "pageLength":5,
    "ordering": false,
    "lengthMenu": [5, 10, 25, 50, 75, 100 ]
});
$('#anniversary').DataTable({

    "pageLength":5,
    "ordering": false,
    "lengthMenu": [5, 10, 25, 50, 75, 100 ]
});
$('#topVisit').DataTable({

    "pageLength":10,
    "ordering": false,
    "lengthMenu": [5, 10, 25, 50, 75, 100 ]
});
$('#topVisit1').DataTable({

    "pageLength":10,
    "ordering": false,
    "lengthMenu": [5, 10, 25, 50, 75, 100 ]
});


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

<!-- /.content-wrapper -->
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layouts.merchant-backend-layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>