        <link rel="stylesheet" href="Highcharts/nesw2/images/style.css" type="text/css">
	    <link type="text/css" href="css/jquery-ui-1.8.6.custom.css" rel="stylesheet" />	
		<script type="text/javascript" src="js/jquery.js"></script>
		<script type="text/javascript" src="js/jquery.min.js"></script>

		<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
		<script type="text/javascript" src="js/jquery-ui-1.8.6.custom.min.js"></script>
		<script type="text/javascript">
		jQuery(function($){
		$.datepicker.regional['vi'] = {
			closeText: 'Tutup',
			prevText: 'Sebelum',
			nextText: 'Sesudah',
			currentText: 'Sekarang',
			monthNames: ['Januari', 'Februari', 'Maret', 'April', 'Mei', 'Juni',
			'Juli', 'Agustus', 'September', 'Oktober', 'November', 'Desember'],
			monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mei', 'Jun',
			'Jul', 'Ags', 'Sep', 'Okt', 'Nov', 'Des'],
			dayNames: ['Minggu', 'Senin', 'Selasa', 'Rabu', 'Kamis', 'Jum&acute;at', 'Sabtu'],
			dayNamesShort: ['Min', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sbt'],
			dayNamesMin: ['Mg', 'Sn', 'Sl', 'Rb', 'Km', 'Jm', 'Sb' ],
			dateFormat: 'yy-mm-dd',
			firstDay: 0,
			isRTL: false,
			showMonthAfterYear: false,
			changeMonth: true,
			changeYear: true,
			yearSuffix: ''};
		$.datepicker.setDefaults($.datepicker.regional['vi']);
	  	$(function(){
				$('#tgl_monev').datepicker({
					inline: true
				});
	    });
		$(function(){
				$('#tglf').datepicker({
					inline: true
				});
	    });
       });
</script>
<script type="text/javascript">
var htmlobjek;
$(document).ready(function(){
  //apabila terjadi event onchange terhadap object <select id=propinsi>
  $("#ibbws").change(function(){
    var ibbws = $("#ibbws").val();
    	$.ajax({
        	url: "data/masterlokasiDebit.php",
        	data: "ibbws="+ibbws,
        	cache: false,
        	success: function(msg){$("#id_lokasi").html(msg);}
    	});
	});
});

$(document).ready(function(){
  //apabila terjadi event onchange terhadap object <select id=propinsi>
  $("#id_lokasi").change(function(){
    var id_lokasi = $("#id_lokasi").val();
    	$.ajax({
        	url: "data/cekupdatedatatma.php",
        	data: "id_lokasi="+id_lokasi,
        	cache: false,
        	success: function(msg){$("#updatedateTMA").html(msg);}
    	});
	});
});


</script>
<?php
session_start();
include "../config/conn.php";
//if($_GET['v']=="cu"){

  if($_GET['id_debit']!="undefined") {
 	$sql_monev="SELECT * FROM m_debit WHERE id_debit='".$_GET['id_debit']."'";	
  	$query_monev=mysql_query($sql_monev);
	$redit_detail=mysql_fetch_array($query_monev);
  }

  $sql_bbws="SELECT * FROM m_bbws WHERE 1=1 AND id_bbws=".$_SESSION['id_bbws']." ";
  $query_bbws=mysql_query($sql_bbws);

  $sql_lokasi="SELECT * FROM m_lokasi WHERE 1=1 ";
  if($redit_detail['id_lokasi']!="") {
	  $sql_lokasi.=" AND id_bbws=".$redit_detail['id_bbws']."";
	}	 
  $sql_lokasi.=" ORDER BY nama_lokasi ASC ";
	$query_lokasi=mysql_query($sql_lokasi);

