    <!-- ======= Breadcrumbs ======= -->
    <section id="breadcrumbs" class="breadcrumbs" style="margin-top:90px;">
      <div class="container">
        <div class="d-flex justify-content-between align-items-center">
          <h2><?php echo ucfirst($headeractive);?></h2>
          <ol>
            <li><a href="<?php echo base_url();?>">Home</a></li>
            <li><?php echo ucfirst($headeractive);?></li>
          </ol>
        </div>
      </div>
    </section><!-- End Breadcrumbs -->
	<style>.penting{ color:red;}</style>
<div class="container">
<?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 }?>
 <section id="contact" class="contact" style="margin-top:-3%">
		<div class="row">	  
		<div class="col-lg-12">
		 <?php foreach($infosewa->result() as $rowpesan){?>	  
        <div class="alert alert-success">
            <?php echo $rowpesan->namalist; ?>
				<?php echo $rowpesan->deskripsi; ?>
        </div>	
		 <?php }?>
            <div class="panel panel-primary">
                <div class="panel-heading">
                    <h3 class="panel-title" style="text-align: center"><strong>Formulir Pemesanan</strong></h3>
				</div>
                <div class="panel-body">
			<?php 	
			$waktu;
			if($detail=='ada'){
			$attribute = array('role' => 'form', 'method' => 'post');
			echo form_open(base_url().'pesan/pesan', $attribute); 
			?>			 
				<div class="col-xs-12 "  >
					<p class="bg-primary" style="color: #fff;background-color: #0880e8;text-align:center;font-size:14px;height:25px;">Data Pemesanan</p>
				</div>					
				 <div class="row">			 
				 <div class="col-sm-6">
                    <div class="form-group">
                        <div class="row">
                            <div class="col-sm-12">
                               <!-- <strong>No. KTP <small>(Kartu Tanda Penduduk)</small> <font class="penting">*</font></strong><br>-->
                                <input  type="hidden" class="form-control" name="ktp" placeholder="Nomor KTP" value="<?php  echo set_value('ktp'); ?>" required>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
                                <strong>Nama pemesan <font class="penting">*</font></strong>
                                <input type="text" class="form-control" name="namapesan"  placeholder="Nama pemesan" value="<?php  echo set_value('namapesan'); ?>"  required maxlength="50" minlength="2">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
                                <strong>No. telepon pemesan <font class="penting">*</font></strong><br>
                                <input type="number" class="form-control" name="hppesan"  placeholder="Nomor telepon pemesan"  value="<?php  echo set_value('hppesan'); ?>"   required maxlength="18" minlength="10">
                            </div>
                        </div>	
                        <div class="row">
                            <div class="col-sm-12">
                               <!--  <strong>Email</strong><br>-->
                                <input type="hidden" class="form-control" name="emailpemesan"  placeholder="Email Pemesan"  value="<?php  echo set_value('emailpemesan'); ?>"   maxlength="50">
                            </div>
                        </div>	
                        <div class="row">
                            <div class="col-sm-12">
                                <strong>Kepala  Instansi <font class="penting">*</font></strong><br>
                                <input type="text" class="form-control" name="namapemakai"  placeholder="Contoh : Kepala BKPSDM"  value="<?php  echo set_value('namapemakai'); ?>"   required maxlength="250">
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
                              <!--   <strong>No. telepon pemakai	<font class="penting">*</font></strong><br>-->
                                <input type="hidden" class="form-control" name="hppakai"  placeholder="Nomor telepon pemakai"  value="<?php  echo set_value('hppakai'); ?>"   required>
                            </div>
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
                                <strong>Alamat <font class="penting">*</font></strong><br>
                                <textarea type="text" class="form-control" name="alamat"  placeholder="Alamat" required style="height: 80px;" maxlength="250"><?php  echo set_value('alamat'); ?></textarea>
                            </div>
                        </div>						
					</div>					
				</div>
				 <div class="col-sm-6">
                    <div class="form-group">
                        <div class="row">
                            <div class="col-sm-6">
                                <strong>Tanggal mulai<font class="penting">*</font></strong><br>
                                 <input type="date" min="<?php echo date('m-d-Y');?>" value="<?php if(set_value('tglpakai')!=''){ echo set_value('tglpakai') ;}?>" name="tglpakai"  class="form-control">
                            </div>
                            <div class="col-sm-6">
                                <strong>Tanggal selesai<font class="penting">*</font></strong><br>
                                 <input type="date" min="<?php echo date('m-d-Y');?>"  name="tglselesai"  value="<?php if(set_value('tglselesai')!=''){ echo set_value('tglselesai') ;}?>" class="form-control">
                            </div>						
                        </div>
                        <div class="row">
                            <div class="col-sm-12">
								<p class="help" style="font-size:12px; font-style: italic;margin-bottom:2%"><b>* Jika hanya 1 hari acara, maka tanggal mulai dan selesai sama</b></p>	
                            </div>
                        </div>													
                       <div class="row"  style="margin-top:33px" >
                            <div class="col-sm-12" >
                                <strong>Pilih Waktu <font class="penting">*</font></strong><br>
								<select class="form-control"  name="waktu" onchange="myFunction()" id="mySelect"   class="form-control" required>
								<option selected="selected" value="" >Pilih Waktu</option>
								<option  value="0" >Siang</option>
								<option  value="1" >Malam</option>
								<option  value="2" >Full Day</option>
								</select>					                                
                            </div>
                        </div>						
                        <div class="row">
                            <div class="col-sm-12">
                                <strong>Fasilitas </strong><br>
								 <!-- Button trigger modal -->
								<p id="demo"><button type="button" class="btn btn-sm btn-block btn-primary" data-toggle="modal" data-target="#exampleModal0" style="margin-bottom:12px;">Klik Fasilitas yang dipesan</button></p>
                            </div>
                        </div>	
                        <div class="row">
                            <div class="col-sm-12" style="margin-top:0%;">
                                <strong>Keperluan <font class="penting">*</font></strong><br>
                                <textarea type="text" class="form-control" name="keperluan"  placeholder="Keperluan" required style="height: 135px;" > <?php  echo set_value('keperluan'); ?> </textarea>
                            </div>
                        </div>						
					</div>					
				</div>		
				
				</div>
				<p style="font-style: italic;color:red;">Tanda bintang (*) wajib di isi</p>
				<!--</bagian kedua>-->						
            </div>
            <!--</center>-->
			<button type="submit" class="btn btn-sm btn-block btn-primary" name="button" value="button">Pesan Sekarang</button>        
		<?php }?>			
          </div>
      </div>
	  </div>
    </section><!-- End Contact Section -->
