Passed
Pull Request — develop (#186)
by Felipe
07:21 queued 01:59
created

AlldbController::doCreate()   D

Complexity

Conditions 16
Paths 96

Size

Total Lines 115
Code Lines 75

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 115
rs 4.8736
c 0
b 0
f 0
cc 16
eloc 75
nc 96
nop 1

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
/**
4
 * PHPPgAdmin v6.0.0-beta.45
5
 */
6
7
namespace PHPPgAdmin\Controller;
8
9
use PHPPgAdmin\Decorators\Decorator;
10
11
/**
12
 * Base controller class.
13
 *
14
 * @package PHPPgAdmin
15
 */
16
class AlldbController extends BaseController
17
{
18
    public $table_place      = 'alldb-databases';
19
    public $controller_title = 'strdatabases';
20
21
    /**
22
     * Default method to render the controller according to the action parameter.
23
     */
24
    public function render()
25
    {
26
        if ('tree' == $this->action) {
27
            return $this->doTree();
28
        }
29
30
        $header_template = 'header.twig';
31
32
        ob_start();
33
        switch ($this->action) {
34
            case 'export':
35
                $this->doExport();
36
37
                break;
38
            case 'save_create':
39
                if (isset($_POST['cancel'])) {
40
                    $this->doDefault();
41
                } else {
42
                    $this->doSaveCreate();
43
                }
44
45
                break;
46
            case 'create':
47
                $this->doCreate();
48
49
                break;
50
            case 'drop':
51
                if (isset($_REQUEST['drop'])) {
52
                    $this->doDrop(false);
53
                } else {
54
                    $this->doDefault();
55
                }
56
57
                break;
58
            case 'confirm_drop':
59
                $this->doDrop(true);
60
61
                break;
62
            case 'alter':
63
                if (isset($_POST['oldname'], $_POST['newname']) && !isset($_POST['cancel'])) {
64
                    $this->doAlter(false);
65
                } else {
66
                    $this->doDefault();
67
                }
68
69
                break;
70
            case 'confirm_alter':
71
                $this->doAlter(true);
72
73
                break;
74
            default:
75
                $header_template = 'header_datatables.twig';
76
                $this->doDefault();
77
78
                break;
79
        }
80
        $output = ob_get_clean();
81
82
        $this->printHeader($this->headerTitle(), null, true, $header_template);
83
        $this->printBody();
84
        echo $output;
85
86
        return $this->printFooter();
87
    }
88
89
    /**
90
     * Show default list of databases in the server.
91
     *
92
     * @param mixed $msg
93
     */
94
    public function doDefault($msg = '')
95
    {
96
        $this->printTrail('server');
97
        $this->printTabs('server', 'databases');
98
        $this->printMsg($msg);
99
        $data = $this->misc->getDatabaseAccessor();
100
101
        $databases = $data->getDatabases();
102
103
        $this->misc->setReloadBrowser(true);
104
105
        $href = $this->misc->getHREF();
106
107
        $columns = [
108
            'database'   => [
109
                'title' => $this->lang['strdatabase'],
110
                'field' => Decorator::field('datname'),
111
                'url'   => \SUBFOLDER . "/redirect/database?{$href}&amp;",
112
                'vars'  => ['database' => 'datname'],
113
            ],
114
            'owner'      => [
115
                'title' => $this->lang['strowner'],
116
                'field' => Decorator::field('datowner'),
117
            ],
118
            'encoding'   => [
119
                'title' => $this->lang['strencoding'],
120
                'field' => Decorator::field('datencoding'),
121
            ],
122
123
            'tablespace' => [
124
                'title' => $this->lang['strtablespace'],
125
                'field' => Decorator::field('tablespace'),
126
            ],
127
            'dbsize'     => [
128
                'title' => $this->lang['strsize'],
129
                'field' => Decorator::field('dbsize'),
130
                'type'  => 'prettysize',
131
            ],
132
            'lc_collate' => [
133
                'title' => $this->lang['strcollation'],
134
                'field' => Decorator::field('datcollate'),
135
            ],
136
            'lc_ctype'   => [
137
                'title' => $this->lang['strctype'],
138
                'field' => Decorator::field('datctype'),
139
            ],
140
            'actions'    => [
141
                'title' => $this->lang['stractions'],
142
            ],
143
            'comment'    => [
144
                'title' => $this->lang['strcomment'],
145
                'field' => Decorator::field('datcomment'),
146
            ],
147
        ];
148
149
        $actions = [
150
            'multiactions' => [
151
                'keycols' => ['database' => 'datname'],
152
                'url'     => 'alldb',
153
                'default' => null,
154
            ],
155
            'drop'         => [
156
                'content'     => $this->lang['strdrop'],
157
                'attr'        => [
158
                    'href' => [
159
                        'url'     => 'alldb',
160
                        'urlvars' => [
161
                            'subject'      => 'database',
162
                            'action'       => 'confirm_drop',
163
                            'dropdatabase' => Decorator::field('datname'),
164
                        ],
165
                    ],
166
                ],
167
                'multiaction' => 'confirm_drop',
168
            ],
169
            'privileges'   => [
170
                'content' => $this->lang['strprivileges'],
171
                'attr'    => [
172
                    'href' => [
173
                        'url'     => 'privileges',
174
                        'urlvars' => [
175
                            'subject'  => 'database',
176
                            'database' => Decorator::field('datname'),
177
                        ],
178
                    ],
179
                ],
180
            ],
181
        ];
182
        if ($data->hasAlterDatabase()) {
183
            $actions['alter'] = [
184
                'content' => $this->lang['stralter'],
185
                'attr'    => [
186
                    'href' => [
187
                        'url'     => 'alldb',
188
                        'urlvars' => [
189
                            'subject'       => 'database',
190
                            'action'        => 'confirm_alter',
191
                            'alterdatabase' => Decorator::field('datname'),
192
                        ],
193
                    ],
194
                ],
195
            ];
196
        }
197
198
        if (!$data->hasTablespaces()) {
199
            unset($columns['tablespace']);
200
        }
201
202
        if (!$data->hasServerAdminFuncs()) {
203
            unset($columns['dbsize']);
204
        }
205
206
        if (!$data->hasDatabaseCollation()) {
207
            unset($columns['lc_collate'], $columns['lc_ctype']);
208
        }
209
210
        if (!isset($data->privlist['database'])) {
211
            unset($actions['privileges']);
212
        }
213
214
        echo $this->printTable($databases, $columns, $actions, $this->table_place, $this->lang['strnodatabases']);
215
216
        $navlinks = [
217
            'create' => [
218
                'attr'    => [
219
                    'href' => [
220
                        'url'     => 'alldb',
221
                        'urlvars' => [
222
                            'action' => 'create',
223
                            'server' => $_REQUEST['server'],
224
                        ],
225
                    ],
226
                ],
227
                'content' => $this->lang['strcreatedatabase'],
228
            ],
229
        ];
230
        $this->printNavLinks($navlinks, $this->table_place, get_defined_vars());
231
    }
232
233
    public function doTree()
234
    {
235
        $data = $this->misc->getDatabaseAccessor();
236
237
        $databases = $data->getDatabases();
238
239
        $reqvars = $this->misc->getRequestVars('database');
240
241
        $attrs = [
242
            'text'    => Decorator::field('datname'),
243
            'icon'    => 'Database',
244
            'toolTip' => Decorator::field('datcomment'),
245
            'action'  => Decorator::redirecturl('redirect', $reqvars, ['subject' => 'database', 'database' => Decorator::field('datname')]),
246
            'branch'  => Decorator::url('/src/views/database', $reqvars, ['action' => 'tree', 'database' => Decorator::field('datname')]),
247
        ];
248
249
        return $this->printTree($databases, $attrs, 'databases');
250
    }
251
252
    /**
253
     * Display a form for alter and perform actual alter.
254
     *
255
     * @param mixed $confirm
256
     */
257
    public function doAlter($confirm)
258
    {
259
        $data = $this->misc->getDatabaseAccessor();
260
261
        if ($confirm) {
262
            $this->printTrail('database');
263
            $this->printTitle($this->lang['stralter'], 'pg.database.alter');
264
265
            echo '<form action="' . \SUBFOLDER . "/src/views/alldb\" method=\"post\">\n";
266
            echo "<table>\n";
267
            echo "<tr><th class=\"data left required\">{$this->lang['strname']}</th>\n";
268
            echo '<td class="data1">';
269
            echo "<input name=\"newname\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
270
            htmlspecialchars($_REQUEST['alterdatabase']), "\" /></td></tr>\n";
271
272
            if ($data->hasAlterDatabaseOwner() && $data->isSuperUser()) {
273
                // Fetch all users
274
275
                $rs    = $data->getDatabaseOwner($_REQUEST['alterdatabase']);
276
                $owner = isset($rs->fields['usename']) ? $rs->fields['usename'] : '';
277
                $users = $data->getUsers();
278
279
                echo "<tr><th class=\"data left required\">{$this->lang['strowner']}</th>\n";
280
                echo '<td class="data1"><select name="owner">';
281
                while (!$users->EOF) {
282
                    $uname = $users->fields['usename'];
283
                    echo '<option value="', htmlspecialchars($uname), '"',
284
                    ($uname == $owner) ? ' selected="selected"' : '', '>', htmlspecialchars($uname), "</option>\n";
285
                    $users->moveNext();
286
                }
287
                echo "</select></td></tr>\n";
288
            }
289
            if ($data->hasSharedComments()) {
290
                $rs      = $data->getDatabaseComment($_REQUEST['alterdatabase']);
291
                $comment = isset($rs->fields['description']) ? $rs->fields['description'] : '';
292
                echo "<tr><th class=\"data left\">{$this->lang['strcomment']}</th>\n";
293
                echo '<td class="data1">';
294
                echo '<textarea rows="3" cols="32" name="dbcomment">',
295
                htmlspecialchars($comment), "</textarea></td></tr>\n";
296
            }
297
            echo "</table>\n";
298
            echo "<input type=\"hidden\" name=\"action\" value=\"alter\" />\n";
299
            echo $this->misc->form;
300
            echo '<input type="hidden" name="oldname" value="',
301
            htmlspecialchars($_REQUEST['alterdatabase']), "\" />\n";
302
            echo "<input type=\"submit\" name=\"alter\" value=\"{$this->lang['stralter']}\" />\n";
303
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />\n";
304
            echo "</form>\n";
305
        } else {
306
            if (!isset($_POST['owner'])) {
307
                $_POST['owner'] = '';
308
            }
309
310
            if (!isset($_POST['dbcomment'])) {
311
                $_POST['dbcomment'] = '';
312
            }
313
314
            if (0 == $data->alterDatabase($_POST['oldname'], $_POST['newname'], $_POST['owner'], $_POST['dbcomment'])) {
315
                $this->misc->setReloadBrowser(true);
316
                $this->doDefault($this->lang['strdatabasealtered']);
317
            } else {
318
                $this->doDefault($this->lang['strdatabasealteredbad']);
319
            }
320
        }
321
    }
322
323
    /**
324
     * Show confirmation of drop and perform actual drop.
325
     *
326
     * @param mixed $confirm
327
     */
328
    public function doDrop($confirm)
329
    {
330
        $data = $this->misc->getDatabaseAccessor();
331
332
        if (empty($_REQUEST['dropdatabase']) && empty($_REQUEST['ma'])) {
333
            return $this->doDefault($this->lang['strspecifydatabasetodrop']);
334
        }
335
336
        if ($confirm) {
337
            $this->printTrail('database');
338
            $this->printTitle($this->lang['strdrop'], 'pg.database.drop');
339
340
            echo '<form action="' . \SUBFOLDER . "/src/views/alldb\" method=\"post\">\n";
341
            //If multi drop
342
            if (isset($_REQUEST['ma'])) {
343
                foreach ($_REQUEST['ma'] as $v) {
344
                    $a = unserialize(htmlspecialchars_decode($v, ENT_QUOTES));
345
                    echo '<p>', sprintf($this->lang['strconfdropdatabase'], $this->misc->printVal($a['database'])), "</p>\n";
346
                    printf('<input type="hidden" name="dropdatabase[]" value="%s" />', htmlspecialchars($a['database']));
347
                }
348
            } else {
349
                echo '<p>', sprintf($this->lang['strconfdropdatabase'], $this->misc->printVal($_REQUEST['dropdatabase'])), "</p>\n";
350
                echo '<input type="hidden" name="dropdatabase" value="', htmlspecialchars($_REQUEST['dropdatabase']), "\" />\n";
351
                // END if multi drop
352
            }
353
354
            echo "<input type=\"hidden\" name=\"action\" value=\"drop\" />\n";
355
            echo $this->misc->form;
356
            echo "<input type=\"submit\" name=\"drop\" value=\"{$this->lang['strdrop']}\" />\n";
357
            echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" />\n";
358
            echo "</form>\n"; //  END confirm
359
        } else {
360
            //If multi drop
361
            if (is_array($_REQUEST['dropdatabase'])) {
362
                $msg = '';
363
                foreach ($_REQUEST['dropdatabase'] as $d) {
364
                    $status = $data->dropDatabase($d);
365
                    if (0 == $status) {
366
                        $msg .= sprintf('%s: %s<br />', htmlentities($d, ENT_QUOTES, 'UTF-8'), $this->lang['strdatabasedropped']);
367
                    } else {
368
                        $this->doDefault(sprintf('%s%s: %s<br />', $msg, htmlentities($d, ENT_QUOTES, 'UTF-8'), $this->lang['strdatabasedroppedbad']));
369
370
                        return;
371
                    }
372
                    // Everything went fine, back to Default page...
373
                }
374
                $this->setReloadDropDatabase(true);
375
                $this->doDefault($msg);
376
            } else {
377
                $status = $data->dropDatabase($_POST['dropdatabase']);
378
                if (0 == $status) {
379
                    $this->setReloadDropDatabase(true);
380
                    $this->doDefault($this->lang['strdatabasedropped']);
381
                } else {
382
                    $this->doDefault($this->lang['strdatabasedroppedbad']);
383
                }
384
            }
385
            //END DROP
386
        }
387
    }
388
389
    // END FUNCTION
390
391
    /**
392
     * Displays a screen where they can enter a new database.
393
     *
394
     * @param mixed $msg
395
     */
396
    public function doCreate($msg = '')
397
    {
398
        $data = $this->misc->getDatabaseAccessor();
399
400
        $this->printTrail('server');
401
        $this->printTitle($this->lang['strcreatedatabase'], 'pg.database.create');
402
        $this->printMsg($msg);
403
404
        $this->coalesceArr($_POST, 'formName', '');
405
406
        // Default encoding is that in language file
407
        $this->coalesceArr($_POST, 'formEncoding', '');
408
        $this->coalesceArr($_POST, 'formTemplate', 'template1');
409
410
        $this->coalesceArr($_POST, 'formSpc', '');
411
412
        $this->coalesceArr($_POST, 'formComment', '');
413
414
        // Fetch a list of databases in the cluster
415
        $templatedbs = $data->getDatabases(false);
416
417
        $tablespaces = null;
418
        // Fetch all tablespaces from the database
419
        if ($data->hasTablespaces()) {
420
            $tablespaces = $data->getTablespaces();
421
        }
422
423
        echo '<form action="' . \SUBFOLDER . "/src/views/alldb\" method=\"post\">\n";
424
        echo "<table>\n";
425
        echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strname']}</th>\n";
426
        echo "\t\t<td class=\"data1\"><input name=\"formName\" size=\"32\" maxlength=\"{$data->_maxNameLen}\" value=\"",
427
        htmlspecialchars($_POST['formName']), "\" /></td>\n\t</tr>\n";
428
429
        echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strtemplatedb']}</th>\n";
430
        echo "\t\t<td class=\"data1\">\n";
431
        echo "\t\t\t<select name=\"formTemplate\">\n";
432
        // Always offer template0 and template1
433
        echo "\t\t\t\t<option value=\"template0\"",
434
        ('template0' == $_POST['formTemplate']) ? ' selected="selected"' : '', ">template0</option>\n";
435
        echo "\t\t\t\t<option value=\"template1\"",
436
        ('template1' == $_POST['formTemplate']) ? ' selected="selected"' : '', ">template1</option>\n";
437
        while (!$templatedbs->EOF) {
438
            $dbname = htmlspecialchars($templatedbs->fields['datname']);
439
            if ('template1' != $dbname) {
440
                // filter out for $this->conf[show_system] users so we dont get duplicates
441
                echo "\t\t\t\t<option value=\"{$dbname}\"",
442
                ($dbname == $_POST['formTemplate']) ? ' selected="selected"' : '', ">{$dbname}</option>\n";
443
            }
444
            $templatedbs->moveNext();
445
        }
446
        echo "\t\t\t</select>\n";
447
        echo "\t\t</td>\n\t</tr>\n";
448
449
        // ENCODING
450
        echo "\t<tr>\n\t\t<th class=\"data left required\">{$this->lang['strencoding']}</th>\n";
451
        echo "\t\t<td class=\"data1\">\n";
452
        echo "\t\t\t<select name=\"formEncoding\">\n";
453
        echo "\t\t\t\t<option value=\"\"></option>\n";
454
455
        foreach ($data->codemap as $key) {
456
            echo "\t\t\t\t<option value=\"", htmlspecialchars($key), '"',
457
            ($key == $_POST['formEncoding']) ? ' selected="selected"' : '', '>',
458
            $this->misc->printVal($key), "</option>\n";
459
        }
460
        echo "\t\t\t</select>\n";
461
        echo "\t\t</td>\n\t</tr>\n";
462
463
        if ($data->hasDatabaseCollation()) {
464
            $this->coalesceArr($_POST, 'formCollate', '');
465
466
            $this->coalesceArr($_POST, 'formCType', '');
467
468
            // LC_COLLATE
469
            echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strcollation']}</th>\n";
470
            echo "\t\t<td class=\"data1\">\n";
471
            echo "\t\t\t<input name=\"formCollate\" value=\"", htmlspecialchars($_POST['formCollate']), "\" />\n";
472
            echo "\t\t</td>\n\t</tr>\n";
473
474
            // LC_CTYPE
475
            echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strctype']}</th>\n";
476
            echo "\t\t<td class=\"data1\">\n";
477
            echo "\t\t\t<input name=\"formCType\" value=\"", htmlspecialchars($_POST['formCType']), "\" />\n";
478
            echo "\t\t</td>\n\t</tr>\n";
479
        }
480
481
        // Tablespace (if there are any)
482
        if ($data->hasTablespaces() && $tablespaces->recordCount() > 0) {
483
            echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strtablespace']}</th>\n";
484
            echo "\t\t<td class=\"data1\">\n\t\t\t<select name=\"formSpc\">\n";
485
            // Always offer the default (empty) option
486
            echo "\t\t\t\t<option value=\"\"",
487
            ('' == $_POST['formSpc']) ? ' selected="selected"' : '', "></option>\n";
488
            // Display all other tablespaces
489
            while (!$tablespaces->EOF) {
490
                $spcname = htmlspecialchars($tablespaces->fields['spcname']);
491
                echo "\t\t\t\t<option value=\"{$spcname}\"",
492
                ($spcname == $_POST['formSpc']) ? ' selected="selected"' : '', ">{$spcname}</option>\n";
493
                $tablespaces->moveNext();
494
            }
495
            echo "\t\t\t</select>\n\t\t</td>\n\t</tr>\n";
496
        }
497
498
        // Comments (if available)
499
        if ($data->hasSharedComments()) {
500
            echo "\t<tr>\n\t\t<th class=\"data left\">{$this->lang['strcomment']}</th>\n";
501
            echo "\t\t<td><textarea name=\"formComment\" rows=\"3\" cols=\"32\">",
502
            htmlspecialchars($_POST['formComment']), "</textarea></td>\n\t</tr>\n";
503
        }
504
505
        echo "</table>\n";
506
        echo "<p><input type=\"hidden\" name=\"action\" value=\"save_create\" />\n";
507
        echo $this->misc->form;
508
        echo "<input type=\"submit\" value=\"{$this->lang['strcreate']}\" />\n";
509
        echo "<input type=\"submit\" name=\"cancel\" value=\"{$this->lang['strcancel']}\" /></p>\n";
510
        echo "</form>\n";
511
    }
512
513
    /**
514
     * Actually creates the new view in the database.
515
     */
516
    public function doSaveCreate()
517
    {
518
        $data = $this->misc->getDatabaseAccessor();
519
520
        // Default tablespace to null if it isn't set
521
        $this->coalesceArr($_POST, 'formSpc', null);
522
523
        // Default comment to blank if it isn't set
524
        $this->coalesceArr($_POST, 'formComment', null);
525
526
        // Default collate to blank if it isn't set
527
        $this->coalesceArr($_POST, 'formCollate', null);
528
529
        // Default ctype to blank if it isn't set
530
        $this->coalesceArr($_POST, 'formCType', null);
531
532
        // Check that they've given a name and a definition
533
        if ('' == $_POST['formName']) {
534
            $this->doCreate($this->lang['strdatabaseneedsname']);
535
        } else {
536
            $status = $data->createDatabase(
537
                $_POST['formName'],
538
                $_POST['formEncoding'],
539
                $_POST['formSpc'],
540
                $_POST['formComment'],
541
                $_POST['formTemplate'],
542
                $_POST['formCollate'],
543
                $_POST['formCType']
544
            );
545
            if (0 == $status) {
546
                $this->misc->setReloadBrowser(true);
547
                $this->doDefault($this->lang['strdatabasecreated']);
548
            } else {
549
                $this->doCreate($this->lang['strdatabasecreatedbad']);
550
            }
551
        }
552
    }
553
554
    /**
555
     * Displays options for cluster download.
556
     *
557
     * @param mixed $msg
558
     */
559
    public function doExport($msg = '')
560
    {
561
        $this->printTrail('server');
562
        $this->printTabs('server', 'export');
563
        $this->printMsg($msg);
564
565
        echo '<form action="' . \SUBFOLDER . "/src/views/dbexport\" method=\"post\">\n";
566
        echo "<table>\n";
567
        echo "<tr><th class=\"data\">{$this->lang['strformat']}</th><th class=\"data\">{$this->lang['stroptions']}</th></tr>\n";
568
        // Data only
569
        echo '<tr><th class="data left" rowspan="2">';
570
        echo "<input type=\"radio\" id=\"what1\" name=\"what\" value=\"dataonly\" checked=\"checked\" /><label for=\"what1\">{$this->lang['strdataonly']}</label></th>\n";
571
        echo "<td>{$this->lang['strformat']}\n";
572
        echo "<select name=\"d_format\">\n";
573
        echo "<option value=\"copy\">COPY</option>\n";
574
        echo "<option value=\"sql\">SQL</option>\n";
575
        echo "</select>\n</td>\n</tr>\n";
576
        echo "<tr><td><input type=\"checkbox\" id=\"d_oids\" name=\"d_oids\" /><label for=\"d_oids\">{$this->lang['stroids']}</label></td>\n</tr>\n";
577
        // Structure only
578
        echo "<tr><th class=\"data left\"><input type=\"radio\" id=\"what2\" name=\"what\" value=\"structureonly\" /><label for=\"what2\">{$this->lang['strstructureonly']}</label></th>\n";
579
        echo "<td><input type=\"checkbox\" id=\"s_clean\" name=\"s_clean\" /><label for=\"s_clean\">{$this->lang['strdrop']}</label></td>\n</tr>\n";
580
        // Structure and data
581
        echo '<tr><th class="data left" rowspan="3">';
582
        echo "<input type=\"radio\" id=\"what3\" name=\"what\" value=\"structureanddata\" /><label for=\"what3\">{$this->lang['strstructureanddata']}</label></th>\n";
583
        echo "<td>{$this->lang['strformat']}\n";
584
        echo "<select name=\"sd_format\">\n";
585
        echo "<option value=\"copy\">COPY</option>\n";
586
        echo "<option value=\"sql\">SQL</option>\n";
587
        echo "</select>\n</td>\n</tr>\n";
588
        echo "<tr><td><input type=\"checkbox\" id=\"sd_clean\" name=\"sd_clean\" /><label for=\"sd_clean\">{$this->lang['strdrop']}</label></td>\n</tr>\n";
589
        echo "<tr><td><input type=\"checkbox\" id=\"sd_oids\" name=\"sd_oids\" /><label for=\"sd_oids\">{$this->lang['stroids']}</label></td>\n</tr>\n";
590
        echo "</table>\n";
591
592
        echo "<h3>{$this->lang['stroptions']}</h3>\n";
593
        echo "<p><input type=\"radio\" id=\"output1\" name=\"output\" value=\"show\" checked=\"checked\" /><label for=\"output1\">{$this->lang['strshow']}</label>\n";
594
        echo "<br/><input type=\"radio\" id=\"output2\" name=\"output\" value=\"download\" /><label for=\"output2\">{$this->lang['strdownload']}</label></p>\n";
595
596
        echo "<p><input type=\"hidden\" name=\"action\" value=\"export\" />\n";
597
        echo "<input type=\"hidden\" name=\"subject\" value=\"server\" />\n";
598
        echo $this->misc->form;
599
        echo "<input type=\"submit\" value=\"{$this->lang['strexport']}\" /></p>\n";
600
        echo "</form>\n";
601
    }
602
}
603