<!-- 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>

      </ol>

    </section>



    <!-- Main content -->

    <section class="content">



         <?php echo $this->utility->showMsg();?>

        <div class="row">

        <div class="col-md-3 col-sm-6 col-xs-12">

          <div class="info-box">

            <span class="info-box-icon bg-aqua"><i class="fa fa-user-times"></i></span>

            <div class="info-box-content">

              <span class="info-box-text">Exipred Members</span>

              <span class="info-box-number"><?php if(!empty($expiredMembers)){ echo count($expiredMembers);} else { echo 0; }?></span>

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


        <div class="col-md-3 col-sm-6 col-xs-12">

          <div class="info-box">

            <span class="info-box-icon bg-aqua"><i class="fa fa-user"></i></span>

            <div class="info-box-content">

              <span class="info-box-text">Members</span>

              <span class="info-box-number"><?php if(!empty($Members)){ echo count($Members);} else { echo 0; }?></span>

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


        <div class="col-md-3 col-sm-6 col-xs-12">

          <div class="info-box">

            <span class="info-box-icon bg-aqua"><i class="fa fa-shopping-cart"></i></span>

            <div class="info-box-content">

               <span class="info-box-text">Total Orders</span>

              <span class="info-box-number"><?php if(!empty($latestOrders)){ echo count($latestOrders);} else { echo 0; }?></span>

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


        <div class="col-md-3 col-sm-6 col-xs-12">

          <div class="info-box">

            <span class="info-box-icon bg-aqua"><i class="fa fa-commenting-o"></i></span>

            <div class="info-box-content">

              <span class="info-box-text">Total Comments</span>

              <span class="info-box-number"><?php if(!empty($latestComments)){ echo count($latestComments);} else { echo 0; }?></span>

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

        
     <?php if(chkReadPermission('Dashboard',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>   
      <!-- Main row -->
      <div class="">
        <!-- Left col -->
        <div class="col-md-8">
          <!-- /.box -->
          <div class="row">
            <?php if($this->session->userdata('admin_id')!='11330' ){ ?>   
            <div class="col-md-6">
              <!-- DIRECT CHAT -->
              <div class="box box-warning direct-chat direct-chat-warning">
                <div class="box-header with-border">
                  <h3 class="box-title">New Comments</h3>

                  <div class="box-tools pull-right">
                    <span data-toggle="tooltip" title="<?php echo count($todaysComments); ?> New Messages" class="badge bg-yellow"><?php echo count($todaysComments); ?></span>
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i>
                    </button>
                  </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body">
                  <!-- Conversations are loaded here -->
                  <div class="direct-chat-messages messageBoxNew">
                    <!-- Message. Default to the left -->
                    <?php if(!empty($todaysComments)){
                      $i=0; 
                      $imageFile = base_url().'assets/images/default-avatar.jpg';
                      $usrname = '';
                      foreach ($todaysComments as $comments) {
                        $toUserData = getValue('feu_userdetails',array('user_id'=>$comments['user_id']));
                        //print_r($toUserData); die;
                        if(!empty($toUserData))
                        {
                          $fileData = getFiles($toUserData['avatar_file_id']);
                          $usrname = $toUserData['username'];
                          //print_r($fileData); //die;
                          if(!empty($fileData))
                          {
                            if(file_exists(FCPATH.'assets/userfiles/'.$fileData['path'].'/80/'.$fileData['filename'].'.'.$fileData['extension']))
                            {
                              $imageFile = base_url().'assets/userfiles/'.$fileData['path'].'/80/'.$fileData['filename'].'.'.$fileData['extension'];
                            }
                            else
                            {
                              $imageFile = base_url().'assets/images/default-avatar.jpg';
                            }
                          }
                          else
                        {
                            $imageFile = base_url().'assets/images/default-avatar.jpg';
                        }
                        }
                        $file_exist = 0;
                        if($comments['image_path']!=''){
                          $file_exist_exp = explode('assets/userfiles/img/message/', $comments['image_path']);
                          if(count($file_exist_exp)>0){
                            if(strlen($file_exist_exp[1]>1)){
                              $file_exist = 1;
                            }
                          }
                        }
                    ?>
                    <?php if(($comments['text']!='' && $comments['image_path']==''))
                          {
                              ?>
                        <div class="direct-chat-msg <?php if($i%2!=0){ echo 'right'; }?>">
                          <div class="direct-chat-info clearfix">
                            <span class="direct-chat-name pull-<?php if($i%2!=0){ echo 'left'; } else { echo 'right';}?>">
                            <a target="_blank" href="<?php echo  base_url().'admin/users/edit/'.base64_encode($comments['user_id']);?>">    
                            <img class="direct-chat-img" src="<?php echo $imageFile; ?>" title="<?php echo $usrname; ?>"></span>
                            </a>
                            <span class="direct-chat-timestamp pull-<?php if($i%2!=0){ echo 'right'; } else { echo 'left';}?>"><?php echo date('d-m-Y H:i',$comments['created']); ?></span>
                          </div>
                            <a target="_blank" href="<?php echo  base_url().'admin/users/edit/'.base64_encode($comments['from_user_id']);?>">  
                              <?php if(!empty($comments['filename']) && file_exists(FCPATH.'assets/userfiles/'.$comments['path'].'/80/'.$comments['filename'].'.'.$comments['extension']))
                                  {
                              ?>
                                <img class="direct-chat-img" src="<?php echo base_url();?>assets/userfiles/<?php echo $comments['path'].'/80/'.$comments['filename'].'.'.$comments['extension']; ?>" title="<?php echo $comments['username']; ?>">
                              <?php  } else { ?>
                                <img class="direct-chat-img" src="<?php echo base_url();?>assets/images/default-avatar.jpg" title="<?php echo $comments['username']; ?>">
                              <?php } ?>
                            </a>  
                          <div class="direct-chat-text">
                            <?php echo $comments['text']; ?>
                            <p><?php if($comments['image_path']){ echo '<img class="image-modal" src="'.base_url().$comments['image_path'].'"  data-toggle="modal" data-target="#myModal" data-id="'.base_url().$comments['image_path'].'">'; } ?></p>
                            <?php if(chkWritePermission('Delete_Comment',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                            <a onclick="return confirm('Are you sure to delete');" href="<?php echo  base_url();?>admin/dashboard/deleteComment/<?php echo $comments['msg_id']; ?>"><i class="fa fa-trash tooltipstered"></i></a>
                            <?php } ?>
                          </div>
                      </div>
                    <?php }
                        $i++;   
                       }
                      }?>
                  </div>
                  <div class="box-footer text-center">
                  <a href="<?php echo base_url();?>admin/message/alllist" class="uppercase">View All Messages</a>
                </div>
                </div>
                
              </div>
              <!--/.direct-chat -->
            </div>
            <?php } ?>
            <!-- /.col -->

            <div class="col-md-6">
              <!-- USERS LIST -->
              <div class="box box-danger">
                <div class="box-header with-border">
                  <h3 class="box-title">Latest Members</h3>

                  <div class="box-tools pull-right">
                    <span class="label label-danger"><?php echo count($todaysMembers); ?> New Members</span>
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i>
                    </button>
                  </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body no-padding">
                  <ul class="users-list clearfix">
                  <?php if(!empty($todaysMembers)){
                     foreach ($todaysMembers as $members) {
                    ?>
                    <li>
                    <a class="latest-member-avatars" target="_blank" href="<?php echo  base_url().'admin/users/edit/'.base64_encode($members['user_id']);?>">
                      <?php if($members['avatar_file_id']!=''){ 
                        $files = getFiles($members['avatar_file_id']);
                        if(!empty($files))
                        {
                          if($files['filename']!='' && file_exists(FCPATH.'assets/userfiles/'.$files['path'].'/80/'.$files['filename'].'.'.$files['extension']))
                          {
                      ?>
                      
                        <div class="avatarMedium" style="background:url('<?php echo base_url();?>assets/userfiles/<?php echo $files['path'].'/80/'.$files['filename'].'.'.$files['extension']; ?>') no-repeat center center / cover;" title="<?php echo $members['username']; ?>"></div>


                      <?php  } else { ?>
                        <img src="<?php echo base_url();?>assets/images/default-avatar.jpg" alt="message user image" title="<?php echo $members['username']; ?>">
                      <?php } } else { ?>
                        <img src="<?php echo base_url();?>assets/images/default-avatar.jpg" alt="message user image" title="<?php echo $members['username']; ?>">
                      <?php } } else { ?>
                        <img src="<?php echo base_url();?>assets/images/default-avatar.jpg" alt="message user image" title="<?php echo $members['username']; ?>">
                      <?php } ?>
                      <a class="users-list-name" href="javascript:void(0)"><?php echo $members['username']; ?></a>
                      <span class="users-list-date"><?php echo date('d M',$members['created']); ?></span>
                    </a>
                    </li>
                   <?php 
                        }
                      }?> 
                  </ul>
                  <!-- /.users-list -->
                </div>
                <?php if(chkReadPermission('All_Members',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                <div class="box-footer text-center">
                  <a href="<?php echo base_url();?>admin/users/alllist" class="uppercase">View All Users</a>
                </div>
                <?php } ?>
                <!-- /.box-footer -->
              </div>
              <!--/.box -->
            </div>
            <!-- /.col -->
            


          </div>


          <!-- TABLE: LATEST ORDERS -->
          <div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title">Latest Orders <p>Total Amount Of Unpaid Party Booking Order: <?php echo number_format($unpaidBookingOrders[0]['total']/100,2,',','.'); ?> (&euro;)</p>

                <a href="<?php echo  base_url().'admin/order/download_booking'?>" target="_blank" class="btn btn-info">Download Booking Unpaid Invoices</a>
              </h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="table-responsive">
                <table class="table no-margin latestOrder">
                  <thead>
                  <tr>
                    <th>Order NO.</th>
                    <th>Invoice Date</th>
                    <th>Payment Date</th>
                    <th>Total(&euro;)</th>
                    <th>Checkin Total(&euro;)</th>
                    <th>Status</th>
                  </tr>
                  </thead>
                  <tbody>
                  <?php if(!empty($todaysOrders)){
                     foreach ($todaysOrders as $orders) {
                        $checkin_status = 'Unpaid';
                        if($orders['checkin_payed']==1){ 
                          $checkin_status = 'Unpaid';
                        } 
                    ?>
                  <tr>
                    <td><a href="<?php echo base_url().'admin/order/view/'. base64_encode($orders['order_id']); ?>"><?php echo $orders['order_id_masked']; ?></a></td>
					           <?php if($orders['upgrade_date']>0){ $cdate = date('Y-m-d',$orders['upgrade_date']); } else { $cdate = $orders['required_date']; } ?>
                    <td><?php echo $cdate; ?></td>
                    <td><?php if(isset($orders['payment_date'])){ echo $orders['payment_date'];} elseif($orders['payed']==1){ echo $cdate;} ?></td>
                    <td><?php echo number_format($orders['total_sum']/100, 2,',', '.'); ?></td>
                    <td><?php if($orders['is_booking']==1){ ?><?php echo number_format($orders['checkin_amount'], 2,',', '.'); ?> ( <?php echo $checkin_status; ?> )<?php } ?></td>
                    <td>
                      <?php if($orders['payed']==1){ ?>
                        <span class="label label-success">Paid</span>
                      <?php } else { ?>
                        <span class="label label-danger">Not Paid</span>
                      <?php } ?>  
                    </td>
                    
                  </tr>
                 <?php 
                        }
                      }?>
                  </tbody>
                </table>
              </div>
              <!-- /.table-responsive -->
            </div>
            <!-- /.box-body -->
            <?php if(chkReadPermission('Manage_Orders',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
            <div class="box-footer latest_footer clearfix">
              <a href="<?php echo base_url().'admin/order'; ?>" class="btn btn-sm btn-default btn-flat pull-right">View All Orders</a>
            </div>
            <?php } ?>
            <!-- /.box-footer -->
        </div>
          <!-- /.box -->


    
      <!-- TABLE: LATEST ORDERS -->
          <div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title">Latest Profile Text</h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="table-responsive">
                <table class="table no-margin latestOrder">
                  <thead>
                  <tr>
                    <th>Pseudonym</th>
                    <th>Text</th>
                  </tr>
                  </thead>
                  <tbody>
                  <?php if(!empty($todaysProfileText)){
                     foreach ($todaysProfileText as $data) {
                    ?>
                  <tr>
                    <td><a href="javascript:void(0);"><?php echo $data['username']; ?></a></td>
                    <td><a href="javascript:void(0);"><?php echo $data['about']; ?></a></td>
                  </tr>
                 <?php 
                        }
                      } else { echo '<tr>
                    <td colsapn="2">No records found...</td>
                    </tr>'; }?>
                  </tbody>
                </table>
              </div>
              <!-- /.table-responsive -->
            </div>
            <!-- /.box-body -->



            <?php if(chkReadPermission('Manage_Profile_Text',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
            <div class="box-footer latest_footer clearfix">
              <a href="<?php echo base_url().'admin/users/profile_text'; ?>" class="btn btn-sm btn-default btn-flat pull-right">View All Profile Text</a>
            </div>
            <?php } ?>
            <!-- /.box-footer -->
          </div>
          <!-- /.box -->
     

     
      <!-- TABLE: LATEST ORDERS -->
          <div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title">Latest Pin Text</h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="table-responsive">
                <table class="table no-margin latestOrder">
                  <thead>
                  <tr>
                    <th>Written By</th>
                    <th>Text</th>
                  </tr>
                  </thead>
                  <tbody>
                  <?php if(!empty($todaysPinText)){
                     foreach ($todaysPinText as $data) {
                    ?>
                  <tr>
                    <td><a href="javascript:void(0);"><?php echo $data['username']; ?></a></td>
                    <td><a href="javascript:void(0);"><?php echo $data['comment']; ?></a></td>
                    
                  </tr>
                 <?php 
                        }
                      } else { echo '<tr>
                    <td colsapn="2">No records found...</td>
                    </tr>'; }?>
                  </tbody>
                </table>
              </div>
              <!-- /.table-responsive -->
            </div>
            <!-- /.box-body -->
            <!-- /.row -->
            <?php if(chkReadPermission('Manage_Pin_Text',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
            <div class="box-footer latest_footer clearfix">
              <a href="<?php echo base_url().'admin/users/pin_text'; ?>" class="btn btn-sm btn-default btn-flat pull-right">View All Pin Text</a>
            </div>
            <?php } ?>
            <!-- /.box-footer -->
          </div>

          
          <?php if($this->session->userdata('admin_id')!='11330' ){ ?> 
          <!-- /.row -->
          <div class="box box-default">
            <div class="box-header with-border">
              <h3 class="box-title">Device Usage</h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="pieChart" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li><i class="fa fa-circle-o text-red"></i> Desktop</li>
                    <li><i class="fa fa-circle-o text-green"></i> Mobile</li>
                    <li><i class="fa fa-circle-o text-yellow"></i> Ipad</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            
          </div>


          <!-- /.row -->
          <div class="box box-default">
            <div class="box-header with-border">
              <h3 class="box-title">Paid members (<?php echo $gentleman+$lady+$couple; ?>) + Free Lady (<?php echo count($freeLadyData); ?>)</h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="userChart" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li><i class="fa fa-circle-o text-red"></i> Gentleman</li>
                    <li><i class="fa fa-circle-o text-green"></i> Lady</li>
                    <li><i class="fa fa-circle-o text-yellow"></i> Couple</li>
                    <li><i class="fa fa-circle-o text-orange"></i> Free lady</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            <div class="box-body">
              <div class="row">
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li>Basic Gentleman : <span class="text-red"><?php echo number_format($basicGentsPercentage,2, '.', ''); ?> % (<?php echo $basicGents; ?>)</span></li>
                    <li>Premium Gentleman : <span class="text-red"><?php echo number_format($premiumGentsPercentage,2, '.', ''); ?> % (<?php echo $premiumGents; ?>)</span></li>
                  </ul>
                </div>
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li>Basic Lady : <span class="text-green"><?php echo number_format($basicLadiesPercentage,2, '.', ''); ?> % (<?php echo $basicLadies; ?>)</span></li>
                    <li>Premium Lady : <span class="text-green"><?php echo number_format($premiumLadiesPercentage,2, '.', ''); ?> % (<?php echo $premiumLadies; ?>)</span></li>
                  </ul>
                </div>
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li>Basic Couple : <span class="text-yellow"><?php echo number_format($basicCouplessPercentage,2, '.', ''); ?> % (<?php echo $basicCoupless; ?>)</span></li>
                    <li>Premium Couple : <span class="text-yellow"><?php echo number_format($premiumCouplessPercentage,2, '.', ''); ?> % (<?php echo $premiumCoupless; ?>)</span></li>
                  </ul>
                </div>

                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            
          </div>

          


          <!-- /.row -->
          <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Revenue statistics</h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="barChart" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li><i class="fa fa-circle-o" style="color:#b3975b"></i> Membership</li>
                    <li><i class="fa fa-circle-o text-green"></i> Booking</li>
                  </ul>
                  <br/>
                  <form action="<?php echo base_url().'admin/dashboard'; ?>" method="post" id="selectForm">
                    <select name="year" class="form-control monthSelect">
                      <option value="0" >--Select Year--</option>
                      <?php if(count($revenues)>0){ 
                                foreach ($revenues as $values) {
                                  if($values['year']){
                       ?>
                            <option value="<?php echo $values['year']; ?>" <?php if($this->input->post('year')){ if($this->input->post('year') == $values['year'] ){ echo 'selected'; } } ?>><?php echo $values['year']; ?></option>
                       <?php } }
                          }  
                        ?>
                    </select>
                  </form>  
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            <div class="box-body">
              <div class="row">
                <div class="col-md-6">
                  <ul class="chart-legend clearfix">
                    <li>Total Basic Members : <span class="text-red"><?php echo $revenuesDetails['basicMemberTotal']; ?></span></li>
                    <li>Total Premium Members : <span class="text-red"><?php echo $revenuesDetails['premMemberTotal']; ?></span></li>
                  </ul>
                </div>
                <div class="col-md-6">
                  <ul class="chart-legend clearfix">
                    <li>Total Basic Membership : <span class="text-green"><?php echo number_format($revenuesDetails['basicTotal'],2, '.', ''); ?> &euro;</span></li>
                    <li>Total Premium Membership : <span class="text-green"><?php echo number_format($revenuesDetails['premTotal'],2, '.', ''); ?> &euro;</span></li>
                  </ul>
                </div>
                

                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div> 





          <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Upcoming Revenue statistics (Next 12 months)</h3>
              <?php if(count($upcomingRevenue)>0){ 
                  $StriPeValidTotal = 0;
                  $StriPeInvalidTotal = 0;
                  $SaferpayValidTotal = 0;
                  $SaferpayinvalidTotal = 0;
                  foreach ($upcomingRevenue as $values) {
                    $StriPeValidTotal = $StriPeValidTotal + $values['StripeValid'];
                    $StriPeInvalidTotal = $StriPeInvalidTotal + $values['StripeInvalid'];
                    $SaferpayValidTotal = $SaferpayValidTotal + $values['SaferpayValid'];
                    $SaferpayinvalidTotal = $SaferpayinvalidTotal + $values['Saferpayinvalid'];
                  }
                }
              ?>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="barChartUpcoming" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> Stripe Valid (<?php echo number_format($StriPeValidTotal, 2,',', '.'); ?> &euro;)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#dd4b39"></i> Stripe Invalid (<?php echo number_format($StriPeInvalidTotal, 2,',', '.'); ?> &euro;)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green" ></i> Saferpay Valid (<?php echo number_format($SaferpayValidTotal, 2,',', '.'); ?> &euro;)</li> 
					<li style="font-size: 12px !important;"><i class="fa fa-circle-o"  style="color:#909" ></i> Saferpay Invalid(<?php echo number_format($SaferpayinvalidTotal, 2,',', '.'); ?> &euro;)</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>
		   
		   
		   
		   
		    <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Upcoming Revenue statistics (Next 12 months)(saferpay)</h3>
              <?php if(count($arr_upcoming_safer)>0){ 
                
                  $SaferpayValidTotals = 0;
                  foreach ($arr_upcoming_safer as $values) {
                     $SaferpayValidTotals = $SaferpayValidTotals + $values['totals3'];
                  }
                }
              ?> 
			  <?php if(count($arr_upcoming_stripe)>0){ 
                
                  $SaferpayValidTotals_stripe = 0;
                  foreach ($arr_upcoming_stripe as $val) {
                     $SaferpayValidTotals_stripe = $SaferpayValidTotals_stripe + $val['totals3_stripe'];
                  }
                }
              ?>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="barChartUpcomingsaferpay" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                  
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green" ></i> Saferpay (<?php echo number_format($SaferpayValidTotals, 2,',', '.'); ?> &euro;)</li>
					<!--<li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#dd4b39"></i> Upcoming stripe (<?php echo number_format($SaferpayValidTotals_stripe, 2,',', '.'); ?> &euro;)</li>-->
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>

			 <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title"> Statistics (converted stripe to saferpay)</h3>
              <?php if(count($arr_upcoming_safer_by_month)>0){ 
                
                  $SaferpayValidTotalsbymonths = 0;
                  $SaferpayValidTotalsbymonthsget = 0;
                  foreach ($arr_upcoming_safer_by_month as $values) {
                     $SaferpayValidTotalsbymonths = $SaferpayValidTotalsbymonths + $values['safer_by_month_ammount'];
                     $SaferpayValidTotalsbymonthsget = $SaferpayValidTotalsbymonthsget + $values['safer_by_month_ammount_get'];
                  }
                }
              ?>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="barChartconvertingsaferpay" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                  <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#dd4b39"></i> Stripe (<?php echo number_format($SaferpayValidTotalsbymonthsget, 2,',', '.'); ?> &euro;)</li>
				  
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green" ></i> Saferpay (<?php echo number_format($SaferpayValidTotalsbymonths, 2,',', '.'); ?> &euro;)</li>
					
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>



           



           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Past Revenue statistics (Last 12 months)</h3>
              <?php if(count($arr_upcoming_new)>0){ 
                  $declinedTotal = 0;
                  $renewTotal = 0;
                  $newTotal = 0;
                  $i=0;
                  foreach ($arr_upcoming_new as $values) {
                    if($i>0)
                    {
                      
                    $declinedTotal = $declinedTotal + $values['declined'];
                    $renewTotal = $renewTotal + $values['renew'];
                    $newTotal = $newTotal + $values['new'];
                    }
                    $i++;
                  }
                }
              ?>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="barChartPast" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> New (<?php echo number_format($newTotal, 2,',', '.'); ?> &euro;)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green"></i> Renew (<?php echo number_format($renewTotal, 2,',', '.'); ?> &euro;)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#dd4b39"></i> Declined (<?php echo number_format($declinedTotal, 2,',', '.'); ?> &euro;)</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
            <div class="box-body">
              <div class="row">
                <div class="col-md-12">
                  <ul class="chart-legend clearfix">
                  <?php $totalGrand = $declinedTotal+$renewTotal; ?>
                    <li>
                      Declined : <span class="text-red" style="margin-right: 20px;"><?php echo number_format(($declinedTotal/$totalGrand)*100,2, '.', ''); ?> %</span>
                      Renew : <span class="text-green"><?php echo number_format(($renewTotal/$totalGrand)*100,2, '.', ''); ?> %</span>
                    </li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>




           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Premium Member Registration/Renewal Statistics (Month Wise)</h3>
              
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="premium_member_month_wise" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                  <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#dd4b39"></i> Previous Year </li>
          
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green" ></i> Current Year</li>
          
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>



          <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Past Party statistics</h3>
              
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="pastPartyStat" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> Number of user those who booked for first time</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green"></i> Number of user those who booked for more than 1 party and less than 4</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#336fce"></i> Number of user those who booked for more than 4 party</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>


           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">User Registration statistics</h3>
              
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="registerUserStat" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <!-- <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> Number of user those who booked for first time</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green"></i> Number of user those who booked for more than 1 party and less than 4</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#336fce"></i> Number of user those who booked for more than 4 party</li>
                  </ul>
                </div> -->
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>


          </div>
          <!-- /.box -->
          <?php } ?>



        </div>
        <!-- /.col -->

        <div class="col-md-4">
          <!-- Info Boxes Style 2 -->
          
              <!-- USERS LIST -->
              <div class="box box-danger">
                <div class="box-header with-border">
                  <h3 class="box-title">Latest Uploads(In last 8 hours)</h3>

                  <div class="box-tools pull-right">
                    <span class="label label-success"><?php echo count($todaysUploads); ?></span>
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i>
                    </button>
                  </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body no-padding">
                  <ul class="users-list clearfix">
                  <?php if(!empty($todaysUploads)){
                     foreach ($todaysUploads as $uploads) {
                    ?>
                    <li>
                    <a href="<?php echo base_url().'admin/users/edit/'.base64_encode($uploads['user_id']); ?>" target="_blank">
                      <?php if(file_exists(FCPATH.'assets/userfiles/'.$uploads['path'].'/'.$uploads['filename'].'.'.$uploads['extension']) && $uploads['filename']!='')
                            {
                      ?>
                      <div class="avatarMedium" style="background:url('<?php echo base_url();?>assets/userfiles/<?php echo $uploads['path'].'/'.$uploads['filename'].'.'.$uploads['extension']; ?>') no-repeat center center / cover;" ></div>
                        
                      <?php  } 
                            elseif(file_exists(FCPATH.'assets/userfiles/'.$uploads['path'].'/'.$uploads['temp_name'].'.'.$uploads['extension']) && $uploads['temp_name']!='')
                            {
                      ?>
                      <div class="avatarMedium" style="background:url('<?php echo base_url();?>assets/userfiles/<?php echo $uploads['path'].'/'.$uploads['temp_name'].'.'.$uploads['extension']; ?>') no-repeat center center / cover;" ></div>
                        
                      <?php  } else { ?>
                        <img class="" src="<?php echo base_url();?>assets/images/default-avatar.jpg" alt="message user image">
                      <?php  } ?>
                      </a>
                      <?php if(chkWritePermission('All_Pictures',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                      <div class="row tinypadding-all ">
                        <a href="<?php echo  base_url();?>admin/dashboard/accept/<?php echo base64_encode($uploads['id']); ?>" class="" onclick="return confirm('Are you sure to accept')">
                          <i class="fa fa-check tooltipstered"></i>
                        </a>
                        <a href="<?php echo  base_url();?>admin/dashboard/reject/<?php echo base64_encode($uploads['id']); ?>" class="" onclick="return confirm('Are you sure to reject')">
                          <i class="fa fa-trash tooltipstered"></i>
                        </a>
                        <a href="<?php echo  base_url();?>admin/dashboard/rotate/<?php echo base64_encode($uploads['id']); ?>/<?php echo str_replace('/','-',uri_string()); ?>" class="">
                          <i class="fa fa-repeat tooltipstered"></i>
                        </a>
                        <input type="checkbox" name="images_all[]" class="images_all" value="<?php echo $uploads['id']; ?>">
                      </div>
                      <?php } ?>
                    </li>
                   <?php 
                        }
                      } ?> 
                  </ul>
                  <!-- /.users-list -->
                </div>
                <?php $ids = '';
                  if(count($todaysAllUploads)>0)
                  foreach ($todaysAllUploads as $key => $value) {
                    $ids = $ids.','.$value['id'].',';
                  }
                ?>
                <div class="box-footer text-center">
                  <?php if($ids!=''){ ?>
                  <a style="margin-right: 10px; display: inline-block; color" href="javascript:void(0)" class="mark_all_user btn btn-success">Mark All <i class="fa fa-spinner fa-spin app_all_spin" style="display: none;"></i></a>
                  <a style="margin-right: 10px; display: inline-block; color" href="javascript:void(0)" data-id="<?php echo $ids; ?>" class="approve_all_user btn btn-success">Approve <i class="fa fa-spinner fa-spin app_all_spin" style="display: none;"></i></a>
                  <a style="margin-right: 10px; display: inline-block; color" href="javascript:void(0)" data-id="<?php echo $ids; ?>" class="reject_all_user btn btn-success">Reject <i class="fa fa-spinner fa-spin rej_all_spin" style="display: none;"></i></a>
                  <?php } ?>
                </div>
                <!-- /.box-footer -->
              </div>
              <!--/.box -->
              <div class="box box-danger">
                <div class="box-header with-border">
                  <h3 class="box-title">Latest Videos(In last 8 hours)</h3>

                  <div class="box-tools pull-right">
                    <span class="label label-success"><?php echo count($todaysVideos); ?></span>
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i>
                    </button>
                  </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body no-padding">
                  <ul class="users-list clearfix">
                  <?php if(!empty($todaysVideos)){
                    foreach ($todaysVideos as $videokey=>$videos) {
                    ?>
                    <li>
                      <?php $video_name = explode('.', $videos['filename']);
                      if(count($video_name)>1){
                        if(file_exists(FCPATH.'assets/videos/uploads/thumb/'.$video_name[0].'.jpg')){
                      ?>
                      <div class="avatarMedium video-pics" style="background:url(<?php echo base_url().'assets/videos/uploads/thumb/'.$video_name[0].'.jpg' ?>) no-repeat center center / cover; -webkit-border-radius: 0; border-radius: 0;"  data-id="<?php echo $videokey; ?>"><span><i class="fa fa-play-circle" style="font-size: 20px; margin-top: 22px;"></i></span></div>   
                      
                      <div id="modalVideo-<?php echo $videokey; ?>" class="modal fade" role="dialog">
                        <div class="modal-dialog">
                          <div class="modal-content">
                            <div class="modal-header">
                              <button type="button" class="close" data-dismiss="modal">&times;</button>
                              <h4 class="modal-title">Video</h4>
                            </div>
                            <div class="modal-body">
                              <video playsinline controls controlsList="nodownload" id="video_src" style="width: 100%;">
                                <source src="<?php echo $videos['videolink']; ?>" type="">
                              </video>  
                            </div>
                          </div>
                        </div>
                      </div>       
                      <?php  } 
                      }
                      ?>
                      <?php if(chkWritePermission('All_Pictures',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
                      <div class="row tinypadding-all " style="margin-top: 17px;">
                        <a href="<?php echo  base_url();?>admin/video/accept/<?php echo base64_encode($videos['id']); ?>" class="" onclick="return confirm('Are you sure to accept')">
                          <i class="fa fa-check tooltipstered"></i>
                        </a>
                        <a href="<?php echo  base_url();?>admin/video/reject/<?php echo base64_encode($videos['id']); ?>" class="" onclick="return confirm('Are you sure to reject')">
                          <i class="fa fa-trash tooltipstered"></i>
                        </a>
                      </div>
                      <?php } ?>
                    </li>
                   <?php 
                        }
                      } ?> 
                  </ul>
                  <!-- /.users-list -->
                </div>
                <?php $ids = '';
                  if(count($todaysVideos)>0)
                  foreach ($todaysVideos as $key => $value) {
                    $ids = $ids.','.$value['id'].',';
                  }
                ?>
                <div class="box-footer text-center">
                  <?php if($ids!=''){ ?>
                  <a style="margin-right: 10px; display: inline-block; color" href="javascript:void(0)" data-id="<?php echo $ids; ?>" class="approve_all_video btn btn-success">Approve All</a>
                  <a style="margin-right: 10px; display: inline-block; color" href="javascript:void(0)" data-id="<?php echo $ids; ?>" class="reject_all_video btn btn-success">Reject All</a>
                  <?php } ?>
                </div>
                <!-- /.box-footer -->
              </div>


              <!-- USERS LIST -->
              <div class="box box-danger">
                <div class="box-header with-border">
                  <h3 class="box-title">Latest Free Images</h3>

                  <div class="box-tools pull-right">
                    <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                    </button>
                    <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i>
                    </button>
                  </div>
                </div>
                <!-- /.box-header -->
                <div class="box-body no-padding">
                  <ul class="users-list clearfix">
                  <?php 
                    if(!empty($freeUserImage)){
                     foreach ($freeUserImage as $uploads) {
                    ?>
                    <li>
                    <a href="<?php echo base_url().'admin/users/edit/'.base64_encode($uploads['user_id']); ?>" target="_blank">
                      <?php if(file_exists(FCPATH.'assets/userfiles/'.$uploads['path'].'/'.$uploads['filename'].'.'.$uploads['extension']) && $uploads['filename']!='')
                            {
                      ?>
                      <div class="avatarMedium" style="background:url('<?php echo base_url();?>assets/userfiles/<?php echo $uploads['path'].'/'.$uploads['filename'].'.'.$uploads['extension']; ?>') no-repeat center center / cover;" ></div>
                        
                      <?php  } 
                            elseif(file_exists(FCPATH.'assets/userfiles/'.$uploads['path'].'/'.$uploads['temp_name'].'.'.$uploads['extension']) && $uploads['temp_name']!='')
                            {
                      ?>
                      <div class="avatarMedium" style="background:url('<?php echo base_url();?>assets/userfiles/<?php echo $uploads['path'].'/'.$uploads['temp_name'].'.'.$uploads['extension']; ?>') no-repeat center center / cover;" ></div>
                        
                      <?php  } else { ?>
                        <img class="" src="<?php echo base_url();?>assets/images/default-avatar.jpg" alt="message user image">
                      <?php  } ?>
                      </a>
                      <div class="row tinypadding-all ">
                        <a href="<?php echo  base_url();?>admin/dashboard/free_picture_approve/<?php echo base64_encode($uploads['id']);?>/<?php echo str_replace('/','-',uri_string());  ?>" class="" onclick="return confirm('Are you sure to accept')">
                          <i class="fa fa-check tooltipstered"></i>
                        </a>
                        <a href="<?php echo  base_url();?>admin/dashboard/free_picture_reject/<?php echo base64_encode($uploads['id']);?>/<?php echo str_replace('/','-',uri_string());  ?>" class="" onclick="return confirm('Are you sure to reject')">
                          <i class="fa fa-trash tooltipstered"></i>
                        </a>
                      </div>
                    </li>
                   <?php 
                        }
                      } ?> 
                  </ul>
                  <!-- /.users-list -->
                </div>
                <?php $ids = '';
                  if(count($freeAllUserImage)>0)
                  foreach ($freeAllUserImage as $key => $value) {
                    $ids = $ids.','.$value['id'].',';
                  }
                ?>
                <div class="box-footer text-center">
                  <?php if($ids!=''){ ?>
                  <a style="margin-right: 10px; display: inline-block; color" href="javascript:void(0)" data-id="<?php echo $ids; ?>" class="approve_all btn btn-success">Approve All <i class="fa fa-spinner fa-spin app_free_spin" style="display: none;"></i></a>
                  <a style="margin-right: 10px; display: inline-block; color" href="javascript:void(0)" data-id="<?php echo $ids; ?>" class="reject_all btn btn-success">Reject All <i class="fa fa-spinner fa-spin rej_free_spin" style="display: none;"></i></a><br/>
                  <?php } ?>
                  <a href="<?php echo base_url();?>admin/dashboard/freeuser" class="uppercase">View All Free Images</a>
                </div>
                <!-- /.box-footer -->
              </div>
              <!--/.box -->


        
          <!-- /.box -->

          <!-- PRODUCT LIST -->
          <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">Recently Added Events</h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <ul class="products-list product-list-in-box">
              <?php if(!empty($todaysEvents)){
                     foreach ($todaysEvents as $events) {
                    ?>
                  <li class="item">
                    <div class="product-img">
                      <?php if($events['file_id']!=''){ 
                        $files = getFiles($events['file_id']);
                        if(!empty($files))
                        {
                          if(file_exists(FCPATH.'assets/userfiles/'.$files['path'].'/'.$files['filename'].'.'.$files['extension']))
                          {
                      ?>
                        <img class="" src="<?php echo base_url();?>assets/userfiles/<?php echo $files['path'].'/'.$files['filename'].'.'.$files['extension']; ?>" alt="<?php echo $comments['username']; ?>">
                      <?php  } else { ?>
                        <img class="" src="<?php echo base_url();?>assets/userfiles/img/parties/no_party.jpg" alt="message user image">
                      <?php } } } else { ?>
                        <img class="" src="<?php echo base_url();?>assets/userfiles/img/parties/no_party.jpg" alt="message user image">
                      <?php } ?>
                      <a href="<?php echo base_url();?>admin/event/sendReminderAll/<?php echo base64_encode($events['id']);?>/<?php echo str_replace('/','-',uri_string()); ?>" title="Send Reminder To All Unpaid Booked Order"><span class="fa fa-envelope"></span></a>
                    </div>
                    <div class="product-info">
                      <a href="javascript:void(0)" class="product-title"><?php echo $events['title']; ?></a>
                        <span class="label label-warning pull-right" style="width: 100%;">From: <?php echo date('d-m-Y H:i',$events['time_from']); ?></span>
                        <span class="label label-success pull-left" style="width: 100%; margin-bottom: 5px;">Participants: <?php echo $events['participants']; ?> Paid ( <?php echo $events['unpaid_participants']; ?> Unpaid )</span>
                        <?php if($events['lastyear_event']){ ?>
                        <span class="label label-danger pull-left" style="width: 100%;">Participants: <?php echo $events['lastyear_participants']; ?> Paid ( <?php echo $events['lastyear_unpaid_participants']; ?> Unpaid )</span>
                        <?php } ?>

                        <span class="product-description">
                          <?php echo substr($events['teasertext'],0,50).'...'; ?>
                        </span>
                    </div>
                  </li>
                <?php } 
                } ?>  
              </ul>
            </div>
            <!-- /.box-body -->
            <?php if(chkReadPermission('Manage_Event',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>
            <div class="box-footer text-center">
              <a href="<?php echo base_url().'admin/event'; ?>" class="uppercase">View All Events</a>
            </div>
            <?php } ?>
            <!-- /.box-footer -->
          </div>
          <!-- /.box -->



          <!--<div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title">Latest Party Feedback</h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <div class="box-body">
              <div class="table-responsive">
                <table class="table no-margin latestOrder">
                  <thead>
                  <tr>
                    <th>Posted User</th>
                    <th>Event Title</th>
                    <th>Comment</th>
                  </tr>
                  </thead>
                  <tbody>
                  <?php if(!empty($latestPartyComments)){
                     foreach ($latestPartyComments as $data) {
                      $fileData = getFiles($data['avatar_file_id']);
                      if(!empty($fileData))
                      {
                        if(file_exists(FCPATH.'assets/userfiles/'.$fileData['path'].'/'.$fileData['filename'].'.'.$fileData['extension'])){
                          $imageFile = base_url().'assets/userfiles/'.$fileData['path'].'/'.$fileData['filename'].'.'.$fileData['extension'];
                        } else {
                          $imageFile = base_url().'assets/images/default-avatar.jpg';
                        }
                      }else{
                          $imageFile = base_url().'assets/images/default-avatar.jpg';
                      }
                    ?>
                  <tr>
                    <td><a href="javascript:void(0);"><img class="direct-chat-img" src="<?php echo $imageFile; ?>" title=""></a></td>
                    <td><a href="javascript:void(0);"><?php echo $data['title']; ?></a></td>
                    <td><a href="javascript:void(0);"><?php echo $data['comment']; ?></a></td>
                  </tr>
                 <?php 
                        }
                      } else { echo '<tr>
                    <td colsapn="2">No records found...</td>
                    </tr>'; }?>
                  </tbody>
                </table>
              </div>
            </div>
            <div class="box-footer latest_footer clearfix">
              <a href="<?php echo base_url().'admin/party_comments'; ?>" class="btn btn-sm btn-default btn-flat pull-right">View All Party Feedback</a>
            </div>
          </div> -->


          <div class="box box-info">
            <div class="box-header with-border">
              <h3 class="box-title">Top 50 Customer Overview Of <?php echo date('Y'); ?></h3>

              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <div class="box-body">
              <div class="table-responsive best_customer_responsive">
                <table class="table no-margin latestOrder best_customer">
                  <thead>
                  <tr>
                    <th>Pseudonym</th>
                    <th>Membership</th>
                    <th>Booking</th>
                    <th>Total</th>
                  </tr>
                  </thead>
                  <tbody>
                  <?php if(!empty($resultBest)){
                    
                     foreach ($resultBest as $data) {
                      $total = 0;
                      $total = $data['order_total']+$data['booking_total'];
                      if($data['filename'] && file_exists(FCPATH.'assets/userfiles/'.$data['path'].'/80/'.$data['filename'].'.'.$data['extension'])){
                        $imageFile = base_url().'assets/userfiles/'.$data['path'].'/80/'.$data['filename'].'.'.$data['extension'];
                      } else {
                        $imageFile = base_url().'assets/images/default-avatar.jpg';
                      }
                    ?>
                  <tr>
                    <td class="best_customer_pic"><a target="_blank" href="<?php echo  base_url().'admin/users/edit/'.base64_encode($data['user_id']);?>"><img class="direct-chat-img" src="<?php echo $imageFile; ?>" title=""><?php echo $data['username']; ?></a></td>
                    <td><?php echo number_format(floor($data['order_total']/100), 0,',', '.'); ?> &euro;</td>
                    <td><?php echo number_format(floor($data['booking_total']/100), 0,',', '.'); ?> &euro;</td>
                    <td><?php echo number_format(floor($total/100), 0,',', '.'); ?> &euro;</td>
                  </tr>
                 <?php 
                        }
                      } else { echo '<tr>
                    <td colsapn="2">No records found...</td>
                    </tr>'; }?>
                  </tbody>
                </table>
              </div>
            </div>
            <div class="box-footer latest_footer clearfix text-center">
              <a href="<?php echo base_url();?>admin/best_users" class="uppercase">View All</a>
            </div>
          </div>



        </div>
        <!-- /.col -->
        </div>

        <?php if($this->session->userdata('admin_id')!='11330' ){ ?>  
        <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Upcoming Revenue statistics (Next 30 days)</h3>
              <?php if(count($arr_upcoming_day)>0){ 
                  $StriPeValidTotal = 0;
                  $StriPeInvalidTotal = 0;
                  $SaferpayValidTotal = 0;
                  foreach ($arr_upcoming_day as $values) {
                    $StriPeValidTotal = $StriPeValidTotal + $values['StripeValid'];
                    $StriPeInvalidTotal = $StriPeInvalidTotal + $values['StripeInvalid'];
                    $SaferpayValidTotal = $SaferpayValidTotal + $values['SaferpayValid'];
                  }
                }
              ?>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="barChartUpcomingDays" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> Stripe Valid (<?php echo number_format($StriPeValidTotal, 2,',', '.'); ?> &euro;)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#dd4b39"></i> Stripe Invalid (<?php echo number_format($StriPeInvalidTotal, 2,',', '.'); ?> &euro;)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green" ></i> Saferpay (<?php echo number_format($SaferpayValidTotal, 2,',', '.'); ?> &euro;)</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>


           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Past Revenue statistics (Past 30 days)</h3>
              <?php if(count($arr_past_day)>0){ 
                  $StriPeValidTotal = 0;
                  $SaferpValid = 0;
                  foreach ($arr_past_day as $values) {
                    $StriPeValidTotal = $StriPeValidTotal + $values['StripeValid'];
                    $SaferpValid = $SaferpValid + $values['SaferpValid'];
                  }
                }
              ?>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="barChartPastDays" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o text-green" ></i> Stripe (<?php echo number_format($StriPeValidTotal, 2,',', '.'); ?> &euro;)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#336fce"></i> Saferpay(<?php echo number_format($SaferpValid, 2,',', '.'); ?> &euro;)</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>


           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Different type member statistics (Past 30 days)</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-6">
                  <div class="chart-responsive">
                    <canvas id="diffTypeMembers" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-6">
                  <ul class="chart-legend clearfix">
                    <li><i class="fa fa-circle-o " style="color:#b3975b"></i>Completed Avatar Step(<span style="color:#b3975b"><?php echo round(($completeAvatar*$allMembers)/100); ?></span>   [<?php echo $completeAvatar; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:lime"></i>Registrations Without Avatar Upload(<span style="color:#b3975b"><?php echo round(($beforeAvatar*$allMembers)/100); ?></span>   [<?php echo $beforeAvatar; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:red"></i>Free Lady Having 3 Apporve Pic(<span style="color:#b3975b"><?php echo round(($freeHaving3Pic*$allMembers)/100); ?></span>   [<?php echo $freeHaving3Pic; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:green"></i>Free Lady Having less Than 3 Apporve Pic(<span style="color:#b3975b"><?php echo round(($freeHavingLessPic*$allMembers)/100); ?></span>   [<?php echo $freeHavingLessPic; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:orange"></i>Free Lady With Reality Checked(<span style="color:#b3975b"><?php echo round(($freeReal*$allMembers)/100); ?></span>   [<?php echo $freeReal; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:purple"></i>Email Confirmed(<span style="color:#b3975b"><?php echo round(($emailConfirm*$allMembers)/100); ?></span>   [<?php echo $emailConfirm; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:yellow"></i>Email  Not Confirmed(<span style="color:#b3975b"><?php echo round(($emailNotConfirm*$allMembers)/100); ?></span>   [<?php echo $emailNotConfirm; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:#ffffff"></i>Paid Members(<span style="color:#b3975b"><?php echo round(($paidMembers*$allMembers)/100); ?></span>   [<?php echo $paidMembers; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:blue"></i>Total Registrations(<span style="color:#b3975b"><?php echo $allMembers; ?></span>)</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>




           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Different type member statistics (Past 12 Months)</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-6">
                  <div class="chart-responsive">
                    <canvas id="diffTypeMembersMonths" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-6">
                  <ul class="chart-legend clearfix">
                    <li><i class="fa fa-circle-o " style="color:#b3975b"></i>Completed Avatar Step(<span style="color:#b3975b"><?php echo round(($completeAvatarMonths*$allMembersMonths)/100); ?></span>   [<?php echo $completeAvatarMonths; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:lime"></i>Registrations Without Avatar Upload(<span style="color:#b3975b"><?php echo round(($beforeAvatarMonths*$allMembersMonths)/100); ?></span>   [<?php echo $beforeAvatarMonths; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:red"></i>Free Lady Having 3 Apporve Pic(<span style="color:#b3975b"><?php echo round(($freeHaving3PicMonths*$allMembersMonths)/100); ?></span>   [<?php echo $freeHaving3PicMonths; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:green"></i>Free Lady Having less Than 3 Apporve Pic(<span style="color:#b3975b"><?php echo round(($freeHavingLessPicMonths*$allMembersMonths)/100); ?></span>   [<?php echo $freeHavingLessPicMonths; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:orange"></i>Free Lady With Reality Checked(<span style="color:#b3975b"><?php echo round(($freeRealMonths*$allMembersMonths)/100); ?></span>   [<?php echo $freeRealMonths; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:purple"></i>Email Confirmed(<span style="color:#b3975b"><?php echo round(($emailConfirmMonths*$allMembersMonths)/100); ?></span>   [<?php echo $emailConfirmMonths; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:yellow"></i>Email  Not Confirmed(<span style="color:#b3975b"><?php echo round(($emailNotConfirmMonths*$allMembersMonths)/100); ?></span>   [<?php echo $emailNotConfirmMonths; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:#ffffff"></i>Paid Members(<span style="color:#b3975b"><?php echo round(($paidMembersMonths*$allMembersMonths)/100); ?></span>   [<?php echo $paidMembersMonths; ?> %])</li>
                    <li><i class="fa fa-circle-o " style="color:blue"></i>Total Registrations(<span style="color:#b3975b"><?php echo $allMembersMonths; ?></span>)</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>



           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Current VS 1 Year Old VS 2 Year Old (New Members)</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="currVSyearNew" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> Current</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#00a65a"></i> 1 Year Old</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#ff6433"></i> 2 Year Old</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>


           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Current VS 1 Year Old VS 2 Year Old (Renew Members)</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="currVSyearRenew" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> Current</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#00a65a"></i> 1 Year Old</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#ff6433"></i> 2 Year Old</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>


           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Current VS 1 Year Old VS 2 Year Old (Bookings)</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="currVSyearBook" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> Current</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#00a65a"></i> 1 Year Old</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#ff6433"></i> 2 Year Old</li>
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>

           <!-----------------Week wise booking report-------------------->
           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Week wise booking report</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-12">
                  <div class="chart-responsive">
                    <canvas id="weekwisebooking" height="50"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;" class="week-li"><i class="fa fa-circle-o" style="color:#b3975b"></i> Current</li>
                    <li style="font-size: 12px !important;" class="week-li"><i class="fa fa-circle-o " style="color:#00a65a"></i> 1 Year Old</li>
                    <li style="font-size: 12px !important;" class="week-li"><i class="fa fa-circle-o " style="color:red"></i> 2 Year Old</li>
                  </ul>
                </div>
                <!-- /.col -->
                
              </div>
              <!-- /.row -->
            </div>
           </div>
           <!-----------------Week wise booking report-------------------->


           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Premium Member Registration/Renewal Statistics (Week Wise)</h3>
              
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-12">
                  <div class="chart-responsive">
                    <canvas id="premium_member_week_wise" height="50"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
                <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;" class="week-li"><i class="fa fa-circle-o" style="color:#dd4b39"></i> Previous Year </li>
                    <li style="font-size: 12px !important;" class="week-li"><i class="fa fa-circle-o text-green" ></i> Current Year</li>          
                  </ul>
                </div>
                <!-- /.col -->
              </div>
              <!-- /.row -->
            </div>
           </div>


          <!----------------Top 8 events revenue------------------------>
           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Last 8 Past Events Revenue in Pie Chart</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                <div class="col-md-8">
                  <div class="chart-responsive">
                    <canvas id="last8eventrevenue" height="100"></canvas>
                  </div>
                  <!-- ./chart-responsive -->
                </div>
              <!-- /.row -->
              <!-- /.col -->
                <div class="col-md-4">
                  <ul class="chart-legend clearfix">
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o" style="color:#b3975b"></i> <?php echo $topeventsrevenue[0]['title']; ?> (<?php echo number_format($topeventsrevenue[0]['total_sum']/100, 2,',', '.'); ?>)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:lime"></i> <?php echo $topeventsrevenue[1]['title']; ?> (<?php echo number_format($topeventsrevenue[1]['total_sum']/100, 2,',', '.'); ?>)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:red"></i> <?php echo $topeventsrevenue[2]['title']; ?> (<?php echo number_format($topeventsrevenue[2]['total_sum']/100, 2,',', '.'); ?>)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:green"></i> <?php echo $topeventsrevenue[3]['title']; ?> (<?php echo number_format($topeventsrevenue[3]['total_sum']/100, 2,',', '.'); ?>)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:orange"></i> <?php echo $topeventsrevenue[4]['title']; ?> (<?php echo number_format($topeventsrevenue[4]['total_sum']/100, 2,',', '.'); ?>)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:purple"></i> <?php echo $topeventsrevenue[5]['title']; ?> (<?php echo number_format($topeventsrevenue[5]['total_sum']/100, 2,',', '.'); ?>)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:yellow"></i> <?php echo $topeventsrevenue[6]['title']; ?> (<?php echo number_format($topeventsrevenue[6]['total_sum']/100, 2,',', '.'); ?>)</li>
                    <li style="font-size: 12px !important;"><i class="fa fa-circle-o " style="color:#ffffff"></i> <?php echo $topeventsrevenue[7]['title']; ?> (<?php echo number_format($topeventsrevenue[7]['total_sum']/100, 2,',', '.'); ?>)</li>
                  </ul>
                </div>
                <!-- /.col -->
            </div>
           </div>
         </div>
           <!----------------Top 8 events revenue------------------------>
           <!----------------Top 8 events revenue------------------------>
           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Top 8 Most Revenue Events in Horizontal Bar Chart</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                
              <!-- /.row -->
              <!-- /.col -->
                <div class="col-md-12">
                  <div class="chart"></div>
                </div>
                <!-- /.col -->
            </div>
           </div>
           <!----------------Top 8 events revenue------------------------>


           <!----------------Top 8 events revenue------------------------>
           <div class="box box-default loaderWrapper">
            <div class="box-header with-border">
              <h3 class="box-title">Top 8 Upcoming Events Revenue in Horizontal Bar Chart</h3>
              <div class="box-tools pull-right">
                <button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
                </button>
                <button type="button" class="btn btn-box-tool" data-widget="remove"><i class="fa fa-times"></i></button>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <div class="row">
                
              <!-- /.row -->
              <!-- /.col -->
                <div class="col-md-12">
                  <div class="upchart"></div>
                </div>
                <!-- /.col -->
            </div>
           </div>
           <!----------------Top 8 events revenue------------------------>

           <?php } ?>
          <?php } ?>
        </div>



<div id="myModal" class="modal fade" role="dialog">
  <div class="modal-dialog">
    <!-- Modal content-->
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal">&times;</button>        
      </div>
      <div class="modal-body imgModalSrc">
        
      </div>
    </div>
  </div>
</div>

    </section>
<?php if(chkReadPermission('Dashboard',$this->session->userdata('admin_id'))!=0 || $this->session->userdata('admin_id')=='19624' ){ ?>   
   <?php if($this->session->userdata('admin_id')!='11330' ){ ?> 
    <!-- /.content -->
    
    <script>
  $(function () {
    $('body').on('click','.approve_all_user', function(){  
      if (confirm("Are you sure to approve all")) {
        if($(this).data('id')!='')
        {
          var ids = '';
          $('input[name="images_all[]"]').each(function(){
            if($(this).is(':checked')){
              ids += $(this).val()+',';
            }
          })
          if(ids==''){
            alert('Please choose a image');
          } else {
            $('.app_all_spin').css('display','inline-block');
            $(this).attr('disabled','disabled');
            $.ajax({
              url: "<?php echo base_url().'admin/dashboard/approve_all_user'; ?>",
              data: 'ids='+ids.replace(/(^,)|(,$)/g, ""),
              type: 'POST',
              success: function(res)
              {
                window.location.reload();
              }
            })
          }
        }
      }
    });
    $('body').on('click','.reject_all_user', function(){
      if (confirm("Are you sure to reject all")) {//alert($(this).data('id'));
        if($(this).data('id')!='')
        {
          var ids = '';
          $('input[name="images_all[]"]').each(function(){
            if($(this).is(':checked')){
              ids += $(this).val()+',';
            }
          })
          if(ids==''){
            alert('Please choose a image');
          } else {
            $('.rej_all_spin').css('display','inline-block');
            $(this).attr('disabled','disabled');
            $.ajax({
              url: "<?php echo base_url().'admin/dashboard/reject_all_user'; ?>",
              data: 'ids='+ids.replace(/(^,)|(,$)/g, ""),
              type: 'POST',
              success: function(res)
              {
                window.location.reload();
              }
            })
          }
          
        }
      }
    });
    $('.approve_all').click(function(){
      if (confirm("Are you sure to approve all")) {
        if($(this).data('id')!='')
        {
          $('.app_free_spin').css('display','inline-block');
          $(this).attr('disabled','disabled');
          $.ajax({
            url: "<?php echo base_url().'admin/dashboard/approve_all'; ?>",
            data: 'ids='+$(this).data('id').trim(','),
            type: 'POST',
            success: function(res)
            {
              window.location.reload();
            }
          })
        }
      }
    });
    $('.reject_all').click(function(){
      if (confirm("Are you sure to reject all")) {
        if($(this).data('id')!='')
        {
          $('.rej_free_spin').css('display','inline-block');
          $(this).attr('disabled','disabled');
          $.ajax({
            url: "<?php echo base_url().'admin/dashboard/reject_all'; ?>",
            data: 'ids='+$(this).data('id').trim(','),
            type: 'POST',
            success: function(res)
            {
              window.location.reload();
            }
          })
        }
      }
    });


    //- PIE CHART -
    //-------------
    // Get context with jQuery - using jQuery's .get() method.
    var pieChartCanvas = $('#pieChart').get(0).getContext('2d')
    var pieChart       = new Chart(pieChartCanvas)
    var PieData        = [
      {
        value    : 700,
        color    : '#f56954',
        highlight: '#f56954',
        label    : 'Desktop'
      },
      {
        value    : 500,
        color    : '#00a65a',
        highlight: '#00a65a',
        label    : 'Mobile'
      },
      {
        value    : 400,
        color    : '#b3975b',
        highlight: '#b3975b',
        label    : 'Ipad'
      }
    ]
    var pieOptions     = {
      //Boolean - Whether we should show a stroke on each segment
      segmentShowStroke    : true,
      //String - The colour of each segment stroke
      segmentStrokeColor   : '#fff',
      //Number - The width of each segment stroke
      segmentStrokeWidth   : 2,
      //Number - The percentage of the chart that we cut out of the middle
      percentageInnerCutout: 50, // This is 0 for Pie charts
      //Number - Amount of animation steps
      animationSteps       : 100,
      //String - Animation easing effect
      animationEasing      : 'easeOutBounce',
      //Boolean - Whether we animate the rotation of the Doughnut
      animateRotate        : true,
      //Boolean - Whether we animate scaling the Doughnut from the centre
      animateScale         : false,
      //Boolean - whether to make the chart responsive to window resizing
      responsive           : true,
      // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
      maintainAspectRatio  : true,
      //String - A legend template
      legendTemplate       : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'
    }
    //Create pie or douhnut chart
    // You can switch between pie and douhnut using the method below.
    pieChart.Doughnut(PieData, pieOptions)


    /**************PAID MEMBERS CHART*************/
    var pieChartCanvas = $('#userChart').get(0).getContext('2d')
    var pieChart       = new Chart(pieChartCanvas)
    var PieData        = [
      {
        value    : <?php echo $gentleman; ?>,
        color    : '#f56954',
        highlight: '#f56954',
        label    : 'Gentleman'
      },
      {
        value    : <?php echo $lady; ?>,
        color    : '#00a65a',
        highlight: '#00a65a',
        label    : 'Lady'
      },
      {
        value    : <?php echo $couple; ?>,
        color    : '#b3975b',
        highlight: '#b3975b',
        label    : 'Couple'
      },
      {
        value    : <?php echo count($freeLadyData); ?>,
        color    : 'orange',
        highlight: 'orange',
        label    : 'Free Lady'
      }
    ]
    var pieOptions     = {
      //Boolean - Whether we should show a stroke on each segment
      segmentShowStroke    : true,
      //String - The colour of each segment stroke
      segmentStrokeColor   : '#fff',
      //Number - The width of each segment stroke
      segmentStrokeWidth   : 2,
      //Number - The percentage of the chart that we cut out of the middle
      percentageInnerCutout: 50, // This is 0 for Pie charts
      //Number - Amount of animation steps
      animationSteps       : 100,
      //String - Animation easing effect
      animationEasing      : 'easeOutBounce',
      //Boolean - Whether we animate the rotation of the Doughnut
      animateRotate        : true,
      //Boolean - Whether we animate scaling the Doughnut from the centre
      animateScale         : false,
      //Boolean - whether to make the chart responsive to window resizing
      responsive           : true,
      // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
      maintainAspectRatio  : true,
      //String - A legend template
      legendTemplate       : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'
    }
    //Create pie or douhnut chart
    // You can switch between pie and douhnut using the method below.
    pieChart.Doughnut(PieData, pieOptions)
    /**************PAID MEMBERS CHART*************/





    /**************DIFFERENT TYPE MEMBERS CHART*************/
    var pieChartCanvas = $('#diffTypeMembers').get(0).getContext('2d')
    var pieChart       = new Chart(pieChartCanvas)
    var PieData        = [
      {
        value    : <?php echo $completeAvatar; ?>,
        color    : '#b3975b',
        highlight: '#b3975b',
        label    : 'Completed Avatar Step'
      },
      {
        value    : <?php echo $beforeAvatar; ?>,
        color    : 'lime',
        highlight: 'lime',
        label    : 'Registrations Without Avatar Upload'
      },
      {
        value    : <?php echo $freeHaving3Pic; ?>,
        color    : 'red',
        highlight: 'red',
        label    : 'Free Lady Having 3 Apporve Pic'
      },
      {
        value    : <?php echo $freeHavingLessPic; ?>,
        color    : 'green',
        highlight: 'green',
        label    : 'Free Lady Having less Than 3 Apporve Pic'
      },
      {
        value    : <?php echo $freeReal; ?>,
        color    : 'orange',
        highlight: 'orange',
        label    : 'Free Lady With Reality Checked'
      },
      {
        value    : <?php echo $emailConfirm; ?>,
        color    : 'purple',
        highlight: 'purple',
        label    : 'Email Confirmed'
      },
      {
        value    : <?php echo $emailNotConfirm; ?>,
        color    : 'yellow',
        highlight: 'yellow',
        label    : 'Email  Not Confirmed'
      },
      {
        value    : <?php echo $paidMembers; ?>,
        color    : '#ffffff',
        highlight: '#ffffff',
        label    : 'Paid Members'
      }
    ]
    var pieOptions     = {
      //Boolean - Whether we should show a stroke on each segment
      segmentShowStroke    : true,
      //String - The colour of each segment stroke
      segmentStrokeColor   : '#fff',
      //Number - The width of each segment stroke
      segmentStrokeWidth   : 2,
      //Number - The percentage of the chart that we cut out of the middle
      percentageInnerCutout: 50, // This is 0 for Pie charts
      //Number - Amount of animation steps
      animationSteps       : 100,
      //String - Animation easing effect
      animationEasing      : 'easeOutBounce',
      //Boolean - Whether we animate the rotation of the Doughnut
      animateRotate        : true,
      //Boolean - Whether we animate scaling the Doughnut from the centre
      animateScale         : false,
      //Boolean - whether to make the chart responsive to window resizing
      responsive           : true,
      // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
      maintainAspectRatio  : true,
      //String - A legend template
      legendTemplate       : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'
    }
    //Create pie or douhnut chart
    // You can switch between pie and douhnut using the method below.
    pieChart.Doughnut(PieData, pieOptions)
    /**************DIFFERENT TYPE MEMBERS CHART*************/






    /**************DIFFERENT TYPE MEMBERS CHART*************/
    var pieChartCanvas = $('#diffTypeMembersMonths').get(0).getContext('2d')
    var pieChart       = new Chart(pieChartCanvas)
    var PieData        = [
      {
        value    : <?php echo $completeAvatarMonths; ?>,
        color    : '#b3975b',
        highlight: '#b3975b',
        label    : 'Completed Avatar Step'
      },
      {
        value    : <?php echo $beforeAvatarMonths; ?>,
        color    : 'lime',
        highlight: 'lime',
        label    : 'Registrations Without Avatar Upload'
      },
      {
        value    : <?php echo $freeHaving3PicMonths; ?>,
        color    : 'red',
        highlight: 'red',
        label    : 'Free Lady Having 3 Apporve Pic'
      },
      {
        value    : <?php echo $freeHavingLessPicMonths; ?>,
        color    : 'green',
        highlight: 'green',
        label    : 'Free Lady Having less Than 3 Apporve Pic'
      },
      {
        value    : <?php echo $freeRealMonths; ?>,
        color    : 'orange',
        highlight: 'orange',
        label    : 'Free Lady With Reality Checked'
      },
      {
        value    : <?php echo $emailConfirmMonths; ?>,
        color    : 'purple',
        highlight: 'purple',
        label    : 'Email Confirmed'
      },
      {
        value    : <?php echo $emailNotConfirmMonths; ?>,
        color    : 'yellow',
        highlight: 'yellow',
        label    : 'Email  Not Confirmed'
      },
      {
        value    : <?php echo $paidMembersMonths; ?>,
        color    : '#ffffff',
        highlight: '#ffffff',
        label    : 'Paid Members'
      }
    ]
    var pieOptions     = {
      //Boolean - Whether we should show a stroke on each segment
      segmentShowStroke    : true,
      //String - The colour of each segment stroke
      segmentStrokeColor   : '#fff',
      //Number - The width of each segment stroke
      segmentStrokeWidth   : 2,
      //Number - The percentage of the chart that we cut out of the middle
      percentageInnerCutout: 50, // This is 0 for Pie charts
      //Number - Amount of animation steps
      animationSteps       : 100,
      //String - Animation easing effect
      animationEasing      : 'easeOutBounce',
      //Boolean - Whether we animate the rotation of the Doughnut
      animateRotate        : true,
      //Boolean - Whether we animate scaling the Doughnut from the centre
      animateScale         : false,
      //Boolean - whether to make the chart responsive to window resizing
      responsive           : true,
      // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
      maintainAspectRatio  : true,
      //String - A legend template
      legendTemplate       : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'
    }
    //Create pie or douhnut chart
    // You can switch between pie and douhnut using the method below.
    pieChart.Doughnut(PieData, pieOptions)
    /**************DIFFERENT TYPE MEMBERS CHART*************/



    /****************BAR CHART***************/
    var year = [];
    var MembershipRevenue = [];
    var BookingRevenue = [];
      <?php if(count($revenue)>0){ 
              foreach ($revenue as $value) {
         ?>
              year.push("<?php echo $value['year']; ?>"); 
              MembershipRevenue.push("<?php echo $value['membershipTotal']; ?>");   
              BookingRevenue.push("<?php echo $value['bookTotal']; ?>");        
         <?php }
            }  ?>

        var areaChartData = {
          labels: year,
          datasets: [
            {
              label: "Membership",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: MembershipRevenue
            },
            {
              label: "Booking",
              fillColor: "rgba(60,141,188,0.9)",
              strokeColor: "rgba(60,141,188,0.8)",
              pointColor: "#3b8bba",
              pointStrokeColor: "rgba(60,141,188,1)",
              pointHighlightFill: "#fff",
              pointHighlightStroke: "rgba(60,141,188,1)",
              data: BookingRevenue
            }
          ]
        };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#barChart").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART***************/



    /****************PAST PARTY CHART***************/
    var year = [];
    var firstCondition = [];
    var secondCondition = [];
    var thirdCondition = [];
      <?php if(count($revenueDetails)>0){ 
              foreach ($revenueDetails as $key=>$value) {
         ?>
              year.push("<?php echo $key; ?>"); 
              firstCondition.push("<?php echo $value['firstCondition']; ?>");   
              secondCondition.push("<?php echo $value['secondCondition']; ?>");        
              thirdCondition.push("<?php echo $value['thirdCondition']; ?>");        
         <?php }
            }  ?>

        var areaChartData = {
          labels: year,
          datasets: [
            {
              label: "firstCondition",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: firstCondition
            },
            {
              label: "secondCondition",
              fillColor: "rgba(60,141,188,0.9)",
              strokeColor: "rgba(60,141,188,0.8)",
              pointColor: "#3b8bba",
              pointStrokeColor: "rgba(60,141,188,1)",
              pointHighlightFill: "#fff",
              pointHighlightStroke: "rgba(60,141,188,1)",
              data: secondCondition
            },
            {
              label: "thirdCondition",
              fillColor: "rgba(60,141,188,0.9)",
              strokeColor: "rgba(60,141,188,0.8)",
              pointColor: "#3b8bba",
              pointStrokeColor: "rgba(60,141,188,1)",
              pointHighlightFill: "#fff",
              pointHighlightStroke: "rgba(60,141,188,1)",
              data: thirdCondition
            }
          ]
        };

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#pastPartyStat").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************PAST PARTY CHART***************/


    /***************** User Registration Chart ***********************/
    var year = [];
    var userNumber = [];
    <?php 
    if(count($userList)>0){ 
      foreach ($userList as $userKey=>$userValue) {
    ?>
      year.push("<?php echo $userKey; ?>"); 
      userNumber.push(parseInt("<?php echo $userValue; ?>"));      
    <?php 
      }
    }  
    ?>
        var areaChartData = {
          labels: year,
          datasets: [
            {
              label: "userNumber",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: userNumber
            }
          ]
        };

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#registerUserStat").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[0].fillColor = "#00a65a";
        barChartData.datasets[0].strokeColor = "#00a65a";
        barChartData.datasets[0].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /***************** User Registration Chart ***********************/

    $('.monthSelect').change(function(){
      $('.ajax-loader').css('display','block');
      $('#selectForm').submit();
    })

    /****************BAR CHART FOR UPCOMING***************/
    var month = [];
    var StripeValidRevenue = [];
    var StripeInvalidRevenue = [];
    var SaferpayValidRevenue = [];
    var SaferpayInvalidRevenue = [];
      <?php if(count($upcomingRevenue)>0){ 
              foreach ($upcomingRevenue as $value) {
         ?>
              month.push("<?php echo $value['month']; ?>"); 
              StripeValidRevenue.push("<?php echo $value['StripeValid']; ?>");   
              StripeInvalidRevenue.push("<?php echo $value['StripeInvalid']; ?>");        
              SaferpayValidRevenue.push("<?php echo $value['SaferpayValid']; ?>");        
              SaferpayInvalidRevenue.push("<?php echo $value['Saferpayinvalid']; ?>");        
         <?php }
            }  ?>

        var areaChartData = {
          labels: month,
          datasets: [
            {
              label: "Stripe Invalid Card",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: StripeInvalidRevenue
            },
            {
              label: "Saferpay Valid",
              fillColor: "rgba(60,141,188,0.9)",
              strokeColor: "rgba(60,141,188,0.8)",
              pointColor: "#3b8bba",
              pointStrokeColor: "rgba(60,141,188,1)",
              pointHighlightFill: "#fff",
              pointHighlightStroke: "rgba(60,141,188,1)",
              data: SaferpayValidRevenue
            },
            {
              label: "Saferpay Invalid",
              fillColor: "#909",
              strokeColor: "#909",
              pointColor: "#909",
              pointStrokeColor: "#909",
              pointHighlightFill: "#909",
              pointHighlightStroke: "#909",
              data: SaferpayInvalidRevenue
            },
            {
              label: "Stripe Valid Card",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: StripeValidRevenue
            }
          ]
        };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#barChartUpcoming").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR UPCOMING***************/
	
	





    /****************BAR CHART FOR UPCOMING DAYS***************/
    var date = [];
    var StripeValidRevenue = [];
    var StripeInvalidRevenue = [];
    var SaferpayValidRevenue = [];
      <?php if(count($arr_upcoming_day)>0){ 
              foreach ($arr_upcoming_day as $value) {
         ?>
              date.push("<?php echo $value['date']; ?>"); 
              StripeValidRevenue.push("<?php echo $value['StripeValid']; ?>");   
              StripeInvalidRevenue.push("<?php echo $value['StripeInvalid']; ?>");        
              SaferpayValidRevenue.push("<?php echo $value['SaferpayValid']; ?>");        
         <?php }
            }  ?>

        var areaChartData = {
          labels: date,
          datasets: [
            {
              label: "Stripe Invalid Card",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: StripeInvalidRevenue
            },
            {
              label: "Saferpay",
              fillColor: "rgba(60,141,188,0.9)",
              strokeColor: "rgba(60,141,188,0.8)",
              pointColor: "#3b8bba",
              pointStrokeColor: "rgba(60,141,188,1)",
              pointHighlightFill: "#fff",
              pointHighlightStroke: "rgba(60,141,188,1)",
              data: SaferpayValidRevenue
            },
            {
              label: "Stripe Valid Card",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: StripeValidRevenue
            }
          ]
        };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#barChartUpcomingDays").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR UPCOMING DAYS***************/




    /****************BAR CHART FOR PAST DAYS***************/
    var date = [];
    var StripeValidRevenue = [];
    var SaferpayValidRevenue = [];
      <?php if(count($arr_past_day)>0){ 
              foreach ($arr_past_day as $value) {
         ?>
              date.push("<?php echo $value['date']; ?>"); 
              StripeValidRevenue.push("<?php echo $value['StripeValid']; ?>");       
              SaferpayValidRevenue.push("<?php echo $value['SaferpValid']; ?>");        
         <?php }
            }  ?>

        var areaChartData = {
          labels: date,
          datasets: [
            {
              label: "Saferpay",
              fillColor: "#3b8bba",
              strokeColor: "#3b8bba",
              pointColor: "#3b8bba",
              pointStrokeColor: "#3b8bba",
              pointHighlightFill: "#3b8bba",
              pointHighlightStroke: "#3b8bba",
              data: SaferpayValidRevenue
            },
            {
              label: "Stripe",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: StripeValidRevenue
            }
          ]
        };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#barChartPastDays").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR PAST DAYS***************/





    /****************BAR CHART FOR PAST***************/
    var month = [];
    var declinedRevenue = [];
    var renewRevenue = [];
    var newRevenue = [];

      <?php if(count($arr_upcoming_new)>0){ 
            $i=0;
              foreach ($arr_upcoming_new as $value) {
                if($i>0)
                {
                  
         ?>
              month.push("<?php echo $value['month']; ?>"); 
              declinedRevenue.push("<?php echo $value['declined']; ?>");   
              renewRevenue.push("<?php echo $value['renew']; ?>");        
              newRevenue.push("<?php echo $value['new']; ?>");        
         <?php } $i++; }
            }  ?>

        var areaChartData = {
          labels: month,
          datasets: [
            {
              label: "Declined",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: declinedRevenue
            },
            {
              label: "Renew",
              fillColor: "rgba(60,141,188,0.9)",
              strokeColor: "rgba(60,141,188,0.8)",
              pointColor: "#3b8bba",
              pointStrokeColor: "rgba(60,141,188,1)",
              pointHighlightFill: "#fff",
              pointHighlightStroke: "rgba(60,141,188,1)",
              data: renewRevenue
            },
            {
              label: "New",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: newRevenue
            }
          ]
        };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#barChartPast").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR PAST***************/



    /****************BAR CHART FOR CURRENT VS 1 YEAR OLD NEW MEMBERS***************/
    var month = [];
    var current = [];
    var old = [];
    var two_year_old = [];
      <?php if(count($currVSyearNew)>0){ 
            foreach ($currVSyearNew as $key=>$value) {?>
              month.push("<?php echo $currVSyear[$key]['month']; ?>");
              current.push("<?php echo $value['current_members']; ?>");   
              old.push("<?php echo $value['old_members']; ?>"); 
              two_year_old.push("<?php echo $value['tow_year_old_members']; ?>"); 
         <?php } }  ?>

        var areaChartData = {
          labels: month,
          datasets: [
            {
              label: "Current",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: current
            },
            {
              label: "Old",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: old
            },
            {
              label: "2 Year Old",
              fillColor: "#ff6433",
              strokeColor: "#ff6433",
              pointColor: "#ff6433",
              pointStrokeColor: "#ff6433",
              pointHighlightFill: "#ff6433",
              pointHighlightStroke: "#ff6433",
              data: two_year_old
            }
          ]
        };
        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#currVSyearNew").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR CURRENT VS 1 YEAR OLD NEW MEMBERS***************/


    /****************BAR CHART FOR CURRENT VS 1 YEAR OLD NEW MEMBERS***************/
    var month = [];
    var current = [];
    var old = [];
    var two_year_old = [];
      <?php if(count($currVSyearRenew)>0){ 
            foreach ($currVSyearRenew as $key=>$value) {?>
              month.push("<?php echo $currVSyear[$key]['month']; ?>"); 
              current.push("<?php echo $value['current_members']; ?>");   
              old.push("<?php echo $value['old_members']; ?>"); 
              two_year_old.push("<?php echo $value['tow_year_old_members']; ?>"); 
         <?php } }  ?>

        var areaChartData = {
          labels: month,
          datasets: [
            {
              label: "Current",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: current
            },
            {
              label: "Old",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: old
            },
            {
              label: "2 Year Old",
              fillColor: "#ff6433",
              strokeColor: "#ff6433",
              pointColor: "#ff6433",
              pointStrokeColor: "#ff6433",
              pointHighlightFill: "#ff6433",
              pointHighlightStroke: "#ff6433",
              data: two_year_old
            }
          ]
        };
        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#currVSyearRenew").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR CURRENT VS 1 YEAR OLD NEW MEMBERS***************/


    /****************BAR CHART FOR CURRENT VS 1 YEAR OLD NEW MEMBERS***************/
    var month = [];
    var current = [];
    var old = [];
    var two_year_old = [];
      <?php if(count($currVSyearBook)>0){ 
            foreach ($currVSyearBook as $key=>$value) {?>
              month.push("<?php echo $currVSyear[$key]['month']; ?>");
              current.push("<?php echo $value['current_members']; ?>");   
              old.push("<?php echo $value['old_members']; ?>"); 
              two_year_old.push("<?php echo $value['tow_year_old_members']; ?>"); 
         <?php } }  ?>

        var areaChartData = {
          labels: month,
          datasets: [
            {
              label: "Current",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: current
            },
            {
              label: "Old",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: old
            },
            {
              label: "2 Year Old",
              fillColor: "#ff6433",
              strokeColor: "#ff6433",
              pointColor: "#ff6433",
              pointStrokeColor: "#ff6433",
              pointHighlightFill: "#ff6433",
              pointHighlightStroke: "#ff6433",
              data: two_year_old
            }
          ]
        };
        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#currVSyearBook").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR CURRENT VS 1 YEAR OLD NEW MEMBERS***************/
	
	
		/****************BAR CHART FOR UPCOMING (saferPay)***************/
    var monthsafer = [];
     var SaferpayRevenue = [];
      <?php
	  if(count($arr_upcoming_safer)>0){ 
              foreach ($arr_upcoming_safer as $key=>$value) {
         ?>
              monthsafer.push("<?php echo $value['safermonth']; ?>"); 
              SaferpayRevenue.push("<?php echo $value['totals3']; ?>");        
         <?php }
            }  ?>
        var areaChartData = {
          labels: monthsafer,
          datasets: [
            
            {
              label: "Stripe Valid Card",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: SaferpayRevenue
            }
          ]
        };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#barChartUpcomingsaferpay").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[0].fillColor = "#00a65a";
		barChartData.datasets[0].strokeColor = "#00a65a";
        barChartData.datasets[0].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR UPCOMING (saferPay)***************/


/****************BAR CHART FOR UPCOMING (saferPay)***************/
    var monthsafer = [];
     var SaferpayRevenue = [];
     var SaferpayRevenueget = [];
      <?php
	  if(count($arr_upcoming_safer_by_month)>0){ 
              foreach ($arr_upcoming_safer_by_month as $key=>$value) {
         ?>
              monthsafer.push("<?php echo $value['safermonths']; ?>"); 
              SaferpayRevenue.push("<?php echo $value['safer_by_month_ammount']; ?>");        
              SaferpayRevenueget.push("<?php echo $value['safer_by_month_ammount_get']; ?>");        
         <?php }
            }  ?>
        var areaChartData = {
          labels: monthsafer,
          datasets: [
            
            {
              label: "renewal via SaferPay",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: SaferpayRevenue
            },
            {
              label: "renewal via Stripe ",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: SaferpayRevenueget
            }
          ]
        };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#barChartconvertingsaferpay").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[0].fillColor = "#00a65a";
		barChartData.datasets[0].strokeColor = "#00a65a";
        barChartData.datasets[0].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR UPCOMING (saferPay)***************/







    /****************BAR CHART FOR UPCOMING (saferPay)***************/
    var monthPrem = [];
    var monthPremThisYear = [];
    var monthPremCurrYear = [];
    <?php
      if(count($pre_month_qry)>0){ 
        foreach ($pre_month_qry as $key=>$value) {
    ?>
          monthPrem.push("<?php echo $value['month']; ?>"); 
          monthPremThisYear.push("<?php echo $value['data_this_year']; ?>");        
          monthPremCurrYear.push("<?php echo $value['data_prev_year']; ?>");        
    <?php }
      }  ?>
      var areaChartData = {
          labels: monthPrem,
          datasets: [
            
            {
              label: "Current Year",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: monthPremThisYear
            },
            {
              label: "Previous Year",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: monthPremCurrYear
            }
          ]
      };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#premium_member_month_wise").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[0].fillColor = "#00a65a";
        barChartData.datasets[0].strokeColor = "#00a65a";
        barChartData.datasets[0].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR UPCOMING (saferPay)***************/






    /****************BAR CHART FOR ***************/
    var weekPrem = [];
    var weekPremThisYear = [];
    var weekPremCurrYear = [];
    <?php
      if(count($pre_week_qry)>0){ 
        foreach ($pre_week_qry as $key=>$value) {
    ?>
          weekPrem.push("<?php echo $value['week']; ?>"); 
          weekPremThisYear.push("<?php echo $value['data_this_year']; ?>");        
          weekPremCurrYear.push("<?php echo $value['data_prev_year']; ?>");        
    <?php }
      }  ?>
      var areaChartData = {
          labels: weekPrem,
          datasets: [
            
            {
              label: "Current Year",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: weekPremThisYear
            },
            {
              label: "Previous Year",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: weekPremCurrYear
            }
          ]
      };

       
        

        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#premium_member_week_wise").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[0].fillColor = "#00a65a";
        barChartData.datasets[0].strokeColor = "#00a65a";
        barChartData.datasets[0].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************BAR CHART FOR ***************/








    /****************WEEK WISE BOOKING REPORT***************/
    var week = [];
    var current = [];
    var one_year_old = [];
    var two_year_old = [];
      <?php if(count($weekwisebook)>0){ 
            foreach ($weekwisebook as $val) {?>
              week.push("<?php echo $val['week']; ?>");
              current.push("<?php echo $val['curr']; ?>");   
              one_year_old.push("<?php echo $val['prev']; ?>"); 
              two_year_old.push("<?php echo $val['prev_prev']; ?>"); 
         <?php } }  ?>

        var areaChartData = {
          labels: week,
          datasets: [
            {
              label: "Current",
              fillColor: "#b3975b",
              strokeColor: "#b3975b",
              pointColor: "#b3975b",
              pointStrokeColor: "#b3975b",
              pointHighlightFill: "#b3975b",
              pointHighlightStroke: "#b3975b",
              data: current
            },
            {
              label: "1 Year Old",
              fillColor: "#dd4b39",
              strokeColor: "#dd4b39",
              pointColor: "#dd4b39",
              pointStrokeColor: "#dd4b39",
              pointHighlightFill: "#dd4b39",
              pointHighlightStroke: "#dd4b39",
              data: one_year_old
            },
            {
              label: "2 Year Old",
              fillColor: "#f00",
              strokeColor: "#f00",
              pointColor: "#f00",
              pointStrokeColor: "#f00",
              pointHighlightFill: "#f00",
              pointHighlightStroke: "#f00",
              data: two_year_old
            }
          ]
        };
        //-------------
        //- BAR CHART -
        //-------------
        var barChartCanvas = $("#weekwisebooking").get(0).getContext("2d");
        var barChart = new Chart(barChartCanvas);
        var barChartData = areaChartData;
        barChartData.datasets[1].fillColor = "#00a65a";
        barChartData.datasets[1].strokeColor = "#00a65a";
        barChartData.datasets[1].pointColor = "#00a65a";
        var barChartOptions = {
          //Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
          scaleBeginAtZero: true,
          //Boolean - Whether grid lines are shown across the chart
          scaleShowGridLines: true,
          //String - Colour of the grid lines
          scaleGridLineColor: "rgba(0,0,0,.05)",
          //Number - Width of the grid lines
          scaleGridLineWidth: 1,
          //Boolean - Whether to show horizontal lines (except X axis)
          scaleShowHorizontalLines: true,
          //Boolean - Whether to show vertical lines (except Y axis)
          scaleShowVerticalLines: true,
          //Boolean - If there is a stroke on each bar
          barShowStroke: true,
          //Number - Pixel width of the bar stroke
          barStrokeWidth: 2,
          //Number - Spacing between each of the X value sets
          barValueSpacing: 5,
          //Number - Spacing between data sets within X values
          barDatasetSpacing: 1,
          //String - A legend template
          //legendTemplate: "<ul class=\"<%=name.toLowerCase()%>-legend\"><% for (var i=0; i<datasets.length; i++){%><li><span style=\"background-color:<%=datasets[i].fillColor%>\"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>",
          //Boolean - whether to make the chart responsive
          responsive: true,
          maintainAspectRatio: true
        };

        barChartOptions.datasetFill = false;
        barChart.Bar(barChartData, barChartOptions);
    /****************WEEK WISE BOOKING REPORT***************/

    /****************TOP 8 EVENTS EVENUE***************/
    var pieChartCanvas = $('#last8eventrevenue').get(0).getContext('2d')
    var pieChart       = new Chart(pieChartCanvas)
    var PieData        = [
      {
        value    : <?php echo ($topeventsrevenue[0]['total_sum']/100); ?>,
        color    : '#b3975b',
        highlight: '#b3975b',
        label    : "<?php echo $topeventsrevenue[0]['title']; ?>",
      },
      {
        value    : <?php echo ($topeventsrevenue[1]['total_sum']/100); ?>,
        color    : 'lime',
        highlight: 'lime',
        label    : "<?php echo $topeventsrevenue[1]['title']; ?>",
      },
      {
        value    : <?php echo ($topeventsrevenue[2]['total_sum']/100); ?>,
        color    : 'red',
        highlight: 'red',
        label    : "<?php echo $topeventsrevenue[2]['title']; ?>",
      },
      {
        value    : <?php echo ($topeventsrevenue[3]['total_sum']/100); ?>,
        color    : 'green',
        highlight: 'green',
        label    : "<?php echo $topeventsrevenue[3]['title']; ?>",
      },
      {
        value    : <?php echo ($topeventsrevenue[4]['total_sum']/100); ?>,
        color    : 'orange',
        highlight: 'orange',
        label    : "<?php echo $topeventsrevenue[4]['title']; ?>",
      },
      {
        value    : <?php echo ($topeventsrevenue[5]['total_sum']/100); ?>,
        color    : 'purple',
        highlight: 'purple',
        label    : "<?php echo $topeventsrevenue[5]['title']; ?>",
      },
      {
        value    : <?php echo ($topeventsrevenue[6]['total_sum']/100); ?>,
        color    : 'yellow',
        highlight: 'yellow',
        label    : "<?php echo $topeventsrevenue[6]['title']; ?>",
      },
      {
        value    : <?php echo ($topeventsrevenue[7]['total_sum']/100); ?>,
        color    : '#ffffff',
        highlight: '#ffffff',
        label    : "<?php echo $topeventsrevenue[7]['title']; ?>",
      }
    ]
    var pieOptions     = {
      //Boolean - Whether we should show a stroke on each segment
      segmentShowStroke    : true,
      //String - The colour of each segment stroke
      segmentStrokeColor   : '#fff',
      //Number - The width of each segment stroke
      segmentStrokeWidth   : 2,
      //Number - The percentage of the chart that we cut out of the middle
      percentageInnerCutout: 50, // This is 0 for Pie charts
      //Number - Amount of animation steps
      animationSteps       : 100,
      //String - Animation easing effect
      animationEasing      : 'easeOutBounce',
      //Boolean - Whether we animate the rotation of the Doughnut
      animateRotate        : true,
      //Boolean - Whether we animate scaling the Doughnut from the centre
      animateScale         : false,
      //Boolean - whether to make the chart responsive to window resizing
      responsive           : true,
      // Boolean - whether to maintain the starting aspect ratio or not when responsive, if set to false, will take up entire container
      maintainAspectRatio  : true,
      //String - A legend template
      legendTemplate       : '<ul class="<%=name.toLowerCase()%>-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'
    }
    //Create pie or douhnut chart
    // You can switch between pie and douhnut using the method below.
    pieChart.Doughnut(PieData, pieOptions)
    /****************TOP 8 EVENTS EVENUE***************/
  })
</script>

<link rel="stylesheet" type="text/css" href="<?php echo base_url('assets/css/rumcaJS.css');?>">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js" integrity="sha256-ihAoc6M/JPfrIiIeayPE9xjin4UWjsx2mjW/rtmxLM4=" crossorigin="anonymous"></script>
<script src="<?php echo base_url('assets/js/rumcaJS.js');?>"></script>

<script>
      $(document).ready(function(){
        var title = [];
        var total = [];
        <?php if(count($topeventsrevenue)>0){ 
            foreach ($topeventsrevenue as $val) {?>
              title.push("<?php echo $val['title']; ?>"); 
              total.push(<?php echo number_format((float)((($val['total_sum']/200)/100000)*100), 2, '.', ''); ?>); 
         <?php } }  ?>
        var data = [{
            "name": "Miasta",
            "axisY": title,
            "axisX": ["20000", "40000", "60000", "80000", "100000", "120000", "140000", "160000", "180000", "200000"],
            "bars": total
        }];
        // My options
        var options = {
            data: data[0],
            showValues: true,
            showVerticalLines: true,
            showHorizontalLines: true,
            animation: true,
            animationOffset: 200,
        };

        // Defaul chart
        var $myChart = $('.chart');
        $myChart.horizontalChart(options);    








        var uptitle = [];
        var uptotal = [];
        <?php if(count($topupeventsrevenue)>0){ 
            foreach ($topupeventsrevenue as $val) {?>
              uptitle.push("<?php echo $val['title']; ?>"); 
              uptotal.push(<?php echo number_format((float)((($val['total_sum']/200)/100000)*100), 2, '.', ''); ?>); 
         <?php } }  ?>
        var updata = [{
            "name": "Miasta",
            "axisY": uptitle,
            "axisX": ["20000", "40000", "60000", "80000", "100000", "120000", "140000", "160000", "180000", "200000"],
            "bars": uptotal
        }];
        // My options
        var options1 = {
            data: updata[0],
            showValues: true,
            showVerticalLines: true,
            showHorizontalLines: true,
            animation: true,
            animationOffset: 200,
        };

        // Defaul chart
        var $upmyChart = $('.upchart');
        $upmyChart.horizontalChart(options1);   
    /**************************************************************************/


    $('.images_all').click(function(){
      var ids = '';
      $('input[name="images_all[]"]').each(function(){
        if($(this).is(':checked')){
          ids += $(this).val()+',';
        }
      })
      //alert(ids);
      $('.approve_all_user').attr('data-id',ids.replace(/(^,)|(,$)/g, ""));
      $('.reject_all_user').attr('data-id',ids.replace(/(^,)|(,$)/g, ""));
    })

    var src = $('.image-modal').data('id');
    $('.imgModalSrc').html('<img src="'+src+'">');
    $('.mark_all_user').click(function(){
      $('input[name="images_all[]"]').each(function(){
        $(this).prop('checked', 'checked');
      })
    })

    $('body').on('click','.video-pics', function(){
      $('#modalVideo-'+$(this).data('id')).modal('show');
    })

    $('.approve_all_video').click(function(){
      if (confirm("Are you sure to approve all")) {
        if($(this).data('id')!='')
        {
          $.ajax({
            url: "<?php echo base_url().'admin/video/approve_all_user'; ?>",
            data: 'ids='+$(this).data('id').trim(','),
            type: 'POST',
            success: function(res)
            {
              window.location.reload();
            }
          })
        }
      }
    });
    $('.reject_all_video').click(function(){
      if (confirm("Are you sure to reject all")) {
        if($(this).data('id')!='')
        {
          $.ajax({
            url: "<?php echo base_url().'admin/video/reject_all_user'; ?>",
            data: 'ids='+$(this).data('id').trim(','),
            type: 'POST',
            success: function(res)
            {
              window.location.reload();
            }
          })
        }
      }
    });

    $('.close').click(function(){
      $('video').trigger('pause');
      $('#video_src').trigger('pause'); 
    })
});
    </script>
<?php } } ?>
<style type="text/css">
.loaderWrapper {
    position: relative;
}
  .ajax-loader {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    text-align: center;
    background: rgba(255,255,255,0.2);
    z-index: 0;
}
.ajax-loader img {
    display: inline-block;
    position: absolute;
    -webkit-transform: translateY(-50%);
    -moz-transform: translateY(-50%);
    transform: translateY(-50%);
    top: 50%;
    z-index: 6;
}
.week-li{float: left; padding-left: 10px;}

.best_customer_responsive{
    height: 450px;
    overflow: hidden;
    overflow-y: auto;
    scrollbar-width: thin;
}
.latestOrder.best_customer tbody td{
  font-size: 12px;
}
.latestOrder.best_customer tbody td a{
  display: inline-block;
  width: 50px;
  text-align: center;
}
.latestOrder.best_customer .best_customer_pic .direct-chat-img{ float: none; }
.best_customer_responsive::-webkit-scrollbar {
    width: 2px;
}

.best_customer_responsive::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    border-radius: 10px;
}

.best_customer_responsive::-webkit-scrollbar-thumb {
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px #b3975b !important; 
}
.messageBoxNew::-webkit-scrollbar {
    width: 2px;
}

.messageBoxNew::-webkit-scrollbar-track {
    -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3); 
    border-radius: 10px;
}

.messageBoxNew::-webkit-scrollbar-thumb {
    border-radius: 10px;
    -webkit-box-shadow: inset 0 0 6px #b3975b !important; 
}

</style>