function SumIssue($Issue,$WDate)
{
$Rs=new DBRecord();
$Sql="SELECT SUM(A.Amounth) FROM dbissuelog A INNER JOIN dbperformancelog B ON A.RefNo=B.Row WHERE B.WorkDate='" .$WDate. "' AND A.IssueCase='".$Issue."' ";
$Rs->SetSQL($Sql);
$Rs->Open();
if($Rs->RowCount()>0)
return $Rs->GetIndex(0);
else
0;
}
function DisplayIssueCase($ID)
{
$Rs=new DBRecord();
$Sql="SELECT ID,Name FROM dbissuecase WHERE ID='".$ID."' ";
//$Sql="SELECT ID,Name count ($IssueCase[$i]) As num FROM dbissuecase WHERE ID='".$ID."' ";
$Rs->SetSQL($Sql);
$Rs->Open();
if($Rs->RowCount()>0)
return $Rs->GetIndex(1);
}
if($_POST["btnReport"]!=null)
{
$Sql="SELECT DISTINCT A.IssueCase FROM dbissuelog A INNER JOIN dbperformancelog B ON A.RefNo=B.Row WHERE B.WorkDate BETWEEN '".$P->ConvertDate($_POST["txtSDate"])."' AND '".$P->ConvertDate($_POST["txtFDate"])."' ORDER BY WorkDate";
$Rs=new DBRecord();
$Rs->SetSQL($Sql);
$Rs->Open();
$RowCount=$Rs->RowCount();
if($Rs->RowCount()>0)
{
for($i=0;$i<$Rs->RowCount();$i++)
{
$IssueCase[$i]=$Rs->GetIndex(0);
$Rs->MoveNext();
}
}
//-------------------------------------
$Sql="SELECT DISTINCT WorkDate FROM dbperformancelog WHERE WorkDate BETWEEN '".$P->ConvertDate($_POST["txtSDate"])."' AND '".$P->ConvertDate($_POST["txtFDate"])."' AND WorkDate <>'' ORDER BY WorkDate";
$Rs=new DBRecord();
$Rs->SetSQL($Sql);
$Rs->Open();
$ColCount=$Rs->RowCount();
if($Rs->RowCount()>0)
{
for($i=0;$i<$Rs->RowCount();$i++)
{
$WDate[$i]=$Rs->GetIndex(0);
$Rs->MoveNext();
}
}