Need help to put some jquery function inside if statement . I want to hide my div when data from database is empty . I've done like this , and nothing happened.
<?php if(empty($all_data)){ ?>
<script>
$(document).ready(function () {
$( '.table-wrapper').css("display","none");
});
</script> <===update
<?php }else{ ?>
<?php foreach($all_data->result() as $data){ ?>
<tr>
<td><?php echo $data->id_history;?></td>
<td><?=$data->id_admin;?></td>
<td><?=$data->ipc;?></td>
<td><?=$data->task_date;?></td>
<td><?=$data->task_time;?></td>
<?php if ($data->id_task == 1){ ?>
<td>Login Site</td>
<?php }else{ ?>
<td>Logout Site</td>
<?php } ?>
<td>-</td>
</tr>
<?php } ?>
<?php } ?>
Is it possible to put some jquery inside php ??