Updated documentation.
[openemr.git] / interface / main / myadmin / tbl_row_delete.php
blob988e9c5e8c85ad617013e3d8b885e993cf8db458
1 <?php
2 /* $Id$ */
3 // vim: expandtab sw=4 ts=4 sts=4:
4 require_once('./libraries/grab_globals.lib.php');
5 require_once('./libraries/common.lib.php');
6 require_once('./libraries/mysql_charsets.lib.php');
8 /**
9 * Drop multiple rows if required
12 // workaround for IE problem:
13 if (isset($submit_mult_x)) {
14 $submit_mult = 'row_delete';
15 } elseif (isset($submit_mult_edit_x)) {
16 $submit_mult = 'row_edit';
19 // garvin: If the 'Ask for confirmation' button was pressed, this can only come from 'delete' mode,
20 // so we set it straight away.
21 if (isset($mult_btn)) {
22 $submit_mult = 'row_delete';
25 if ($submit_mult == 'row_edit') {
26 $js_to_run = 'tbl_change.js';
29 require_once('./header.inc.php');
31 if (!empty($submit_mult)) {
32 switch($submit_mult) {
33 case 'row_edit':
34 if (isset($rows_to_delete) && is_array($rows_to_delete)) {
35 $primary_key = array();
36 // garvin: As we got the fields to be edited from the 'rows_to_delete' checkbox, we use the index of it as the
37 // indicating primary key. Then we built the array which is used for the tbl_change.php script.
38 foreach($rows_to_delete AS $i_primary_key => $del_query) {
39 $primary_key[] = urldecode($i_primary_key);
42 include './tbl_change.php';
44 break;
46 case 'row_delete':
47 default:
48 if ((isset($rows_to_delete) && is_array($rows_to_delete))
49 || isset($mult_btn)) {
50 $action = 'tbl_row_delete.php';
51 $err_url = 'tbl_row_delete.php?' . PMA_generate_common_url($db, $table);
52 if (!isset($mult_btn)) {
53 $original_sql_query = $sql_query;
54 $original_url_query = $url_query;
55 $original_pos = $pos;
57 require('./mult_submits.inc.php');
59 $url_query = PMA_generate_common_url($db, $table)
60 . '&amp;goto=tbl_properties.php';
63 /**
64 * Show result of multi submit operation
66 if ((!empty($submit_mult) && isset($rows_to_delete))
67 || isset($mult_btn)) {
68 PMA_showMessage($strSuccess);
71 if (isset($original_sql_query)) {
72 $sql_query = $original_sql_query;
75 if (isset($original_url_query)) {
76 $url_query = $original_url_query;
79 if (isset($original_pos)) {
80 $pos = $original_pos;
83 require('./sql.php');
85 /**
86 * Displays the footer
88 require_once('./footer.inc.php');
89 break;