예제 #1
0
파일: help.php 프로젝트: reboxhost/phpb2b
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 = "title like '%" . $search_title . "%'";
        }
    }
    if ($do == "edit") {
        setvar("HelptypeOptions", $helptype_option = $helptype->getTypeOptions('', 3));
        if (!empty($id)) {
            setvar("HelptypeOptions", $helptype_option = $helptype->getTypeOptions($item['helptype_id'], 3));
            setvar("item", $item = $help->read("*", $id));
        }
        $tpl_file = "help.edit";
        template($tpl_file);
        exit;
    }
}
if (isset($_POST['save']) && !empty($_POST['help'])) {
    $vals = $_POST['help'];
    if (isset($_POST['id'])) {
        $id = intval($_POST['id']);
    }
    if (!empty($id)) {
        $vals['modified'] = $time_stamp;
        $result = $help->save($vals, "update", $id);
    } else {