job notification
Hi,
Can you please let me know how to create a job notification?
I have creted a php qry which will extract all records where a customer has requested a callback.
What I need is on the admin side at the top, a notification to show with the number of customers who expecting a callback.
It has to show the number of customers without the page being refreshed.
I have found this script and works fine however it is conflicting with the webassist script and my cms doent's work properly.
Is there a build in functionality which will allow me to do this?
Here is the current js script:
=========================Script Starts========================================
<script src="jquery.min.js"></script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" />
<script src="bootstrap.min.js"></script>
<br /><br />
<div>
<nav class="navbar navbar-inverse">
<div class="container-fluid">
<div class="navbar-header">
<a class="navbar-brand" href="#"></a>
</div>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="label label-pill label-danger count" style="border-radius:10px;"></span> <span class="glyphicon glyphicon-bell" style="font-size:18px;"></span></a>
<ul class="dropdown-menu"></ul>
</li>
</ul>
</div>
</nav>
<br />
<script>
$(document).ready(function(){
function load_unseen_notification(view = '')
{
$.ajax({
url:"fetch.php",
method:"POST",
data:{view:view},
dataType:"json",
success:function(data)
{
$('.dropdown-menu').html(data.notification);
if(data.unseen_notification > 0)
{
$('.count').html(data.unseen_notification);
}
}
});
}
load_unseen_notification();
$(document).on('click', '.dropdown-toggle', function(){
$('.count').html('');
load_unseen_notification('yes');
});
setInterval(function(){
load_unseen_notification();;
}, 5000);
});
</script>
==============================Script End======================================
=========================php script starts======fetch.php====================================
<?php
include("connect.php");
if(isset($_POST['view'])){
if($_POST["view"] != '')
{
}
$query = "SELECT * FROM tblcustomer WHERE job=1 LIMIT 5";
$result = mysqli_query($con, $query);
$output = '';
if(mysqli_num_rows($result) > 0)
{
while($row = mysqli_fetch_array($result))
{
$output .= '
<li>
<a href="#">
<a href="http://domain.com/tblcustomer_update.php?ID='.$row["ID"].'" <strong>'.$row["Email"].'</strong></a>
</a>
</li>
<br /><br />
';
}
}
else{
$output .= '
<li><a href="#" class="text-bold text-italic">No Noti Found</a></li>';
}
$status_query = "SELECT * FROM tblcustomer WHERE job=1";
$result_query = mysqli_query($con, $status_query);
$count = mysqli_num_rows($result_query);
$data = array(
'notification' => $output,
'unseen_notification' => $count
);
echo json_encode($data);
}
?>
=========================php script end==========================================
I hope you will understand what I'm trying to achive and that it will be an easy way to be created with webassist.
Looking forward to your reply