</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++;?>
			<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"><input type="number"  name="jumlah"  onkeyup="if(this.value > <?php echo $row->batasmax; ?>) this.value = null;"  class="form-control" value="<?php if($row->batasmax <=1) {  echo '1' ;}?>" <?php if($row->batasmax <=1) {  echo 'readonly' ;}?> style="text-align:center"></td>	
			  <td style="text-align:center"> 		  
			  <input type="checkbox" class="pilihsatu" name="pilihfasilitas[]"  value="<?php echo cetak($row->harga.'-'.$row->idfasilitas.'-'.$row->namafasilitas);?>">
			  </td>	
			</tr>
		  <?php }?>
		  <?php $no=0; foreach($fasilitas2->result() as $row2){ $no++;?>
			<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="form-control "     min="1"    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" name="pilihfasilitas_pil1siang" value="<?php echo cetak($row2->harga.'-'.$row2->idfasilitas);?>">
			  </td>	
			</tr>
		  <?php }?>		  		
			<tr>
			<td colspan="1">Total <input type="hidden" id="total" ><input type="hidden" id="total2"><input  type="hidden" id="field3"></td>
			<td colspan="3" style="text-align:right"><input type="text" id="grandtotal"  class="form-control"  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 kamar bisa pesan lebih dari satu </b></p>	</td>
			</tr>			
		  </tbody>
		</table>			
      <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm"  data-dismiss="modal">Selesai</button>
      </div>
    </div>
  </div>
</div>
<!-- Malam -->
<!-- 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++;?>
			<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"><input type="number"    name="jumlah[]"  onkeyup="if(this.value > <?php echo $row->batasmax; ?>) this.value = null;"  class="form-control" value="<?php if($row->batasmax <=1) {  echo '1' ;}?>" <?php if($row->batasmax <=1) {  echo 'readonly' ;}?> style="text-align:center"></td>	
			  <td style="text-align:center"> 		  
			  <input type="checkbox" class="pilihsatu_set" name="pilihfasilitas[]"  value="<?php echo cetak($row->harga.'-'.$row->idfasilitas.'-'.$row->namafasilitas);?>">
			  </td>	
			</tr>
		  <?php }?>
		  <?php $no=0; foreach($fasilitasmalam2->result() as $row2){ $no++;?>
			<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_set"  name="jumlah_pil1malam" class="form-control "    min="1"   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" name="pilihfasilitas_pil1malam" value="<?php echo cetak($row2->harga.'-'.$row2->idfasilitas);?>">
			  </td>	
			</tr>
		  <?php }?>		  		
			<tr>
			<td colspan="1">Total <input type="hidden" id="total_set" ><input type="hidden" id="total2_set"><input  type="hidden" id="field3_set"></td>
			<td colspan="3" style="text-align:right"><input type="text" id="grandtotal_set"  class="form-control"  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 kamar bisa pesan lebih dari satu </b></p>	</td>
			</tr>				
		  </tbody>
		</table>			
      <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm"  data-dismiss="modal">Selesai</button>
      </div>
    </div>
  </div>
