HEX
Server: Apache
System: Linux www3.pit.tblive.com 5.14.0-687.38.1.el9_8.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Aug 12 17:19:12 EDT 2026 x86_64
User: awaldron (1020)
PHP: 8.1.34
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //home/awaldron/public_html/archive/demo/contact_details.php
<?php
session_start();

include("_functions.php");
dbconnect();

// SET BREADCRUMB
$GLOBALS[breadcrumb] = "<a href=\"/content.php?p=1\">Intranet Home</a> > <a href=\"/content.php?p=10\">My Intranet</a> > <a href=\"/contacts.php\">My Contacts</a> > Contact Details";


$rowjava = TRUE;
$is_logged = is_logged();

$page_title = "Contact Details";
$GLOBALS["ext_page"] = $page_title;  // SET FAUX PAGE NAME
$_GET["p"] = ($_GET["r"]=="mc"?12:1);			 // SET FAUX PARENT ID

$lnav_mods = get_layout($_GET["p"],1);
$rnav_mods = get_layout($_GET["p"],3);

// DELETE CONTACT FROM MY CONTACTS LIST
if (isset($_GET["pdel"]) && is_logged()) {
	$deleted = quickUPDATE("DELETE FROM tbl_extdir WHERE username='".$_SESSION["auth_user"]."' AND dir_id=".$_GET["pdel"]);
	if ($_GET["r"] == "ed") header("Location: /directory_external.php");
	else header("Location: /contacts.php");
}

if (isset($_POST["submitedits"])) {
	$upd = "UPDATE tbl_extdir SET ";
	$upd .= "dir_name='".$_POST["dir_name"]."', ";
	$upd .= "dir_title='".$_POST["dir_title"]."', ";
	$upd .= "dir_business='".$_POST["dir_business"]."', ";
	$upd .= "dir_add1='".$_POST["dir_add1"]."', ";
	$upd .= "dir_add2='".$_POST["dir_add2"]."', ";
	$upd .= "dir_add3='".$_POST["dir_add3"]."', ";
	$upd .= "dir_add4='".$_POST["dir_add4"]."', ";
	$upd .= "dir_primary='".$_POST["dir_primary"]."', ";
	$upd .= "dir_mobile='".$_POST["dir_mobile"]."', ";
	$upd .= "dir_fax='".$_POST["dir_fax"]."', ";
	$upd .= "dir_email='".$_POST["dir_email"]."', ";
	$upd .= "dir_url='".$_POST["dir_url"]."', ";
	$upd .= "dir_type='".(zero($_POST["dir_type2"])?$_POST["dir_type1"]:$_POST["dir_type2"])."', ";
	$upd .= "dir_memo='".$_POST["dir_memo"]."', ";
	$upd .= "is_public='".$_POST["is_public"]."' ";
	$upd .= "WHERE dir_id=".$_POST["dir_id"];
	quickUPDATE($upd);
}

if (isset($_POST["submitnew"])) {
	$upd = "INSERT INTO tbl_extdir SET ";
	$upd .= "dir_name='".$_POST["dir_name"]."', ";
	$upd .= "dir_title='".$_POST["dir_title"]."', ";
	$upd .= "dir_business='".$_POST["dir_business"]."', ";
	$upd .= "dir_add1='".$_POST["dir_add1"]."', ";
	$upd .= "dir_add2='".$_POST["dir_add2"]."', ";
	$upd .= "dir_add3='".$_POST["dir_add3"]."', ";
	$upd .= "dir_add4='".$_POST["dir_add4"]."', ";
	$upd .= "dir_primary='".$_POST["dir_primary"]."', ";
	$upd .= "dir_mobile='".$_POST["dir_mobile"]."', ";
	$upd .= "dir_fax='".$_POST["dir_fax"]."', ";
	$upd .= "dir_email='".$_POST["dir_email"]."', ";
	$upd .= "dir_url='".$_POST["dir_url"]."', ";
	$upd .= "dir_type='".(zero($_POST["dir_type2"])?$_POST["dir_type1"]:$_POST["dir_type2"])."', ";
	$upd .= "dir_memo='".$_POST["dir_memo"]."', ";
	$upd .= "username='".$_SESSION["auth_user"]."', ";
	$upd .= "is_public=".$_POST["is_public"];
	quickUPDATE($upd);
	$maxid = quickSQL("SELECT MAX(dir_id) FROM tbl_extdir WHERE username='".$_SESSION["auth_user"]."'");
	quickUPDATE("INSERT INTO tbl_extdir_list (username,dir_id) VALUES ('".$_SESSION["auth_user"]."',".$maxid.")");
	header("Location: contact_details.php?r=".$_GET["r"]."&id=".$maxid);
}

include("_pagestart.php");
echo "<div class=\"headline\">".$page_title."</div>\n";

if ($_GET["act"] != "add") {
	$sql = "SELECT * FROM tbl_extdir WHERE dir_id=".$_GET["id"];
	$res = mysql_query($sql);
	extract(mysql_fetch_array($res));
}

echo "<div class=\"pagebody\">\n";

