function remove_confirm($instance) { global $s_confirmations, $s_delete_idx; $panels_arrayname = get_panel_array($_SERVER['SCRIPT_NAME']); $name = 'dt_delete' . $instance; $idx = get_panel_index($GLOBALS[$panels_arrayname], $name); array_splice($GLOBALS[$panels_arrayname], $idx, 1); unset($s_confirmations['row'][$instance]); if (count($s_confirmations['row']) == 0) { unset($s_confirmations['row']); $s_delete_idx = 0; } }
$pname = 'dt_edit' . $s_edit_idx; $instance = $s_edit_idx > 1 ? "({$s_edit_idx}) " : ''; $ptitle = sprintf($dt_strings['EditFrom'], $instance, $s_wt['table']); ${$target_panels}[] = array($pname, $ptitle, 'open'); $pos = get_panel_index(${$target_panels}, $pname); ${$target_panels} = array_moveto_top(${$target_panels}, $pos); $s_edit_where[$s_edit_idx] = array('where' => get_request_data('edit', 'GET'), 'table' => $s_wt['table']); $s_fields = get_table_computed_sources($s_wt['table'], $s_fields); $s_edit_values[$s_edit_idx] = init_edit_values($s_edit_where[$s_edit_idx], $s_fields[$s_wt['table']]); } elseif (isset($_GET['del'])) { $where = get_request_data('del', 'GET'); $quote = identifier_quote($s_login['dialect']); $sql = 'DELETE FROM ' . $quote . $s_wt['table'] . $quote . ' ' . $where; if ($s_cust['askdel'] == TRUE) { $s_delete_idx = $s_delete_idx > 0 ? get_max_key($s_confirmations['row']) + 1 : 1; $target_panels = get_panel_array($s_referer); $pname = 'dt_delete' . $s_delete_idx; $ptitle = 'Delete'; $ptitle .= $s_delete_idx > 1 ? " ({$s_delete_idx}) " : ' '; $ptitle .= 'from table ' . $s_wt['table']; ${$target_panels}[] = array($pname, $ptitle, 'open'); $pos = get_panel_index(${$target_panels}, $pname); ${$target_panels} = array_moveto_top(${$target_panels}, $pos); $s_confirmations['row'][$s_delete_idx] = array('msg' => sprintf($MESSAGES['CONFIRM_ROW_DELETE'], $s_wt['table'], $where), 'sql' => $sql); } else { fbird_query($dbhandle, $sql) or $ib_error = fbird_errmsg(); // cleanup the watchtable output buffer $s_watch_buffer = ''; } } // cleanup the watchtable output buffer
} $bindargs[] = empty($field['notnull']) && strlen($value) == 0 ? NULL : $value; } $cols[] = $field['name']; $k++; } if (count($bindargs) > 0) { $ib_error = $s_cust['enter']['as_new'] == TRUE ? insert_row($table, $cols, $bindargs) : update_row($table, $cols, $bindargs, substr($s_edit_where[$instance]['where'], 6)); if (empty($ib_error)) { $success = TRUE; $s_enter_values = array(); $s_watch_buffer = ''; // cleanup the watchtable output buffer $s_watch_buffer = ''; } } } $panels_arrayname = get_panel_array($_SERVER['SCRIPT_NAME']); if ($success || $job == 'cancel') { // remove the dt_edit panel $name = 'dt_edit' . $instance; $idx = get_panel_index(${$panels_arrayname}, $name); array_splice(${$panels_arrayname}, $idx, 1); unset($s_edit_where[$instance]); unset($s_edit_values[$instance]); if (count($s_edit_where) == 0) { $s_edit_idx = 0; } } } }