</div>

<!-- SIANG MALAM -->
<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++;?>
			<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"><input type="number"    name="jumlah[]"  onkeyup="if(this.value > <?php echo $row->batasmax; ?>) this.value = null;"  class="form-control" value="<?php if($row->batasmax <=1) {  echo '1' ;}?>" <?php if($row->batasmax <=1) {  echo 'readonly' ;}?> style="text-align:center"></td>	
			  <td style="text-align:center"> 		  
			  <input type="checkbox" class="pilihsatu_set3" name="pilihfasilitas[]"  value="<?php echo cetak($row->harga.'-'.$row->idfasilitas.'-'.$row->namafasilitas);?>">
			  </td>	
			</tr>
		  <?php }?>
		  <?php $no=0; foreach($fasilitasmalam3->result() as $row2){ $no++;?>
			<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_set3"  name="jumlah_pil1malam3" class="form-control "    min="1"   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_set3" name="pilihfasilitas_pil1malam3" value="<?php echo cetak($row2->harga.'-'.$row2->idfasilitas);?>">
			  </td>	
			</tr>
		  <?php }?>		  		
			<tr>
			<td colspan="1">Total <input type="hidden" id="total_set3" ><input type="hidden" id="total2_set3"><input  type="hidden" id="field3_set3"></td>
			<td colspan="3" style="text-align:right"><input type="text" id="grandtotal_set3"  class="form-control"  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 kamar bisa pesan lebih dari satu </b></p>	</td>
			</tr>				
		  </tbody>
		</table>			
      <div class="modal-footer">
        <button type="button" class="btn btn-primary btn-sm"  data-dismiss="modal">Selesai</button>
      </div>
    </div>
  </div>
</div>


</main><!-- End #main -->
 <!-- Modal -->
<?php echo form_close(); ?>	
<script src="<?php echo base_url().'assets_v1'.'/';?>assets/js/jquery.min.js"></script>
<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');
		$("#grandtotal").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
});
$('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');
			$("#grandtotal").val('Rp ' + parseFloat(grandtotalok, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
	}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());			
	}
});
	$("input").on("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());
  });
  
  
  
 //malam 
