<!DOCTYPE html>
<?php $home = 'Master'; $nama = 'Detail Sewa';?>
<html lang="en">
<?php include("layout/meta.php");?>
	<body class="no-skin">
	<?php include("layout/navbar.php");?>
		<div class="main-container ace-save-state" id="main-container">
			<script type="text/javascript">
				try{ace.settings.loadState('main-container')}catch(e){}
				$('#exampleModal3').modal({
					backdrop: 'static',
					keyboard: false
				})		
				$('#exampleModal2').modal({
					backdrop: 'static',
					keyboard: false
				})			
				$('#exampleModal1').modal({
					backdrop: 'static',
					keyboard: false
				})					
			</script>
			<?php include("layout/sidebar.php");?>
			<div class="main-content">
			  <div class="main-content-inner">
				<div class="col-xs-12">
				<?php if(!empty($pesan)){ ?>
				<div class="alert alert-<?php echo $alert;?>" role="alert" style="text-align:center;">
				 <strong><?php echo validation_errors(); echo $pesan ;?></strong>
				</div><?php }?>					
					<h3 class="header smaller lighter blue"><?php echo $nama;?></h3>					
				  <div class="widget-box">
					<div class="widget-body">	
					<div class="table-header">
						<?php echo $home.' <i class="ace-icon fa fa-angle-double-right"></i> '.$nama; ?>
					<div class="row  pull-right ">		
					<div class="col-sm-12">
					<a href="<?php echo  base_url().'admin/pesan/cetakskrd/'.$idpesan;?>" target="_blank">
					<button  type="button" name="buttonnota" value="Print. SKRD" class="btn btn-danger btn-sm">		
					<i class="ace-icon fa fa-file-text-o "></i>Print. SKRD</button></a>					
					<a href="<?php echo  base_url().'pesan/cetaknota/'.$idpesan;?>" target="_blank">
					<button  type="button" name="buttonnota" value="buttonnota" class="btn btn-success btn-sm">		
					<i class="ace-icon fa fa-file-text-o "></i>Print. Nota</button></a>					
					<a href="<?php echo  base_url().'pesan/cetakpesan/'.$idpesan;?>" target="_blank" >
					<button  type="button" name="button" value="button" class="btn btn-success btn-sm">		
					<i class="ace-icon fa fa-list-alt "></i>Print. Sewa</button></a>			
					</div>		
					</div>						
					</div>				
					</div>    					
 						<?php 
				
							foreach($tampilpesandetail->result() as $row){
							$idpesan = $row->idpesan;							
							$ktp = $row->ktp;
							$namapesan = $row->namapesan;
							$hppesan = $row->hppesan;
							$namapemakai = $row->namapemakai;
							$emailpemesan = $row->emailpemesan;
							$hppakai = $row->hppakai;
							$alamat = $row->alamat;
							$tglpesan1 = $row->tglpesan;
							$date=date_create($tglpesan1);
							$tglpesan = date_format($date,"Y-m-d");
							$tglpakai = $row->tglpakai;
							$tglselesai = $row->tglselesai;
							$jampakai = $row->jampakai;
							$keperluan = $row->keperluan;
							$dp1 = $row->dp1;
							$tgldp1 = $row->tgldp1;
							$dp2 = $row->dp2;
							$tgldp2 = $row->tgldp2;
							$status = $row->status;
							$statusdp = $row->statusdp;
							$keterangan = $row->keterangan;
							$statusacara = $row->status;
							$tglpakai = $row->tglpakai;
							$tglselesai = $row->tglselesai;
							$jampakai = $row->jampakai;
							$pemkot = $row->pemkot;
							$disetujui = $row->disetujui;
							$noskrd = $row->noskrd;
							$siangmalam = $row->siangmalam;
							$tanggal = new DateTime($tglpakai); 
							$sekarang = new DateTime($tglselesai);
							$selisihhari = $tanggal->diff($sekarang);	
							$selisihhariok = $selisihhari->d+1;	
							if($pemkot==1){
								$pot = 50/100;
								$totalhargapot = $totalharga - ($totalharga * $pot);
							}
							if($pemkot==2){
								$pot =0;
								$totalhargapot = $totalharga ;
							}
							}
											
						$attribute = array('role' => 'form', 'class' => 'form-horizontal' , 'name' => 'form2', 'id' => 'form2');
						echo form_open(base_url().'admin/pesan/simpandetail', $attribute); 
						?>
						<input type="hidden" id="form-field-1" name="keterangan"  value="<?php echo $keterangan;?>" placeholder="keterangan"  class="form-control" required />
						<input type="hidden" value="00:00" name="jampakai" required style="width:80px">
						<!--<button class="btn btn-danger btn-sm " title="Atur Jadwal Baru " type="submit" name="button3" value="button3"  accesskey="s" style="margin-left:-11px">Atur Jadwal Baru ?</button>-->	
					<!--Bagian 1-->	
					<div class="row">
					  <div class="col-sm-6">					
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">No. Registrasi</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="idpesan"  value="<?php echo $idpesan; ?>" placeholder="No. Registrasi"  class="form-control" required readonly />
							</div>
						  </div>	
						<!--
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Ktp</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="ktp"  value="<?php echo $ktp;?>" placeholder="Kartu Tanda Penduduk"  class="form-control" required />
							</div>
						  </div>	
						-->
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Nama Pesan</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="namapesan"  value="<?php echo $namapesan;?>" placeholder="Nama Pesan"  class="form-control" required />
							</div>
						  </div>
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Hp. pemesan</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="hppesan"  value="<?php echo $hppesan;?>" placeholder="Hp. pemesan"  class="form-control" required />
							</div>
						  </div>
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Nama Pemakai</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="namapemakai"  value="<?php echo $namapemakai;?>" placeholder="Nama Pemakai"  class="form-control" required />
							</div>
						  </div>
						  <!--
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Email Pemesan</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="emailpemesan"  value="<?php echo $emailpemesan;?>" placeholder="Email Pemesan"  class="form-control" required />
							</div>
						  </div>
						
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Hp. Pemakai</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="hppakai"  value="<?php echo $hppakai;?>" placeholder="Hp. Pemakai"  class="form-control" required />
							</div>
						  </div>	-->								  
						</div>
					  <div class="col-sm-6">		
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Alamat</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="alamat"  value="<?php echo $alamat;?>" placeholder="Alamat"  class="form-control" required />
							</div>
						  </div>						  
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Tgl. Pesan</label>
							<div class="col-sm-8">
							  <input type="date" id="form-field-1" readonly name="tglpesan"  value="<?php echo $tglpesan;?>" placeholder="tglpesan"  class="form-control" required />
							</div>
						  </div>
						  <div class="form-group">						  
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Tgl. Pakai</label>
							<div class="col-sm-8">
							  <input type="date" id="form-field-1" readonly name="tglpakai"  value="<?php echo $tglpakai;?>" placeholder="tglpakai"  class="form-control" required />
							</div>
						  </div>	
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Tgl. Selesai</label>
							<div class="col-sm-8">
							  <input type="date" id="form-field-1" readonly name="tglselesai"  value="<?php echo $tglselesai;?>" placeholder="tglselesai"  class="form-control" required />
							</div>
						  </div>						  	
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Keperluan</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="keperluan"  value="<?php echo $keperluan;?>" placeholder="keperluan"  class="form-control" required />
							</div>
						  </div>
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">No. SKRD</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="noskrd"  value="<?php echo $noskrd;?>" placeholder="noskrd"  class="form-control" required readonly />
							</div>
						  </div>						  
						  <!--
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1" style="color:red"><b>Terima ?</b></label>
							<div class="col-sm-8">
								<label class="radio-inline"><input type="radio" name="statusacara" <?php if($statusacara==0){ echo 'checked' ;}?> value="0">Baru</label>
								<label class="radio-inline"><input type="radio" name="statusacara" <?php if($statusacara==1){ echo 'checked' ;}?> value="1">Diterima</label>							 
								<button class="btn btn-danger btn-sm " title="Batalkan" type="submit" name="button2" value="button2"  accesskey="s"> Batalkan Sewa ini ?</button>								 
							</div>
						  </div>
						  -->
						  
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1" style="color:red"><b>Disetujui ?</b></label>
							<div class="col-sm-8">
								<label class="radio-inline"><input type="radio" name="disetujui" <?php if($disetujui==0){ echo 'checked' ;}?> value="0">Belum Disetujui</label>
								<label class="radio-inline"><input type="radio" name="disetujui" <?php if($disetujui==1){ echo 'checked' ;}?> value="1">Disetujui</label>	
								&nbsp;&nbsp;&nbsp;
								<button class="btn btn-danger btn-sm " title="Batalkan" type="submit" name="button2" value="button2"  accesskey="s"> Batalkan Sewa ini ?</button>								
							</div>
						  </div>							  
						</div>						
					</div>
					<!--Bagian 2-->
					<div class="table-header">
						Transaksi (Jika langsung lunas di kolom DP2)
					</div>					
					<div class="row">
					  <div class="col-sm-6">					
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Pilih Waktu</label>
							<div class="col-sm-8">
								<select class="form-control"  name="waktu" onchange="myFunction()" id="mySelect"   class="form-control">
								<option selected="selected" value="" >Pilih Waktu</option>
								<option  value="0" <?php  if($siangmalam=='0'){ echo 'selected' ;}?>>Siang</option>
								<option  value="1" <?php if($siangmalam=='1'){ echo 'selected' ;}?>>Malam</option>
								<option  value="2" <?php if($siangmalam=='2'){ echo 'selected' ;}?>>Full Day</option>
								</select>								
							</div>
						  </div>								  
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Fasilitas</label>
							<div class="col-sm-8">
							<button type="button" id="idbuttonfasilitas" class="btn btn-sm btn-block btn-primary" data-toggle="modal" data-target="#exampleModal<?php if($siangmalam==0){ echo '';} if($siangmalam==1){ echo '2';}  if($siangmalam==2){ echo '3';}?>" style="margin-bottom:12px;">Klik Fasilitas yang dipesan</button>
								<p id="demo"></p>
							</div>
						  </div>	
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1"></label>
							<div class="col-sm-8">
							<table class="table">
								<thead>
								  <tr>
								  <th scope="col" style="width:35%;text-align:center">Fasilitas</th>
								  <th scope="col" style="width:30%;text-align:center">Harga</th>
								  <th scope="col" style="width:15%;text-align:center">Jumlah</th>
								  </tr>
								</thead>
								<tbody>
								 <?php $no=0; foreach($cetakpesan->result() as $row){ $no++; ?>
								  <tr>
									<td><?php echo $row->namafasilitas;?></td>
									<td style="text-align:center"><?php echo number_format($row->harga);?></td>
									<td style="text-align:center"><?php echo $row->jumlah;?></td>
								  </tr>
								 <?php }?>
								</tbody>
							  </table>								
							</div>
						  </div>						  
							</div>						  
					  <div class="col-sm-6">	
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Total Harga</label>
							<div class="col-sm-4">
							  <input type="text" name="totalharga" id="validtotalharga" value="<?php echo number_format($totalharga).'.00' ;?>" size="3"   style="width:100%;text-align:right"  readonly="readonly">
							</div>
							<div class="col-sm-3">
							  <input type="text" name="totalhari" id="validtotalhari" value="<?php echo ($selisihhari->d+1);?>" size="3"   class="form-control" style="width:100%;text-align:right"  readonly="readonly">
							</div>		
							<div class="col-sm-2">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Hari</label>
							</div>								
						  </div>	
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1" >pemkot ?</label>
							<div class="col-sm-8">
								<label class="radio-inline"><input type="radio" name="pemkot" class="pemkot" <?php if($pemkot==1){ echo 'checked' ;}?> value="1" required>Ya, pemkot</label>
								<label class="radio-inline"><input type="radio" name="pemkot" class="pemkot" <?php if($pemkot==2){ echo 'checked' ;}?> value="2" required>Tidak</label>							 						 
							</div>
						  </div>	
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Grand Total</label>
							<div class="col-sm-8">
							  <input type="text"  name="validgrandtotal" id="validgrandtotal" placeholder="Grand Total" value=<?php echo number_format  ($totalhargapot).'.00';?> class="form-control"  style="width:100%;text-align:right" required readonly  />
							</div>
						  </div>	
						  <!-- DP1-->
						 <input type="hidden" name="dp1"  id="currency-field"  autocomplete="off"   data-type="currency" value=<?php echo $totalhargapot;?> placeholder="dp1"  style="width:100%;text-align:right"  />	  

						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Tgl Bayar</label>
							<div class="col-sm-8">
							  <input type="date" id="form-field-1" name="tgldp1"  value="<?php echo $tgldp1;?>" placeholder="Tgl DP1"  class="form-control"  style="width:100%;text-align:right"    required />
							</div>
						  </div>
						<!--
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">DP2 (Pelunasan)</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1" name="dp2"  id="currency-field"  autocomplete="off"   data-type="currency"  value="<?php  number_format($dp2);?>" placeholder="DP2"  style="width:100%;text-align:right"  required />
							</div>
						  </div> 

						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Tgl DP2 </label>
							<div class="col-sm-8">
							  <input type="date" id="form-field-1" name="tgldp2"  value="<?php  $tgldp2;?>" placeholder="Tgl DP2"  class="form-control"  style="width:100%;text-align:right"   />
							</div>
						  </div>-->
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1">Status Pembayaran</label>
							<div class="col-sm-8">
							  <input type="text" id="form-field-1"   value="<?php if($statusdp==0){ echo 'Belum';};if($statusdp==1){ echo 'Lunas';};if($statusdp==2){ echo 'Ditolak';};?>" placeholder="keterangan"  class="form-control"  style="width:100%;text-align:right"   readonly />
							  <button class="btn btn-danger btn-sm " title="Batalkan" type="submit" name="button4" value="button4"  accesskey="s">Reset Belum Lunas</button>			
							</div>
						  </div>
						  <div class="form-group">
							<label class="col-sm-2 control-label no-padding-right" for="form-field-1"></label>
							<div class="col-sm-8">
							<button class="btn btn-success btn-sm btn-block" title="Simpan" type="submit" name="button" value="button"  accesskey="s"> Simpan</button>							 
							</div>
						  </div>						  
						</div>						
					</div>
					</div>
				  </div>
				</div>
				<!-- /.span -->
			  </div>
