Beispiel #1
0
}
if (isset($_POST['save']) && !empty($_POST['data']['dict'])) {
    $_POST['data']['dict']['word'] = pb_lang_merge($_POST['data']['multi']);
    $vals = $_POST['data']['dict'];
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
    if (!empty($id)) {
        $vals['modified'] = $time_stamp;
        $result = $dict->save($vals, "update", $id);
    } else {
        $vals['created'] = $vals['modified'] = $time_stamp;
        $result = $dict->save($vals);
    }
    if (!$result) {
        flash();
    }
}
if (isset($_GET['q'])) {
    $conditions[] = "word like '%" . $_GET['q'] . "%'";
}
if (isset($_REQUEST['del']) && !empty($_REQUEST['id'])) {
    $deleted = false;
    $deleted = $dict->del($_REQUEST['id']);
}
$amount = $dict->findCount(null, $conditions);
$page->setPagenav($amount);
$result = $dict->findAll("Dict.*,t.name AS typename", array("LEFT JOIN {$tb_prefix}dicttypes t ON Dict.dicttype_id=t.id"), $conditions, "Dict.id DESC", $page->firstcount, $page->displaypg);
setvar("Items", $result);
setvar("ByPages", $page->pagenav);
template($tpl_file);