// not used for access - popup indicator only if (empty($statesel)) { $statesel = $_REQUEST['st']; } if (empty($cities)) { $cities = $_REQUEST['ci']; } if (empty($likes)) { $likes = urldecode($_REQUEST['li']); } if (!$page || !is_numeric($page)) { $page = 0; } if ($UUID) { try { $resdb = db_resident(2007); if ($_POST['submit'] && $ACCESS >= 50) { $strippost = str_replace('"', "'", $_POST); // make all double quotes to be single extract($strippost, EXTR_SKIP); if (!is_numeric($prog_id) || strlen($prog_id) != 6) { throw new Exception('Program ID is invalid', __LINE__); } $phone = preg_replace('/[^0-9]/', '', $phone); if ($editf) { $sql = "update resprograms set program=" . chknul($program) . ",addr1=" . chknul($addr1) . ",city=" . chknul($city) . ",state='{$state}',zip=" . chknul($zip) . ",dir_name=" . chknul($dir_name) . ",phone=" . chknul($phone) . ",uid_mod={$UUID} where prog_id='{$prog_id}'"; } elseif ($ACCESS < 400) { throw new Exception('Insufficient Access Level', __LINE__); } else { $sql = "insert into resprograms values ('{$prog_id}'," . chknul($program) . "," . chknul($addr1) . "," . chknul($city) . ",'{$state}'," . chknul($zip) . "," . chknul($dir_name) . "," . chknul($phone) . ",{$UUID},NULL)"; }
$cblid = 0; if ($strippost['callback'] === 'NEW') { $clist = new CustList('Call-back - ' . date('D'), 1, "Call-backs for shadow list# {$lid}, created on " . date('r')); $cblid = $clist->id; } elseif ($strippost['callback'] === 'OLD') { $cblid = $strippost['cbsel']; if (empty($cblid) || !is_numeric($cblid)) { $cblid = 0; } } if ($cblid) { $sql = "insert into custlists values({$UUID},{$docid},{$cblid})"; $db->query($sql); } } elseif (isset($_POST['accept'])) { $res = db_resident(DESTY); $yer = DESTY; $doc->accept($ama, $res, $yer); // move notes $sql = "update notes set year = " . DESTY . " where res_id = {$docid} and year = 1"; $db->query($sql); $redir = "showdoc.php?id={$docid}&lid={$lid}&ck={$very}{$peekarg}&pos={$pos}&shadow=1&next={$nextid}&prev={$preved}&y=" . DESTY; } elseif (isset($_POST['reject'])) { $doc->reject($ama); $redir = "shadowdoc.php?id={$nextid}&lid={$lid}&ck={$very}{$peekarg}&y={$yer}&pos=" . ($pos + 1); } } // not already accepted-rejected } catch (Exception $e) { $mesg = "Request failed: " . $e->getMessage() . ' (' . $e->getCode() . ')<br>'; unset($result);