Currently, I'm doing a system where is manager can assign the job to workers. I have a table listing. In this table listing, when I click at Job Order Number, there will be a popup modal. What I'm having right now is, if the job status is pending, I want to show a different popup modal . Do you guys have any idea how can I achieve that ?
Currently, I'm doing like this where I declare the modal popus using php class.
<td id="testing" data-id="<?php echo $row['jobregister_id'];?>" class = "<?php echo $row["job_status"]; ?>" data-target="doubleClick-info" onClick="document.getElementById('doubleClick-info').style.display='block'"><?php echo $row["job_order_number"]; ?></td>
<td><?php echo $row["job_priority"]; ?></td>
<td"><?php echo $row["job_status"]; ?></td>
and here is my ajax for job status pending
<div id="doubleClick-info" class="modal">
<div class="tabInfo">
<input type="radio" name="tabDoingInfo" id="tabDoingInfo1" checked="checked">
<label for="tabDoingInfo1" class="tabHeadingInfo"> Job Info </label>
<div class="tab" id="JobInfoTab">
<div class="contentJobInfo">
<div class="techClose" data-dismiss="modal" onclick="document.getElementById('doubleClick-info').style.display='none'">×</div>
<form action="homeindex.php" method="post">
<div class="info-details">
</div></form></div></div>
<script type='text/javascript'>
$(document).ready(function () {
$('body').on('click','.Pending',function(){
// $('.JobInfo').click(function () {
var jobregister_id = $(this).data('id');
// AJAX request
$.ajax({
url: 'ajaxhomepending.php',
type: 'post',
data: { jobregister_id: jobregister_id },
success: function (response) {
// Add response in Modal body
$('.info-details').html(response);
// Display Modal
$('#doubleClick-info').modal('show');
}
});
});
});
</script>
it all seems fine. i define the javascript using class. but when the class have no value, how do i define it ? do you guys have any idea how to do it. thank you so much.