i have workers or employee table .. and i have Resign Date inside the table ..
and there is Edit Button, Replace Button and Delete button in every single data in table ..
Replace BUTTON is for replacing the new worker over the resigned worker.. and i already make the button disable when the resign date is empty and enable when it not empty .
now i don't know how can i make the button enable in next month of resign date.
for example : when someone is resign at 17/03/2021 the NEW BUTTON will be disable until 01/03/2021 after that the button enable .. i hope someone can help me
here is my table :
$data = sqlsrv_fetch_array($result, SQLSRV_FETCH_ASSOC);
$kode=trim($data ['id_mcm']);
$kode_mcm=trim($data ['kode_mcm']);
$nama_mcm=trim($data ['nama_mcm']);
$kode_ctr=trim($data ['kode_ctr']);
$nama_ctr=trim($data ['nama_ctr']);
$no_ktp=trim($data ['no_ktp']);
$no_hp=trim($data['no_hp']);
$domisili=trim($data['domisili']);
$tgl_join=date_format($data ['tgl_join'],'d-m-Y');
if ($data ['tgl_resign']!=''){$tgl_resign=date_format($data ['tgl_resign'],'d-m-Y');
<!--i tried to added this code below so i can use if inside Replace button tag with less operation-->
$tgl_resign_baru=date_format($data ['tgl_resign'],'30-m-Y');
}else{$tgl_resign='';}
$alamat=trim($data['alamat']);
?>
<tr <?php if($tgl_resign!=''){echo 'style="background-color:#f2c4cd"';} else {echo'';}?>>
<td><?php echo ++$no_urut;?></td>
<td><?php echo $kode_mcm;?></td>
<td><?php echo $nama_mcm;?></td>
<td><?php echo $kode_ctr;?></td>
<td><?php echo $nama_ctr;;?></td>
<td><?php echo $no_ktp;?></td>
<td><?php echo $no_hp;?></td>
<td><?php echo $domisili;?></td>
<td><?php echo $tgl_join;?></td>
<td><?php echo $tgl_resign;?></td>
<td><?php echo $alamat;?></td>
<td>
and here is the Button tag :
<!-- button Modal replace-->
<button type="button" class="btn btn-success btn-xs" data-toggle="modal" data-target="#myy<?php echo $kode; ?>"
<?php if (($akses=="Leader" || $akses=="IT") && $tgl_resign!="" && $kode_mcm!=""
&& $tgl_resign>$tgl_resign_baru) <-- and i add this too . but it doesn't work
{
echo '';
}else{
echo 'disabled';}?>>
Baru
</button>
Aucun commentaire:
Enregistrer un commentaire