<!-- Kosong -->
<div class="modal fade bd-example-modal-lg" id="exampleModal0" tabindex="-1" role="dialog"aria-labelledby="exampleModalLongTitle" aria-hidden="true" style="margin-top:-2%">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel"></h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
		<p>Maaf. Silahkan <strong>pilih waktu</strong> terlebih dahulu. </p>			
      <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm"  data-dismiss="modal">Selesai</button>
      </div>
    </div>
  </div>
</div>
<!-- Siang -->
<div class="modal fade bd-example-modal-lg" id="exampleModal" tabindex="-1" role="dialog"aria-labelledby="exampleModalLongTitle" aria-hidden="true" style="margin-top:-2%">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Fasilitas Siang / Hari</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
		<table class="table table-striped table-hover">
		  <thead>
			<tr>
			  <th scope="col" style="width:35%;text-align:center">Fasilitas</th>
			  <th scope="col" style="width:30%;text-align:center">Harga / Maksimal</th>
			  <th scope="col" style="width:15%;text-align:center">Jumlah</th>
			  <th scope="col" style="text-align:center" style="width:20%">Pilih</th>
			</tr>
		  </thead>
		  <tbody>
		  <?php $no=0; foreach($fasilitas->result() as $row){ $no++;
		  						  $idfasilitas = $row->idfasilitas;
		  $cek= $this->m_pesan->fasilitaspilih($idfasilitas, $idpesan);	
		$idfasilitaspilih =$cek->idfasilitas;
		$jumlah =$cek->jumlah;	
		$harga =$cek->harga;	
		$hari =$cek->hari;	
		$sub1[] = $cek->jumlah *  $cek->harga;
		  ?>
			<tr>
			  <td> <?php echo cetak($row->namafasilitas);?></td>
			  <td style="text-align:center">Rp <?php echo cetak(number_format($row->harga)).'/'.$row->batasmax;?></td>
			  <td style="text-align:center">1</td>	
			  <td style="text-align:center"> 		  
			  <input type="checkbox" class="pilihsatu" name="pilihfasilitas[]"  <?php if($idfasilitas==$idfasilitaspilih){ echo 'checked'; }?>  value="<?php echo cetak($row->harga.'-'.$row->idfasilitas.'-'.$row->namafasilitas);?>">
			  </td>	
			</tr>
		  <?php }?>
		  <?php $no=0; foreach($fasilitas2->result() as $row2){ $no++;
			$idfasilitas = $row2->idfasilitas;
			$cek2= $this->m_pesan->fasilitaspilih($idfasilitas, $idpesan);	
			$idfasilitaspilih2 =$cek2->idfasilitas;
			$jumlah2 =$cek2->jumlah;
			$hari2 =$cek2->hari;	
			$harga2 = $cek2->harga;
			$sub2[] = $cek2->jumlah *  $cek2->harga;
		  ?>
			<tr>
			  <td><?php echo cetak($row2->namafasilitas);?></td>
			  <td style="text-align:center">Rp <?php echo cetak(number_format($row2->harga)).'/'.$row2->batasmax;?></td>
			  <td style="text-align:center">
			  <input type="number"    id="nilai1" name="jumlah_pil1siang" class="jumlah_pil1siang"     min="1"  value="<?php echo $jumlah2; ?>"   style="text-align:center"></td>	
			  <td style="text-align:center">			 
			  <input type="checkbox" class="pilihdua" name="pilihfasilitas_pil1siang" <?php if($idfasilitas==$idfasilitaspilih2){ echo 'checked'; }?> value="<?php echo cetak($row2->harga.'-'.$row2->idfasilitas);?>">
			  </td>	
			</tr>
		  <?php
		  }
		  //grandtotal 
		  $tot1 = array_sum($sub1);
		  $tot2 = array_sum($sub2);
		  $grandtotal = $tot1+$tot2;
		  ?>		  		
			<tr>
			<td colspan="1"><input type="hidden" id="total" value="<?php echo $tot1 ;?>"><input type="hidden" id="total2" value="<?php echo $tot2 ;?>"><input  type="hidden" id="field3" value="<?php echo $jumlah2 * $harga2;?>" ></td>
			<td colspan="3" style="text-align:right"><input type="hidden" id="grandtotal"  class="form-control" value="Rp <?php echo number_format($grandtotal).'.00';?>"  readonly="readonly" style="text-align:right"></td>
			</tr>	
			<tr>
			<td colspan="4"><p class="help" style="font-size:14px; font-style: italic;margin-bottom:2%"><b>* Pada kolom Kelas bisa pesan lebih dari satu </b></p>	</td>
			</tr>			
		  </tbody>
		</table>			
      <div class="modal-footer">
      	<button class="btn btn-success btn-sm btn-block" title="Simpan" type="submit" name="button" value="button"  accesskey="s"> Simpan</button>		
      </div>
    </div>
  </div>
