Record View'; if (isset($_REQUEST['save_record'])) { if ($_REQUEST['save_record']) { save_recordid($_REQUEST['recordid']); $msg .= '

Record saved!

'; } } if ($_REQUEST['add']) { if ($_REQUEST['submit'] == "Add Record") { if ($_REQUEST['templateid']) { $user = get_user_info($_SESSION['KnowledgeBase']['userid']); $sql = "INSERT INTO kb_records (active, templateid, createdby) VALUES ('1', ". $db->quote($_REQUEST['templateid']) .", ". $db->quote($user['f_username']) .")"; $res = $db->query($sql); $sql = "SELECT recordid FROM kb_records WHERE templateid = ". $db->quote($_REQUEST['templateid']) ." AND createdby = ". $db->quote($user['f_username']) ." ORDER BY createdon DESC LIMIT 1"; $res = $db->query($sql); if ($res && $res->numRows() == 1) { $row = $res->fetchRow(MDB2_FETCHMODE_ASSOC); header("Location: edit.html?recordid=". $row['recordid']); exit; } } else { $msg .= '

Select the type of record to add!

'; } } require_once(FILE_ROOT ."/php/add-record.php"); } else if (! isset($_REQUEST['recordid']) || isset($_REQUEST['recordid']) && empty($_REQUEST['recordid'])) { header("Location: search.html"); exit; } if (! $_REQUEST['add']) { $r = new Record; $rec = $r->getRecord($_REQUEST['recordid']); if (count($rec) == 0) { header("Location: search.html"); exit; } else { require_once(FILE_ROOT ."/php/record.php"); if (! external_portal()) { echo '
'; if (isset($_SESSION[SESS_NAME]['userid'])) { echo '[ Edit Record ] '; } echo '[ Raw Record ] [ Print Friendly ] '; if (in_array($_REQUEST['recordid'], $_SESSION[SESS_NAME]['saved_recordids'])) { echo '[ View Saved Records ] '; } else { echo '[ Save Record ] '; } echo '
'; } } } ! external_portal() ? require_once(FILE_ROOT ."/php". $version ."/footer.php") : null; db_disconnect(); ?>