<?php require_once '..\\class\\Notes.php'; $o = new Notes(); $r = $o->delete_note($_POST['id']); echo json_encode($r); return;
exit; } Session::Messages($langNoteAdd, 'alert-success'); redirect_to_home_page('main/notes/index.php'); } } else { $new_or_modify = empty($_POST['id']) ? "addNote=1" : "modify=$_POST[id]"; Session::flashPost()->Messages($langFormErrors)->Errors($v->errors()); redirect_to_home_page("main/notes/index.php?$new_or_modify"); } } // end of if $submit /* delete */ if (isset($_GET['delete'])) { $thisNoteId = intval(getDirectReference($_GET['delete'])); Notes::delete_note($thisNoteId); Session::Messages($langNoteDel, 'alert-success'); redirect_to_home_page('main/notes/index.php'); } /* display form */ if (isset($_GET['addNote']) or isset($_GET['modify'])) { $navigation[] = array('url' => "index.php", 'name' => $langNotes); if (isset($_GET['modify'])) { $langAdd = $pageName = $langModifNote; $modify = intval(getDirectReference($_GET['modify'])); $note = Notes::get_note($modify); } else { $pageName = $langAddNote;