if ($message) echo "<P>".$message;
echo "<P><table border=0 cellspacing=1 cellpadding=5 bgcolor=\"#CCCCCC\">\n";
if ((($_SESSION["auth_user"] == $username) || is_admin()) && ($_GET["act"] == "edit")) {
	$author = TRUE;
	$new = FALSE;
	$style = "width:300px;";
	echo "<form action=\"".self()."\" method=\"post\">\n";
	echo "<input type=\"hidden\" name=\"dir_id\" value=\"".$dir_id."\">\n";
} else if ($is_logged && ($_GET["act"] == "add")) {
	$author = TRUE;
	$new = TRUE;
	$style = "width:300px;";
	echo "<form action=\"".self()."\" method=\"post\">\n";
} else {
	$author = FALSE;
	$new = FALSE;
	$style = "width:300px;border:0px;background:#F0F0F0;";
}

if ($author) {
	$sql = "SELECT DISTINCT dir_type FROM tbl_extdir ORDER BY dir_type ASC";
	$res = mysql_query($sql);
	while ($row = mysql_fetch_array($res)) {
		if (!zero($row["dir_type"])) $types .= "<option value=\"".$row["dir_type"]."\"".($row["dir_type"]==$dir_type?" SELECTED":"").">".$row["dir_type"]."</option>\n";
	}
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Contact Name</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_name\" value=\"".zero_print($dir_name)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\"><b>Required</b></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Contact Title</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_title\" value=\"".zero_print($dir_title)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Business Name</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_business\" value=\"".zero_print($dir_business)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Address 1</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_add1\" value=\"".zero_print($dir_add1)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Address 2</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_add2\" value=\"".zero_print($dir_add2)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Address 3</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_add3\" value=\"".zero_print($dir_add3)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Address 4</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_add4\" value=\"".zero_print($dir_add4)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Primary Phone</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_primary\" value=\"".zero_print($dir_primary)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\">USA: (xxx) xxx-xxxx</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Mobile Phone</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_mobile\" value=\"".zero_print($dir_mobile)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\">USA: (xxx) xxx-xxxx</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Fax Number</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_fax\" value=\"".zero_print($dir_fax)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\">USA: (xxx) xxx-xxxx</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Email Address</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_email\" value=\"".zero_print($dir_email)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Website URL</b></td><td bgcolor=\"#F0F0F0\"><input type=\"text\" name=\"dir_url\" value=\"".zero_print($dir_url)."\" style=\"".$style."\"></td><td bgcolor=\"#F0F0F0\">Please include 'http://'</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Category</b></td><td bgcolor=\"#F0F0F0\"><SELECT name=\"dir_type1\"><option></option>".$types."</SELECT> Other: <input type=\"text\" name=\"dir_type2\" value=\"\" style=\"width:144px;\"></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Additional Info</b></td><td bgcolor=\"#F0F0F0\"><textarea name=\"dir_memo\" style=\"height:100px;".$style."\">".zero_print($dir_memo)."</textarea></td><td bgcolor=\"#F0F0F0\"></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Make Public?</b></td><td bgcolor=\"#F0F0F0\"><SELECT name=\"is_public\"><option value=\"1\"".($is_public==1?" SELECTED":"").">Yes</option><option value=\"0\"".($is_public==0?" SELECTED":"").">No</option></select></td><td bgcolor=\"#F0F0F0\">If Yes, Contact is listed in the<br>External Directory</td></tr>\n";
	if ($new) echo "<tr bgcolor=\"#E0E0E0\"><td colspan=3 align=\"center\"><input type=\"submit\" name=\"submitnew\" class=\"btn\" value=\" Submit New Contact \"></td></tr>\n";
	else echo "<tr bgcolor=\"#E0E0E0\"><td colspan=3 align=\"center\"><input type=\"submit\" name=\"submitedits\" class=\"btn\" value=\" Submit Changes \"> &nbsp; <input type=\"button\" class=\"btn\" value=\" Permanently Delete This Contact \" onClick=\"ConfirmDelete(".$dir_id.",".$is_public.");\"></td></tr>\n";
	echo "</form>\n";
	echo "</table>\n";
} else {
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Contact Name</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_name)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Contact Title</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_title)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Business Name</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_business)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Address 1</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_add1)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Address 2</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_add2)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Address 3</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_add3)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Address 4</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_add4)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Primary Phone</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_primary)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Mobile Phone</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_mobile)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Fax Number</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_fax)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Email Address</b></td><td bgcolor=\"#F0F0F0\"><a href=\"mailto:".zero_print($dir_email)."\">".zero_print($dir_email)."</a></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Website URL</b></td><td bgcolor=\"#F0F0F0\"><a href=\"".zero_print($dir_url)."\" target=\"out\">".zero_print($dir_url)."</a></td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Category</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_type)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Additional Info</b></td><td bgcolor=\"#F0F0F0\">".zero_print($dir_memo)."</td></tr>\n";
	echo "<tr bgcolor=\"#E0E0E0\"><td><b>Make Public?</b></td><td bgcolor=\"#F0F0F0\">".($is_public==1?"Yes":"No")."</td></tr>\n";
	echo "</table>\n";
	if (($_SESSION["auth_user"] == $username) || is_admin()) echo "<P><input type=\"button\" class=\"btn\" value=\" Edit This Contact \" onClick=\"location.href='contact_details.php?r=".$_GET["r"]."&id=".$dir_id."&act=edit'\">\n";
}
echo "</div>\n";

include("_pageend.php");
?>