</div>
<!-- Malam -->
<div class="modal fade bd-example-modal-lg" id="exampleModal2" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true" style="margin-top:-2%">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Fasilitas Malam / Hari</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
		<table class="table table-striped table-hover">
		  <thead>
			<tr>
			  <th scope="col" style="width:35%;text-align:center">Fasilitas</th>
			  <th scope="col" style="width:30%;text-align:center">Harga / Maksimal</th>
			  <th scope="col" style="width:15%;text-align:center">Jumlah</th>
			  <th scope="col" style="text-align:center" style="width:20%">Pilih</th>
			</tr>
		  </thead>
		  <tbody>
			<?php $no=0; foreach($fasilitasmalam->result() as $row){ $no++;
			$idfasilitas = $row->idfasilitas;
			$cek= $this->m_pesan->fasilitaspilih($idfasilitas, $idpesan);	
			$idfasilitaspilih =$cek->idfasilitas;
			$jumlah =$cek->jumlah;	
			$harga =$cek->harga;	
			$hari =$cek->hari;	
			$sub1malam[] = $cek->jumlah *  $cek->harga;		  
			?>
			<tr>
			  <td> <?php echo cetak($row->namafasilitas);?></td>
			  <td style="text-align:center">Rp <?php echo cetak(number_format($row->harga)).'/'.$row->batasmax;?></td>
			  <td style="text-align:center">1</td>	
			  <td style="text-align:center">
			  <input type="checkbox" class="pilihsatu_set_malam" name="pilihfasilitas2[]" <?php if($idfasilitas==$idfasilitaspilih){ echo 'checked'; }?> value="<?php echo cetak($row->harga.'-'.$row->idfasilitas.'-'.$row->namafasilitas);?>">
			  </td>	
			</tr>
			<?php }?>
			<?php $no=0; foreach($fasilitasmalam2->result() as $row2){ $no++;
			$idfasilitas = $row2->idfasilitas;
			$cek2= $this->m_pesan->fasilitaspilih($idfasilitas, $idpesan);	
			$idfasilitaspilih2 =$cek2->idfasilitas;
			$jumlah2malam =$cek2->jumlah;
			$hari2malam =$cek2->hari;	
			$harga2 = $cek2->harga;
			$sub2malam[] = $cek2->subtotal
			?>
			<tr>
			  <td><?php echo cetak($row2->namafasilitas);?></td>
			  <td style="text-align:center">Rp <?php echo cetak(number_format($row2->harga)).'/'.$row2->batasmax;?></td>
			  <td style="text-align:center">
			  <input type="number"    id="nilai1_malam"  name="jumlah_pil1malam" class="jumlah_pil1malam"  min="1" value="<?php echo $jumlah2malam; ?>"     onkeyup="if(this.value > <?php echo $row2->batasmax; ?>) this.value = null;"  style="text-align:center"></td>	
			  <td style="text-align:center">			 
			  <input type="checkbox" class="pilihdua_set_malam" name="pilihfasilitas_pil1malam" value="<?php echo cetak($row2->harga.'-'.$row2->idfasilitas);?>"  <?php if($idfasilitas==$idfasilitaspilih2){ echo 'checked'; }?> > 
			  </td>	
			</tr>
			<?php
			}
			//grandtotal 
			$tot1malam = array_sum($sub1malam);
			$tot2malam = array_sum($sub2malam);
			$grandtotal1malam = $tot1malam+$tot2malam;
			?>	  		
			<tr>
			<td colspan="1"><input type="hidden" id="total_malam" value="<?php echo $tot1malam ;?>"><input type="hidden" id="total2_malam" value="<?php echo $tot2malam ;?>"><input  type="hidden" id="field3_malam" value="<?php echo $jumlah2malam * $harga2malam;?>" ></td>
			<td colspan="3" style="text-align:right"><input type="hidden" id="grandtotal_malam"  class="form-control" value="Rp <?php echo number_format($grandtotal1malam).'.00';?>"  readonly="readonly" style="text-align:right"></td>
			</tr>	
			<tr>
			<td colspan="4"><p class="help" style="font-size:14px; font-style: italic;margin-bottom:2%"><b>* Pada kolom Kelas bisa pesan lebih dari satu </b></p>	</td>
			</tr>				
		  </tbody>
		</table>			
      <div class="modal-footer">
       	<button class="btn btn-success btn-sm btn-block" title="Simpan" type="submit" name="button" value="button"  accesskey="s"> Simpan</button>		
      </div>
    </div>
  </div>
