$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 ORDER BY last_name");
if (!$listusrn) {
echo(" Error getting representative list. Error: ". mysql_error());
}else{
echo(" " .
"Click Representative ");
while($rowa = mysql_fetch_array($listusrn)){
$ID_array[] = $rowa[0];
$first_name_array[] = $rowa[1];
$last_name_array[] = $rowa[2];
$repusrn_array[] = $rowa[3];
echo(" ¦ $rowa[1] $rowa[2] ¦ ");
}//whilefetchingusrnlist
}//gotlistusrn
?>
|
mysql_select_db('ecosmar_contacts', $dbcnx);
$i=0;
while($i < count($repusrn_array)) {
$bean = $repusrn_array[$i];
echo("" .
"" .
" $bean | ");
$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) {
echo("Error getting contact list from DB. Error: ". mysql_error(). " | ");
}else{
$num_rows = mysql_num_rows($listem);
if($num_rows < 1){
echo("There are No Contacts for this Representative | ");
}else{//therearecontacts
echo("Name" .
" | $biz" .
" | Phone" .
" | Email" .
" | [TOP] | ");
$color_check2 = 1;
while ($row = mysql_fetch_array($listem)) {
$ckc = $color_check2 / 2;
if(is_int($ckc)){
$bkc = "#eeeeee";
}else{
$bkc = "white";
}
$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=='Business Type'){
$bizzy = $biztype;
}else{
$bizzy = $Company;
}
$checkem = @mysql_query("SELECT react_month FROM con_reactivity WHERE CID='$ID'");
if(!$checkem){
echo('Error');
}else{
$rowb = mysql_fetch_row($checkem);
$check = $rowb[0];
if ($check != 0){
$act_flag = " ";
}else{
$act_flag = " ";
}
}
echo(" [View/Edit] [DEL] [RE-ASSIGN] | " .
"$act_flag $first_Name $Name | $bizzy | $Phone | $email | " .
" ");
$color_check2 = $color_check2 + 1;
}//whilecontactlisting
}// therearecontacts
}//listedthem
echo(" ");
$i++;
}//whilereplisting
?>
|