$('input[class="pilihsatu_set"]').change(function (){
      var total = 0;
      $('input[class="pilihsatu_set"]:checked').each(function(){
       total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val());
      });   
      $("#total_set").val(total);
	var grandtotalok_set = (parseInt($("#total_set").val()  || '0') +parseInt($("#total2_set").val() || '0')+ parseInt($("#field3_set").val()  || '0')) -  parseInt($("#total2_set").val() || '0');
		$("#grandtotal_set").val('Rp ' + parseFloat(grandtotalok_set, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
});
$('input[class="pilihdua_set"]').change(function (){
	var total = 0;
	var kosong = $("#nilai1_set").val();	
	if(kosong==''){
		var n1 = 1;
		$("#nilai1_set").val(n1);
		var kosong =$("#nilai1_set").val(); 
		$('input[class="pilihdua_set"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2_set").val(total);
		var grandtotalok_set = (parseInt($("#total_set").val()  || '0') +parseInt($("#total2_set").val() || '0')+ parseInt($("#field3_set").val()  || '0')) -  parseInt($("#total2_set").val() || '0');
			$("#grandtotal_set").val('Rp ' + parseFloat(grandtotalok_set, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
	}else{
		$('input[class="pilihdua_set"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2_set").val(total);
		var grandtotalok_set = (parseInt($("#total_set").val()  || '0') +parseInt($("#total2_set").val() || '0')+ parseInt($("#field3_set").val()  || '0')) -  parseInt($("#total2_set").val() || '0');
			$("#grandtotal_set").val('Rp ' + parseFloat(grandtotalok_set, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
	}		
});
	$("input").on("change", function() {
	var nilai1_set = $('#nilai1_set').val();
	var ret = parseInt($("#nilai1_set").val() || '0') * parseInt($("#total2_set").val() || '0');
	$("#field3_set").val(ret);
	//var kosong = 0;
	var grandtotalok_set = (parseInt($("#total_set").val()  || '0') +parseInt($("#total2_set").val() || '0')+ parseInt($("#field3_set").val()  || '0')) -  parseInt($("#total2_set").val() || '0');
		$("#grandtotal_set").val('Rp ' + parseFloat(grandtotalok_set, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
  });
  
   //SIANGMALAM 
$('input[class="pilihsatu_set3"]').change(function (){
      var total = 0;
      $('input[class="pilihsatu_set3"]:checked').each(function(){
       total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val());
      });   
      $("#total_set3").val(total);
	var grandtotalok_set = (parseInt($("#total_set3").val()  || '0') +parseInt($("#total2_set3").val() || '0')+ parseInt($("#field3_set3").val()  || '0')) -  parseInt($("#total2_set").val() || '0');
		$("#grandtotal_set3").val('Rp ' + parseFloat(grandtotalok_set, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
});
$('input[class="pilihdua_set3"]').change(function (){
	var total = 0;
	var kosong = $("#nilai1").val();	
	if(kosong==''){
		var n1 = 1;
		$("#nilai1").val(n1);
		var kosong =$("#nilai1_set").val(); 
		$('input[class="pilihdua_set3"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2_set3").val(total);
		var grandtotalok_set = (parseInt($("#total_set3").val()  || '0') +parseInt($("#total2_set3").val() || '0')+ parseInt($("#field3_set3").val()  || '0')) -  parseInt($("#total2_set").val() || '0');
			$("#grandtotal_set3").val('Rp ' + parseFloat(grandtotalok_set, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
	}else{
		$('input[class="pilihdua_set3"]:checked').each(function(){
		total += isNaN(parseInt($(this).val())) ? 0 : parseInt($(this).val()   );
		});   
		$("#total2_set3").val(total);
		var grandtotalok_set = (parseInt($("#total_set3").val()  || '0') +parseInt($("#total2_set3").val() || '0')+ parseInt($("#field3_set3").val()  || '0')) -  parseInt($("#total2_set").val() || '0');
			$("#grandtotal_set3").val('Rp ' + parseFloat(grandtotalok_set, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
	}		
});
	$("input").on("change", function() {
	var nilai1_set3 = $('#nilai1_set3').val();
	var ret = parseInt($("#nilai1_set3").val() || '0') * parseInt($("#total2_set3").val() || '0');
	$("#field3_set3").val(ret);
	//var kosong = 0;
	var grandtotalok_set = (parseInt($("#total_set3").val()  || '0') +parseInt($("#total2_set3").val() || '0')+ parseInt($("#field3_set3").val()  || '0')) -  parseInt($("#total2_set3").val() || '0');
		$("#grandtotal_set3").val('Rp ' + parseFloat(grandtotalok_set, 10).toFixed(2).replace(/(\d)(?=(\d{3})+\.)/g, "$1,").toString());
  });
</script>
<script>
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> ';
   }
  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;">Klik Fasilitas yang dipesan</button> ';
   }   
   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;">Klik Fasilitas yang dipesan</button> ';
   }     
   if(x==""){
	  isi ='<button type="button" class="btn btn-sm btn-block btn-primary" data-toggle="modal" data-target="#exampleModal0" style="margin-bottom:12px;">Klik Fasilitas yang dipesan</button> ';
   }   
  document.getElementById("demo").innerHTML = isi;
}
</script>

<!-- Modal -->
<div class="modal fade" id="warningModal" tabindex="-1" aria-labelledby="modalLabel" aria-hidden="true">
  <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header bg-primary text-dark">
                <h5 class="modal-title text-white" id="modalLabel" >Pemberitahuan</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
<div class="modal-body text-center d-flex flex-column justify-content-center align-items-center">
    "Dengan hormat, kami informasikan bahwa Gedung Diklat Madiun <br />
    <b>tidak menyediakan layanan untuk acara Resepsi Pernikahan</b><br />
    Terima kasih atas perhatiannya"
</div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
            </div>
        </div>
    </div>
</div>

<script>
    $(document).ready(function(){
        $("#warningModal").modal('show'); // Menampilkan modal otomatis saat halaman dimuat
    });
</script>
