$dnum = date(Ymd)*4;
$from = $_GET['fr'];
if($from == ""){
$from = $_POST['fr'];
}
if($from != $dnum){
echo("<<<<Restricted Area>>>>" .
"
Sorry, you must Log In to view this Page
");
exit();
}
$usrn = $_GET['usrn'];
if($usrn == ""){
$usrn = $_POST['usrn'];
}
if($usrn == ""){
echo("<<<<Restricted Area>>>>" .
"
Problem with your username. Please Log In again.
");
exit();
}
$mo = date(m);
$dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1');
mysql_select_db('ecosmar_website', $dbcnx);
$listusrn = @mysql_query("SELECT ID,usrn FROM psw ORDER BY last_name");
if (!$listusrn) {
die("Error getting username list from psw.
" . 'Error: '. mysql_error(). '
');
}
while($rowa = mysql_fetch_array($listusrn)){
$ID_array[] = $rowa[0];
$repusrn_array[] = $rowa[1];
}
mysql_select_db('ecosmar_contacts', $dbcnx);
$countem = @mysql_query("SELECT ID,dtnum,usrn FROM con_main");
if (!$countem) {
die("Error counting contacts.
" . 'Error: '. mysql_error(). '
');
}else{
$fullcount = mysql_num_rows($countem);
}
?>
 
 | 
Eco-$mart, Inc.  On-line Administration
 | 
 
|  Contact Report   
Total Contacts: 
 | 
 Help 
 | 
|  Representative
 | Total Contacts
 | Added This Month
 | View
 | 
mysql_select_db('ecosmar_contacts', $dbcnx);
$i=0;
while($i < count($repusrn_array)) {
$thismo = array();
$bean = $repusrn_array[$i];
echo("|   $repusrn_array[$i] | ");
$listem = @mysql_query("SELECT ID,dtnum FROM con_main WHERE usrn='$bean'");
if (!$listem) {
echo('
Error counting contacts.  ' . 'Error: '. mysql_error(). '  | 
');
}else{
$total = mysql_num_rows($listem);
if($total == "" or $total == 0){
$total = 0;
}
echo("$total | ");
while($row = mysql_fetch_row($listem)){
$ID = $row[0];
$dtnum = $row[1];
$chunk_dtnum = chunk_split($dtnum, 2, ':');
$chunk_arr = explode(":", $chunk_dtnum);
if($chunk_arr[2] == $mo){
$thismo[] = $chunk_arr[2];
}
}
}
$newmo = count($thismo);
if($newmo == ""){
$newmo = 0;
}
echo("$newmo | [View] | ");
$i++;
}
?>
|   | 
 
©2007 - Data Base Interface - Custom Built at: 
 
 |