<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>resources/css/date-css.css" />
<?php
$option_tgl = array('1' => 'Sama Dengan', 
					'2' => 'Lebih Besar Dari', 
					'3' => 'Lebih Besar Sama Dengan', 
					'4' => 'Kurang Dari',
					'5' => 'Kurang Dari Sama Dengan',
					'6' => 'Antara'
					);
$option_text = array('1' => 'Sama Dengan', 
					'8' => 'Berisi'
					);

?>
<div class="centering" style="width:800px;margin-top: 1%;">
<div id='search_detil_banding' style="background:white;padding:5px;">
	<div class="detil" style="font-size:14px;margin-top:25px;width: 100%;margin: 0 auto;border-color: #FFFFFF;">
		<h3>PENCARIAN DETIL - REGISTER PERMOHONAN BANDING</h3>
		<form method="post" id="frm_search_detil" action="<?php echo base_url().'perkara_banding_list/search_detail/1/'.$enc; ?>">
		<table id="tableDetilPerkara">
			<col width="38%">
			<col width="25%">
			<col width="37%">
			<tbody>
				<tr>
					<td style="color:white;">Nomor Perkara</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style='width:99%'>
							<?php
								$js="id='no_perkara_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('no_perkara_select', $option_text, '8', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;"><input id='no_perkara' name='no_perkara' class="standard-input">
					</td>
				</tr>
				<tr>
					<td style="color:white;">Tanggal Putusan PN</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='tgl_putusan_pn_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('tgl_putusan_pn_select', $option_tgl, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px; color:black;">
					<input id="from_tgl_putusan_pn" name="from_tgl_putusan_pn" style="background:#fff;" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"> 
					<input id= "a_tgl_putusan_pn" class='antara tgl_putusan_pn_select' style="background:#fff;" value="s/d" disabled="true">
					<input id="to_tgl_putusan_pn" name="to_tgl_putusan_pn" style="background:#fff;" class="datepicker a_date tgl_putusan_pn_select" maxlength="10" placeholder="tgl/bln/tahun"></td>
				</tr>
				<tr>
					<td style="color:white;">Tanggal Permohonan</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='tgl_permohonan_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('tgl_permohonan_select', $option_tgl, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;">
					<input id="from_tgl_permohonan" style="background:#fff;" name="from_tgl_permohonan" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"> 
					<input id= "a_tgl_permohonan" class='antara tgl_permohonan_select' style="background:#fff;" value="s/d" disabled="true">
					<input id="to_tgl_permohonan" name="to_tgl_permohonan" style="background:#fff;" class="datepicker a_date tgl_permohonan_select" maxlength="10" placeholder="tgl/bln/tahun"></td>
				</tr>
				<tr>
					<td style="color:white;">Pemohon Banding</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='permohonan_banding' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('permohonan_banding_select', $option_text, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;"><input id='permohonan_banding' style="width:99%;background:#fff;" name='permohonan_banding' class="standard-input"></td>
				</tr>
				<tr>
					<td style="color:white;">Prodeo</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='status_prodeo' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('prodeo_select', $option_text, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<select name="status_prodeo" id="status_prodeo" onchange="" style="width:99%;background:#fff;" class="custom-dropdown__select custom-dropdown__select--white">
								<option value="-1"></option>
								<option value="1">Ya</option>
								<option value="0">Tidak</option>
							</select>
						</span>
					</td>
				</tr>
				<tr>
					<td style="color:white;">Tanggal Pengiriman Berkas Banding</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='tgl_pengiriman_berkas_banding_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('tgl_pengiriman_berkas_banding_select', $option_tgl, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;">
					<input id="from_tgl_pengiriman_berkas_banding" name="from_tgl_pengiriman_berkas_banding" style="background:#fff;" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"> 
					<input id= "a_tgl_pengiriman_berkas_banding" class='antara tgl_pengiriman_berkas_banding_select' style="background:#fff;" value="s/d" disabled="true">
					<input id="to_tgl_pengiriman_berkas_banding" name="to_tgl_pengiriman_berkas_banding" style="background:#fff;" class="datepicker a_date tgl_pengiriman_berkas_banding_select" maxlength="10" placeholder="tgl/bln/tahun"></td>
				</tr>
				<tr>
					<td style="color:white;">Tanggal Penerimaan Kembali Berkas Banding</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='tgl_penerimaan_berkas_banding_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('tgl_penerimaan_berkas_banding_select', $option_tgl, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;">
					<input id="from_tgl_penerimaan_berkas_banding" name="from_tgl_penerimaan_berkas_banding" style="background:#fff;" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"> 
					<input id= "a_tgl_penerimaan_berkas_banding" class='antara tgl_penerimaan_berkas_banding_select' style="background:#fff;" value="s/d" disabled="true">
					<input id="to_tgl_penerimaan_berkas_banding" name="to_tgl_penerimaan_berkas_banding" style="background:#fff;" class="datepicker a_date tgl_penerimaan_berkas_banding_select" maxlength="10" placeholder="tgl/bln/tahun"></td>
				</tr>
				<tr>
					<td style="color:white;">Tanggal Putusan Banding</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='tgl_putusan_banding_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('tgl_putusan_banding_select', $option_tgl, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;">
					<input id="from_tgl_putusan_banding" name="from_tgl_putusan_banding" style="background:#fff;" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"> 
					<input id= "a_tgl_putusan_banding" class='antara tgl_putusan_banding_select' style="background:#fff;" value="s/d" disabled="true">
					<input id="to_tgl_putusan_banding" name="to_tgl_putusan_banding" style="background:#fff;" class="datepicker a_date tgl_putusan_banding_select" maxlength="10" placeholder="tgl/bln/tahun"></td>
				</tr>
				<tr>
					<td style="color:white;">Nomor Putusan Banding</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='nomor_putusan_banding_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('nomor_putusan_banding_select', $option_text, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;"><input id='nomor_putusan_banding' name='nomor_putusan_banding' style="background:#fff; width:99%;" class="standard-input"></td>
				</tr>
				<tr>
					<td style="color:white;">Tanggal Pengarsipan Banding</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='tgl_pengarsipan_banding_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('tgl_pengarsipan_banding_select', $option_tgl, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;">
					<input id="from_tgl_pengarsipan_banding" name="from_tgl_pengarsipan_banding" style="background:#fff;" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"> 
					<input id= "a_tgl_pengarsipan_banding" class='antara tgl_pengarsipan_banding_select' style="background:#fff;" value="s/d" disabled="true">
					<input id="to_tgl_pengarsipan_banding" name="to_tgl_pengarsipan_banding" style="background:#fff;" class="datepicker a_date tgl_pengarsipan_banding_select" maxlength="10" placeholder="tgl/bln/tahun"></td>
				</tr>
				<tr>
					<td style="color:white;">Tanggal Pemberitahuan Putusan Banding Kepada Pembanding</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='tgl_pemberitahuan_pembanding_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('tgl_pemberitahuan_pembanding_select', $option_tgl, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;">
					<input id="from_tgl_pemberitahuan_pembanding" style="background:#fff;" name="from_tgl_pemberitahuan_pembanding" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"> 
					<input id= "a_tgl_pemberitahuan_pembanding" style="background:#fff;" class='antara tgl_pemberitahuan_pembanding_select' value="s/d" disabled="true">
					<input id="to_tgl_pemberitahuan_pembanding" style="background:#fff;" name="to_tgl_pemberitahuan_pembanding" class="datepicker a_date tgl_pemberitahuan_pembanding_select" maxlength="10" placeholder="tgl/bln/tahun"></td>
				</tr>
				<tr>
					<td style="color:white;">Tanggal Pemberitahuan Putusan Banding Kepada Terbanding</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald" style="width:99%;">
							<?php
								$js="id='tgl_pemberitahuan_terbanding_select' class='custom-dropdown__select custom-dropdown__select--white' style='width:99%;' ";
								echo form_dropdown('tgl_pemberitahuan_terbanding_select', $option_tgl, '1', $js);
							?>
						</span>
					</td>
					<td style="padding:0px;padding-left:5px;">
					<input id="from_tgl_pemberitahuan_terbanding" style="background:#fff;" name="from_tgl_pemberitahuan_terbanding" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun"> 
					<input id= "a_tgl_pemberitahuan_terbanding" style="background:#fff;" class='antara tgl_pemberitahuan_terbanding_select' value="s/d" disabled="true">
					<input id="to_tgl_pemberitahuan_terbanding" style="background:#fff;" name="to_tgl_pemberitahuan_terbanding" class="datepicker a_date tgl_pemberitahuan_terbanding_select" maxlength="10" placeholder="tgl/bln/tahun"></td>
				</tr>
				<tr style="color:white;">
					<td>Cabut Permohonan Banding</td>
					<td style="padding:0px;padding-left:5px;color:black;">Sama Dengan</td>
					<td style="padding:0px;padding-left:5px;">
					<input class="checkbox_status" id="status_cabut" type="checkbox" name="status_cabut"><font color="black">Ya</font>
					</td>
				</tr>
				<tr>
					<td style="color:white;">Status Banding</td>
					<td style="padding:0px;padding-left:5px;color:black;">Sama Dengan</td>
					<td style="padding:0px;padding-left:5px;">
						<span class="custom-dropdown custom-dropdown--emerald"  style="border:1px #ddd solid;  width:350px;">
				        <select style="width:350px;" name="status_banding" id="status_banding" class="custom-dropdown__select custom-dropdown__select--white">
				        	<option value="-1"></option>
					       	<?php
				        	if($proses_perkara->num_rows>0){
								foreach ($proses_perkara->result() as $row) {
									echo '<option value="'.base64_encode($this->encrypt->encode($row->proses_id)).'">
									'.$row->proses_nama.'</option>';
								}
							}
							?>
							</select>
						</span>
					</td>
				</tr>
				<input type="hidden" value="<?php echo $enc;?>" name ="enc" id ="enc" class='btn'>
				<tr>
					<td colspan="3" style="background:white;" align="center">
						<input type="button" onClick='clearAll()' value="Bersihkan" class="btn"></input>
						<input type="submit" value="Cari" class="btn"></input>
						<input type="button" id='close_form_search_detail' value="Kembali" class="btn">
					</td>
				</tr>
			</tbody>
		</table>
	</form>
	</div>
</div>

<script type="text/javascript">
	$('#close_form_search_detail').closingFormWin();

    $( function() {
        $('#from_tgl_putusan_pn').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
        $('#to_tgl_putusan_pn').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });


    $( function() {
        $('#from_tgl_permohonan').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
        $('#to_tgl_permohonan').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });

    $( function() {
        $('#from_tgl_pengiriman_berkas_banding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
        $('#to_tgl_pengiriman_berkas_banding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });

    $( function() {
        $('#from_tgl_penerimaan_berkas_banding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
        $('#to_tgl_penerimaan_berkas_banding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });

    $( function() {
        $('#from_tgl_putusan_banding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
        $('#to_tgl_putusan_banding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });

    $( function() {
        $('#from_tgl_pengarsipan_banding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
        $('#to_tgl_pengarsipan_banding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });


    $( function() {
        $('#from_tgl_pemberitahuan_pembanding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
        $('#to_tgl_pemberitahuan_pembanding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });

    $( function() {
        $('#from_tgl_pemberitahuan_terbanding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
        $('#to_tgl_pemberitahuan_terbanding').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });

$('.datepicker').keyup(function(e){
	if( (e.keyCode<8 || e.keyCode>57)){
		return;
	}

    if(e.keyCode != '8'){
    	if(e.target.value.length == 1){
    		if(e.target.value>3){
    			alert('Input Tidak Benar Format, Tanggal tidak boleh lebih dari 30')
    			e.target.value = '';
    		}
    	}

    	if(e.target.value.length == 4 && e.keyCode!='13'){
    		if(e.keyCode!=49 && e.keyCode!=48){
    			alert('Input Tidak Benar Format, Bulan Tidak Boleh dari 12')
    			var val = e.target.value;
    			val = val.substring(0, val.length - 1);
    			e.target.value = val;
    		}
    	}

    	if(e.target.value.length == 5){
    		var val = e.target.value;
    		var bln = val.substr(val.length -2);
    		if(bln>12){
    			alert('Input Tidak Benar Format, Bulan Tidak Boleh dari 12')
    			val = val.substring(0, val.length - 1);
    			e.target.value = val;
    		}
    	}
    	if(e.target.value.length == 7 && e.keyCode!='13'){
    		if( e.keyCode>50 && e.keyCode!=48){
    			alert('Anda Yakin dengan Tahun yang anda masukan?')
    			var val = e.target.value;
    			val = val.substring(0, val.length - 1);
    			e.target.value = val;
    		}
    	}
    	if(e.target.value.length == 10){
			if(isDateValid(e.target.value)==false){
				var val = e.target.value;
    			val = val.substring(0, val.length - 1);
    			e.target.value = val;
			}
		}
        if (e.target.value.length == 2) e.target.value = e.target.value + "/";
        if (e.target.value.length == 5) e.target.value = e.target.value + "/";
    }
})

$('.antara').hide()
$('.a_date').hide()

$(this).change(function(e) {
    var val = $('#'+e.target.id).val()
    if(val==6){
    	$('.'+e.target.id).show();
    }else{
    	$('.'+e.target.id).hide();
    }

    if(e.target.id=='id_tahapan'){
    	var tahapan_id = $('#id_tahapan').val()
    	$('.pros').show();
    	$('.pros').not('#'+tahapan_id).hide();
    }
    if(e.target.id=='id_alur_perkara'){
    	var enc = $('#id_alur_perkara').val()
    	if(enc!=-1){
    		window.open('<?php echo base_url();?>search/'+enc,'_self')
    	}
    	
    }
});

function clearAll(){
	$('#search_detil_banding :input').not('.btn').val('');
}

$(document).ready(function() {
  $(window).keydown(function(event){
    if(event.keyCode == 13) {
      event.preventDefault();
      return false;
    }
  });
});
	
</script>