Here's the code, reposted, with the include files hard coded into the script.
I've eliminated enough of the middle portion of the code so that the forum will allow me to post it with less than 10k characters.
Thanks.
<?php
###################################################################################
Let's get the security settings out of the way
These variables allow you to connect to the mySQL database.
We'll assign them variables so that we don't have to keep repeating it throughout the script.
If you would like to change it you can, but it seems a bit redundant
###################################################################################
IP Address
$sqlip = "localhost";
mySQL Username
$user = "SERV";
mySQL Password
$pw = "*******";
Database Name
$db = "atwtx ";
###########################END SECURITY VARIABLE ASSIGNMENTS#######################
echo "<table border='0' cellspacing='0' id='AutoNumber1' bordercolor='#C0C0C0' cellpadding='0' align='center'>";
echo "<tr>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> Agent Station </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> Agent Name </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> Start Call </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> End Call </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> Total Calls </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> SA </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> CB </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> AM </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> AM-X </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> CP </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> DX </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> FX/PG </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> AH </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> NA </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> NI </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> DNC </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> PM </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> TA </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> Busy </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> NQ </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Verdana'> CPH </font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'> </td>";
echo "</tr>";
###########################LET'S GET SOME SAMPLE RESULTS###########################
$mysql_access = mysql_connect($sqlip, $user, $pw);
mysql_select_db($db, $mysql_access) or die("Cannot connect to the database.<br>" . mysql_error());
$query = "SELECT * FROM agentlogfiles WHERE id >'0' Group By agentstation ORDER BY id" or die("No Records Found...<br>" . mysql_error());
$result = mysql_query($query, $mysql_access);
while($row = mysql_fetch_row($result))
{
echo "<tr>";
$agentstationid=$row[7];
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Arial'>$agentstationid</font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Arial'>Name</font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Arial'>";
echo $row[8];
echo ':';
echo $row[9];
echo ':';
echo $row[10];
echo "</font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b><font size='1' face='Arial'>End</font></b></td>";
include ("agent_logfiles_total_call_count_inc.php");
###########################LET'S GET SALE RESULTS###########################
$mysql_access = mysql_connect($sqlip, $user, $pw);
mysql_select_db($db, $mysql_access) or die("Cannot connect to the database.<br>" . mysql_error());
$query = "SELECT * FROM agentlogfiles WHERE disposition = 'HangUp-SA' AND agentstation='$agentstationid' " or die("No Records Found...<br>" . mysql_error());
$result = mysql_query($query, $mysql_access);
$rowcount='-1';
do
{
$rowcount=($rowcount+1);
}
while($row = mysql_fetch_row($result));
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b>";
echo "<font size='1' face='Arial'>";
echo $rowcount;
echo "</font></b></td>";
###########################END SALE RESULTS###########################
###########################LET'S GET CALLBACK RESULTS###########################
$mysql_access = mysql_connect($sqlip, $user, $pw);
mysql_select_db($db, $mysql_access) or die("Cannot connect to the database.<br>" . mysql_error());
$query = "SELECT * FROM agentlogfiles WHERE disposition = 'HangUp-CB' AND agentstation='$agentstationid' " or die("No Records Found...<br>" . mysql_error());
$result = mysql_query($query, $mysql_access);
$rowcount='-1';
do
{
$rowcount=($rowcount+1);
}
while($row = mysql_fetch_row($result));
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b>";
echo "<font size='1' face='Arial'>";
echo $rowcount;
echo "</font></b></td>";
###########################END CALLBACK RESULTS###########################
###########################LET'S GET ANSWERING MACHING (NO MSG) RESULTS###########################
$mysql_access = mysql_connect($sqlip, $user, $pw);
mysql_select_db($db, $mysql_access) or die("Cannot connect to the database.<br>" . mysql_error());
$query = "SELECT * FROM agentlogfiles WHERE disposition = 'HangUp-AM' AND agentstation='$agentstationid' " or die("No Records Found...<br>" . mysql_error());
$result = mysql_query($query, $mysql_access);
$rowcount='-1';
do
{
$rowcount=($rowcount+1);
}
while($row = mysql_fetch_row($result));
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b>";
echo "<font size='1' face='Arial'>";
echo $rowcount;
echo "</font></b></td>";
###########################END ANSWERING MACHINE (NO MSG) RESULTS###########################
###########################LET'S GET ANSWERING MACHINE (LEAVE MSG) RESULTS###########################
$mysql_access = mysql_connect($sqlip, $user, $pw);
mysql_select_db($db, $mysql_access) or die("Cannot connect to the database.<br>" . mysql_error());
$query = "SELECT * FROM agentlogfiles WHERE disposition = 'HangUp-AM LM - C-OMB-Misc-AMMsg1.wav' AND agentstation='$agentstationid' " or die("No Records Found...<br>" . mysql_error());
$result = mysql_query($query, $mysql_access);
$rowcount='-1';
do
{
$rowcount=($rowcount+1);
}
while($row = mysql_fetch_row($result));
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'><b>";
echo "<font size='1' face='Arial'>";
echo $rowcount;
echo "</font></b></td>";
###########################END ANSWERING MACHINE (LEAVE MSG) RESULTS###########################
echo "</font></b></td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'> </td>";
echo "<td style='border-style: solid; border-width: 1' nowrap align='center'> </tr>";
}
echo '</table>';
?>