|
| |
//***********************************
//* get contacts
//***********************************
$counter = 0;
$SelectStr = "SELECT * FROM contacts where User_ID ='" . $_SESSION["sessionUserID"] . "' ORDER BY Last_Name, First_Name";
if( $_REQUEST["l"] > " "){
$SelectStr = "SELECT * FROM contacts where User_ID ='" . $_SESSION["sessionUserID"] . "' and Last_Name like '" . $_REQUEST["l"] . "%' ORDER BY Last_Name, First_Name";
}
if( ($_REQUEST["type"] > " ") && ($_REQUEST["type"] <> "emergency") && ($_REQUEST["type"] <> "all") ){
$SelectStr = "SELECT * FROM contacts where User_ID ='" . $_SESSION["sessionUserID"] . "' and Type = '" . $_REQUEST["type"] . "' ORDER BY Last_Name, First_Name";
}
if( ($_REQUEST["type"] == "emergency") ){
$SelectStr = "SELECT * FROM contacts where User_ID ='" . $_SESSION["sessionUserID"] . "' and Emergency = 'Y' ORDER BY Last_Name, First_Name";
}
if( $_REQUEST["contactSearch"] > " "){
$SelectStr = "SELECT * FROM contacts where User_ID ='" . $_SESSION["sessionUserID"] . "' and (Last_Name like '" . $_REQUEST["contactSearch"] . "%' ) or (First_Name like '" . $_REQUEST["contactSearch"] . "%' ) ORDER BY Last_Name, First_Name";
}
$result = mysql_query($SelectStr) or die(mysql_error());
while($myrow=MySQL_fetch_array($result)){
$counter++;
if($counter == 4){echo "
| "; $counter = 1;}
?>
= $myrow["First_Name"] ?>, = $myrow["Last_Name"] ?>
if($myrow["Address_1"] > " " || $myrow["Address_2"] > " "){ ?>= $myrow["Address_1"] ?> = $myrow["Address_2"] ?> } ?>
if($myrow["City"] > " " || $myrow["State"] > " " || $myrow["Zip"] > " "){ ?>= $myrow["City"] ?> if($myrow["City"] > " "){ ?>, } ?>= $myrow["State"] ?> = $myrow["Zip"] ?>
} ?> if($myrow["Mobile"] > " "){ ?>m = $myrow["Mobile"] ?> } ?> if($myrow["Phone"] > " "){ ?>h = $myrow["Phone"] ?> } ?> if($myrow["Work"] > " "){ ?>w = $myrow["Work"] ?> } ?> if($myrow["Email"] > " "){ ?>e ">= $myrow["Email"] ?> } ?>
" class="editContact">edit contact |
}
if($counter == 1){ echo " | | ";}
if($counter == 2){ echo " | ";}
//****************************************
//* end of get contacts
//****************************************
?>
| |
|