</div>


<!-- FULL DAY -->
<div class="modal fade bd-example-modal-lg" id="exampleModal3" tabindex="-1" role="dialog" aria-labelledby="exampleModalLongTitle" aria-hidden="true" style="margin-top:-2%">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <h5 class="modal-title" id="exampleModalLabel">Fasilitas Full Day / Hari</h5>
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span>
        </button>
      </div>
		<table class="table table-striped table-hover">
		  <thead>
			<tr>
			  <th scope="col" style="width:35%;text-align:center">Fasilitas</th>
			  <th scope="col" style="width:30%;text-align:center">Harga / Maksimal</th>
			  <th scope="col" style="width:15%;text-align:center">Jumlah</th>
			  <th scope="col" style="text-align:center" style="width:20%">Pilih</th>
			</tr>
		  </thead>
		  <tbody>
			<?php $no=0; foreach($fasilitassiangmalam->result() as $row){ $no++;
			$idfasilitas = $row->idfasilitas;
			$cek= $this->m_pesan->fasilitaspilih($idfasilitas, $idpesan);	
			$idfasilitaspilih =$cek->idfasilitas;
			$jumlah =$cek->jumlah;	
			$harga =$cek->harga;	
			$hari =$cek->hari;	
			$sub1full[] = $cek->jumlah *  $cek->harga;		  
			?>
			<tr>
			  <td> <?php echo cetak($row->namafasilitas);?></td>
			  <td style="text-align:center">Rp <?php echo cetak(number_format($row->harga)).'/'.$row->batasmax;?></td>
			  <td style="text-align:center">1</td>	
			  <td style="text-align:center"> 		  
			  <input type="checkbox" class="pilihsatu_set_full" name="pilihfasilitas3[]" <?php if($idfasilitas==$idfasilitaspilih){ echo 'checked'; }?> value="<?php echo cetak($row->harga.'-'.$row->idfasilitas.'-'.$row->namafasilitas);?>">
			  </td>	
			</tr>
			<?php }?>
			<?php $no=0; foreach($fasilitasmalam3->result() as $row2){ $no++;
			$idfasilitas = $row2->idfasilitas;
			$cek2= $this->m_pesan->fasilitaspilih($idfasilitas, $idpesan);	
			$idfasilitaspilih2 =$cek2->idfasilitas;
			$jumlah2full =$cek2->jumlah;
			$hari2full =$cek2->hari;	
			$harga2full = $cek2->harga;
			$sub2full[] = $cek2->subtotal
			?>
			<tr>
			  <td><?php echo cetak($row2->namafasilitas);?></td>
			  <td style="text-align:center">Rp <?php echo cetak(number_format($row2->harga)).'/'.$row2->batasmax;?></td>
			  <td style="text-align:center">
			  <input type="number"    id="nilai1_full"  name="jumlah_pil1full" class="jumlah_pil1full"  min="1"   value="<?php echo $jumlah2full; ?>"  onkeyup="if(this.value > <?php echo $row2->batasmax; ?>) this.value = null;"  style="text-align:center"></td>	
			  <td style="text-align:center">			 
			  <input type="checkbox" class="pilihdua_set_full" name="pilihfasilitas_pil1full" value="<?php echo cetak($row2->harga.'-'.$row2->idfasilitas);?>"  <?php if($idfasilitas==$idfasilitaspilih2){ echo 'checked'; }?> > 
			  </td>	
			</tr>
			<?php
			}
			//grandtotal 
			$tot1full = array_sum($sub1full);
			$tot2full = array_sum($sub2full);
			$grandtotal1full = $tot1full+$tot2full;
			?>	  		
			<tr>
			<td colspan="1"><input type="hidden" id="total_full" value="<?php echo $tot1full ;?>"><input type="hidden" id="total2_full" value="<?php echo $tot2full ;?>"><input  type="hidden" id="field3_full" value="<?php echo $jumlah2full * $harga2full;?>" ></td>
			<td colspan="3" style="text-align:right"><input type="hidden" id="grandtotal_full"  class="form-control" value="Rp <?php echo number_format($grandtotal1full).'.00';?>"  readonly="readonly" style="text-align:right"></td>
			</tr>	
			<tr>
			<td colspan="4"><p class="help" style="font-size:14px; font-style: italic;margin-bottom:2%"><b>* Pada kolom Kelas bisa pesan lebih dari satu </b></p>	</td>
			</tr>				
		  </tbody>
		</table>			
      <div class="modal-footer">
       	<button class="btn btn-success btn-sm btn-block" title="Simpan" type="submit" name="button" value="button"  accesskey="s"> Simpan</button>		
      </div>
    </div>
  </div>
