Total incoming calls is 10, there 2 voicemails, so return 20% (and repeat this process for each day requested).
The two portions of code here;
Code: Select all
<?php
$getDistinctDaysForIn = mysql_query("SELECT DISTINCT Date
FROM phonelog2
WHERE Date>='$start_date'
AND Date<='$end_date'
");
while ($row = mysql_fetch_array($getDistinctDaysForIn))
{
$countTotalIn = mysql_query("SELECT COUNT( * )
FROM phonelog2
WHERE `Date`='{$row['Date']}'
AND Line<>1
AND Line<>2
AND Line<>3
AND Line<>4
AND time>='$hours1'
AND time<='$hours2'
AND In_Out='I'
");
while ($row = mysql_fetch_array($countTotalIn))
{
echo "<tr align=center>";
echo "<td>";
echo $row[0];
echo "</td>";
echo "</tr>";
}
}
?>Code: Select all
<?php
$getDistinctDaysForVmail = mysql_query("SELECT DISTINCT Date
FROM phonelog2
WHERE Date>='$start_date'
AND Date<='$end_date'
");
while ($row = mysql_fetch_array($getDistinctDaysForVmail))
{
$countVmailTotal = mysql_query("SELECT COUNT( * )
FROM phonelog2
WHERE `Date`='{$row['Date']}'
AND Line<>1
AND Line<>2
AND Line<>3
AND Line<>4
AND time>='$hours1'
AND time<='$hours2'
AND (Station=20
OR Station=21
OR Station=22
OR Station=23)
");
while ($row = mysql_fetch_array($countVmailTotal))
{
echo "<tr align=center>";
echo "<td>";
echo $row[0];
echo "</td>";
echo "</tr>";
}
}
?>Thanks