Ejemplo n.º 1
0
         }
         $content = '';
         $addtime = timetodate($DT_TIME);
         $typeid = 0;
         $item = array();
         $menuid = 0;
         $tname = $menus[$menuid][0];
         include tpl('item_edit', $module);
     }
     break;
 case 'edit':
     $itemid or msg();
     $do->itemid = $itemid;
     if ($submit) {
         if ($do->pass($post)) {
             $do->edit($post);
             dmsg('修改成功', $forward);
         } else {
             msg($do->errmsg);
         }
     } else {
         $item = $do->get_one();
         extract($item);
         $addtime = timetodate($addtime);
         $menuid = 0;
         $tname = $menus[$menuid][0];
         include tpl('item_edit', $module);
     }
     break;
 case 'batch':
     if ($submit) {
Ejemplo n.º 2
0
    require 'subclasses/item.php';
    $dbh_item = new item();
    $object_name = 'dbh_item';
    require 'components/create_form_data.php';
    extract($arr_form_data);
    if ($_POST['btn_cancel']) {
        log_action('Pressed cancel button');
        redirect("listview_item.php?{$query_string}");
    }
    if ($_POST['btn_submit']) {
        log_action('Pressed submit button');
        $message .= $dbh_item->sanitize($arr_form_data)->lst_error;
        extract($arr_form_data);
        if ($dbh_item->check_uniqueness_for_editing($arr_form_data)->is_unique) {
            //Good, no duplicate in database
        } else {
            $message = "Record already exists with the same primary identifiers!";
        }
        if ($message == "") {
            $dbh_item->edit($arr_form_data);
            redirect("listview_item.php?{$query_string}");
        }
    }
}
require 'subclasses/item_html.php';
$html = new item_html();
$html->draw_header('Edit Item', $message, $message_type);
$html->draw_listview_referrer_info($filter_field_used, $filter_used, $page_from, $filter_sort_asc, $filter_sort_desc);
$html->draw_hidden('item_id');
$html->draw_controls('edit');
$html->draw_footer();