</div>
			  <!-- /.main-content -->
			</div>
			<!-- Button trigger modal -->
<?php echo form_close();?>   		
<?php  include("layout/sc_currency.php");?>	
<script>
//Siang
$('input[class="pilihsatu"]').change(function (){
      var total = 0;
      $('input[class="pilihsatu"]:checked').each(function(){
       total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val());
      });   
      $("#total").val(total);
	  
		//var grandtotalok = (parseInt($("#total").val()  || '0') +parseInt($("#total2").val() || '0')+ parseInt($("#field3").val()  || '0')) -  parseInt($("#total2").val() || '0');
		var grandtotalok = (parseInt($("#total").val()  || '0') +parseInt($("#total2").val() || '0')+ parseInt($("#field3").val()  || '0'));
		$("#grandtotal").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);	
});
$('input[class="pilihdua"]').change(function (){
	var total = 0;
	var kosong = $("#nilai1").val();	
	if(kosong==''){
		var n1 = 1;
		$("#nilai1").val(n1);
		$('input[class="pilihdua"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2").val(total);
		var grandtotalok =( (parseInt($("#total").val()  || '0') +parseInt($("#total2").val() || '0')+ parseInt($("#field3").val()  || '0')) -  parseInt($("#total2").val() || '0') ) +  parseInt($("#total2").val() || '0');
			$("#grandtotal").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);		
	}else{
		$('input[class="pilihdua"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2").val(total);
		var grandtotalok = (parseInt($("#total").val()  || '0') +parseInt($("#total2").val() || '0')+ parseInt($("#field3").val()  || '0')) -  parseInt($("#total2").val() || '0');
			$("#grandtotal").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());		
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);			
	}
});
	//$("input").on("change", function() {
	$('input[class="jumlah_pil1siang"]').change(function (){	
	var nilai1 = $('#nilai1').val();
	var ret = parseInt($("#nilai1").val() || '0') * parseInt($("#total2").val() || '0');
	$("#field3").val(ret);
	//var kosong = 0;
	var grandtotalok = (parseInt($("#total").val()  || '0') +parseInt($("#total2").val() || '0')+ parseInt($("#field3").val()  || '0')) -  parseInt($("#total2").val() || '0');
		$("#grandtotal").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);	
  });
  
 //MALAM
