<div style="padding:10px;"></div>
<div class="detil" style="padding: 4px;font-size:14px;margin-top:25px;width: 35%;margin: 0 auto;border-color: #FFFFFF;">
    <form id="frm_putusan" style="padding: 4px;background:white;margin:0;" method="post" action="<?php echo base_url().'savepertimbangan';?>">
		<table id="tableDetilPerkara" style="font-size:14px;">
			<col width="40%">
			<col width="60%">
			<tbody>
			<?php
				if($this->session->userdata('jenis_pengadilan')==2){
					$tpj="Tanggal Pendapat Oditur";
					$ipj="Isi Pendapat Oditur";
				}else{
					$tpj="Tanggal Pendapat Jaksa";
					$ipj="Isi Pendapat Jaksa";
					 }
			?>		
				<tr id="tr_pihak">
					<td colspan="2" class="divider">Edit - Pemeriksaan Peninjauan Kembali Dalam Hal Bukti Baru (Novum)</td>
					<input type="hidden" id="curr_date" value="<?php echo date('d/mY');?>">
				</tr>
				<tr>
					<td>Nomor Perkara</td>
					<td style="padding:0px;padding-left:5px;"><?php echo (!empty($noperkarapn) ? $noperkarapn : '');?></td>
				</tr>
				<tr>
					<td>Tanggal Permohonan</td>
					<td style="padding:0px;padding-left:5px;"><?php echo (!empty($tglpermohonan) ? $tglpermohonan : '');?></td>
				</tr>
				<tr id="tr_pihak">
					<input type="hidden" id="date_put" value="<?php echo (!empty($tglputusan))? $tglputusan:'';?>">
					<input type="hidden" id="enc" name="enc" value="<?php echo (!empty($idperkara))? $idperkara:'';?>">
					<input type="hidden" id="enc_alur" name="enc_alur" value="<?php echo (!empty($alur_perkara_id))? $alur_perkara_id:'';?>">
				</tr>
				<tr>
                    <td>Tanggal Penetapan Majelis<font color="red">*</font></td>
                    <td>
                        <input id="tgl_pen_majelis" name="tgl_pen_majelis" value="<?php echo $this->tanggalhelper->convertToInputDate($penetapan_majelis_hakim);?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
                    </td>
                </tr>
                <tr>
                    <td>Majelis Hakim/Hakim<font color="red">*</font></td>
                    <td>
                        <span class="custom-dropdown custom-dropdown--emerald" style='width:200px;'>
                            <select style="width:200px" name="majelis_hakim" id="majelis_hakim" class="custom-dropdown__select custom-dropdown__select--white">                                                                                                 
                                <option value="1">Majelis Hakim</option>
                                <option value="2" <?php echo (empty($idAnggota1)) ? 'selected' : '';?>>Hakim Tunggal</option>                                
                            </select>
                        </span>
                    </td>
                </tr>
                <tr>
                    <td><span>Hakim Ketua<font color="red">*</font></span></td>
                    <td>
                        <span class="custom-dropdown custom-dropdown--emerald" style='width:200px;'>
                            <select style="width:200px" name="h_ketua" id="h_ketua" class="custom-dropdown__select custom-dropdown__select--white">                                                                                                  
                                <option value="">Pilih Hakim Ketua</option>
                                <?php
                                if($listHakimPN->num_rows()>0){
                                    foreach ($listHakimPN->result() as $row) {
                                        $id = base64_encode($this->encrypt->encode($row->id));
                                        $select = ($idketua==$row->id)? 'selected':'';
                                        echo '<option value="'.$id.'" '.$select.'>'.$row->nama_gelar.'</option>';
                                    }
                                }
                                ?>
                            </select>
                        </span>
                    </td>
                </tr>
                <tr class='tr_new_pen' hidden>
                    <td><span>Hakim Anggota I<font color="red">*</font></span></td>
                    <td>
                        <span class="custom-dropdown custom-dropdown--emerald" style='width:200px;'>
                            <select style="width:200px" name="h_anggota1" id="h_anggota1" class="custom-dropdown__select custom-dropdown__select--white">                                                                                                  
                                <option value="">Pilih Hakim Anggota I</option>
                                <?php
                                if($listHakimPN->num_rows()>0){
                                    foreach ($listHakimPN->result() as $row) {
                                        $id = base64_encode($this->encrypt->encode($row->id));
                                        $select = ($idAnggota1==$row->id)? 'selected':'';
                                        echo '<option value="'.$id.'" '.$select.'>'.$row->nama_gelar.'</option>';
                                    }
                                }
                                ?>
                            </select>
                        </span>
                    </td>
                </tr>
                <tr class='tr_new_pen' hidden>
                    <td><span>Hakim Anggota II<font color="red">*</font></span></td>
                    <td>
                        <span class="custom-dropdown custom-dropdown--emerald" style='width:200px;'>
                            <select style="width:200px" name="h_anggota2" id="h_anggota2" class="custom-dropdown__select custom-dropdown__select--white">                                                                                                  
                                <option value="">Pilih Hakim Anggota II</option>
                                <?php
                                if($listHakimPN->num_rows()>0){
                                    foreach ($listHakimPN->result() as $row) {
                                        $id = base64_encode($this->encrypt->encode($row->id));
                                        $select = ($idAnggota2==$row->id)? 'selected':'';
                                        echo '<option value="'.$id.'" '.$select.'>'.$row->nama_gelar.'</option>';
                                    }
                                }
                                ?>
                            </select>
                        </span>
                    </td>
                </tr>
				<tr>
					<td>Tanggal Penetapan Pemeriksaan PK<font color="red">*</font></td>
					<td style="padding:0px;padding-left:5px;">
						<input id="tanggal_pen" name="tanggal_pen" value="<?php echo (!empty($tgl_penetapan) ? $tgl_penetapan : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
					</td>
				</tr>
				<tr>
					<td>Tanggal Pemeriksaan PK<font color="red">*</font></td>
					<td style="padding:0px;padding-left:5px;">
						<input id="tanggal_pem" name="tanggal_pem" value="<?php echo (!empty($tgl_pemeriksaan) ? $tgl_pemeriksaan : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
					</td>
				</tr>		  	
			<?php
				if($alurPerkaraId<100){
			?>
				<tr>
					<td>Tanggal Penyumpahan<font color="red">*</font></td>
					<td style="padding:0px;padding-left:5px;">
						<input id="tanggal_sumpah" name="tanggal_sumpah" value="<?php echo (!empty($tgl_sumpah) ? $tgl_sumpah : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
					</td>
				</tr>
			<?php } ?>
				<tr>
					<td colspan="2" style="background:white;" align="center">
						<input type="button" value="Kembali" id="kembali" class="btn">
						<input type="submit" id="simpan" value="Simpan" class="btn">
					</td>
				</tr>
			</tbody>
		</table>
	</form>
