Single Bar Chart
Pie Chart
Messages
Show AllS/N | Name | Date | Phone | Category | Message | |
---|---|---|---|---|---|---|
VIEW |
$countu){
//fwtch each array
while($row= mysqli_fetch_assoc($resultu))
{
//select whatever is in the table
$user= $row["username"];
}
}
//select query for register
$selv= "SELECT count(*) as id from visitors";
$resultv= mysqli_query($connect,$selv) or die(''.mysqli_error($connect));
$countv= 0;//$count is used to identify the first value
//check if there is something in the table
if(mysqli_num_rows($resultv)>$countv){
//fwtch each array
while($row= mysqli_fetch_assoc($resultv))
{
//select whatever is in the table
$vis= $row["id"];
}
}
//select query for messages
$selc= "SELECT count(*) as name from contact";
$resultc= mysqli_query($connect,$selc) or die(''.mysqli_error($connect));
$countc= 0;//$count is used to identify the first value
//check if there is something in the table
if(mysqli_num_rows($resultc)>$countc){
//fwtch each array
while($row= mysqli_fetch_assoc($resultc))
{
//select whatever is in the table
$msgs= $row["name"];
}
}
//select query for subscribers
$sels= "SELECT count(*) as email from subscribers";
$results= mysqli_query($connect,$sels) or die(''.mysqli_error($connect));
$counts= 0;//$count is used to identify the first value
//check if there is something in the table
if(mysqli_num_rows($results)>$counts){
//fwtch each array
while($row= mysqli_fetch_assoc($results))
{
//select whatever is in the table
$sub= $row["email"];
}
}
?>
'$last_login_time'")
or die('Error fetching register data: ' . mysqli_error($connect));
$new_visitors = mysqli_query($connect, "SELECT COUNT(*) AS count FROM visitors WHERE date > '$last_login_time'")
or die('Error fetching visitors data: ' . mysqli_error($connect));
$new_messages = mysqli_query($connect, "SELECT COUNT(*) AS count FROM contact WHERE date > '$last_login_time'")
or die('Error fetching messages data: ' . mysqli_error($connect));
$new_subscribers = mysqli_query($connect, "SELECT COUNT(*) AS count FROM subscribers WHERE date > '$last_login_time'")
or die('Error fetching subscriber data: ' . mysqli_error($connect));
// Fetch the counts
$register_count = mysqli_fetch_assoc($new_registers)['count'];
$visitor_count = mysqli_fetch_assoc($new_visitors)['count'];
$message_count = mysqli_fetch_assoc($new_messages)['count'];
$subscriber_count = mysqli_fetch_assoc($new_subscribers)['count'];
// Calculate the total sum of all counts
$total_count = $register_count + $visitor_count + $message_count + $subscriber_count;
// Update the cookie to the current time
setcookie("last_login_time", date("Y-m-d H:i:s"), time() + (86400 * 30), "/");
?>
'$last_login_time'";
$resultmsgs = mysqli_query($connect, $querymsgs) or die('Error fetching messages data: ' . mysqli_error($connect));
// Fetch the count for this category
$countmsgs = mysqli_fetch_assoc($resultmsgs)['count'];
// Store the result in the array
$new_category_messages[$categorymsgs] = $countmsgs;
// Add the count to the total new messages
$total_new_messages += $countmsgs;
}
// Display notifications if there are new messages in any category
foreach ($new_category_messages as $categorymsgs => $countmsgs) {
if ($countmsgs > 0) {
//echo "You have $countmsgs new message(s) in the $categorymsgs category.
";
}
}
// Display the total number of new messages
if ($total_new_messages > 0) {
//echo "You have a total of $total_new_messages new message(s) across all categories.
";
}
// Update the cookie to the current time (for tracking next login time)
setcookie("last_login_time", date("Y-m-d H:i:s"), time() + (86400 * 30), "/");
?>
S/N | Name | Date | Phone | Category | Message | |
---|---|---|---|---|---|---|
VIEW |