function process_order_category_search($window, $id, $ctrl)
{
    global $wb;
    switch ($id) {
        case IDC_SEARCH_SUBMIT:
            $wb->current_page = 1;
            $wb->keyword = wb_get_text(wb_get_control($window, IDC_KEYWORD));
            reset_order_category_view();
            wb_destroy_window($window);
            break;
        case IDCLOSE:
            // IDCLOSE is predefined
        // IDCLOSE is predefined
        case IDCANCEL:
            //			set_default_accel();
            wb_destroy_window($window);
            break;
    }
}
function insert_update_order_category($parent)
{
    global $wb;
    $ctrl_map = order_category_ctrl_mapping();
    $table_name = $wb->setting["Settings"]["order_category_table"];
    $set_str = "";
    while (list($ctrl_name, $field_name) = each($ctrl_map)) {
        $value = wb_get_text(wb_get_control($parent, $ctrl_name));
        $set_str .= "{$field_name}='{$value}',";
    }
    $set_str = rtrim($set_str, ',');
    if ($wb->current_action == 'update') {
        $id = $wb->current_ids;
        $sql = "UPDATE {$table_name} SET {$set_str} WHERE id='{$id}' ";
    } else {
        $sql = "INSERT INTO {$table_name} SET {$set_str} ";
    }
    $wb->db->query($sql);
    //	include(PATH_FORM."yc_order.form.inc.php");
    reset_order_category_view();
}
function del_selected_order_category()
{
    global $wb;
    if ($wb->del_ids) {
        $category_table_name = $wb->setting["Settings"]["order_category_table"];
        $where_is = " WHERE id IN ({$wb->del_ids}) ";
        $sql = " DELETE FROM {$category_table_name} {$where_is} ";
        $wb->db->query($sql);
        reset_order_category_view();
        $wb->del_ids = null;
    } else {
        wb_message_box($wb->mainwin, $wb->vars["Lang"]["lang_deleted_empty"], $wb->vars["Lang"]["system_name"], WBC_WARNING);
    }
}