Mohon pencerahan untuk memunculkan jatuh tempo masa simperDibuat
Login Terakhir
7 Tahun lalu,
Telah Dilihat 1349 Kali
| |
Sultan Account |
|
|
Nian Dwi Christianto SW
Mengatakan :
Sultan Account
Assalam,
Berikut skrip yang sudah saya oprek remindernya, namun di tampilan belum muncul.
Mohon pencerahannya :
>> kegiatan.php
<?php
$kegiatan = mysqli_query($config, "SELECT * FROM data_karyawan ORDER BY nik DESC");
$no="$awal"; //awal 0 nanti ditambah satu
$nom2=sprintf("%s",$perintah,$no); //eksekusi $perintah dan $nom
$query=@mysqli_query($nom2, $koneksi);
$jatuh_tempo=mysqli_num_rows($query);
$selisih=mysqli_num_rows($query);
?>
<h4 style='padding-top:15px'>Hasil Input Data Karyawan </h4>
<!-- Basic Data Tables Example -->
<div class="col-md-17">
<div class="paccanel panel-default">
<div class="panel-heading">
<a class='btn btn-primary' href='index.php?view=kegiatan&act=tambah'><i class='fa fa-plus'>
</i> Tambahkan Data Baru</a>
</div>
<div class="panel-body">
<table class="table table-striped table-bordered table-hover dataTables-example" >
<thead class='alert-info'>
<tr>
<th width='20' height="55">No</th>
<th width="50">No. Reg</th>
<th width="30">NIK</th>
<th width="40">Nama</th>
<th width="69">Tanggal Pengajuan</th>
<th width="53">Jabatan</th>
<th width="83">Departemen</th>
<th width="80">Masa Simper</th>
<th width="70">Jatuh Tempo(60 hari)</th>
<th width="40">Action</th>
</tr>
</thead>
<tbody>
<?php
// mp koneksi ke database dan pemilihan database
$koneksi = mysqli_connect('localhost', 'root', '');
$db = mysqli_select_db('she');
// jalankan query
$query = mysqli_query($koneksi, "SELECT *,DATE_ADD(masa_simper, INTERVAL - 60 DAY) as jatuh_tempo, DATEDIFF(DATE_ADD(masa_simper, INTERVAL - 60 DAY), CURDATE()) as jatuh_tempo FROM data_karyawan");
$no = 1;
while ($i = mysqli_fetch_array($query))
$no = 1;
while ($i = mysqli_fetch_array($kegiatan))
{
echo
"<tr class='gradeX'>
<td>$no</td>
<td>$i[noreg_simper]</td>
<td align=center>$i[nik]</td>
<td>$i[nama]</td>
<td>$i[tgl_pengajuan]</td>
<td>$i[jabatan]</td>
<td>$i[departemen]</td>
<td>$i[masa_simper]</td>
<td>$data[jatuh_tempo]</td>
<td style='width:90px'><center>
<a style='margin-right:10px' href='index.php?view=kegiatan&act=detail&id=$i[noreg_simper]' title='Lihat Detail Data ini'><i class='fa fa-search'></i></a>
<a style='margin-right:10px' href='index.php?view=kegiatan&act=edit&id=$i[nik]' title='Edit Data ini'><i class='fa fa-pencil-square-o'></i></a>
<a href='index.php?view=kegiatan&delete=$i[nik]' title='Hapus Data ini' onclick=\"return confirm('Apakah anda Yakin Data ini Dihapus?')\" ><i class='fa fa-trash-o'></i></a>
</center></td>
</tr>";
$no++;
}
?>
</tbody>
</table>
</div>
</div>
</div>
<!-- /Basic Data Tables Example -->
<?php
if (isset($_GET[delete])){
mysqli_query($config, "DELETE FROM data_karyawan where nik='$_GET[delete]'");
echo "<script>document.location='kegiatan.mu';</script>";
}
?>
<footer id="footer">
<div class="text-center clearfix">
<p><small>© 2018 - Developed by IT Binsua 2018</small>
</div>
</footer> Ada 1 File Kiriman : 1. jatuh_tempo.JPG (64 KB) |
|
| Bukhori Muslim commented on 26 Agu 2018 05:45:40 Sultan Account |
|
|
|
Assalam,.. pake php saja mas,... gini :
<?php
$date=date_create($i['masa_simper']);
date_add($date,date_interval_create_from_date_string("60 days"));
echo date_format($date,"Y-m-d"); // Tanggal hasil setelah penamahan 60 hari
?> |
|