Esempio n. 1
0
$dicttype = new Dicttypes();
$tpl_file = "dict";
if (isset($_GET['do'])) {
    $do = trim($_GET['do']);
    if (!empty($_GET['id'])) {
        $id = intval($_GET['id']);
    }
    if ($do == "search") {
        if (!empty($_GET['help']['title'])) {
            $search_title = $_GET['help']['title'];
            $conditions = "word like '%" . $search_title . "%'";
        }
    }
    if ($do == "del" && !empty($id)) {
        $deleted = false;
        $deleted = $dict->del($id);
    }
    if ($do == "edit") {
        if (!empty($id)) {
            $item = $dict->read("*", $id);
            setvar("item", $item);
        }
        if (!empty($item['dicttype_id'])) {
            setvar("dicttypeOptions", $dicttype_option = $dicttype->getTypeOptions($item['dicttype_id']));
        } else {
            setvar("dicttypeOptions", $dicttype_option = $dicttype->getTypeOptions());
        }
        $tpl_file = "dict.edit";
        template($tpl_file);
        exit;
    }