<?
if(file_exists("../piswin/$filename")){
$fr = file("../piswin/$filename");
//Output a line of the file until the end is reached
for($i = 0 ; $i < count($fr); $i++)
{
$empid=substr($fr[$i],0,6);
$rg=substr($fr[$i],16,4);//echo"$empid";
if($empid=="$rs[EmpId]" and $rg>=$affter and $rg<=$evening)
{
$fr = file("../piswin/$filename");
for($i = 0 ; $i < count($fr); $i++)
{
$empid=substr($fr[$i],0,6);
$rg=substr($fr[$i],16,4);
$cid=count($empid=="$rs[EmpId]" and $rg>=$morning and $rg<=$affter);
$cid++;
echo"$cid";
if($empid=="$rs[EmpId]" and $rg>=$morning and $rg<=$affter)
echo"<strong>X</strong>";
}
}
}
}
else{echo "<strong>?</strong>";}
?>