</div>
<div style="padding:5px;"></div>
<script type="text/javascript">
var majelis = '<?php echo $idAnggota1; ?>';
if(majelis>0){
    $(".tr_new_pen").show();    
}
$("#majelis_hakim").change(function() {
    var e=$("#majelis_hakim").val()
    if (e=='1'){
        $(".tr_new_pen").show();
    }else if (e=='2'){
        $(".tr_new_pen").hide()
    }
});

$('#kembali').closingFormWin();
$('#frm_putusan').SubmitHandling({
	refresh:'1',
	setRefresh:1,
	divRef:'#konten',
	clicked:1,
	btnClicked:'.close_form',
	whenStatus:1,	
});
$( document ).ready(function() {
	$('.datepicker').ValidateDateInput();
    $( function() {
        $('#tanggal_pen').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay: $.datepicker.noWeekends,
            onSelect: function(dateText, inst) {
            	var date = $(this).datepicker('getDate');
            	var dayOfWeek = weekday[date.getDay()];
            	var error = 0;
            	var message ='';
            	if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
            		message ='Tidak Dapat Memilih diluar Hari Kerja.';
            		message_error_show_parent(message);
            		return;
            	}
				
				var tmp = $(this).val().split("/");
				var tmp2 = $('#curr_date').val().split("/");
				if((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() > new Date(tmp2[2]+"-"+tmp2[1]+"-"+tmp2[0]+"T00:00:00").getTime())){
					message = 'Tidak Dapat Memilih Melebihi Hari ini. Sekarang Tanggal '+$('#curr_date').val();
					message_error_show_parent(message);
					$(this).css("background-color", "red");
				}else{
					$(this).css("background-color", "#dedbdb");
				}
			}
        });
		$('#tanggal_pem').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay: $.datepicker.noWeekends,
            onSelect: function(dateText, inst) {
            	var date = $(this).datepicker('getDate');
            	var dayOfWeek = weekday[date.getDay()];
            	var error = 0;
            	var message ='';
            	if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
            		message ='Tidak Dapat Memilih diluar Hari Kerja.';
            		message_error_show_parent(message);
            		return;
            	}
				
				var tmp = $(this).val().split("/");
				var tmp2 = $('#curr_date').val().split("/");
				if((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() > new Date(tmp2[2]+"-"+tmp2[1]+"-"+tmp2[0]+"T00:00:00").getTime())){
					message = 'Tidak Dapat Memilih Melebihi Hari ini. Sekarang Tanggal '+$('#curr_date').val();
					message_error_show_parent(message);
					$(this).css("background-color", "red");
				}else{
					$(this).css("background-color", "#dedbdb");
				}
			}
        });
		$('#tanggal_jaksa').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay: $.datepicker.noWeekends,
            onSelect: function(dateText, inst) {
            	var date = $(this).datepicker('getDate');
            	var dayOfWeek = weekday[date.getDay()];
            	var error = 0;
            	var message ='';
            	if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
            		message ='Tidak Dapat Memilih diluar Hari Kerja.';
            		message_error_show_parent(message);
            		return;
            	}
				
				var tmp = $(this).val().split("/");
				var tmp2 = $('#curr_date').val().split("/");
				if((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() > new Date(tmp2[2]+"-"+tmp2[1]+"-"+tmp2[0]+"T00:00:00").getTime())){
					message = 'Tidak Dapat Memilih Melebihi Hari ini. Sekarang Tanggal '+$('#curr_date').val();
					message_error_show_parent(message);
					$(this).css("background-color", "red");
				}else{
					$(this).css("background-color", "#dedbdb");
				}
			}
        });
		$('#tanggal_hakim').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay: $.datepicker.noWeekends,
            onSelect: function(dateText, inst) {
            	var date = $(this).datepicker('getDate');
            	var dayOfWeek = weekday[date.getDay()];
            	var error = 0;
            	var message ='';
            	if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
            		message ='Tidak Dapat Memilih diluar Hari Kerja.';
            		message_error_show_parent(message);
            		return;
            	}
				
				var tmp = $(this).val().split("/");
				var tmp2 = $('#curr_date').val().split("/");
				if((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() > new Date(tmp2[2]+"-"+tmp2[1]+"-"+tmp2[0]+"T00:00:00").getTime())){
					message = 'Tidak Dapat Memilih Melebihi Hari ini. Sekarang Tanggal '+$('#curr_date').val();
					message_error_show_parent(message);
					$(this).css("background-color", "red");
				}else{
					$(this).css("background-color", "#dedbdb");
				}
			}
        });
		$('#tanggal_sumpah').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay: $.datepicker.noWeekends,
            onSelect: function(dateText, inst) {
            	var date = $(this).datepicker('getDate');
            	var dayOfWeek = weekday[date.getDay()];
            	var error = 0;
            	var message ='';
            	if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
            		message ='Tidak Dapat Memilih diluar Hari Kerja.';
            		message_error_show_parent(message);
            		return;
            	}
				
				var tmp = $(this).val().split("/");
				var tmp2 = $('#curr_date').val().split("/");
				if((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() > new Date(tmp2[2]+"-"+tmp2[1]+"-"+tmp2[0]+"T00:00:00").getTime())){
					message = 'Tidak Dapat Memilih Melebihi Hari ini. Sekarang Tanggal '+$('#curr_date').val();
					message_error_show_parent(message);
					$(this).css("background-color", "red");
				}else{
					$(this).css("background-color", "#dedbdb");
				}
			}
        });

	$('#tgl_pen_majelis').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            beforeShowDay: $.datepicker.noWeekends,
            onSelect: function(dateText, inst) {
            	var date = $(this).datepicker('getDate');
            	var dayOfWeek = weekday[date.getDay()];
            	var error = 0;
            	var message ='';
            	if(dayOfWeek=='Sunday' || dayOfWeek=='Saturday'){
            		message ='Tidak Dapat Memilih diluar Hari Kerja.';
            		message_error_show_parent(message);
            		return;
            	}
				
				var tmp = $(this).val().split("/");
				var tmp2 = $('#curr_date').val().split("/");
				if((new Date(tmp[2]+"-"+tmp[1]+"-"+tmp[0]+"T00:00:00").getTime() > new Date(tmp2[2]+"-"+tmp2[1]+"-"+tmp2[0]+"T00:00:00").getTime())){
					message = 'Tidak Dapat Memilih Melebihi Hari ini. Sekarang Tanggal '+$('#curr_date').val();
					message_error_show_parent(message);
					$(this).css("background-color", "red");
				}else{
					$(this).css("background-color", "#dedbdb");
				}
			}
        });
    });
});
</script>
