<?php

session_start();
error_reporting(1);
include('includes/config.php');
include('includes/db.php');

if (strlen($_SESSION['adminlogin']) == 0) {
    header('location:index.php');
} 

if(isset($_REQUEST['action']) ){
    $sql = "SELECT * from sign WHERE status = 1";
    $query = $dbh->prepare($sql);
    $query->execute();
    
    $signCount = $query->rowCount();

    $sql = "SELECT * from server_copy WHERE status = 1";
    $query = $dbh->prepare($sql);
    $query->execute();
    $serverCount = $query->rowCount();

    $notification = ["sign"=>$signCount,"server"=>$serverCount];

    echo json_encode($notification);


}