 
<?php $__env->startSection('content'); ?>
<div class="content-wrapper">
        <!-- Content Header (Page header) -->
        <section class="content-header">
          <h1 class="pull-left"><?php if($loyalty->loyalty_type==2): ?> Report- Credits Given To Customers <?php else: ?> Report- Stamps Given To Customers <?php endif; ?></h1>
    	<div class="pull-right">

		</div><br><br>
		<?php echo $__env->make('includes.messages', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>
        </section>
      
        <!-- Main content -->
		<section class="content">
        <div class="row">
			<div class="col-md-4" style="">&nbsp;</div>
			<div class="col-md-4" style="">
				<a href="<?php echo url('merchant/appuserdownload'); ?>"><input type="button" class="btn btn-primary" name="view report" value="Download Excel"></a>
			</div>
		
		
			<div class="col-md-4" style="float:right;">
				<?php echo Form::open(array('url'=>'merchant/appuser2','method'=>'GET','role'=>"form",'files'=>true,'id'=>'adds-add-form')); ?>

					<div class="col-md-8">
							<div class="form_group">
								<?php echo Form::text('name',Input::old('name'),array('class' => 'form-control')); ?>

							</div>
					</div>
					<div class="form_group">
						<?php echo Form::label('', '',['class' => '']); ?>

						<input type="submit" class='btn btn-primary' name="Search" value="Search">&emsp;
					</div>
				<?php echo Form::close(); ?>

			</div><br/><br/>
		</div>
        <section class="content">
        <div class="row">
            <div class="col-md-12">
              <div class="box">
             <div class="box-body">
                <?php if(count($data1) == 0): ?>
					<p class='notice'><?php echo trans('admin::users.pages.no_record_found'); ?></p>
				<?php else: ?>
				 <table id="userdetail" class="table table-bordered table-striped">
                  				<thead>
                  				<tr>
									<th>Date</th>
									<th>Time</th>
									<th>Name</th>
									<th>Mobile Number</th>
									<th><?php if($loyalty->loyalty_type==2): ?> Credits <?php else: ?> Stamps <?php endif; ?> Given</th>
									<th>Valid Till </th>
									<th>Bill Number</th>
									<?php if($loyalty->loyalty_type==2): ?>
									<th>Bill Amount</th>
									<?php endif; ?>
									<th>Comments </th>
									<th>eBooklet ID </th>
								</tr>
								</thead>
							<tbody>
								<style>
								tr td table{
												text-align: center;
											}
								tr td table tr th{}
								</style>	
                    
					<?php foreach( $data1 as $dd ): ?>
							<?php 
								$key1=(new BaseController())->generate_key_string();
								$key2=(new BaseController())->generate_key_string();
								$en1=(new BaseController())->encryption($key2.'_'.$dd->user_id);
								$en2=(new BaseController())->encryption($key1.'_'.$dd->merchant_id);
								$str1=strtr(base64_encode($en1), '+/=', '-_,');
								$str2=strtr(base64_encode($en2), '+/=', '-_,');
							?>                               
							   
							<tr> 	
								<td><?php echo date('Y-m-d',strtotime($dd->created_at)); ?></td>
								<td><?php echo date('H:i:s',strtotime($dd->created_at)); ?></td>
								<td><?php echo $dd->name; ?></td>
                  				<td><a href="<?php echo url('merchant/appuser/view/'.$str1.'/'.$str2); ?>"><?php echo $dd->mobile_no; ?></a></td>
                  				<td><?php if($loyalty->loyalty_type==2): ?><?php echo $dd->original_points; ?> <?php else: ?> <?php echo $dd->points; ?><?php endif; ?></td>
                  				<td><?php echo $dd->valid_till; ?>

								<td><?php echo $dd->bill_no; ?></td>
								<?php if($loyalty->loyalty_type==2): ?>
								<td><?php echo $dd->bill_amount; ?></td>
								<?php endif; ?>
								<td><?php echo $dd->feedback; ?></td>
								<td><?php echo $dd->ebooklet_id; ?></td>
							</tr>
					<?php endforeach; ?>
							</tbody>
                </table>
                  <?php endif; ?>
                </div><!-- /.box-body -->
              </div><!-- /.box -->
<?php $name = Input::get('name'); ?>
<?php echo $data1->appends(array('name' => $name))->links(); ?>			  

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

/*$('#userdetail').DataTable({
	
    "pageLength":10,
    "ordering": false,
    "lengthMenu": [5, 10, 25, 50, 75, 100 ]
});
$(document).ready(function() {
    $('#userdetail').DataTable( {
        "processing": true,
        "serverSide": true,
	"pageLength":10,
   	 "ordering": false,
    	"lengthMenu": [5, 10, 20, 50, 75, 100 ]
        "ajax": "<?php echo url('merchant/appuser2'); ?>"
    } );
} );*/
</script>
<?php $__env->stopSection(); ?>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.merchant-backend-layout', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>