<div style="padding:10px;"></div>
<div class="detil" style="padding: 4px;font-size:14px;margin-top:25px;width: 85%;margin: 0 auto;border-color: #FFFFFF;">
	<form id="frm_mediasi" style="padding: 4px;background:white;margin:0;" method="post" action="<?php echo base_url().'savehasilmediasipk';?>">
		<table id="tableDetilPerkara" style="font-size:14px;">
			<col width="40%">
			<col width="60%">
			<tbody>
				<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="mediasi_id" name="mediasi_id" value="<?php echo (!empty($idmediasi))? $idmediasi:'';?>">					
					<input type="hidden" id="curr_date" value="<?php echo $current_date;?>">
					<input type="hidden" id="enc_act" name="enc_act" value="<?php echo $enc_act;?>">
					<input type="hidden" id="enc_id" name="enc_id" value="<?php echo $enc_id;?>">
					<td colspan="2" style="background-color:#A3DBA8;padding:5px;">Edit - Hasil Mediasi PK</td>
				</tr>											
				<tr>
					<td>Tanggal Laporan Oleh Mediator<font color="red">*</font></td>
					<td style="padding:0px;padding-left:5px;">
						<input id="tgl_lapor" name="tgl_lapor" value="<?php echo (!empty($tgl_lapor) ? $tgl_lapor : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
					</td>
				</tr>				
				<tr>
					<td>Hasil Mediasi<font color="red">*</font></td>
					<td style="padding:0px;padding-left:5px;" colspan="2">
						<span class="custom-dropdown custom-dropdown--emerald" style='width:150px;'>
							<select name="st_hasil" id="st_hasil" style="width:120px;" class="custom-dropdown__select custom-dropdown__select--white">								
                                <?php
                                    $nilai = '';
                                    if(!empty($hasilmediasi)){
                                        $nilai = $hasilmediasi;
                                    }
                                ?>
                                <option value=''>Pilih Hasil Mediasi</option>
                                <option value='Y' <?php echo ($nilai=='Y')? 'selected':'' ?>  >Berhasil</option>
                                <option value='S' <?php echo ($nilai=='S')? 'selected':'' ?>  >Berhasil Sebagian</option>
                                <option value='D' <?php echo ($nilai=='D')? 'selected':'' ?>  >Tidak Dapat Dilaksanakan</option>
							</select>
						</span>
					</td>
				</tr>
				<tr>
					<td>Tanggal Pengiriman Hasil Mediasi ke MA</td>
					<td style="padding:0px;padding-left:5px;">
						<input id="tgl_pengiriman_kesepakatan" name="tgl_pengiriman_kesepakatan" value="<?php echo (!empty($tgl_pengiriman_kesepakatan) ? $tgl_pengiriman_kesepakatan : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
					</td>
				</tr>								
				<tr id='tr_tglakta' style="display:none">
					<td>Tanggal Akta Perdamaian/Penetapan Pencabutan</td>
					<td style="padding:0px;padding-left:5px;">
						<input id="tgl_perdamaian_cabut" name="tgl_perdamaian_cabut" value="<?php echo (!empty($tgl_perdamaian_cabut) ? $tgl_perdamaian_cabut : '');?>" class="datepicker" maxlength="10" placeholder="tgl/bln/tahun">
					</td>
				</tr>
				<tr id='tr_isikesepakatan' style="display:none">
					<td valign="top" style="vertical-align:top;">Isi Akta Perdamaian</td>
					<td style="background:white;" id="isi_kesepakatan_text">
						<?php echo $this->ckeditor->editor("isi_kesepakatan",$isi_kesepakatan);?>
					</td>
				</tr>
				<tr id='tr_keterangan'>
                    <td>Keterangan</td>
                    <td style="padding:0px;padding-left:5px;">
                        <textarea id="keterangan" name="keterangan" class="standard-input" style="resize: none;margin: 0px; width: 880px; height: 60px;"><?php echo (!empty($keterangan)?$keterangan:'');?></textarea>
                    </td>
                </tr>
				<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">
$('#kembali').closingFormWin();

$( document ).ready(function() {
    var hasil_mediasi='<?php echo $hasilmediasi;?>';
	if(hasil_mediasi==="Y" || hasil_mediasi==="S"){
	    $('#tr_isikesepakatan').show();
	    $('#isi_perdamaian').show();
	};
	if(hasil_mediasi==="T"||hasil_mediasi==="D"){
    	$('#tr_keterangan').show();
	};
});


$("#st_hasil").change(function(){
    switch($(this).val()){
        case "Y":
                $('#tr_tglakta').show();
                $('#tr_isikesepakatan').show();
                $('#tr_keterangan').hide();
        break;
        case "S":
                $('#tr_tglakta').show();
                $('#tr_isikesepakatan').show();
                $('#tr_keterangan').hide();
        break;
        case "T":
        		$('#tr_keterangan').show();
                $('#tr_tglakta').hide();
                $('#tr_isikesepakatan').hide();                
        break;
        case "D":
        		$('#tr_keterangan').show();
                $('#tr_tglakta').hide();
                $('#tr_isikesepakatan').hide();
        break; 
        case "":
                $('#tr_tgl_akta_perdamaian').hide();
                $('#isi_perdamaian').hide();
                $('#tr_keterangan').show();
        break;       
    }
});

$( document ).ready(function() {
	$('#frm_mediasi').SubmitHandling({
		refresh:'1',
		setRefresh:1,
		divRef:'#frm_mediasi',
		clicked:1,
		btnClicked:'.close_form',
		whenStatus:1,
		isCKEdit:1,
		tdID:'isi_kesepakatan_text',
		textID:'isi_kesepakatan',
	});
	$('.datepicker').ValidateDateInput();
    $( function() {
        $('#tglpermohonanmediasi').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_kesepakatan').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 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_penetapan').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 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_pemberitahuan').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 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_lapor').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 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_pengiriman_kesepakatan').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 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_perdamaian_cabut').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 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>
                                <option value='T' <?php echo ($nilai=='T')? 'selected':'' ?>  >Tidak Berhasil</option>                                       
