示例#1
0
         $message["submit"] = submitPractice($conn, $userID, $cr, $incr);
     } else {
         $message["submit"] = false;
     }
     break;
 case "updateword":
     $wid = isset($_POST["id"]) ? $_POST["id"] : "";
     $word = isset($_POST["word"]) ? $_POST["word"] : "";
     $wordBase = isset($_POST["wordbase"]) ? $_POST["wordbase"] : "";
     $translation = isset($_POST["translation"]) ? $_POST["translation"] : "";
     $description = isset($_POST["description"]) ? $_POST["description"] : "";
     $message["status"] = updateWord($conn, $userID, $wid, $word, $translation, $description, $wordBase);
     break;
 case "deleteword":
     $wid = isset($_POST["id"]) ? $_POST["id"] : "";
     $message["status"] = deleteWord($conn, $userID, $wid);
     break;
 case "insertlist":
     $list = $_POST["list"];
     $message = insertList($conn, $userID, $list);
     break;
 case "listlist":
     $message["results"] = getListList($conn, $userID, $_GET["first"], $_GET["last"]);
     $message["success"] = true;
     break;
 case "sharelistuser":
     $message["status"] = shareListUser($conn, $userID, $_POST["user"], $_POST["list"]);
     break;
 case "renamelist":
     $message["status"] = renameList($conn, $userID, $_POST["id"], $_POST["name"]);
     break;
示例#2
0
<?php

require_once 'config.php';
$session->requireLoggedIn();
require 'design_head.php';
if (!empty($_GET['del'])) {
    deleteWord($_GET['del']);
}
if (empty($_GET['lang']) || !is_numeric($_GET['lang'])) {
    echo '<h2>Show words</h2>';
    echo 'Select language first<br/><br/>';
    $list = getCategories(CATEGORY_LANGUAGE);
    foreach ($list as $row) {
        echo '<a href="' . $_SERVER['PHP_SELF'] . '?lang=' . $row['categoryId'] . '">' . $row['categoryName'] . '</a> (' . getWordCount($row['categoryId']) . ' words)<br/>';
    }
} else {
    echo '<h2>Show words</h2>';
    $langId = $_GET['lang'];
    $list = getWords($langId);
    foreach ($list as $row) {
        coreButton('Delete', $_SERVER['PHP_SELF'] . '?lang=' . $langId . '&amp;del=' . $row['id']);
        echo $row['word'] . '<br/>';
    }
}
require 'design_foot.php';