//}
?>
<form id="upload_form" enctype="multipart/form-data" method="post">
<input type="hidden" id="id_debit" name="id_debit" value="<?php echo $redit_detail['id_debit'];?>" />
<!--strong><em>Form Input Lokasi</em></strong-->
<div class="row">
<table width="100%" border="0" cellpadding="3" cellspacing="3">
  <tr>
    <td valign="top"><strong>Tahun Debit</strong></td>
    <td width="15%" valign="top">:
    <select id="tahun" name="tahun" class="form-control">
        <option value="">-Pilih-</option>
        <option value="2014" <?php if ($redit_detail['tahun_debit']=="2014") { echo 'selected="selected"';} ?>>2014</option>
        <option value="2015" <?php if ($redit_detail['tahun_debit']=="2015") { echo 'selected="selected"';} ?>>2015</option>
        <option value="2016" <?php if ($redit_detail['tahun_debit']=="2016") { echo 'selected="selected"';} ?>>2016</option>
        <option value="2017" <?php if ($redit_detail['tahun_debit']=="2017") { echo 'selected="selected"';} ?>>2017</option>
        <option value="2018" <?php if ($redit_detail['tahun_debit']=="2018") { echo 'selected="selected"';} ?>>2018</option>
        <option value="2019" <?php if ($redit_detail['tahun_debit']=="2019") { echo 'selected="selected"';} ?>>2019</option>
        <option value="2020" <?php if ($redit_detail['tahun_debit']=="2020") { echo 'selected="selected"';} ?>>2020</option>
    </select>
      </td>
    <td width="28%" valign="top">&nbsp;</td>
    <td width="14%" valign="top">&nbsp;</td>
    <td width="26%" valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td valign="top"><strong>BBWS</strong></td>
    <td valign="top">:      
      <select id="ibbws" name="ibbws">
        <option value="">-Pilih BBWS-</option>
        <?php 
	while($rt=mysql_fetch_array($query_bbws)){
	?>
        <option value="<?php echo $rt['id_bbws']; ?>" <?php if ($redit_detail['id_bbws']==$rt['id_bbws']) { echo 'selected="selected"';} ?>> <?php echo $rt['nama_bbws']; ?></option>
        <?php } ?>
      </select>
</td>
    <td valign="top">&nbsp;</td>
    <td valign="top">&nbsp;</td>
    <td valign="top">&nbsp;</td>
  </tr>
  <tr>
    <td width="17%" valign="top"><strong>Nama Lokasi</strong></td>
    <td colspan="4" valign="top">:
      <select id="id_lokasi" name="id_lokasi">
        <option value="">-Pilih Lokasi-</option>
        <?php 
	while($rl=mysql_fetch_array($query_lokasi)){
	?>
        <option value="<?php echo $rl['id_lokasi']; ?>" <?php if ($redit_detail['id_lokasi']==$rl['id_lokasi']) { echo 'selected="selected"';} ?>> <?php echo $rl['nama_lokasi']; ?></option>
        <?php } ?>
        </select> <div id="updatedateTMA"></div></td>
    </tr>
  <tr>
    <td valign="top" colspan="2"><strong><em>NILAI CURVE</em></strong></td>
</td>
  <tr>
    <td valign="top"><strong>Nilai Curve A</strong></td>
    <td valign="top">:
      <input type="text" id="nilai_a" name="nilai_a" value="<?php echo $redit_detail['nilai_a'];?>" class="form-control" />
      </td>
    </tr>
  <tr>
    <td valign="top"><strong>Nilai Curve B</strong></td>
    <td valign="top">:
      <input type="text" id="nilai_b" name="nilai_b" value="<?php echo $redit_detail['nilai_b'];?>" class="form-control" />
      </td>
    </tr>
  <tr>
    <td valign="top"><strong>Nilai Curve C</strong></td>
    <td valign="top">:
      <input type="text" id="nilai_c" name="nilai_c" value="<?php echo $redit_detail['nilai_c'];?>" class="form-control" />
      </td>
    </tr>
  <tr>
    <td valign="top">&nbsp;</td>
    <td align="right" valign="top"></td>
    <td valign="top">&nbsp;</td>
    <td valign="top">&nbsp;</td>
    <td align="left" valign="top"><input type="submit" id="batal" name="batal" class="batal" value="Batal" />
      <input type="submit" id="simpan" name="simpan" class="simpan" value="Simpan" /></td>
  </tr>
</table>
<br />
</div>
<br />
<div class="modal-footer" align="right"></div>
</form>