$dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1');
mysql_select_db('ecosmar_contacts', $dbcnx);
$listem = @mysql_query("SELECT ID,Name1,Name2,Company,Address,City,State,ZipCode,Country,Phone,email,Link,count,dtnum FROM agent ORDER BY Name2");
if (!$listem) {
echo("
Error retrieving data from New Agent Applications. Error: ". mysql_error(). " |
");
}
$num_rows = mysql_num_rows($listem);
if($num_rows < 1){
echo("
There are No Agents Listed |
");
}else{
while ($row = mysql_fetch_array($listem)) {
$ID = $row['ID'];
$Name1 = $row['Name1'];
$Name2 = $row['Name2'];
$Company = $row['Company'];
$Address = $row['Address'];
$City = $row['City'];
$State = $row['State'];
$ZipCode = $row['ZipCode'];
$Country = $row['Country'];
$Phone = $row['Phone'];
$email = $row['email'];
$Link = $row['Link'];
$count = $row['count'];
$countem = @mysql_query("SELECT usrn FROM con_main WHERE ref_RID='$ID'");
if(!$countem){
echo("No Contact Count". mysql_error());
}else{
$numcon = mysql_num_rows($countem);
}
$dtnum = $row['dtnum'];
$chunk_dtnum = chunk_split($dtnum, 2, ':');
$chunk_arr = explode(":", $chunk_dtnum);
$datus = $chunk_arr[2].'-'.$chunk_arr[3].'-'.$chunk_arr[0].$chunk_arr[1];
echo("
" .
"As of $datus" .
" | $Name1 $Name2 $Company" .
" | Phone: $Phone Email: $email" .
" |
" .
" View/Edit " .
" DEL " .
" | $Address $City $State $ZipCode $Country" .
" | Domain: $Link Web Count: $count Contacts: $numcon" .
" |
");
}
}
?>