<section class="content">
<div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header">
              <h3 class="box-title">Daftar Kegiatan IEL Education</h3>

              <div class="box-tools">
                <div class="input-group input-group-sm" style="width: 150px;">
                  <input type="text" name="table_search" class="form-control pull-right" placeholder="Search">

                  <div class="input-group-btn">
                    <button type="submit" class="btn btn-default"><i class="fa fa-search"></i></button>
                  </div>
                </div>
              </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body table-responsive no-padding">
              <table class="table table-hover">
                <tr>
                  <th>No</th>
                  <th width="250">Nama Kegiatan</th>
                  <th width="220">Tanggal</th>
                  <th>Keterangan</th>
                  <th>Daftar</th>
                </tr>
                
                <?php $no=$num+1; foreach($acara as $s){?>
				<tr>
					
					<td class="center"><?php echo $no;?></td>
					<td ><b><?php echo $s->nama_acara;?></b></td>
					<td><center>
					
					<?php
					 $tanggal = $s->tgl_acara;
					 $hari   = date("l",strtotime($tanggal));
					 //echo $hari;
					 $hari_indonesia = array('Monday'  => 'Senin',
						'Tuesday'  => 'Selasa',
						'Wednesday' => 'Rabu',
						'Thursday' => 'Kamis',
						'Friday' => 'Jumat',
						'Saturday' => 'Sabtu',
						'Sunday' => 'Minggu');
					 echo $hari_indonesia[$hari];
					?>
					
					
					
					
					<?php echo tgl_indo($s->tgl_acara);?><br>
					<b><?php echo $s->waktu_awal;?> WIB  s.d  <?php echo $s->waktu_akhir;?> WIB </b>
					</center></td>
					<td><?php echo $s->keterangan;?></td>
					<td>
					<?php 
					date_default_timezone_set('Asia/Jakarta');
					$today = date( 'Y-m-d H:i:s');
					$tgl=$s->tgl_acara;
					$jam=$s->waktu_akhir;
					$spasi=' ';
					$cek=$tgl.$spasi.$jam;
					if ($cek > $today){?>
					
					 <a class="btn btn-app" href="<?php echo base_url();?>acara/daftar/<?php echo $s->id_acara;?>">
						<span class="badge bg-green"><b><?php 
							$id_acara=$s->id_acara;
							$tot= $this->m_acara->tot($id_acara);
							echo $tot;
							?></b>
						</span>
						<i class="fa fa-users text-green"></i>Peserta
					  </a>
					<?php }else{?>
						<?php echo'<a class="btn btn-app" href="'.base_url().'acara" onclick="return confirm(\'Kegiatan telah selesai dilaksanakan, anda tidak bisa mengisi daftar hadir !!\')">';?>
						<span class="badge bg-red"><b><?php 
							$id_acara=$s->id_acara;
							$tot= $this->m_acara->tot($id_acara);
							echo $tot;
							?></b>
						</span>
						<i class="fa fa-users text-red"></i>Peserta
					  </a>
					
					
					
					
					<?php }?>
					
					
					</td>
				</tr>
				<?php $no++;}?>
              </table>
			  <?php echo $this->pagination->create_links();?>
            </div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
      </div>
</div>