<?php


function monitor_count($BNAME)
{
require("./total.inc");

$conn = db_connect();
if(!$conn){
   echo "not connection!";
   exit;
   }
$result = db_query($conn, "select * from monitor where free4='$BNAME' and come='ON'");
if(!$result){
   print("bud query set");
   exit;
   }
$num = db_num_rows($result);

db_free_result($result);
db_Close($conn);

return($num);
}



function block_count($CNAME)
{
require("./total.inc");

$conn = db_connect();
if(!$conn){
   echo "not connection!";
   exit;
   }
$result = db_query($conn, "select * from userblock where cname ='$CNAME'");
if(!$result){
   print("bud query set");
   exit;
   }
$num = db_num_rows($result);

db_free_result($result);
db_Close($conn);

return($num);
}



function monitor_count_client($CNAME)
{
require("./total.inc");
//require("./db.inc");

$conn = db_connect();
if(!$conn){
   echo "not connection!";
   exit;
   }
$result = db_query($conn, "select * from monitor where cname ='$CNAME' and come='ON'");
if(!$result){
   print("bud query set");
   exit;
   }
$num = db_num_rows($result);

db_free_result($result);
db_Close($conn);

return($num);
}


?>
