Example #1
0
 function selectEmailPrint($emailFields, $columns)
 {
     if ($emailFields) {
         print_fieldset("email", 'E-mail');
         echo "<div onkeydown=\"eventStop(event); return bodyKeydown(event, 'email');\">\n";
         echo "<p>" . 'From' . ": <input name='email_from' value='" . h($_POST ? $_POST["email_from"] : $_COOKIE["adminer_email"]) . "'>\n";
         echo 'Subject' . ": <select name='email_id'><option>" . optionlist(get_key_vals("SELECT {$this->id}, {$this->title} FROM {$this->table} ORDER BY {$this->title}"), $_POST["email_id"], true) . "</select>\n";
         echo "<p>" . 'Attachments' . ": <input type='file' name='email_files[]' onchange=\"this.onchange = function () { }; var el = this.cloneNode(true); el.value = ''; this.parentNode.appendChild(el);\">";
         echo "<p>" . (count($emailFields) == 1 ? '<input type="hidden" name="email_field" value="' . h(key($emailFields)) . '">' : html_select("email_field", $emailFields));
         echo "<input type='submit' name='email' value='" . 'Send' . "' onclick=\"return this.form['delete'].onclick();\">\n";
         echo "</div>\n";
         echo "</div></fieldset>\n";
         return true;
     }
 }
Example #2
0
 : formChecked(this, /check/)) + ')');">
</div></fieldset>
<?php 
            }
            $format = $adminer->dumpFormat();
            if ($format) {
                print_fieldset("export", lang('Export'));
                $output = $adminer->dumpOutput();
                echo $output ? html_select("output", $output, $adminer_import["output"]) . " " : "";
                echo html_select("format", $format, $adminer_import["format"]);
                echo " <input type='submit' name='export' value='" . lang('Export') . "'>\n";
                echo "</div></fieldset>\n";
            }
        }
        if ($adminer->selectImportPrint()) {
            print_fieldset("import", lang('Import'), !$rows);
            echo "<input type='file' name='csv_file'> ";
            echo html_select("separator", array("csv" => "CSV,", "csv;" => "CSV;", "tsv" => "TSV"), $adminer_import["format"], 1);
            // 1 - select
            echo " <input type='submit' name='import' value='" . lang('Import') . "'>";
            echo "<input type='hidden' name='token' value='{$token}'>\n";
            echo "</div></fieldset>\n";
        }
        $adminer->selectEmailPrint(array_filter($email_fields, 'strlen'), $columns);
        echo "</form>\n";
    }
}
if (is_ajax()) {
    ob_end_clean();
    exit;
}
Example #3
0
    echo $_POST ? "" : "<script type='text/javascript'>focus(document.getElementsByTagName('textarea')[0]);</script>\n";
    echo "<p>{$execute}\n";
} else {
    echo "<fieldset><legend>" . lang('File upload') . "</legend><div>";
    echo ini_bool("file_uploads") ? '<input type="file" name="sql_file[]" multiple> (&lt; ' . ini_get("upload_max_filesize") . 'B)' : lang('File uploads are disabled.');
    echo "\n{$execute}";
    echo "</div></fieldset>\n";
    echo "<fieldset><legend>" . lang('From server') . "</legend><div>";
    echo lang('Webserver file %s', "<code>adminer.sql" . (extension_loaded("zlib") ? "[.gz]" : "") . "</code>");
    echo ' <input type="submit" name="webfile" value="' . lang('Run file') . '">';
    echo "</div></fieldset>\n";
    echo "<p>";
}
echo adminer_checkbox("error_stops", 1, $_POST ? $_POST["error_stops"] : isset($_GET["import"]), lang('Stop on error')) . "\n";
echo adminer_checkbox("only_errors", 1, $_POST ? $_POST["only_errors"] : isset($_GET["import"]), lang('Show only errors')) . "\n";
echo "<input type='hidden' name='token' value='{$token}'>\n";
if (!isset($_GET["import"]) && $history) {
    print_fieldset("history", lang('History'), $_GET["history"] != "");
    for ($val = end($history); $val; $val = prev($history)) {
        // not array_reverse() to save memory
        $key = key($history);
        list($q, $time, $elapsed) = $val;
        echo '<a href="' . h(ME . "sql=&history={$key}") . '">' . lang('Edit') . "</a>" . " <span class='time' title='" . @date('Y-m-d', $time) . "'>" . @date("H:i:s", $time) . "</span>" . " <code class='jush-{$jush}'>" . shorten_utf8(ltrim(str_replace("\n", " ", str_replace("\r", "", preg_replace('~^(#|-- ).*~m', '', $q)))), 80, "</code>") . ($elapsed ? " <span class='time'>({$elapsed})</span>" : "") . "<br>\n";
    }
    echo "<input type='submit' name='clear' value='" . lang('Clear') . "'>\n";
    echo "<a href='" . h(ME . "sql=&history=all") . "'>" . lang('Edit all') . "</a>\n";
    echo "</div></fieldset>\n";
}
?>
</form>
Example #4
0
 /** Print order box in select
  * @param array result of selectOrderProcess()
  * @param array selectable columns
  * @param array
  * @return null
  */
 function selectOrderPrint($order, $columns, $indexes)
 {
     print_fieldset("sort", lang('Sort'), $order);
     $i = 0;
     foreach ((array) $_GET["order"] as $key => $val) {
         if ($val != "") {
             echo "<div>" . select_input(" name='order[{$i}]' onchange='selectFieldChange(this.form);'", $columns, $val);
             echo checkbox("desc[{$i}]", 1, isset($_GET["desc"][$key]), lang('descending')) . "</div>\n";
             $i++;
         }
     }
     echo "<div>" . select_input(" name='order[{$i}]' onchange='selectAddRow(this);'", $columns);
     echo checkbox("desc[{$i}]", 1, false, lang('descending')) . "</div>\n";
     echo "</div></fieldset>\n";
 }
