load_lang(); $func = new functions(); $db = new dbquery(); $db->connect(); //Get the table if(!empty($_SESSION['current_basket']['view'])) { $table = $_SESSION['current_basket']['view']; } else { $table = $_SESSION['current_basket']['table']; } $coll_id = $_SESSION['current_basket']['coll_id']; $basket_id = $_SESSION['current_basket']['id']; //get the res_id if(isset($_REQUEST['id'])) { $rid = $_REQUEST['id']; } //Modify if(isset($_REQUEST['modify']) ) { $nid = $_REQUEST['nid']; if(empty($_REQUEST['notes'])) { $error = _NOTES.' '._EMPTY; } elseif(empty($error)) { $text = $func->protect_string_db($_REQUEST['notes']); $db->query("UPDATE ".$_SESSION['tablename']['not_notes']." SET note_text = '".$text."', date_note = '".date("Y")."-".date("m")."-".date("d")." ".date("H:i:s")."', user_id = '".$_SESSION['user']['UserId']."' WHERE id = ".$nid); if($_SESSION['history']['noteup']) { $hist = new history(); $hist->add($table, $rid, "UP", _POSTINDEXING_NOTE_UPDATED._ON_DOC_NUM.$rid , $_SESSION['config']['databasetype'],'notes'); } ?> query("delete from ".$_SESSION['tablename']['not_notes']." where id = ".$nid); if($_SESSION['history']['notedel']) { $hist = new history(); $hist->add($table, $rid, "DEL", _POSTINDEXING_NOTE_DELETED._ON_DOC_NUM.$rid , $_SESSION['config']['databasetype'],'notes'); } ?> query("select n.id, n.date_note, n.user_id, n.note_text, u.lastname, u.firstname from ".$_SESSION['tablename']['not_notes']." n inner join ".$_SESSION['tablename']['users']." u on n.user_id = u.user_id where n.identifier = ".$rid." and tablename = '".$basket_id."' and coll_id = '".$coll_id."'"); $line = $db->fetch_object(); $user = $func->show_string($line->lastname." ".$line->firstname); $text = $func->show_string($line->note_text); $nid = $line->id; $core_tools->load_html(); $core_tools->load_header(); ?>