function DelNote($player_id, $note_id) { global $db_prefix; // Чужие заметки трогать нельзя $note = LoadNote($player_id, $note_id); if ($note['owner_id'] != $player_id) { return; } $query = "DELETE FROM " . $db_prefix . "notes WHERE owner_id = {$player_id} AND note_id = {$note_id}"; dbquery($query); }
function EditNote($note_id) { global $GlobalUser; $note = LoadNote($GlobalUser['player_id'], $note_id); if ($note == NULL) { echo loca("NOTE_CANT_DO"); return; } $u = array("", "", ""); $u[$note['prio']] = " SELECTED"; echo "<form action=\"?page=notizen&session=" . $_GET['session'] . "\" method=post>\n"; echo "<input type=hidden name=s value=2>\n"; echo "<input type=hidden name=n value=" . $note['note_id'] . ">\n"; echo "<table width=519>\n"; echo "<tr><td class=c colspan=2>" . loca("NOTE_EDIT") . "</td></tr>\n"; echo "<tr><th>" . loca("NOTE_PRIORITY") . "</th><th><select name=u><option value=2" . $u[2] . ">" . loca("NOTE_PRIO_2") . "</option><option value=1" . $u[1] . ">" . loca("NOTE_PRIO_1") . "</option><option value=0" . $u[0] . ">" . loca("NOTE_PRIO_0") . "</option></select></th></tr>\n"; echo "<tr><th>" . loca("NOTE_EDIT_SUBJ") . "</th><th><input type=text name=betreff size=30 maxlength=30 value='" . stripslashes($note['subj']) . "'></th></tr>\n"; echo "<tr><th>" . loca("NOTE_EDIT_TEXT") . " (<span id=\"cntChars\">" . $note['textsize'] . "</span> / 5000 " . loca("NOTE_CHARS") . ")</th><th><textarea name=text cols=60 rows=10 onkeyup=\"javascript:cntchar(5000)\">" . stripslashes($note['text']) . "</textarea></th></tr>\n"; echo "<tr><td class=c><a href=?page=notizen&session=" . $_GET['session'] . ">" . loca("NOTE_BACK") . "</a></td><td class=c><input type=reset value='" . loca("NOTE_RESET") . "'><input type=submit value='" . loca("NOTE_APPLY") . "'></td></tr>\n"; echo "</table></form><br><br><br><br>\n"; }