Example #5
0
?>

<?php 
if ($TABLE != "") {
    ?>
<input type="submit" name="drop" value="<?php 
    echo lang('Drop');
    ?>
"<?php 
    echo confirm();
    ?>
><?php 
}
if (support("partitioning")) {
    $partition_table = preg_match('~RANGE|LIST~', $row["partition_by"]);
    print_fieldset("partition", lang('Partition by'), $row["partition_by"]);
    ?>
<p>
<?php 
    echo "<select name='partition_by' onchange='partitionByChange(this);'" . on_help("getTarget(event).value.replace(/./, 'PARTITION BY \$&')", 1) . ">" . optionlist(array("" => "") + $partition_by, $row["partition_by"]) . "</select>";
    ?>
(<input name="partition" value="<?php 
    echo h($row["partition"]);
    ?>
">)
<?php 
    echo lang('Partitions');
    ?>
: <input type="number" name="partitions" class="size<?php 
    echo $partition_table || !$row["partition_by"] ? " hidden" : "";
    ?>
 /** Print order box in select
  * @param array result of selectOrderProcess()
  * @param array selectable columns
  * @param array
  * @return null
  */
 function selectOrderPrint($order, $columns, $indexes)
 {
     print_fieldset("sort", lang('Sort'), $order);
     $i = 0;
     foreach ((array) $_GET["order"] as $key => $val) {
         if (isset($columns[$val])) {
             echo "<div><select name='order[{$i}]'><option>" . optionlist($columns, $val, true) . "</select>";
             echo checkbox("desc[{$i}]", 1, isset($_GET["desc"][$key]), lang('descending')) . "</div>\n";
             $i++;
         }
     }
     echo "<div><select name='order[{$i}]' onchange='selectAddRow(this);'><option>" . optionlist($columns, null, true) . "</select>";
     echo "<label><input type='checkbox' name='desc[{$i}]' value='1'>" . lang('descending') . "</label></div>\n";
     // not checkbox() to allow selectAddRow()
     echo "</div></fieldset>\n";
 }