162 lines
9.4 KiB
PHP
162 lines
9.4 KiB
PHP
<script type="text/javascript">
|
|
$('.date').datepicker({format: 'dd/mm/yyyy',todayHighlight:'TRUE',autoclose: true,});
|
|
</script>
|
|
|
|
<?php
|
|
include ('../koneksi.php');
|
|
$id_rw_kegiatan=$_POST['id'];
|
|
|
|
$wkt=pg_query("SELECT waktu_mulai,waktu_selesai FROM riwayat_kegiatan WHERE id='$id_rw_kegiatan'");
|
|
while($r=pg_fetch_array($wkt)) {
|
|
$waktu_mulai=$r['waktu_mulai'];
|
|
$waktu_selesai=$r['waktu_selesai'];
|
|
}
|
|
?>
|
|
|
|
<form role="form">
|
|
|
|
<div class="form-group">
|
|
<label for="exampleInputEmail1">Hapus Peserta Luar</label>
|
|
<select class="form-control" name="list_peserta_l" id="list_peserta_l">
|
|
<option></option>
|
|
<?php
|
|
$listpeg=pg_query("SELECT (SELECT nama FROM data_pegawai_luar WHERE id=peserta_luar),id FROM riwayat_peserta
|
|
WHERE riwayat_kegiatan_id='$id_rw_kegiatan'
|
|
AND (SELECT nama FROM data_pegawai_luar WHERE id=peserta_luar) IS NOT NULL
|
|
ORDER BY id ASC");
|
|
while($rowslist=pg_fetch_array($listpeg)) {
|
|
?>
|
|
<option value="<?php echo $rowslist[1]; ?>"><?php echo $rowslist[0]?></option>
|
|
<?php
|
|
}
|
|
?>
|
|
</select>
|
|
</div>
|
|
|
|
|
|
|
|
<hr>
|
|
|
|
<div class="form-group">
|
|
<label for="exampleInputEmail1">Waktu</label> <span style="font-family:Arial;font-weight:bold;color:#A2B5BB">Jika Waktu s/d Selesai, silakan input s/d 00:00</span>
|
|
<div class="input-group input-daterange">
|
|
<input type="text" class="form-control" maxlength="5" id="waktu_mulai_m_l" value="<?php echo date('H:i',strtotime($waktu_mulai)); ?>"
|
|
onkeyup="var v = this.value;if (v.match(/^\d{2}$/) !== null) {this.value = v + ':';}
|
|
else if (v.match(/^\d{2}\/\d{2}$/) !== null) {}" placeholder="hh:ss">
|
|
<span class="input-group-addon">s/d</span>
|
|
<input type="text" class="form-control" maxlength="5" id="waktu_selesai_m_l" value="<?php echo date('H:i',strtotime($waktu_selesai)); ?>"
|
|
onkeyup="var v = this.value;if (v.match(/^\d{2}$/) !== null) {this.value = v + ':';}
|
|
else if (v.match(/^\d{2}\/\d{2}$/) !== null) {}" placeholder="hh:ss">
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="exampleInputEmail1">Nama Peserta Luar</label>
|
|
<input type="hidden" value="<?php echo $id; ?>" id="id_rw_peserta_luar">
|
|
<input type="hidden" value="<?php echo $id_rw_kegiatan; ?>" id="riwayat_kegiatan_id">
|
|
<input type="hidden" value="<?php echo $peserta_luar; ?>" id="peserta_luar">
|
|
|
|
<input type="text" class="form-control" list="browsers_l" name="browser_l" id="peserta_nama_l" value="<?php echo $nama; ?>">
|
|
<datalist id="browsers_l">
|
|
<?php
|
|
$userpeg=pg_query("SELECT *
|
|
FROM data_pegawai_luar
|
|
ORDER BY nama ASC");
|
|
while($rows=pg_fetch_array($userpeg)) {
|
|
?>
|
|
<?php
|
|
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Chrome') !== false) {
|
|
?>
|
|
<option id_ms_pegawai_l="<?php echo($rows[0]);?>" value="<?php echo $rows[1]; ?>"><?php echo $rows[3]; ?></option>
|
|
<?php
|
|
} else
|
|
if(strpos($_SERVER['HTTP_USER_AGENT'], 'Firefox') !== false) {
|
|
?>
|
|
<option id_ms_pegawai_l="<?php echo($rows[0]);?>" value="<?php echo $rows[1]; ?>"><?php echo $rows[1].' ------ '.$rows[3]; ?></option>
|
|
<?php
|
|
}
|
|
}
|
|
?>
|
|
</datalist>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label for="exampleInputEmail1">NIP</label>
|
|
<input type="email" class="form-control" id="nipb_l" value="<?php echo $nipb; ?>">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="exampleInputEmail1">Jenis Kelamin</label>
|
|
<select class="form-control" id="jenis_kelamin_l">
|
|
<option></option>
|
|
<option <?php if ($jenis_kelamin=='Laki-laki') {echo "selected";} ?> value="Laki-laki">Laki-laki</option>
|
|
<option <?php if ($jenis_kelamin=='Perempuan') {echo "selected";} ?> value="Perempuan">Perempuan</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="exampleInputEmail1">Instansi</label>
|
|
<input type="email" class="form-control" id="instansi_l" value="<?php echo $instansi; ?>">
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="exampleInputEmail1">Jabatan</label>
|
|
<input type="email" class="form-control" id="jabatan_l" value="<?php echo $jabatan; ?>">
|
|
</div>
|
|
</form>
|
|
|
|
<script>
|
|
|
|
$("#list_peserta_l").change(function(){
|
|
var x = confirm("Anda yakin ingin menghapus ?");
|
|
if (x) {
|
|
var key = "hapus_peserta_luar";
|
|
var id = $("#list_peserta_l").val();
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/undtu/crud.php",
|
|
data: 'id='+id
|
|
+'&key='+key,
|
|
success: function(data){
|
|
alert('data peserta terhapus..');
|
|
$('#keluar_tambah_luar').trigger('click');
|
|
}
|
|
});
|
|
} else {}
|
|
});
|
|
|
|
$("#peserta_nama_l").change(function(){
|
|
var id_ms_pegawai3 = $("#peserta_nama_l").val();
|
|
var z = $('#browsers_l');
|
|
var val = $(z).find('option[value="' + id_ms_pegawai3 + '"]');
|
|
var a = val.attr('id_ms_pegawai_l');
|
|
var key = "list_peserta_luar";
|
|
if (!a) {
|
|
alert('Data baru..');
|
|
$('#nipb_l').val('');
|
|
$('#instansi_l').val('');
|
|
$('#jabatan_l').val('');
|
|
$('#nipb_l').first().focus().selected();
|
|
} else {
|
|
$.ajax({
|
|
type: "POST",
|
|
url: "app/peserta/crud.php",
|
|
data: 'peserta_luars='+a
|
|
+'&key='+key,
|
|
success: function(data){
|
|
var chars = data.split('$%^');
|
|
$('#nipb_l').val(chars[3]);
|
|
$('#instansi_l').val(chars[2]);
|
|
$("#jenis_kelamin_l").val(chars[1]).change();
|
|
$('#jabatan_l').val(chars[4]);
|
|
$('#peserta_luar').val(a);
|
|
$('#nipb_l').first().focus().selected();
|
|
}
|
|
});
|
|
}
|
|
});
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|