$('input[class="pilihsatu_set_malam"]').change(function (){
      var total = 0;
      $('input[class="pilihsatu_set_malam"]:checked').each(function(){
       total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val());
      });   
      $("#total_malam").val(total);
		var grandtotalok =( (parseInt($("#total_malam").val()  || '0') +parseInt($("#total2_malam").val() || '0')+ parseInt($("#field3_malam").val()  || '0')) -  parseInt($("#total2_malam").val() || '0') )+parseInt($("#total2_malam").val() || '0');
		$("#grandtotal_malam").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);	
});
$('input[class="pilihdua_set_malam"]').change(function (){
	var total = 0;
	var kosong = $("#nilai1_malam").val();	
	if(kosong==''){
		var n1 = 1;
		$("#nilai1_malam").val(n1);
		$('input[class="pilihdua_set_malam"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2_malam").val(total);
		//var grandtotalok = (parseInt($("#total_malam").val()  || '0') +parseInt($("#total2_malam").val() || '0')+ parseInt($("#field3_malam").val()  || '0')) -  parseInt($("#total2_malam").val() || '0');
		var grandtotalok = (parseInt($("#total_malam").val()  || '0') +parseInt($("#total2_malam").val() || '0')+ parseInt($("#field3_malam").val()  || '0'));
			$("#grandtotal_malam").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);		
	}else{
		$('input[class="pilihdua_set_malam"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2_malam").val(total);
		//var grandtotalok = (parseInt($("#total_malam").val()  || '0') +parseInt($("#total2_malam").val() || '0')+ parseInt($("#field3_malam").val()  || '0')) -  parseInt($("#total2_malam").val() || '0');
		var grandtotalok = (parseInt($("#total_malam").val()  || '0') +parseInt($("#total2_malam").val() || '0')+ parseInt($("#field3_malam").val()  || '0'));
			$("#grandtotal_malam").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());		
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);			
	}
	});
	//$("input").on("change", function() {
	$('input[class="jumlah_pil1malam"]').change(function (){	
	var nilai1 = $('#nilai1_malam').val();
	var ret = parseInt($("#nilai1_malam").val() || '0') * parseInt($("#total2_malam").val() || '0');
	$("#field3_malam").val(ret);
	//var kosong = 0;
	var grandtotalok = (parseInt($("#total_malam").val()  || '0') +parseInt($("#total2_malam").val() || '0')+ parseInt($("#field3_malam").val()  || '0')) -  parseInt($("#total2_malam").val() || '0');
		$("#grandtotal_malam").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);	
  });

 //FULL
