<?php 
$level_sesion=$this->session->userdata('level');
$foto=$this->session->userdata('foto');
$nama_pns=$this->session->userdata('nama_pns');
$id_unit=$this->session->userdata('unit_kerja');
$id=$this->session->userdata('id');
$nip=$this->session->userdata('nip');
?>

<div class="col-sm-12">
										
<div class="row">
									<div class="col-sm-12">
									
									<div>
										<th class="left" colspan="9">
										<form class="form-search" action="<?php echo site_url();?>c_acara/cari" method=POST>
										<span class="input-icon">
										<input name="cari" type="text" placeholder="Cari......." class="nav-search-input" id="nav-search-input" autocomplete="on" />
											<i class="ace-icon fa fa-search nav-search-icon"></i>
											</span>
											<div class="widget-toolbar">
											<a href="<?php echo base_url();?>format/format_uploud_sertifikat.xlsx"><button class="btn btn-xs btn-success" type="button">Download Format Exel</button></a>
											
											<a href="<?php echo base_url();?>c_acara/tbh"  data-toggle="modal"><button class="btn btn-xs btn-primary" type="button">
												<i class="ace-icon glyphicon glyphicon-plus bigger-110"></i>
												Tambah
											</button></a>
											<?php if($level_sesion==2){?>
											<?php } ?>
											<a href="javascript:history.back()" class="btn btn-xs btn-warning" type="reset" data-action="collapse">
												<i class="ace-icon fa fa-undo bigger-110"></i>
												Kembali
											</button></a>
											</div>
											</div>
										</form>	
										<hr>
										<?php echo '<div class="pesan">'.$this->session->flashdata('message').'</div>';?>
										<div class="widget-box transparent">
											<div class="widget-body">
												<div class="widget-main no-padding">
												<div class="box-body table-responsive no-padding">
													<table class="table table-bordered table-striped">
														<thead class="thin-border-bottom">
															<tr>
																<th colspan="6">
																<h3 class="widget-title blue smaller">DAFTAR LoA</a></h3>
																</th>
															</tr>
															<tr>
																<th class="center">No</th>
																<th class="center">Judul Acara</th>
																<th class="center">Penerima LoA</th>
																<th class="center" colspan="4">Tindakan</th>
															</tr>
														</thead>
														<tbody>
												<?php $no=$num+1; foreach($acara as $s){?>
												<tr>
													
													<td class="center"><?php echo $no;?></td>
													<td><a href="#" ><?php echo $s->nama_acara;?></a>
													<?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>
													<table><tr>
													<th>Dengan Link kegiatan : <b> <?php echo $s->link_acara;?> </b></th>
													</tr>
													</table>
													<hr>
													Keterangan : <?php echo $s->keterangan;?>
													<hr>
													<?php if($level_sesion==2){?>						
													<a href="#materi_<?php echo $s->id_acara;?>"  data-toggle="modal">
													<button type="submit" class="btn btn-sm btn-primary" style="border-radius: 50px; background-color: #171ad4; color: #ffffff; border: none;"><i class="ace-icon glyphicon glyphicon-plus"></i> Upload Materi</button></a>
													<?php } ?><br><br>
													<table class="table table-bordered table-striped" border="1">
													<tr style="background-color: #7599fa;">
													<td>No</td><td>Materi</td><td>Narasumber</td><td>Jpl</td><td>File</td><td>Tindakan</td>
													</tr>
													<?php $result =$this->db->query("SELECT * FROM tbl_program_acara
													where id_acara=$s->id_acara");
													$nom=1;
													foreach ($result->result_array() as $x){?>
													<tr style="background-color: #edf0f7;">
													<td><?php echo $nom;?></td><td><?php echo $x['materi'];?></td><td><?php echo $x['narasumber'];?></td><td><?php echo $x['jpl'];?></td><td><?php if ($x['link_file']!=NULL){?><a href="<?php echo base_url();?>materi/<?php echo $x['link_file'];?>">Download Materi</a><?php }?></td>
													<td class="center"><?php echo'<a class="blue" href="'.base_url().'c_acara/hapus_materi/'.$x['id_program'].'/'.$x['id_acara'].'" title="Hapus" onclick="return confirm(\'Anda yakin ' .$x['materi'].' akan Dihapus ?\')"><i class="ace-icon fa fa-trash-o bigger-130"></i>';?></td>
													</tr>
													<?php  $nom++;} ?>
													</table>
													<div class="modal small fade" id="materi_<?php echo $s->id_acara;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
													<div class="modal-dialog modal-lg">
													<div class="modal-content">
													<div class="modal-header">
													<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
													<h5 id="myModalLabel"><center>Uploud Materi Kegiatan <?php echo $s->nama_acara;?></center></h5>
													</div>
													<?php echo form_open_multipart('c_acara/upload_materi'); ?>
													<div class="modal-body">
													
													<div class="col-xs-12">
															<!-- PAGE CONTENT BEGINS -->
															<div class="row">
																<div class="col-xs-12">
																	<br><br>
																	<table id="simple-table" class="table table-striped table-bordered table-hover">
																		<input type="text" name="sts_esertifikat" value="<?php echo $s->sts_esertifikat;?>" hidden >
																		<input type="text" name="id_acara" value="<?php echo $s->id_acara;?>" hidden >
																		<tr><td>Materi</td><td><input type="text" class="form-control" name="materi" required placeholder="Nama Materi"></td></tr>
																		<tr><td>Narasumber</td><td><input type="text" class="form-control" name="narasumber" required placeholder="Nama Narasumber"></td></tr>
																		<tr><td>Jumlah JPL</td><td><input type="text" class="form-control" name="jpl" required placeholder="Jumlah Jam"></td></tr>
																		<tr><td>File</td><td><input type="file" name="userfile" size="20" /></td></tr>
																		<tr><td> </td><td>
																		<button class="btn btn-danger btn-sm"data-dismiss="modal" aria-hidden="true">Cancel</button>
																		<button class="btn btn-info btn-sm" type="submit">
																		<i class="ace-icon fa fa-floppy-o bigger-110"></i>
																		Upload
																		</button>
																		</td></tr>
																	</table>
																</div><!-- /.span -->
															</div><!-- /.row -->
													
													</div>
													<br>
													<div class="modal-footer">
													
													
													</div>
													</form>
													</div>
													</div>
													</div>
													</td>
													
													
													<td><center><b>
														<a class="blue" href="<?php echo site_url();?>c_acara/verifikasi/<?php echo $s->id_acara;?>">
														<span class="badge badge-danger"><?php 
														$id_acara=$s->id_acara;
														$tot= $this->m_acara->tot_verifikasi($id_acara);
														echo $tot;
														?></a></span></b></center>
													</td>
													<td>
																<table id="simple-table" class="table table-striped table-bordered table-hover">
																<tr>
																	<td>Upload Peserta</td><td><a href="#peserta_<?php echo $s->id_acara;?>"  data-toggle="modal"><button class="btn btn-xs btn-primary" type="">Upload</button></a></td>
																</tr>
																<tr>
																	<td>Upload <br>Background Depan</td><td><a href="#bg_<?php echo $s->id_acara;?>"  data-toggle="modal"><button class="btn btn-xs btn-primary" type="">Upload</button></a></td>
																</tr>
																<tr>
																	<td>Upload <br>Background Belakang</td><td><a href="#bgblk_<?php echo $s->id_acara;?>"  data-toggle="modal"><button class="btn btn-xs btn-primary" type="">Upload</button></a></td>
																</tr>
																<tr>
																	<td>Upload Stampel</td><td><a href="#cap_<?php echo $s->id_acara;?>"  data-toggle="modal"><button class="btn btn-xs btn-primary" type="">Upload</button></a></td>
																</tr>
																<tr>
																	<td>Upload Tanda Tangan</td><td><a href="#ttd_<?php echo $s->id_acara;?>"  data-toggle="modal"><button class="btn btn-xs btn-primary" type="">Upload</button></a></td>
																</tr>
																<tr>
																	<td>Upload Template</td><td><a href="#template_<?php echo $s->id_acara;?>"  data-toggle="modal"><button class="btn btn-xs btn-primary" type="">Upload</button></a></td>
																</tr>
															</table>
															
															
															<!--MODAL UPLOAD PESERTA-->
															<div class="modal small fade" id="peserta_<?php echo $s->id_acara;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
															<div class="modal-dialog modal-sm">
																<div class="modal-content">
																	<div class="modal-header">
																		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
																			<h5 id="myModalLabel"><center>Perhatian !<br>Silahkan uploud file Peserta</center></h5>

																	</div>
																	<?php echo form_open_multipart('c_acara/kirim_exel/'.$s->id_acara); ?>
																	<div class="modal-body">
																		<p class="error-text" >
																		
																		<input type="file" name="userfile" size="20" />
																		</p>
																	</div>
																	<div class="modal-footer">
																		<button class="btn btn-danger btn-sm"data-dismiss="modal" aria-hidden="true">Cancel</button> 
																		<button class="btn btn-info btn-sm" type="submit">
																		<i class="ace-icon fa fa-floppy-o bigger-110"></i>
																		Upload
																		</button>
																	</div>
																	</form>
																</div>
															</div>
															</div>

															<!--MODAL UPLOAD BG DEPAN-->	
															<div class="modal small fade" id="bg_<?php echo $s->id_acara;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
															<div class="modal-dialog modal-sm">
																<div class="modal-content">
																	<div class="modal-header">
																		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
																			<h5 id="myModalLabel"><center>Perhatian !<br>Silahkan uploud Background Depan</center></h5>

																	</div>
																	<?php echo form_open_multipart('c_acara/upload_bgdepan/'.$s->id_acara); ?>
																	<div class="modal-body">
																		<p class="error-text" >
																		<input type="textfile" name="id_acara" size="20" value="<?php echo $s->id_acara;?>"hidden />
																		<input type="file" name="userfile" size="20" />
																		</p>
																	</div>
																	<div class="modal-footer">
																		<button class="btn btn-danger btn-sm"data-dismiss="modal" aria-hidden="true">Cancel</button> 
																		<button class="btn btn-info btn-sm" type="submit">
																		<i class="ace-icon fa fa-floppy-o bigger-110"></i>
																		Upload
																		</button>
																	</div>
																	</form>
																</div>
															</div>
															</div>

															<!--MODAL UPLOAD BG Belakang-->	
															<div class="modal small fade" id="bgblk_<?php echo $s->id_acara;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
															<div class="modal-dialog modal-sm">
																<div class="modal-content">
																	<div class="modal-header">
																		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
																			<h5 id="myModalLabel"><center>Perhatian !<br>Silahkan uploud Background Belakang</center></h5>

																	</div>
																	<?php echo form_open_multipart('c_acara/upload_bgblk/'.$s->id_acara); ?>
																	<div class="modal-body">
																		<p class="error-text" >
																		<input type="textfile" name="id_acara" size="20" value="<?php echo $s->id_acara;?>"hidden />
																		<input type="file" name="userfile" size="20" />
																		</p>
																	</div>
																	<div class="modal-footer">
																		<button class="btn btn-danger btn-sm"data-dismiss="modal" aria-hidden="true">Cancel</button> 
																		<button class="btn btn-info btn-sm" type="submit">
																		<i class="ace-icon fa fa-floppy-o bigger-110"></i>
																		Upload
																		</button>
																	</div>
																	</form>
																</div>
															</div>
															</div>

															<!--MODAL UPLOAD BG Stampel-->	
															<div class="modal small fade" id="cap_<?php echo $s->id_acara;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
															<div class="modal-dialog modal-sm">
																<div class="modal-content">
																	<div class="modal-header">
																		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
																			<h5 id="myModalLabel"><center>Perhatian !<br>Silahkan uploud Stampel</center></h5>

																	</div>
																	<?php echo form_open_multipart('c_acara/upload_cap/'.$s->id_acara); ?>
																	<div class="modal-body">
																		<p class="error-text" >
																		<input type="textfile" name="id_acara" size="20" value="<?php echo $s->id_acara;?>"hidden />
																		<input type="file" name="userfile" size="20" />
																		</p>
																	</div>
																	<div class="modal-footer">
																		<button class="btn btn-danger btn-sm"data-dismiss="modal" aria-hidden="true">Cancel</button> 
																		<button class="btn btn-info btn-sm" type="submit">
																		<i class="ace-icon fa fa-floppy-o bigger-110"></i>
																		Upload
																		</button>
																	</div>
																	</form>
																</div>
															</div>
															</div>

															<!--MODAL UPLOAD BG TTD-->	
															<div class="modal small fade" id="ttd_<?php echo $s->id_acara;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
															<div class="modal-dialog modal-sm">
																<div class="modal-content">
																	<div class="modal-header">
																		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
																			<h5 id="myModalLabel"><center>Perhatian !<br>Silahkan uploud Tanda Tangan</center></h5>

																	</div>
																	<?php echo form_open_multipart('c_acara/upload_ttd/'.$s->id_acara); ?>
																	<div class="modal-body">
																		<p class="error-text" >
																		<input type="textfile" name="id_acara" size="20" value="<?php echo $s->id_acara;?>"hidden />
																		<input type="file" name="userfile" size="20" />
																		</p>
																	</div>
																	<div class="modal-footer">
																		<button class="btn btn-danger btn-sm"data-dismiss="modal" aria-hidden="true">Cancel</button> 
																		<button class="btn btn-info btn-sm" type="submit">
																		<i class="ace-icon fa fa-floppy-o bigger-110"></i>
																		Upload
																		</button>
																	</div>
																	</form>
																</div>
															</div>
															</div>

															<!--MODAL UPLOAD TEMPLATE-->	
															<div class="modal small fade" id="template_<?php echo $s->id_acara;?>" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
															<div class="modal-dialog modal-sm">
																<div class="modal-content">
																	<div class="modal-header">
																		<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
																			<h5 id="myModalLabel"><center>Perhatian !<br>Silahkan uploud Template dalam Bentuk PHP</center></h5>

																	</div>
																	<?php echo form_open_multipart('c_acara/uploud_template/'.$s->id_acara); ?>
																	<div class="modal-body">
																		<p class="error-text" >
																		
																		<input type="file" name="userfile" size="20" />
																		</p>
																	</div>
																	<div class="modal-footer">
																		<button class="btn btn-danger btn-sm"data-dismiss="modal" aria-hidden="true">Cancel</button> 
																		<button class="btn btn-info btn-sm" type="submit">
																		<i class="ace-icon fa fa-floppy-o bigger-110"></i>
																		Upload
																		</button>
																	</div>
																	</form>
																</div>
															</div>
															</div>							
													</td>
													<td class="center"><?php echo'<a class="blue" href="'.base_url().'c_acara/ubah/'.$s->id_acara.'"><i class="ace-icon fa fa-pencil bigger-130"></i>';?></td>
													<?php if($level_sesion==2){?>
													<td class="center"><?php echo'<a class="blue" href="'.base_url().'c_acara/hapus/'.$s->id_acara.'" onclick="return confirm(\'Anda yakin ' .$s->nama_acara.' akan Dihapus ?\')"><i class="ace-icon fa fa-trash-o bigger-130"></i>';?></td>
													<?php } ?>
												</tr>
												<?php $no++;}?>
														</tbody>
													</table><?php echo $this->pagination->create_links();?>
													</div>
												</div><!-- /.widget-main -->
											</div><!-- /.widget-body -->
										</div><!-- /.widget-box -->
										</div>
										</p>
										</div><!-- /.col -->
										
										</div>
										
	</div>										
</div>	