Translation update done using Pootle.
[phpmyadmin/sankalp_k.git] / tbl_tracking.php
blob757456be64fd16aed7e9ff89bd9cbff67a6dd7e1
1 <?php
2 /* vim: set expandtab sw=4 ts=4 sts=4: */
3 /**
5 * @package phpMyAdmin
6 */
8 // Run common work
9 require_once './libraries/common.inc.php';
11 define('TABLE_MAY_BE_ABSENT', true);
12 require './libraries/tbl_common.php';
13 $url_query .= '&amp;goto=tbl_tracking.php&amp;back=tbl_tracking.php';
14 $url_params['goto'] = 'tbl_tracking.php';;
15 $url_params['back'] = 'tbl_tracking.php';
17 // Init vars for tracking report
18 if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
19 $data = PMA_Tracker::getTrackedData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version']);
21 $selection_schema = false;
22 $selection_data = false;
23 $selection_both = false;
25 if (! isset($_REQUEST['logtype'])) {
26 $_REQUEST['logtype'] = 'schema_and_data';
28 if ($_REQUEST['logtype'] == 'schema') {
29 $selection_schema = true;
30 } elseif($_REQUEST['logtype'] == 'data') {
31 $selection_data = true;
32 } else {
33 $selection_both = true;
35 if (! isset($_REQUEST['date_from'])) {
36 $_REQUEST['date_from'] = $data['date_from'];
38 if (! isset($_REQUEST['date_to'])) {
39 $_REQUEST['date_to'] = $data['date_to'];
41 if (! isset($_REQUEST['users'])) {
42 $_REQUEST['users'] = '*';
44 $filter_ts_from = strtotime($_REQUEST['date_from']);
45 $filter_ts_to = strtotime($_REQUEST['date_to']);
46 $filter_users = array_map('trim', explode(',', $_REQUEST['users']));
49 // Prepare export
50 if (isset($_REQUEST['report_export'])) {
52 /**
53 * Filters tracking entries
55 * @param array the entries to filter
56 * @param string "from" date
57 * @param string "to" date
58 * @param string users
60 * @return array filtered entries
63 function PMA_filter_tracking($data, $filter_ts_from, $filter_ts_to, $filter_users) {
64 $tmp_entries = array();
65 $id = 0;
66 foreach( $data as $entry ) {
67 $timestamp = strtotime($entry['date']);
69 if ($timestamp >= $filter_ts_from && $timestamp <= $filter_ts_to &&
70 ( in_array('*', $filter_users) || in_array($entry['username'], $filter_users) ) ) {
71 $tmp_entries[] = array( 'id' => $id,
72 'timestamp' => $timestamp,
73 'username' => $entry['username'],
74 'statement' => $entry['statement']
77 $id++;
79 return($tmp_entries);
82 $entries = array();
83 // Filtering data definition statements
84 if ($_REQUEST['logtype'] == 'schema' || $_REQUEST['logtype'] == 'schema_and_data') {
85 $entries = array_merge($entries, PMA_filter_tracking($data['ddlog'], $filter_ts_from, $filter_ts_to, $filter_users));
88 // Filtering data manipulation statements
89 if ($_REQUEST['logtype'] == 'data' || $_REQUEST['logtype'] == 'schema_and_data') {
90 $entries = array_merge($entries, PMA_filter_tracking($data['dmlog'], $filter_ts_from, $filter_ts_to, $filter_users));
93 // Sort it
94 foreach ($entries as $key => $row) {
95 $ids[$key] = $row['id'];
96 $timestamps[$key] = $row['timestamp'];
97 $usernames[$key] = $row['username'];
98 $statements[$key] = $row['statement'];
101 array_multisort($timestamps, SORT_ASC, $ids, SORT_ASC, $usernames, SORT_ASC, $statements, SORT_ASC, $entries);
105 // Export as file download
106 if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldumpfile') {
107 @ini_set('url_rewriter.tags','');
109 $dump = "# " . sprintf(__('Tracking report for table `%s`'), htmlspecialchars($_REQUEST['table'])) . "\n" .
110 "# " . date('Y-m-d H:i:s') . "\n";
111 foreach($entries as $entry) {
112 $dump .= $entry['statement'];
114 $filename = 'log_' . htmlspecialchars($_REQUEST['table']) . '.sql';
115 header('Content-Type: text/x-sql');
116 header('Expires: ' . gmdate('D, d M Y H:i:s') . ' GMT');
117 header('Content-Disposition: attachment; filename="' . $filename . '"');
118 if (PMA_USR_BROWSER_AGENT == 'IE') {
119 header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
120 header('Pragma: public');
121 } else {
122 header('Pragma: no-cache');
123 header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
126 echo $dump;
127 exit();
132 * Gets tables informations
136 * Displays top menu links
138 require_once './libraries/tbl_links.inc.php';
139 echo '<br />';
142 * Actions
145 // Create tracking version
146 if (isset($_REQUEST['submit_create_version'])) {
147 $tracking_set = '';
149 if ($_REQUEST['alter_table'] == true) {
150 $tracking_set .= 'ALTER TABLE,';
152 if ($_REQUEST['rename_table'] == true) {
153 $tracking_set .= 'RENAME TABLE,';
155 if ($_REQUEST['create_table'] == true) {
156 $tracking_set .= 'CREATE TABLE,';
158 if ($_REQUEST['drop_table'] == true) {
159 $tracking_set .= 'DROP TABLE,';
161 if ($_REQUEST['create_index'] == true) {
162 $tracking_set .= 'CREATE INDEX,';
164 if ($_REQUEST['drop_index'] == true) {
165 $tracking_set .= 'DROP INDEX,';
167 if ($_REQUEST['insert'] == true) {
168 $tracking_set .= 'INSERT,';
170 if ($_REQUEST['update'] == true) {
171 $tracking_set .= 'UPDATE,';
173 if ($_REQUEST['delete'] == true) {
174 $tracking_set .= 'DELETE,';
176 if ($_REQUEST['truncate'] == true) {
177 $tracking_set .= 'TRUNCATE,';
179 $tracking_set = rtrim($tracking_set, ',');
181 if (PMA_Tracker::createVersion($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'], $tracking_set )) {
182 $msg = PMA_Message::success(sprintf(__('Version %s is created, tracking for %s.%s is activated.'), $_REQUEST['version'], $GLOBALS['db'], $GLOBALS['table']));
183 $msg->display();
187 // Deactivate tracking
188 if (isset($_REQUEST['submit_deactivate_now'])) {
189 if (PMA_Tracker::deactivateTracking($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'])) {
190 $msg = PMA_Message::success(sprintf(__('Tracking for %s.%s , version %s is deactivated.'), $GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version']));
191 $msg->display();
195 // Activate tracking
196 if (isset($_REQUEST['submit_activate_now'])) {
197 if (PMA_Tracker::activateTracking($GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version'])) {
198 $msg = PMA_Message::success(sprintf(__('Tracking for %s.%s , version %s is activated.'), $GLOBALS['db'], $GLOBALS['table'], $_REQUEST['version']));
199 $msg->display();
203 // Export as SQL execution
204 if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'execution') {
205 foreach($entries as $entry) {
206 $sql_result = PMA_DBI_query( "/*NOTRACK*/\n" . $entry['statement'] );
208 $msg = PMA_Message::success(__('SQL statements executed.'));
209 $msg->display();
212 // Export as SQL dump
213 if (isset($_REQUEST['report_export']) && $_REQUEST['export_type'] == 'sqldump')
215 $new_query = "# " . __('You can execute the dump by creating and using a temporary database. Please ensure that you have the privileges to do so.') . "\n" .
216 "# " . __('Comment out these two lines if you do not need them.') . "\n" .
217 "\n" .
218 "CREATE database IF NOT EXISTS pma_temp_db; \n" .
219 "USE pma_temp_db; \n" .
220 "\n";
222 foreach($entries as $entry) {
223 $new_query .= $entry['statement'];
225 $msg = PMA_Message::success(__('SQL statements exported. Please copy the dump or execute it.'));
226 $msg->display();
228 $db_temp = $db;
229 $table_temp = $table;
231 $db = $table = '';
232 require_once './libraries/sql_query_form.lib.php';
234 PMA_sqlQueryForm($new_query, 'sql');
236 $db = $db_temp;
237 $table = $table_temp;
241 * Schema snapshot
243 if (isset($_REQUEST['snapshot'])) {
245 <h3><?php echo __('Structure snapshot');?> [<a href="tbl_tracking.php?<?php echo $url_query;?>"><?php echo __('Close');?></a>]</h3>
246 <?php
247 $data = PMA_Tracker::getTrackedData($_REQUEST['db'], $_REQUEST['table'], $_REQUEST['version']);
249 // Get first DROP TABLE and CREATE TABLE statements
250 $drop_create_statements = $data['ddlog'][0]['statement'];
252 if (strstr($data['ddlog'][0]['statement'], 'DROP TABLE')) {
253 $drop_create_statements .= $data['ddlog'][1]['statement'];
255 // Print SQL code
256 PMA_showMessage(sprintf(__('Version %s snapshot (SQL code)'), $_REQUEST['version']), $drop_create_statements);
258 // Unserialize snapshot
259 $temp = unserialize($data['schema_snapshot']);
260 $columns = $temp['COLUMNS'];
261 $indexes = $temp['INDEXES'];
263 <h3><?php echo __('Structure');?></h3>
264 <table id="tablestructure" class="data">
265 <thead>
266 <tr>
267 <th><?php echo __('Column'); ?></th>
268 <th><?php echo __('Type'); ?></th>
269 <th><?php echo __('Collation'); ?></th>
270 <th><?php echo __('Null'); ?></th>
271 <th><?php echo __('Default'); ?></th>
272 <th><?php echo __('Extra'); ?></th>
273 <th><?php echo __('Comment'); ?></th>
274 </tr>
275 </thead>
276 <tbody>
277 <?php
278 $style = 'odd';
279 foreach($columns as $field_index => $field) {
281 <tr class="noclick <?php echo $style; ?>">
282 <?php
283 if ($field['Key'] == 'PRI') {
284 echo '<td><b><u>' . $field['Field'] . '</u></b></td>' . "\n";
285 } else {
286 echo '<td><b>' . $field['Field'] . '</b></td>' . "\n";
289 <td><?php echo $field['Type'];?></td>
290 <td><?php echo $field['Collation'];?></td>
291 <td><?php echo $field['Null'];?></td>
292 <td><?php echo $field['Default'];?></td>
293 <td><?php echo $field['Extra'];?></td>
294 <td><?php echo $field['Comment'];?></td>
295 </tr>
296 <?php
297 if ($style == 'even') {
298 $style = 'odd';
299 } else {
300 $style = 'even';
304 </tbody>
305 </table>
307 <?php
308 if (count($indexes) > 0) {
310 <h3><?php echo __('Indexes');?></h3>
311 <table id="tablestructure_indexes" class="data">
312 <thead>
313 <tr>
314 <th><?php echo __('Keyname');?></th>
315 <th><?php echo __('Type');?></th>
316 <th><?php echo __('Unique');?></th>
317 <th><?php echo __('Packed');?></th>
318 <th><?php echo __('Column');?></th>
319 <th><?php echo __('Cardinality');?></th>
320 <th><?php echo __('Collation');?></th>
321 <th><?php echo __('Null');?></th>
322 <th><?php echo __('Comment');?></th>
323 </tr>
324 <tbody>
325 <?php
326 $style = 'odd';
327 foreach ($indexes as $indexes_index => $index) {
328 if ($index['Non_unique'] == 0) {
329 $str_unique = __('Yes');
330 } else {
331 $str_unique = __('No');
333 if ($index['Packed'] != '') {
334 $str_packed = __('Yes');
335 } else {
336 $str_packed = __('No');
339 <tr class="noclick <?php echo $style; ?>">
340 <td><b><?php echo $index['Key_name'];?></b></td>
341 <td><?php echo $index['Index_type'];?></td>
342 <td><?php echo $str_unique;?></td>
343 <td><?php echo $str_packed;?></td>
344 <td><?php echo $index['Column_name'];?></td>
345 <td><?php echo $index['Cardinality'];?></td>
346 <td><?php echo $index['Collation'];?></td>
347 <td><?php echo $index['Null'];?></td>
348 <td><?php echo $index['Comment'];?></td>
349 </tr>
350 <?php
351 if ($style == 'even') {
352 $style = 'odd';
353 } else {
354 $style = 'even';
358 </tbody>
359 </table>
360 <?php
361 } // endif
363 <br /><hr /><br />
364 <?php
366 // end of snapshot report
369 * Tracking report
371 if (isset($_REQUEST['report']) || isset($_REQUEST['report_export'])) {
373 <h3><?php echo __('Tracking report');?> [<a href="tbl_tracking.php?<?php echo $url_query;?>"><?php echo __('Close');?></a>]</h3>
375 <small><?php echo __('Tracking statements') . ' ' . $data['tracking']; ?></small><br/>
376 <br/>
378 <form method="post" action="tbl_tracking.php?<?php echo $url_query; ?>&amp;report=true&amp;version=<?php echo $_REQUEST['version'];?>">
379 <?php
381 $str1 = '<select name="logtype">' .
382 '<option value="schema"' . ($selection_schema ? ' selected="selected"' : '') . '>' . __('Structure only') . '</option>' .
383 '<option value="data"' . ($selection_data ? ' selected="selected"' : ''). '>' . __('Data only') . '</option>' .
384 '<option value="schema_and_data"' . ($selection_both ? ' selected="selected"' : '') . '>' . __('Structure and data') . '</option>' .
385 '</select>';
386 $str2 = '<input type="text" name="date_from" value="' . $_REQUEST['date_from'] . '" size="19" />';
387 $str3 = '<input type="text" name="date_to" value="' . $_REQUEST['date_to'] . '" size="19" />';
388 $str4 = '<input type="text" name="users" value="' . $_REQUEST['users'] . '" />';
389 $str5 = '<input type="submit" name="list_report" value="' . __('Go') . '" />';
391 printf(__('Show %s with dates from %s to %s by user %s %s'), $str1, $str2, $str3, $str4, $str5);
395 * First, list tracked data definition statements
397 $i = 1;
398 if ($selection_schema || $selection_both ) {
400 <table id="ddl_versions" class="data" width="100%">
401 <thead>
402 <tr>
403 <th width="18">#</th>
404 <th width="100"><?php echo __('Date');?></th>
405 <th width="60"><?php echo __('Username');?></th>
406 <th><?php echo __('Data definition statement');?></th>
407 </tr>
408 </thead>
409 <tbody>
410 <?php
411 $style = 'odd';
412 foreach ($data['ddlog'] as $entry) {
413 if (strlen($entry['statement']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
414 $statement = substr($entry['statement'], 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]';
415 } else {
416 $statement = PMA_formatSql(PMA_SQP_parse($entry['statement']));
418 $timestamp = strtotime($entry['date']);
420 if ($timestamp >= $filter_ts_from && $timestamp <= $filter_ts_to &&
421 ( in_array('*', $filter_users) || in_array($entry['username'], $filter_users) ) ) {
423 <tr class="noclick <?php echo $style; ?>">
424 <td><small><?php echo $i;?></small></td>
425 <td><small><?php echo $entry['date'];?></small></td>
426 <td><small><?php echo $entry['username']; ?></small></td>
427 <td><?php echo $statement; ?></td>
428 </tr>
429 <?php
430 if ($style == 'even') {
431 $style = 'odd';
432 } else {
433 $style = 'even';
435 $i++;
439 </tbody>
440 </table>
441 <?php
443 } //endif
446 * Secondly, list tracked data manipulation statements
449 if (($selection_data || $selection_both) && count($data['dmlog']) > 0) {
451 <table id="dml_versions" class="data" width="100%">
452 <thead>
453 <tr>
454 <th width="18">#</th>
455 <th width="100"><?php echo __('Date');?></th>
456 <th width="60"><?php echo __('Username');?></th>
457 <th><?php echo __('Data manipulation statement');?></th>
458 </tr>
459 </thead>
460 <tbody>
461 <?php
462 $style = 'odd';
463 foreach ($data['dmlog'] as $entry) {
464 if (strlen($entry['statement']) > $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) {
465 $statement = substr($entry['statement'], 0, $GLOBALS['cfg']['MaxCharactersInDisplayedSQL']) . '[...]';
466 } else {
467 $statement = PMA_formatSql(PMA_SQP_parse($entry['statement']));
469 $timestamp = strtotime($entry['date']);
471 if ($timestamp >= $filter_ts_from && $timestamp <= $filter_ts_to &&
472 ( in_array('*', $filter_users) || in_array($entry['username'], $filter_users) ) ) {
474 <tr class="noclick <?php echo $style; ?>">
475 <td><small><?php echo $i; ?></small></td>
476 <td><small><?php echo $entry['date']; ?></small></td>
477 <td><small><?php echo $entry['username']; ?></small></td>
478 <td><?php echo $statement; ?></td>
479 </tr>
480 <?php
481 if ($style == 'even') {
482 $style = 'odd';
483 } else {
484 $style = 'even';
486 $i++;
490 </tbody>
491 </table>
492 <?php
495 </form>
496 <form method="post" action="tbl_tracking.php?<?php echo $url_query; ?>&amp;report=true&amp;version=<?php echo $_REQUEST['version'];?>">
497 <?php
498 printf(__('Show %s with dates from %s to %s by user %s %s'), $str1, $str2, $str3, $str4, $str5);
500 $str_export1 = '<select name="export_type">' .
501 '<option value="sqldumpfile">' . __('SQL dump (file download)') . '</option>' .
502 '<option value="sqldump">' . __('SQL dump') . '</option>' .
503 '<option value="execution" onclick="alert(\'' . PMA_escapeJsString(__('This option will replace your table and contained data.')) .'\')">' . __('SQL execution') . '</option>' .
504 '</select>';
506 $str_export2 = '<input type="submit" name="report_export" value="' . __('Go') .'" />';
508 </form>
509 <form method="post" action="tbl_tracking.php?<?php echo $url_query; ?>&amp;report=true&amp;version=<?php echo $_REQUEST['version'];?>">
510 <input type="hidden" name="logtype" value="<?php echo $_REQUEST['logtype'];?>" />
511 <input type="hidden" name="date_from" value="<?php echo $_REQUEST['date_from'];?>" />
512 <input type="hidden" name="date_to" value="<?php echo $_REQUEST['date_to'];?>" />
513 <input type="hidden" name="users" value="<?php echo $_REQUEST['users'];?>" />
514 <?php
515 echo "<br/>" . sprintf(__('Export as %s'), $str_export1) . $str_export2 . "<br/>";
517 </form>
518 <?php
519 echo "<br/><br/><hr/><br/>\n";
520 } // end of report
524 * List selectable tables
527 $sql_query = " SELECT DISTINCT db_name, table_name FROM " .
528 PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) . "." .
529 PMA_backquote($GLOBALS['cfg']['Server']['tracking']) .
530 " WHERE " . PMA_backquote('db_name') . " = '" . PMA_sqlAddslashes($GLOBALS['db']) . "' " .
531 " ORDER BY ". PMA_backquote('db_name') . ", " . PMA_backquote('table_name');
533 $sql_result = PMA_query_as_controluser($sql_query);
535 if (PMA_DBI_num_rows($sql_result) > 0) {
537 <form method="post" action="tbl_tracking.php?<?php echo $url_query;?>">
538 <select name="table">
539 <?php
540 while ($entries = PMA_DBI_fetch_array($sql_result)) {
541 if (PMA_Tracker::isTracked($entries['db_name'], $entries['table_name'])) {
542 $status = ' (' . __('active') . ')';
543 } else {
544 $status = ' (' . __('not active') . ')';
546 if ($entries['table_name'] == $_REQUEST['table']) {
547 $s = ' selected="selected"';
548 } else {
549 $s = '';
551 echo '<option value="' . htmlspecialchars($entries['table_name']) . '"' . $s . '>' . htmlspecialchars($entries['db_name']) . ' . ' . htmlspecialchars($entries['table_name']) . $status . '</option>' . "\n";
554 </select>
555 <input type="submit" name="show_versions_submit" value="<?php echo __('Show versions');?>" />
556 </form>
557 <?php
560 <br />
561 <?php
564 * List versions of current table
567 $sql_query = " SELECT * FROM " .
568 PMA_backquote($GLOBALS['cfg']['Server']['pmadb']) . "." .
569 PMA_backquote($GLOBALS['cfg']['Server']['tracking']) .
570 " WHERE " . PMA_backquote('db_name') . " = '" . PMA_sqlAddslashes($_REQUEST['db']) . "' ".
571 " AND " . PMA_backquote('table_name') . " = '" . PMA_sqlAddslashes($_REQUEST['table']) ."' ".
572 " ORDER BY ". PMA_backquote('version') . " DESC ";
574 $sql_result = PMA_query_as_controluser($sql_query);
576 $last_version = 0;
577 $maxversion = PMA_DBI_fetch_array($sql_result);
578 $last_version = $maxversion['version'];
580 if ($last_version > 0) {
582 <table id="versions" class="data">
583 <thead>
584 <tr>
585 <th><?php echo __('Database');?></th>
586 <th><?php echo __('Table');?></th>
587 <th><?php echo __('Version');?></th>
588 <th><?php echo __('Created');?></th>
589 <th><?php echo __('Updated');?></th>
590 <th><?php echo __('Status');?></th>
591 <th><?php echo __('Show');?></th>
592 </tr>
593 </thead>
594 <tbody>
595 <?php
596 $style = 'odd';
597 PMA_DBI_data_seek($sql_result, 0);
598 while($version = PMA_DBI_fetch_array($sql_result)) {
599 if ($version['tracking_active'] == 1) {
600 $version_status = __('active');
601 } else {
602 $version_status = __('not active');
604 if ($version['version'] == $last_version){
605 if ($version['tracking_active'] == 1) {
606 $tracking_active = true;
607 } else {
608 $tracking_active = false;
612 <tr class="noclick <?php echo $style;?>">
613 <td><?php echo htmlspecialchars($version['db_name']);?></td>
614 <td><?php echo htmlspecialchars($version['table_name']);?></td>
615 <td><?php echo $version['version'];?></td>
616 <td><?php echo $version['date_created'];?></td>
617 <td><?php echo $version['date_updated'];?></td>
618 <td><?php echo $version_status;?></td>
619 <td> <a href="tbl_tracking.php?<?php echo $url_query;?>&amp;report=true&amp;version=<?php echo $version['version'];?>"><?php echo __('Tracking report');?></a> | <a href="tbl_tracking.php?<?php echo $url_query;?>&amp;snapshot=true&amp;version=<?php echo $version['version'];?>"><?php echo __('Structure snapshot');?></a></td>
620 </tr>
621 <?php
622 if ($style == 'even') {
623 $style = 'odd';
624 } else {
625 $style = 'even';
629 </tbody>
630 </table>
631 <?php if ($tracking_active == true) {?>
632 <div id="div_deactivate_tracking">
633 <form method="post" action="tbl_tracking.php?<?php echo $url_query; ?>">
634 <fieldset>
635 <legend><?php printf(__('Deactivate tracking for %s.%s'), $GLOBALS['db'], $GLOBALS['table']); ?></legend>
636 <input type="hidden" name="version" value="<?php echo $last_version; ?>" />
637 <input type="submit" name="submit_deactivate_now" value="<?php echo __('Deactivate now'); ?>" />
638 </fieldset>
639 </form>
640 </div>
641 <?php
644 <?php if ($tracking_active == false) {?>
645 <div id="div_activate_tracking">
646 <form method="post" action="tbl_tracking.php?<?php echo $url_query; ?>">
647 <fieldset>
648 <legend><?php printf(__('Activate tracking for %s.%s'), $GLOBALS['db'], $GLOBALS['table']); ?></legend>
649 <input type="hidden" name="version" value="<?php echo $last_version; ?>" />
650 <input type="submit" name="submit_activate_now" value="<?php echo __('Activate now'); ?>" />
651 </fieldset>
652 </form>
653 </div>
654 <?php
659 <div id="div_create_version">
660 <form method="post" action="tbl_tracking.php?<?php echo $url_query; ?>">
661 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
662 <fieldset>
663 <legend><?php printf(__('Create version %s of %s.%s'), ($last_version + 1), $GLOBALS['db'], $GLOBALS['table']); ?></legend>
665 <input type="hidden" name="version" value="<?php echo ($last_version + 1); ?>" />
667 <p><?php echo __('Track these data definition statements:');?></p>
668 <input type="checkbox" name="alter_table" value="true" checked="checked" /> ALTER TABLE<br/>
669 <input type="checkbox" name="rename_table" value="true" checked="checked" /> RENAME TABLE<br/>
670 <input type="checkbox" name="create_table" value="true" checked="checked" /> CREATE TABLE<br/>
671 <input type="checkbox" name="drop_table" value="true" checked="checked" /> DROP TABLE<br/>
672 <br/>
673 <input type="checkbox" name="create_index" value="true" checked="checked" /> CREATE INDEX<br/>
674 <input type="checkbox" name="drop_index" value="true" checked="checked" /> DROP INDEX<br/>
675 <p><?php echo __('Track these data manipulation statements:');?></p>
676 <input type="checkbox" name="insert" value="true" checked="checked" /> INSERT<br/>
677 <input type="checkbox" name="update" value="true" checked="checked" /> UPDATE<br/>
678 <input type="checkbox" name="delete" value="true" checked="checked" /> DELETE<br/>
679 <input type="checkbox" name="truncate" value="true" checked="checked" /> TRUNCATE<br/>
681 </fieldset>
682 <fieldset class="tblFooters">
683 <input type="submit" name="submit_create_version" value="<?php echo __('Create version'); ?>" />
684 </fieldset>
685 </form>
686 </div>
688 <br class="clearfloat"/>
690 <?php
692 * Displays the footer
694 require './libraries/footer.inc.php';