$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();
}
$listby = $_POST['listby'];
if($listby == "mostrecent"){
$ob='Most Recent';
$ordby='dtnum';
$dir='DESC';
}elseif($listby == "lessrecent"){
$ob='Least Recent';
$ordby='dtnum';
$dir='ASC';
}elseif($listby == "Name"){
$ob='Name';
$ordby='Name';
$dir='ASC';
}elseif($listby == "Company"){
$ob='Company';
$ordby='Company';
$dir='ASC';
$biz='Company';
}elseif($listby == "Business Type"){
$ob='Business Type';
$ordby='biztype';
$dir='ASC';
$biz='Business Type';
}else{
$ob='Original List';
$ordby='dtnum';
$dir='ASC';
}
$dbcnx = @mysql_connect('mysql.plainhost.com', 'ecosmar_ecosmart', 'ecoman1');
mysql_select_db('ecosmar_website', $dbcnx);
$listusrn = @mysql_query("SELECT ID,first_name,last_name,usrn FROM psw WHERE psw_rd='$usrn' 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];
$first_name_array[] = $rowa[1];
$last_name_array[] = $rowa[2];
$repusrn_array[] = $rowa[3];
}
?>
|
Eco-$mart, Inc. On-line Administration
|
All Regional Contact List
(Ordered by )
|
Help
|
Name
|
| Phone
| Email
| Manage
|
mysql_select_db('ecosmar_contacts', $dbcnx);
$i=0;
while($i < count($repusrn_array)) {
$bean = $repusrn_array[$i];
echo(" $first_name_array[$i] $last_name_array[$i] |
");
$listem = @mysql_query("SELECT ID,first_Name,Name,Company,biztype,Phone,email,dtnum,usrn FROM con_main WHERE usrn='$bean' ORDER BY $ordby $dir");
if (!$listem) {
die('Error geting list from conmain.
' . 'Error: '. mysql_error(). '
');
}
while ($row = mysql_fetch_array($listem)) {
$ID = $row['ID'];
$first_Name = $row['first_Name'];
$Name = $row['Name'];
$Company = $row['Company'];
$biztype = $row['biztype'];
$Phone = $row['Phone'];
$email = $row['email'];
$dtnum = $row['dtnum'];
$repusrn = $row['usrn'];
if($ob=='Company'){
$bizzy = $Company;
}elseif($ob=='Business Type'){
$bizzy = $biztype;
}
$checkem = @mysql_query("SELECT react_month FROM con_reactivity WHERE CID='$ID'");
if(!$checkem){
echo('Error Checking Activity.
' . 'Error: '. mysql_error(). '
');
}else{
$rowb = mysql_fetch_row($checkem);
$check = $rowb[0];
if ($check != 0){
$act_flag = "
";
}else{
$act_flag = "
";
}
}
echo("$act_flag $first_Name $Name | $bizzy | $Phone | $email | " .
"[View/Note] [RE-ASSIGN] |
");
}
$i++;
}
?>
|
©2007 - Data Base Interface - Custom Built at:
|