<?php
include("../../config.php");
$data = "SELECT Process, Name FROM Process WHERE Process='$Process' ";
$check = $con->query($data);
while($result= $check->fetch()){
$CC = $result['Name'];
$data2 = "SELECT SUM(Count) AS TT, COUNT(DISTINCT Name) as TT1, Name FROM Work WHERE Process='$Process' AND CDate BETWEEN '$ST' AND '$EN' GROUP BY Name";
$check2 = $con->query($data2);
$Name1 = 0;
while($result2= $check2->fetch()){
$Name1 = $Name1 + $result2['TT1'];
}
echo "จำนวน ".$Name." คน";
echo "<hr>";
echo $CC.","."<br/>";
}
?>
<?php
include("../../config.php");
$data = "SELECT Process, Name FROM Process WHERE Process='$Process' ";
$check = $con->query($data);
while($result= $check->fetch()){
$CC = $result['Name'];
echo "จำนวน ".$Name." คน";
$data2 = "SELECT SUM(Count) AS TT, COUNT(DISTINCT Name) as TT1, Name FROM Work WHERE Process='$Process' AND CDate BETWEEN '$ST' AND '$EN' GROUP BY Name";
$check2 = $con->query($data2);
$Name1 = 0;
while($result2= $check2->fetch()){
$Name1 = $Name1 + $result2['TT1'];
}
if( isset($Name1)){ echo ",<br>"; }
$Name1 = true;
echo $CC;
}
?>