i want do display information about new update from user. example : this is url for user example.com/user and this is url for admin example.com/admin
the proses is when user post the articel the admin is automatically get notice/information the notice is like this "1 New Post added" <- (popup dialog)
so, how to run the proces for admin. "when user post the admin is automatically get notice/information" about new added post using jquery?.
this is my file index.php
<?php
include "popupnotice.php"
?>
popupnotice.php
<style type="text/css">
#popup {
visibility: hidden;
background-color: red;
position: absolute;
top: 10px;
z-index: 100;
height: 100px;
width: 300px
}
</style>
<div id="noticearea">
<?php
try{
$db = dbConn::getConnection();
$noinf= 'Y';
$sqlck = $db->prepare("SELECT COUNT(id_notice) as idnotice FROM str_articel WHERE notice_info=:noinf");
$sqlck->bindParam(':noinf', $noinf);
$sqlck->execute();
$resck = $sqlck->fetch(PDO::FETCH_ASSOC);
if($resck)
{
?>
<div id="modal">
<div class="modal-content">
<div class="header">
<div class="titlenotice"><h1>NOTICE/INFORMATION</h1></div>
<div class="break"></div>
</div>
<div class="copy">
<p>
<?php echo $resck['idnotice']; ?> New Post added
</p>
</div>
<div class="cf footer">
<a href="#" class="btn">Close</a>
</div>
</div>
<div class="overlay"></div>
</div>
<?php }}
catch (PDOException $e) {
echo "Connection Error " . $e->getMessage();
} ?>
</div>
in default page index.php if i login and no new added post i do not get notice if new post is added to db and i get notice everytime if any new.
anyone can help?