Ejemplo n.º 1
0
         if (isset($tmpSelect) && strpos(' ' . $tmpSelect, OPEN_SEPARATOR . $table . OPEN_SEPARATOR) || !isset($tmpSelect) && !empty($table)) {
             $formattedTableName = isset($_POST['use_backquotes']) ? Dump::backQuote($table) : '"' . $table . '"';
             // If only datas, no need to displays table name
             if ($_POST['what'] != 'dataonly') {
                 $dumpBuffer .= DUMP_CRLF . '#' . DUMP_CRLF . '# ' . sprintf(_("Table structure for table %s"), $formattedTableName) . DUMP_CRLF . '#' . DUMP_CRLF . DUMP_CRLF . Dump::SQLDefinition(OPEN_DATABASE, $table, array('drop' => isset($_POST['drop']) ? $_POST['drop'] : null, 'use_backquotes' => isset($_POST['use_backquotes']) ? $_POST['use_backquotes'] : null)) . ';' . DUMP_CRLF;
             }
             // At least data
             if ($_POST['what'] == 'data' || $_POST['what'] == 'dataonly') {
                 $dumpBuffer .= DUMP_CRLF . '#' . DUMP_CRLF . '# ' . sprintf(_("Dumping data for table %s"), $formattedTableName) . DUMP_CRLF . '#' . DUMP_CRLF . DUMP_CRLF;
                 if ($_POST['what'] == 'dataonly' && isset($_POST['add_delete'])) {
                     $dumpBuffer .= 'DELETE * FROM ' . $formattedTableName . ';' . DUMP_CRLF . DUMP_CRLF;
                 }
                 if (!isset($limitFrom) || !isset($limitTo)) {
                     $limitFrom = $limitTo = 0;
                 }
                 $dumpBuffer .= Dump::SQLData(OPEN_DATABASE, $table, array('from' => $limitFrom, 'to' => $limitTo, 'use_backquotes' => isset($_POST['use_backquotes']) ? $_POST['use_backquotes'] : null, 'show_columns' => isset($_POST['show_columns']) ? $_POST['show_columns'] : null, 'extended_inserts' => isset($_POST['extended_inserts']) ? $_POST['extended_inserts'] : null));
             }
             // end if
         }
         // end if
     }
     // end for
     // don't remove, it makes easier to select & copy from browser
     $dumpBuffer .= DUMP_CRLF;
 } elseif ($_POST['what'] == 'xml') {
     // first add the xml tag
     $dumpBuffer .= '<?xml version="1.0" encoding="ISO-8859-1" ?>' . DUMP_CRLF . DUMP_CRLF;
     // some comments
     $dumpBuffer .= '<!--' . DUMP_CRLF . '--' . DUMP_CRLF . '-- OpenClinic XML-Dump' . DUMP_CRLF . '-- version ' . OPEN_VERSION . DUMP_CRLF . '-- http://openclinic.sourceforge.net/' . DUMP_CRLF . '--' . DUMP_CRLF . '-- ' . _("Host") . ": " . OPEN_HOST . DUMP_CRLF . '-- ' . _("Generation Time") . ": " . I18n::localDate() . DUMP_CRLF . '-- ' . _("Server Version") . ': ' . DUMP_MYSQL_VERSION . DUMP_CRLF . '-- ' . _("PHP Version") . ": " . phpversion() . DUMP_CRLF . '-- ' . _("Database") . ": " . OPEN_DATABASE . DUMP_CRLF;
     if (isset($_POST['table_select'])) {
         $tableSelect = implode($_POST['table_select'], ', ');