include "/srv/athenace/lib/shared/functions_form.php"; if (!is_numeric($_GET['id'])) { header("Location: /staff/?id=notFound"); exit; } if (isset($_GET['go']) && $_GET['go'] == "y") { $contactsDelete = new Contacts(); $contactsDelete->setContactsid($_GET['id']); $contactsDelete->deleteFromDB(); header("Location: /contacts/?ItemDeleted=y"); exit; } include "../tmpl/header.php"; $contacts = new Contacts(); // Load DB data into object $contacts->setContactsid($_GET['id']); $contacts->loadContacts(); $all = $contacts->getAll(); if (isset($all)) { ?> <div class="panel panel-info"> <div class="panel-heading"> <strong>Viewing <?php echo $contacts->getContactsid(); ?> </strong> </div> <div class="panel-body"> <?php foreach ($all as $key => $value) {
$sqltext = "SELECT * FROM contacts,address WHERE contacts.addsid=address.addsid AND contactsid=?"; // print "<br>$sqltext"; $q = $db->select($sqltext, array($_GET['id']), 'i'); $r = $q[0]; $addsid = $r->addsid; if (isset($_GET['remove']) && $_GET['remove'] == "y" && isset($_GET['id']) && is_numeric($_GET['id'])) { db_delete("contacts", $_GET['id'], 'contactsid'); header("Location: /contacts/"); exit; } if (isset($_GET['go']) && $_GET['go'] == "y") { // Add to Address table $addsid = db_updateAddress($_POST, $addsid); $contactsUpdate = new Contacts(); // Update DB $contactsUpdate->setContactsid($_GET['id']); $contactsUpdate->setFname($_POST['fname']); $contactsUpdate->setSname($_POST['sname']); $contactsUpdate->setCo_name($_POST['co_name']); $contactsUpdate->setRole($_POST['role']); $contactsUpdate->setCustid($_POST['custid']); $contactsUpdate->setSuppid($_POST['suppid']); $contactsUpdate->setNotes($_POST['notes']); $contactsUpdate->updateDB(); header("Location: /contacts/?Updated=" . $result['id']); exit; } $pagetitle = "Edit contact"; include "../tmpl/header.php"; if (isset($_GET['SentAccessEmail']) && $_GET['SentAccessEmail'] == 1) { ?>
$parts = preg_split('/\\|/', decrypt($token)); $usr = $parts[0]; $pw = $parts[1]; if (!isset($_POST['pt']) || $_POST['pt'] == '') { $contid = pass($usr, $pw, 'contacts'); } else { $cke = base64_decode($_POST['pt']); $keywords = preg_split("/\\./", $cke); if ($keywords[4] == 'ATHENASECCHK') { $cid = $keywords[0]; $contid = $keywords[1]; $usr = $keywords[2]; $pw = $keywords[3]; #echo "$stfid, $usr, $pw";exit; } } #echo "$contid,$usr,$pw";exit; if ($contid) { dropCookie($contid, $usr, $pw); // logEvent("26",$staffid,"Username:"******"Location: {$cust_url}"); } else { killCookie(); // logEvent("31",0,"Username:"******"Location: {$login_url}/?pf=y"); }