$('input[class="pilihsatu_set_full"]').change(function (){
      var total = 0;
      $('input[class="pilihsatu_set_full"]:checked').each(function(){
       total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val());
      });   
      $("#total_full").val(total);
		var grandtotalok =( (parseInt($("#total_full").val()  || '0') +parseInt($("#total2_full").val() || '0')+ parseInt($("#field3_full").val()  || '0')) -  parseInt($("#total2_full").val() || '0') )+parseInt($("#total2_full").val() || '0');
		$("#grandtotal_full").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);	
});
$('input[class="pilihdua_set_full"]').change(function (){
	var total = 0;
	var kosong = $("#nilai1_full").val();	
	if(kosong==''){
		var n1 = 1;
		$("#nilai1_full").val(n1);
		console.log($("#nilai1_full").val(n1));
		$('input[class="pilihdua_set_full"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2_full").val(total);
		//var grandtotalok = (parseInt($("#total_full").val()  || '0') +parseInt($("#total2_full").val() || '0')+ parseInt($("#field3_full").val()  || '0')) -  parseInt($("#total2_full").val() || '0');
		var grandtotalok = (parseInt($("#total_full").val()  || '0') +parseInt($("#total2_full").val() || '0')+ parseInt($("#field3_full").val()  || '0')) ;
			$("#grandtotal_full").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);		
	}else{
		$('input[class="pilihdua_set_full"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2_full").val(total);
		var grandtotalok = (parseInt($("#total_full").val()  || '0') +parseInt($("#total2_full").val() || '0')+ parseInt($("#field3_full").val()  || '0')) -  parseInt($("#total2_full").val() || '0');
			$("#grandtotal_full").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());		
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);			
	}
	});
	//$("input").on("change", function() {
	$('input[class="jumlah_pil1full"]').change(function (){	
	var nilai1 = $('#nilai1_full').val();
	var ret = parseInt($("#nilai1_full").val() || '0') * parseInt($("#total2_full").val() || '0');
	$("#field3_full").val(ret);
	//var kosong = 0;
	var grandtotalok = (parseInt($("#total_full").val()  || '0') +parseInt($("#total2_full").val() || '0')+ parseInt($("#field3_full").val()  || '0')) -  parseInt($("#total2_full").val() || '0');
		$("#grandtotal_full").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//tamb
		var jumlahari = $("#validtotalhari").val();
		var validtotalharga = parseInt(grandtotalok) *  parseInt(jumlahari);
		$("#validtotalharga").val(parseFloat(validtotalharga, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
		//$("#validtotalharga").val(validtotalharga);	
  });
  
  /*
$("input[name='pemkot']").click(function(){
    //alert('You clicked radio!');
    if($('input:radio[name=pemkot]:checked').val() == "1"){
		var totalharga, validtotalharga;
		var potongan = 50;
		validtotalharga = $("#validtotalharga").val();
		validtotalharga1 = validtotalharga.replace(",", "");	   
		totalhargaok = validtotalharga1 - (validtotalharga1 * 50/100);
		$("#validgrandtotal").val(parseFloat(totalhargaok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
    }
    if($('input:radio[name=pemkot]:checked').val() == "2"){
		var totalharga, validtotalharga;
		var potongan = 50;
		validtotalharga = $("#validtotalharga").val();
		validtotalharga1 = validtotalharga.replace(",", "");	   
		totalhargaok = validtotalharga1 ;
		$("#validgrandtotal").val(parseFloat(totalhargaok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
    }	
});
*/

        function updateGrandTotal() {
            const totalharga = <?php echo $totalharga; ?>;
            const pemkot = document.querySelector('input[name="pemkot"]:checked').value;
            let pot = 0;

            if (pemkot == 1) {
                pot = 50 / 100;
            }

            const totalhargapot = totalharga - (totalharga * pot);
            document.getElementById('validgrandtotal').value = totalhargapot.toFixed(2).replace(/\d(?=(\d{3})+\.)/g, '$&,');
        }

        document.addEventListener('DOMContentLoaded', function () {
            const pemkotRadios = document.querySelectorAll('input[name="pemkot"]');
            pemkotRadios.forEach(radio => {
                radio.addEventListener('change', updateGrandTotal);
            });

            // Set initial value
            updateGrandTotal();
        });

function myFunction() {
  var isi = "";
  var x = document.getElementById("mySelect").value;
  document.getElementById("demo").innerHTML = x;
  if(x=="0"){
	  isi ='<button type="button" class="btn btn-sm btn-block btn-primary" data-toggle="modal" data-target="#exampleModal" style="margin-bottom:12px;" >Klik Fasilitas yang dipesan</button> ';
	  var x = document.getElementById("idbuttonfasilitas");
	  x.style.display = "none";
	  	  $("#total").val(nol);
	  	  $("#total2").val(nol);
	  	  $("#field3").val(nol);
	  	  $("#grandtotal").val(nol);	  
	  	  $("#validgrandtotal").val(nol);	  
   }
  if(x=="1"){
	  isi ='<button type="button" class="btn btn-sm btn-block btn-primary" data-toggle="modal" data-target="#exampleModal2" style="margin-bottom:12px;"  data-backdrop="static" data-keyboard="false">Klik Fasilitas yang dipesan</button> ';
	  	  var x = document.getElementById("idbuttonfasilitas");
	  x.style.display = "none";
	  var nol =0;
	  	  $("#total_malam").val(nol);
	  	  $("#total2_malam").val(nol);
	  	  $("#field3_malam").val(nol);
	  	  $("#grandtotal_malam").val(nol);
   }   
  if(x=="2"){
	  isi ='<button type="button" class="btn btn-sm btn-block btn-primary" data-toggle="modal" data-target="#exampleModal3" style="margin-bottom:12px;"  data-backdrop="static" data-keyboard="false">Klik Fasilitas yang dipesan</button> ';
	  	  var x = document.getElementById("idbuttonfasilitas");
	  x.style.display = "none";
	  	  var nol =0;
	  	  $("#total_full").val(nol);
	  	  $("#total2_full").val(nol);
	  	  $("#field3_full").val(nol);
	  	  $("#grandtotal_full").val(nol);

   }    
   if(x==""){
	  isi ='<button type="button" class="btn btn-sm btn-block btn-primary" data-toggle="modal" data-target="#exampleModal0" style="margin-bottom:12px;"  data-backdrop="static" data-keyboard="false">Klik Fasilitas yang dipesan</button> ';
	  	  var x = document.getElementById("idbuttonfasilitas");
	  x.style.display = "none";
   }   
  document.getElementById("demo").innerHTML = isi;
}
</script>
			<?php include("layout/footer.php");?>
			<a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
				<i class="ace-icon fa fa-angle-double-up icon-only bigger-110"></i>
			</a>
		</div><!-- /.main-container -->
		<!-- basic scripts -->
			<?php include("layout/sc_footer.php");?>
	</body>
</html>
