<link href="<?php echo $base?>plugins/daterangepicker/daterangepicker-bs3.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $base?>plugins/iCheck/all.css" rel="stylesheet" type="text/css" />
<link href="<?php echo $base?>plugins/timepicker/bootstrap-timepicker.min.css" rel="stylesheet"/>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.date.extensions.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/input-mask/jquery.inputmask.extensions.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/daterangepicker/daterangepicker.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/timepicker/bootstrap-timepicker.min.js" type="text/javascript"></script>
<script src="<?php echo $base?>plugins/iCheck/icheck.min.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $base?>plugins/autocomplete/shieldui-all.css" />
<link href="<?php echo $base?>bootstrap/css/bootstrap-datetimepicker.min.css" rel="stylesheet" media="screen">
<script type="text/javascript" src="<?php echo $base?>bootstrap/js/bootstrap-datetimepicker.js" charset="UTF-8"></script>
<script type="text/javascript" src="<?php echo $base?>bootstrap/js/locales/bootstrap-datetimepicker.id.js" charset="UTF-8"></script>
<script type="text/javascript" src="<?php echo $base?>plugins/autocomplete/shieldui-all.min.js"></script>
<script type="text/javascript">
  $(document).ready(function(){
	var base = <?php echo json_encode($base);?>;
	
	$("#example1").dataTable();
	
	$('.context').click(function(e){
		var kode = $(this).attr('id');
		$('#kodekunci').val(kode);
   		$("#menuklik").modal('show');
	});
	
	/*$('.context').bind('contextmenu', function(e){
		e.preventDefault();
    	var kode = $(this).attr('id');
		$('#kodekunci').val(kode);
   		$("#menuklik").modal('show');
	});*/
	
	$('#editdata').click(function(){
		var kode = $('#kodekunci').val();
		window.location=''+base+'edit-dosen/'+ kode +'';
	});
	
	$('#nonaktif').click(function(){
		var kode = $('#kodekunci').val();
		if (confirm("Anda yakin me-nonaktifkan data dengan kode " + kode+"?")){
			window.location=''+base+'query-delete-dosen/'+ kode +'';	
		}
	});
	
	$('#newdata').click(function(){
		window.location=''+base+'add-dosen';
	});

  });
   
</script>
<script type="text/javascript">
 function hourChange(selectObj) {
   var selectIndex=selectObj.selectedIndex;
   var selectValue=selectObj.options[selectIndex].text;
   
	var idjadwal = $("#idjadwal").val();
	   
   if (selectIndex == 0){
		$('#penumpang').show();
		$('#kendaraan').hide();
		var e = document.getElementById("cbpenumpang");
		var str = e.options[e.selectedIndex].text;
		var idangkutan = e.selectedIndex;
            $.ajax({
                type: "get",
                url: "data-jadwal-proses.php?actget=4&idjadwal="+ idjadwal +"&idangkutan="+ idangkutan,
                data: "id="+idjadwal,
                success: function(data){
					        
					var jdata = jQuery.parseJSON(data);
					alert(jdata.harga);	
					$('#total').val(jdata.harga);				
					
                },
                error: function(){
                    alert("failure");
                }
            });
   } else if (selectIndex == 1){
	   document.getElementById("cbkendaraan").selectedIndex = "0";
		$('#penumpang').hide();
		$('#kendaraan').show();
		var e = document.getElementById("cbkendaraan");
		var str = e.options[e.selectedIndex].text;
		var idangkutan = e.selectedIndex;
            $.ajax({
                type: "get",
                url: "data-jadwal-proses.php?actget=4&idjadwal="+ idjadwal +"&idangkutan="+ idangkutan,
                data: "id="+idjadwal,
                success: function(data){
					        
					var jdata = jQuery.parseJSON(data);	
					alert(jdata.harga);	
					$('#total').val(jdata.harga);				
                },
                error: function(){
                    alert("failure");
                }
            });
   }	
 }
</script>
<aside class="right-side">                
                <section class="content-header">
                    <h1>
                        Pemesanan Tiket
                    </h1>
                    <ol class="breadcrumb">
                        <li><a href="home"><i class="fa fa-dashboard"></i> Home</a></li>
                        <li><a href="#">Tiket</a></li>
                        <li class="active">Transaksi Pemesanan Tiket</li>
                    </ol>
                </section>

                <!-- Main content -->
                <section class="content">
                    <div class="row">
                        <div class="col-xs-12">
                            <div class="box">
                                <div class="box-header">
                                </div><!-- /.box-header -->
                               <?php
						$id_jadwal = $_POST['id_jadwal'];
						$nama = $_POST['nama'];
						$no_identitas = $_POST['no_identitas'];
						$jenisangkutan = $_POST['jenisangkutan'];
						$penumpang = $_POST['penumpang'];
						$kendaraan = $_POST['kendaraan'];
							if($jenisangkutan == 1){
								$id_angkutan = $penumpang;	
							}else{
								$id_angkutan = $kendaraan;	
							}
							$harga = 30000;
									
									?>
                                    
                                    <h3>Nama Penumpang : <?php echo $nama?></h3>
                                    <h3>No. Identitas : <?php echo $no_identitas?></h3>
                                    
                                    <input style="height:40px" type="text" class="col-sm-7" onkeyup="document.getElementById('kembali').value=this.value -<?php echo $harga?>" placeholder = "0">
                                    <input style="height:40px" type="text" class="col-sm-1" value="KEMBALI" disabled="disabled">
                                    <input style="height:40px" type="text" class="col-sm-4" id="kembali" value="0" disabled="disabled">
        <div class="box-body">
        	<div class="col-sm-8">
                <form class="form-horizontal" role="form" method="POST" enctype="multipart/form-data" action="<?php echo $base?>pemesanan-tiket-proses">
                    <input type="hidden" name="id_jadwal" value="<?php echo $id_jadwal?>">
                    <input type="hidden" name="nama" value="<?php echo $nama?>">
                    <input type="hidden" name="no_identitas" value="<?php echo $no_identitas?>">
                    <input type="hidden" name="jenisangkutan" value="<?php echo $jenisangkutan?>">
                    <input type="hidden" name="id_angkutan" value="<?php echo $id_angkutan?>">
                    <div class="modal-footer">
                        <div class="form-group">  
                            <label class="col-sm-2" for="aksi"></label>      
                                <div class="col-sm-10">
                                	<button class="btn btn-warning" style="width:80px"><i class='fa fa-level-up'></i> Batal</button>
                                    <button type="submit" class="btn btn-success" style="width:80px"><i class='glyphicon glyphicon-ok'></i> Cetak</button>
                                </div>
                        </div>
                    </div>
                </form>
                </div>
          </div><!-- /.box-body -->
      </div><!-- /.box -->
    </div><!-- /.col -->
  </div><!-- /.row -->
  
