Files
simak/app/setor/modal_setor.php
2025-10-10 09:25:05 +07:00

42 lines
2.1 KiB
PHP

<script type="text/javascript">
$('.date').datepicker({format: 'dd/mm/yyyy',todayHighlight:'TRUE',autoclose: true,orientation:"bottom"});
</script>
<?php
$id=$_POST['id'];
?>
<div class="form-group">
<label for="exampleInputEmail1">Tanggal Setor</label>
<input type="text" class="date form-control" id="tgl_modal_setor" placeholder="dd/mm/yyyy"
onkeyup="
var v = this.value;
if (v.match(/^\d{2}$/) !== null) {
this.value = v + '/';
} else if (v.match(/^\d{2}\/\d{2}$/) !== null) {
this.value = v + '/';
}
"
value="<?php
$tpk=date('d-m-Y');
if (($tpk=="01-01-1970") || ($tpk==NULL) || ($tpk=="")) {
echo "";
} else {
echo date('d/m/Y');
}
?>"
>
</div>
<script>
$('#tgl_modal_setor').bind('input', function() {
var a = $('#tgl_modal_setor').val();
if (!a) {
var now = new Date();
var day = ("0" + now.getDate()).slice(-2);
var month = ("0" + (now.getMonth() + 1)).slice(-2);
var today = (day) + "/" + (month) + "/" + now.getFullYear();
$('#tgl_modal_setor').val(today);
}
});
</script>