Initial commit

This commit is contained in:
2022-11-21 09:47:28 +01:00
commit 76cec83d26
11652 changed files with 1980467 additions and 0 deletions

View File

@ -0,0 +1,23 @@
<form id="create_table_form_minimal" method="post" action="tbl_create.php" class="lock-page">
<fieldset>
<legend>
<?php if (PMA\libraries\Util::showIcons('ActionLinksMode')): ?>
<?= PMA\libraries\Util::getImage('b_table_add.png'); ?>&nbsp
<?php endif; ?>
<?= __('Create table'); ?>
</legend>
<?= PMA_URL_getHiddenInputs($db); ?>
<div class="formelement">
<?= __('Name'); ?>:
<input type="text" name="table" maxlength="64" size="30" required="required" />
</div>
<div class="formelement">
<?= __('Number of columns'); ?>:
<input type="number" min="1" name="num_fields" value="4" required="required" />
</div>
<div class="clearfloat"></div>
</fieldset>
<fieldset class="tblFooters">
<input type="submit" value="<?= __('Go'); ?>" />
</fieldset>
</form>

View File

@ -0,0 +1,84 @@
<table id="query_Aggregate" style="display:none;"width="5%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px">
</td>
<td class="frams5" width="99%" >
</td>
<td class="frams2" width="10px">
<div class="bor">
</div>
</td>
</tr>
<tr>
<td class="frams8">
</td>
<td class="input_tab">
<table width="168" class="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" class="center nowrap">
<strong>
<?= __('Aggregate'); ?>
</strong>
</td>
</tr>
</thead>
<tbody>
<tr>
<td width="58" class="nowrap">
<?= __('Operator'); ?>
</td>
<td width="102">
<select name="operator" id="e_operator">
<option value="---" selected="selected">
---
</option>
<option value="sum" >
SUM
</option>
<option value="min">
MIN
</option>
<option value="max">
MAX
</option>
<option value="avg">
AVG
</option>
<option value="count">
COUNT
</option>
</select>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" class="center nowrap">
<input type="button" id="ok_edit_Aggr" class="butt" name="Button" value="<?= __('OK'); ?>" />
<input type="button"
class="butt"
name="Button"
value="<?= __('Cancel'); ?>"
onclick="document.getElementById('query_Aggregate').style.display = 'none';" />
</td>
</tr>
</tbody>
</table>
</td>
<td class="frams6">
</td>
</tr>
<tr>
<td class="frams4">
<div class="bor">
</div>
</td>
<td class="frams7">
</td>
<td class="frams3">
</td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,3 @@
<div id="osn_tab">
<canvas class="pmd" id="canvas" width="100" height="100" ></canvas>
</div>

View File

@ -0,0 +1,140 @@
<?php for ($i = 0, $l = count($GLOBALS['PMD']["TABLE_NAME"]); $i < $l; $i++) :
$t_n = $GLOBALS['PMD']["TABLE_NAME"][$i];
$t_n_url = $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>
<input name="t_x[<?= $t_n_url; ?>]" type="hidden" id="t_x_<?= $t_n_url; ?>_" />
<input name="t_y[<?= $t_n_url; ?>]" type="hidden" id="t_y_<?= $t_n_url; ?>_" />
<input name="t_v[<?= $t_n_url; ?>]" type="hidden" id="t_v_<?= $t_n_url; ?>_" />
<input name="t_h[<?= $t_n_url; ?>]" type="hidden" id="t_h_<?= $t_n_url; ?>_" />
<!-- Why should we put styles here?! -->
<table id="<?= $t_n_url; ?>"
cellpadding="0"
cellspacing="0"
class="pmd_tab"
style="position:absolute; left:<?= (isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["X"] : rand(20, 700)); ?>px; top:<?= (isset($tab_pos[$t_n]) ? $tab_pos[$t_n]["Y"] : rand(20, 550)); ?>px; display:<?= (isset($tab_pos[$t_n]) || $display_page == -1) ? 'block;' : 'none';?>; z-index: 1;">
<thead>
<tr class="header">
<?php if (isset($_REQUEST['query'])) : ?>
<td class="select_all">
<input class="select_all_1"
type="checkbox"
style="margin: 0;"
value="select_all_<?= htmlspecialchars($t_n_url); ?>"
id="select_all_<?= htmlspecialchars($t_n_url); ?>"
title="select all"
pmd_url_table_name="<?= htmlspecialchars($t_n_url); ?>"
pmd_out_owner="<?= htmlspecialchars($GLOBALS['PMD_OUT']['OWNER'][$i]); ?>">
</td>
<?php endif; ?>
<td class="small_tab"
title="<?= __('Show/hide columns'); ?>"
id="id_hide_tbody_<?= $t_n_url; ?>"
table_name="<?= htmlspecialchars($t_n_url); ?>"
onmouseover="this.className='small_tab2';"
onmouseout="this.className='small_tab';" ><?= (! isset($tab_pos[$t_n]) || ! empty($tab_pos[$t_n]["V"])) ? 'v' : '&gt;'; ?>
</td>
<td class="small_tab_pref small_tab_pref_1"
table_name_small="<?= $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>"
onmouseover="this.className='small_tab_pref2 small_tab_pref_1';"
onmouseout="this.className='small_tab_pref small_tab_pref_1';" >
<img src="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>"
title="<?= __('See table structure'); ?>" />
</td>
<td id="id_zag_<?= htmlspecialchars($t_n_url); ?>"
class="tab_zag nowrap tab_zag_noquery"
onmousedown="cur_click=document.getElementById('<?= $t_n_url; ?>');"
table_name="<?= htmlspecialchars($t_n_url); ?>"
query_set="<?= isset($_REQUEST['query']) ? 1 : 0 ; ?>" >
<span class="owner">
<?= $GLOBALS['PMD_OUT']["OWNER"][$i]; ?>
</span>
<?= $GLOBALS['PMD_OUT']['TABLE_NAME_SMALL'][$i]; ?>
</td>
<?php if (isset($_REQUEST['query'])) : ?>
<td class="tab_zag tab_zag_query"
id="id_zag_<?= htmlspecialchars($t_n_url); ?>_2"
table_name="<?= htmlspecialchars($t_n_url); ?>"
onmousedown="cur_click=document.getElementById('<?= htmlspecialchars($t_n_url); ?>');">
</td>
<?php endif; ?>
</tr>
</thead>
<tbody id="id_tbody_<?= $t_n_url; ?>" style="<?= (isset($tab_pos[$t_n]) && empty($tab_pos[$t_n]["V"])) ? 'display: none' : ''; ?>">
<?php $display_field = PMA_getDisplayField(
$_GET['db'],
$GLOBALS['PMD']["TABLE_NAME_SMALL"][$i]
);
for ($j = 0, $id_cnt = count($tab_column[$t_n]["COLUMN_ID"]); $j < $id_cnt; $j++) :
$tmpColumn = $t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j];
$click_field_param = array(
$GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i],
urlencode($tab_column[$t_n]["COLUMN_NAME"][$j])
);
if (!PMA\libraries\Util::isForeignKeySupported($GLOBALS['PMD']['TABLE_TYPE'][$i])) {
$click_field_param[] = isset($tables_pk_or_unique_keys[$tmpColumn]) ? 1 : 0;
} else {
// if foreign keys are supported, it's not necessary that the
// index is a primary key
$click_field_param[] = isset($tables_all_keys[$tmpColumn]) ? 1 : 0;
}
?>
<tr id="id_tr_<?= $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>.<?= urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>"
<?= ($display_field == $tab_column[$t_n]["COLUMN_NAME"][$j]) ? 'class="tab_field_3"' : 'class="tab_field"'; ?>
onmouseover="old_class = this.className; this.className = 'tab_field_2';"
onmouseout="this.className = old_class;"
click_field_param="<?= implode($click_field_param, ','); ?>">
<?php if (isset($_REQUEST['query'])) : ?>
<td class="select_all">
<input class="select_all_store_col"
value="<?= htmlspecialchars($t_n_url) , urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>"
type="checkbox"
id="select_<?= htmlspecialchars($t_n_url); ?>._<?= urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>"
style="margin: 0;"
title="select_<?= urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>"
store_column_param="<?= urlencode($GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i]); ?>,<?= htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]); ?>,<?= urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>">
</td>
<?php endif; ?>
<td width="10px" colspan="3" id="<?= $t_n_url; ?>.<?= urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]); ?>">
<div class="nowrap">
<?php if (isset($tables_pk_or_unique_keys[$t_n . "." . $tab_column[$t_n]["COLUMN_NAME"][$j]])) : ?>
<img src="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/FieldKey_small.png'); ?>" alt="*" />
<?php else :
$type = 'pmd/Field_small';
if (strstr($tab_column[$t_n]["TYPE"][$j], 'char')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'text')
) {
$type .= '_char';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'int')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'float')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'double')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'decimal')
) {
$type .= '_int';
} elseif (strstr($tab_column[$t_n]["TYPE"][$j], 'date')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'time')
|| strstr($tab_column[$t_n]["TYPE"][$j], 'year')
) {
$type .= '_date';
}
?>
<img src="<?= $_SESSION['PMA_Theme']->getImgPath($type); ?>.png" alt="*" />
<?php endif; ?>
<?= htmlspecialchars(
$tab_column[$t_n]["COLUMN_NAME"][$j] . " : "
. $tab_column[$t_n]["TYPE"][$j],
ENT_QUOTES
); ?>
</div>
</td>
<?php if (isset($_REQUEST['query'])) : ?>
<td class="small_tab_pref small_tab_pref_click_opt"
onmouseover="this.className='small_tab_pref2 small_tab_pref_click_opt'"
onmouseout="this.className='small_tab_pref small_tab_pref_click_opt'"
Click_option_param="pmd_optionse,<?= urlencode($tab_column[$t_n]['COLUMN_NAME'][$j]); ?>,<?= $GLOBALS['PMD_OUT']['TABLE_NAME_SMALL'][$i]; ?>" >
<img src="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/exec_small.png'); ?>" title="options" />
</td>
<?php endif; ?>
</tr>
<?php endfor; ?>
</tbody>
</table>
<?php endfor; ?>

View File

@ -0,0 +1,47 @@
<table id="layer_upd_relation" style="display:none;" width="5%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px">
</td>
<td class="frams5" width="99%">
</td>
<td class="frams2" width="10px">
<div class="bor">
</div>
</td>
</tr>
<tr>
<td class="frams8">
</td>
<td class="input_tab">
<table width="100%" class="center" cellpadding="2" cellspacing="0">
<tr>
<td colspan="3" class="center nowrap">
<strong>
<?= __('Delete relation'); ?>
</strong>
</td>
</tr>
<tr>
<td colspan="3" class="center nowrap">
<input id="del_button" name="Button" type="button" class="butt" value="<?= __('Delete'); ?>" />
<input id="cancel_button" type="button" class="butt" name="Button" value="<?= __('Cancel'); ?>" />
</td>
</tr>
</table>
</td>
<td class="frams6">
</td>
</tr>
<tr>
<td class="frams4">
<div class="bor">
</div>
</td>
<td class="frams7">
</td>
<td class="frams3">
</td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,11 @@
<?php $cfgRelation = PMA_getRelationsParam(); ?>
<form action="db_designer.php" method="post" name="edit_delete_pages" id="edit_delete_pages" class="ajax">
<?= PMA_URL_getHiddenInputs($db); ?>
<fieldset id="page_edit_delete_options">
<input type="hidden" name="operation" value="<?= $operation; ?>" />
<label for="selected_page">
<?= $operation == 'editPage' ? __("Page to open") : __("Page to delete"); ?>:
</label>
<?= PMA_getHtmlForPageSelector($cfgRelation, $db); ?>
</fieldset>
</form>

View File

@ -0,0 +1,138 @@
<table id="query_having" style="display:none;" width="5%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px">
</td>
<td class="frams5" width="99%" >
</td>
<td class="frams2" width="10px">
<div class="bor">
</div>
</td>
</tr>
<tr>
<td class="frams8">
</td>
<td class="input_tab">
<table width="168" class="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" class="center nowrap">
<strong>
HAVING
</strong>
</td>
</tr>
</thead>
<tbody id="rename_to">
<tr>
<td width="58" class="nowrap">
<?= __('Operator'); ?>
</td>
<td width="102">
<select name="hoperator" id="hoperator">
<option value="---" selected="selected">
---
</option>
<option value="None" >
None
</option>
<option value="sum" >
SUM
</option>
<option value="min">
MIN
</option>
<option value="max">
MAX
</option>
<option value="avg">
AVG
</option>
<option value="count">
COUNT
</option>
</select>
</td>
</tr>
<tr>
<tr>
<td width="58" class="nowrap">
<?= __('Operator'); ?>
</td>
<td width="102">
<select name="hrel_opt" id="hrel_opt">
<option value="--" selected="selected">
--
</option>
<option value="=">
=
</option>
<option value="&gt;">
&gt;
</option>
<option value="&lt;">
&lt;
</option>
<option value="&gt;=">
&gt;=
</option>
<option value="&lt;=">
&lt;=
</option>
<option value="NOT">
NOT
</option>
<option value="IN">
IN
</option>
<option value="EXCEPT">
<?= __('Except'); ?>
</option>
<option value="NOT IN">
NOT IN
</option>
</select>
</td>
</tr>
<tr>
<td class="nowrap">
<?= __('Value'); ?>
<br />
<?= __('subquery'); ?>
</td>
<td>
<textarea id="hQuery" value="" cols="18">
</textarea>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" class="center nowrap">
<input type="button" id="ok_edit_having" class="butt" name="Button" value="<?= __('OK'); ?>" />
<input type="button"
class="butt"
name="Button"
value="<?= __('Cancel'); ?>"
onclick="document.getElementById('query_having').style.display = 'none';" />
</td>
</tr>
</tbody>
</table>
</td>
<td class="frams6">
</td>
</tr>
<tr>
<td class="frams4">
<div class="bor">
</div>
</td>
<td class="frams7">
</td>
<td class="frams3">
</td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,10 @@
<?php $cfgRelation = PMA_getRelationsParam(); ?>
<!-- Do not expand HTML here, invisible characters will make javascript crash -->
<div id="script_server" class="hide"><?= htmlspecialchars($GLOBALS['server']); ?></div>
<div id="script_db" class="hide"><?= htmlspecialchars($_GET['db']); ?></div>
<div id="script_token" class="hide"><?= htmlspecialchars($_GET['token']); ?></div>
<div id="script_tables" class="hide"><?= htmlspecialchars(json_encode($script_tables)); ?></div>
<div id="script_contr" class="hide"><?= htmlspecialchars(json_encode($script_contr)); ?></div>
<div id="script_display_field" class="hide"><?= htmlspecialchars(json_encode($script_display_field)); ?></div>
<div id="script_display_page" class="hide"><?= htmlspecialchars($display_page); ?></div>
<div id="pmd_tables_enabled" class="hide"><?= htmlspecialchars($cfgRelation['pdfwork']); ?></div>

View File

@ -0,0 +1,108 @@
<table id="layer_new_relation" style="display:none;" width="5%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px">
</td>
<td class="frams5" width="99%" >
</td>
<td class="frams2" width="10px">
<div class="bor">
</div>
</td>
</tr>
<tr>
<td class="frams8">
</td>
<td class="input_tab">
<table width="168" class="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" class="center nowrap">
<strong>
<?= __('Create relation'); ?>
</strong>
</td>
</tr>
</thead>
<tbody id="foreign_relation">
<tr>
<td colspan="2" class="center nowrap">
<strong>
FOREIGN KEY
</strong>
</td>
</tr>
<tr>
<td width="58" class="nowrap">
on delete
</td>
<td width="102">
<select name="on_delete" id="on_delete">
<option value="nix" selected="selected">
--
</option>
<option value="CASCADE">
CASCADE
</option>
<option value="SET NULL">
SET NULL
</option>
<option value="NO ACTION">
NO ACTION
</option>
<option value="RESTRICT">
RESTRICT
</option>
</select>
</td>
</tr>
<tr>
<td class="nowrap">
on update
</td>
<td>
<select name="on_update" id="on_update">
<option value="nix" selected="selected">
--
</option>
<option value="CASCADE">
CASCADE
</option>
<option value="SET NULL">
SET NULL
</option>
<option value="NO ACTION">
NO ACTION
</option>
<option value="RESTRICT">
RESTRICT
</option>
</select>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" class="center nowrap">
<input type="button" id="ok_new_rel_panel" class="butt" name="Button" value="<?= __('OK'); ?>" />
<input type="button" id="cancel_new_rel_panel" class="butt" name="Button" value="<?= __('Cancel'); ?>" />
</td>
</tr>
</tbody>
</table>
</td>
<td class="frams6">
</td>
</tr>
<tr>
<td class="frams4">
<div class="bor">
</div>
</td>
<td class="frams7">
</td>
<td class="frams3">
</td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,273 @@
<table id="pmd_optionse" style="display:none;" width="5%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px">
</td>
<td class="frams5" width="99%" >
</td>
<td class="frams2" width="10px">
<div class="bor">
</div>
</td>
</tr>
<tr>
<td class="frams8">
</td>
<td class="input_tab">
<table width="168" class="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" rowspan="2" id="option_col_name" class="center nowrap">
</td>
</tr>
</thead>
<tbody id="where">
<tr>
<td class="center nowrap">
<b>
WHERE
</b>
</td>
</tr>
<tr>
<td width="58" class="nowrap">
<?= __('Relation operator'); ?>
</td>
<td width="102">
<select name="rel_opt" id="rel_opt">
<option value="--" selected="selected">
--
</option>
<option value="=">
=
</option>
<option value="&gt;">
&gt;
</option>
<option value="&lt;">
&lt;
</option>
<option value="&gt;=">
&gt;=
</option>
<option value="&lt;=">
&lt;=
</option>
<option value="NOT">
NOT
</option>
<option value="IN">
IN
</option>
<option value="EXCEPT">
<?= __('Except'); ?>
</option>
<option value="NOT IN">
NOT IN
</option>
</select>
</td>
</tr>
<tr>
<td class="nowrap">
<?= __('Value'); ?>
<br />
<?= __('subquery'); ?>
</td>
<td>
<textarea id="Query" value="" cols="18">
</textarea>
</td>
</tr>
<tr>
<td class="center nowrap">
<b>
<?= __('Rename to'); ?>
</b>
</td>
</tr>
<tr>
<td width="58" class="nowrap">
<?= __('New name'); ?>
</td>
<td width="102">
<input type="text" value="" id="new_name"/>
</td>
</tr>
<tr>
<td class="center nowrap">
<b>
<?= __('Aggregate'); ?>
</b>
</td>
</tr>
<tr>
<td width="58" class="nowrap">
<?= __('Operator'); ?>
</td>
<td width="102">
<select name="operator" id="operator">
<option value="---" selected="selected">
---
</option>
<option value="sum" >
SUM
</option>
<option value="min">
MIN
</option>
<option value="max">
MAX
</option>
<option value="avg">
AVG
</option>
<option value="count">
COUNT
</option>
</select>
</td>
</tr>
<tr>
<td width="58" class="center nowrap">
<b>
GROUP BY
</b>
</td>
<td>
<input type="checkbox" value="groupby" id="groupby"/>
</td>
</tr>
<tr>
<td width="58" class="center nowrap">
<b>
ORDER BY
</b>
</td>
<td>
<select name="orderby" id="orderby">
<option value="---" selected="selected">
---
</option>
<option value="ASC" >
ASC
</option>
<option value="DESC">
DESC
</option>
</select>
</td>
</tr>
<tr>
<td class="center nowrap">
<b>
HAVING
</b>
</td>
</tr>
<tr>
<td width="58" class="nowrap">
<?= __('Operator'); ?>
</td>
<td width="102">
<select name="h_operator" id="h_operator">
<option value="---" selected="selected">
---
</option>
<option value="None" >
<?= __('None'); ?>
</option>
<option value="sum" >
SUM
</option>
<option value="min">
MIN
</option>
<option value="max">
MAX
</option>
<option value="avg">
AVG
</option>
<option value="count">
COUNT
</option>
</select>
</td>
</tr>
<tr>
<td width="58" class="nowrap">
<?= __('Relation operator'); ?>
</td>
<td width="102">
<select name="h_rel_opt" id="h_rel_opt">
<option value="--" selected="selected">
--
</option>
<option value="=">
=
</option>
<option value="&gt;">
&gt;
</option>
<option value="&lt;">
&lt;
</option>
<option value="&gt;=">
&gt;=
</option>
<option value="&lt;=">
&lt;=
</option>
<option value="NOT">
NOT
</option>
<option value="IN">
IN
</option>
<option value="EXCEPT">
<?= __('Except'); ?>
</option>
<option value="NOT IN">
NOT IN
</option>
</select>
</td>
</tr>
<tr>
<td width="58" class="nowrap">
<?= __('Value'); ?>
<br/>
<?= __('subquery'); ?>
</td>
<td width="102">
<textarea id="having" value="" cols="18">
</textarea>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" class="center nowrap">
<input type="button" id="ok_add_object" class="butt" name="Button" value="<?= __('OK'); ?>" />
<input type="button" id="cancel_close_option" class="butt" name="Button" value="<?= __('Cancel'); ?>" />
</td>
</tr>
</tbody>
</table>
</td>
<td class="frams6">
</td>
</tr>
<tr>
<td class="frams4">
<div class="bor">
</div>
</td>
<td class="frams7">
</td>
<td class="frams3">
</td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,33 @@
<?php
$cfgRelation = PMA_getRelationsParam();
$choices = array(
'same' => __('Save to selected page'),
'new' => __('Create a page and save to it')
);
?>
<form action="db_designer.php" method="post" name="save_as_pages" id="save_as_pages" class="ajax">
<?= PMA_URL_getHiddenInputs($db); ?>
<fieldset id="page_save_as_options">
<table>
<tbody>
<tr>
<td>
<input type="hidden" name="operation" value="savePage" />
<?= PMA_getHtmlForPageSelector($cfgRelation, $db); ?>
</td>
</tr>
<tr>
<td>
<?= PMA\libraries\Util::getRadioFields('save_page', $choices, 'same', true); ?>
</td>
</tr>
<tr>
<td>
<label for="selected_value"><?= __('New page name'); ?></label>
<input type="text" name="selected_value" id="selected_value" />
</td>
</tr>
</tbody>
</table>
</fieldset>
</form>

View File

@ -0,0 +1,10 @@
<select name="selected_page" id="selected_page">
<option value="0">-- <?= __('Select page'); ?> --</option>
<?php if ($cfgRelation['pdfwork']) : $pages = PMA_getPageIdsAndNames($db); ?>
<?php foreach ($pages as $nr => $desc) : ?>
<option value="<?= $nr; ?>">
<?= htmlspecialchars($desc); ?>
</option>
<?php endforeach; ?>
<?php endif; ?>
</select>

View File

@ -0,0 +1,19 @@
<div class="panel">
<div style="clear:both;">
</div>
<div id="ab">
</div>
<div style="clear:both;">
</div>
</div>
<a class="trigger" href="#">
<?= __('Active options'); ?>
</a>
<div id="box">
<form method="post" action="db_qbe.php" id="vqb_form">
<textarea cols="80" name="sql_query" id="textSqlquery" rows="15">
</textarea>
<input type="hidden" name="submit_sql" value="true">
<?= PMA_URL_getHiddenInputs($_GET['db']); ?>
</form>
</div>

View File

@ -0,0 +1,66 @@
<table id="query_rename_to" style="display:none;" width="5%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px">
</td>
<td class="frams5" width="99%" >
</td>
<td class="frams2" width="10px">
<div class="bor">
</div>
</td>
</tr>
<tr>
<td class="frams8">
</td>
<td class="input_tab">
<table width="168" class="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" class="center nowrap">
<strong>
<?= __('Rename to'); ?>
</strong>
</td>
</tr>
</thead>
<tbody id="rename_to">
<tr>
<td width="58" class="nowrap">
<?= __('New name'); ?>
</td>
<td width="102">
<input type="text" value="" id="e_rename"/>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" class="center nowrap">
<input type="button" id="ok_edit_rename" class="butt" name="Button" value="<?= __('OK'); ?>" />
<input type="button"
class="butt"
name="Button"
value="<?= __('Cancel'); ?>"
onclick="document.getElementById('query_rename_to').style.display = 'none';" />
</td>
</tr>
</tbody>
</table>
</td>
<td class="frams6">
</td>
</tr>
<tr>
<td class="frams4">
<div class="bor">
</div>
</td>
<td class="frams7">
</td>
<td class="frams3">
</td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,11 @@
<form method="post" action="schema_export.php" class="disableAjax" id="id_export_pages">
<fieldset>
<?= PMA_URL_getHiddenInputs($db); ?>
<label><?= __('Select Export Relational Type'); ?></label><br/>
<?= PMA_pluginGetChoice(
'Schema', 'export_type', $export_list, 'format'
); ?>
<input type="hidden" name="page_number" value="<?= htmlspecialchars($page); ?>" />
<?= PMA_pluginGetOptions('Schema', $export_list); ?>
</fieldset>
</form>

View File

@ -0,0 +1,189 @@
<?php
function getImg($path)
{
return $_SESSION['PMA_Theme']->getImgPath($path);
}
?>
<?php if (!$visualBuilder) : ?>
<div id="name-panel" style="overflow:hidden">
<span id="page_name" style="border:none">
<?= $selected_page == null ? __("Untitled") : htmlspecialchars($selected_page); ?>
</span>
<span id="saved_state" style="border:none">
<?= $selected_page == null ? '*' : ''; ?>
</span>
</div>
<?php endif; ?>
<div class="pmd_header side-menu" id="side_menu">
<a class="M_butt" id="key_Show_left_menu" href="#">
<img title="<?= __('Show/Hide tables list'); ?>"
alt="v"
src="<?= getImg('pmd/downarrow2_m.png'); ?>"
data-down="<?= getImg('pmd/downarrow2_m.png'); ?>"
data-up="<?= getImg('pmd/uparrow2_m.png'); ?>" />
<span class="hide hidable">
<?= __('Show/Hide tables list'); ?>
</span>
</a>
<a href="#" id="toggleFullscreen" class="M_butt">
<img title="<?= __('View in fullscreen'); ?>"
src="<?= getImg('pmd/viewInFullscreen.png'); ?>"
data-enter="<?= getImg('pmd/viewInFullscreen.png'); ?>"
data-exit="<?= getImg('pmd/exitFullscreen.png'); ?>" />
<span class="hide hidable"
data-exit="<?= __('Exit fullscreen'); ?>"
data-enter="<?= __('View in fullscreen'); ?>">
<?= __('View in fullscreen'); ?>
</span>
</a>
<?php if (! $visualBuilder) : ?>
<a id="newPage" href="#" class="M_butt">
<img title="<?= __('New page'); ?>"
alt=""
src="<?= getImg('pmd/page_add.png'); ?>" />
<span class="hide hidable">
<?= __('New page'); ?>
</span>
</a>
<a href="#" id="editPage" class="M_butt ajax">
<img title="<?= __('Open page'); ?>"
src="<?= getImg('pmd/page_edit.png'); ?>" />
<span class="hide hidable">
<?= __('Open page'); ?>
</span>
</a>
<a href="#" id="savePos" class="M_butt">
<img title="<?= __('Save page'); ?>"
src="<?= getImg('pmd/save.png'); ?>" />
<span class="hide hidable">
<?= __('Save page'); ?>
</span>
</a>
<a href="#" id="SaveAs" class="M_butt ajax">
<img title="<?= __('Save page as'); ?>"
src="<?= getImg('pmd/save_as.png'); ?>" />
<span class="hide hidable">
<?= __('Save page as'); ?>
</span>
</a>
<a href="#" id="delPages" class="M_butt ajax">
<img title="<?= __('Delete pages'); ?>"
src="<?= getImg('pmd/page_delete.png'); ?>" />
<span class="hide hidable">
<?= __('Delete pages'); ?>
</span>
</a>
<a href="#" id="StartTableNew" class="M_butt">
<img title="<?= __('Create table'); ?>"
src="<?= getImg('pmd/table.png'); ?>" />
<span class="hide hidable">
<?= __('Create table'); ?>
</span>
</a>
<a href="#" class="M_butt" id="rel_button">
<img title="<?= __('Create relation'); ?>"
src="<?= getImg('pmd/relation.png'); ?>" />
<span class="hide hidable">
<?= __('Create relation'); ?>
</span>
</a>
<a href="#" class="M_butt" id="display_field_button">
<img title="<?= __('Choose column to display'); ?>"
src="<?= getImg('pmd/display_field.png'); ?>" />
<span class="hide hidable">
<?= __('Choose column to display'); ?>
</span>
</a>
<a href="#" id="reloadPage" class="M_butt">
<img title="<?= __('Reload'); ?>"
src="<?= getImg('pmd/reload.png'); ?>" />
<span class="hide hidable">
<?= __('Reload'); ?>
</span>
</a>
<a href="<?= PMA\libraries\Util::getDocuLink('faq', 'faq6-31'); ?>"
target="documentation"
class="M_butt">
<img title="<?= __('Help'); ?>"
src="<?= getImg('pmd/help.png'); ?>" />
<span class="hide hidable">
<?= __('Help'); ?>
</span>
</a>
<?php endif; ?>
<a href="#" class="<?= $params_array['angular_direct']; ?>" id="angular_direct_button">
<img title="<?= __('Angular links'); ?> / <?= __('Direct links'); ?>"
src="<?= getImg('pmd/ang_direct.png'); ?>" />
<span class="hide hidable">
<?= __('Angular links'); ?> / <?= __('Direct links'); ?>
</span>
</a>
<a href="#" class="<?= $params_array['snap_to_grid']; ?>" id="grid_button">
<img title="<?= __('Snap to grid'); ?>" src="<?= getImg('pmd/grid.png'); ?>" />
<span class="hide hidable">
<?= __('Snap to grid'); ?>
</span>
</a>
<a href="#" class="<?= $params_array['small_big_all']; ?>" id="key_SB_all">
<img title="<?= __('Small/Big All'); ?>"
alt="v"
src="<?= getImg('pmd/downarrow1.png'); ?>"
data-down="<?= getImg('pmd/downarrow1.png'); ?>"
data-right="<?= getImg('pmd/rightarrow1.png') ?>" />
<span class="hide hidable">
<?= __('Small/Big All'); ?>
</span>
</a>
<a href="#" id="SmallTabInvert" class="M_butt" >
<img title="<?= __('Toggle small/big'); ?>"
src="<?= getImg('pmd/bottom.png'); ?>" />
<span class="hide hidable">
<?= __('Toggle small/big'); ?>
</span>
</a>
<a href="#" id="relLineInvert" class="<?= $params_array['relation_lines']; ?>" >
<img title="<?= __('Toggle relation lines'); ?>"
src="<?= getImg('pmd/toggle_lines.png'); ?>" />
<span class="hide hidable">
<?= __('Toggle relation lines'); ?>
</span>
</a>
<?php if (! $visualBuilder) : ?>
<a href="#" id="exportPages" class="M_butt" >
<img title="<?= __('Export schema'); ?>"
src="<?= getImg('pmd/export.png'); ?>" />
<span class="hide hidable">
<?= __('Export schema'); ?>
</span>
</a>
<?php else: ?>
<a class="M_butt"
href="#"
onclick="build_query('SQL Query on Database', 0)"
onmousedown="return false;"
class="M_butt">
<img title="<?= __('Build Query'); ?>"
src="<?= getImg('pmd/query_builder.png'); ?>" />
<span class="hide hidable">
<?= __('Build Query'); ?>
</span>
</a>
<?php endif; ?>
<a href="#" class="<?= $params_array['side_menu']; ?>" id="key_Left_Right">
<img title="<?= __('Move Menu'); ?>" alt=">"
data-right="<?= getImg('pmd/2leftarrow_m.png'); ?>"
src="<?= getImg('pmd/2rightarrow_m.png'); ?>" />
<span class="hide hidable">
<?= __('Move Menu'); ?>
</span>
</a>
<a href="#" class="<?= $params_array['pin_text']; ?>" id="pin_Text">
<img title="<?= __('Pin text'); ?>"
alt=">"
data-right="<?= getImg('pmd/anchor.png'); ?>"
src="<?= getImg('pmd/anchor.png'); ?>" />
<span class="hide hidable">
<?= __('Pin text'); ?>
</span>
</a>
</div>

View File

@ -0,0 +1,69 @@
<div id="layer_menu" style="display:none;">
<div class="center">
<a href="#" class="M_butt" target="_self" >
<img title="<?= __('Hide/Show all'); ?>"
alt="v"
id="key_HS_all"
src="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>"
data-down="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow1.png'); ?>"
data-right="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow1.png'); ?>" />
</a>
<a href="#" class="M_butt" target="_self" >
<img alt="v"
id="key_HS"
title="<?= __('Hide/Show Tables with no relation'); ?>"
src="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2.png'); ?>"
data-down="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/downarrow2.png'); ?>"
data-right="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/rightarrow2.png'); ?>" />
</a>
</div>
<div id="id_scroll_tab" class="scroll_tab">
<table width="100%" style="padding-left: 3px;">
<?php $name_cnt = count($GLOBALS['PMD']['TABLE_NAME']);
for ($i = 0; $i < $name_cnt; $i++) :
$checked = (isset($tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]])
&& $tab_pos[$GLOBALS['PMD']["TABLE_NAME"][$i]]["H"])
|| $display_page == -1; ?>
<tr>
<td title="<?= __('Structure'); ?>"
width="1px"
onmouseover="this.className='L_butt2_2'"
onmouseout="this.className='L_butt2_1'"
class="L_butt2_1">
<img alt=""
table_name="<?= $GLOBALS['PMD_URL']['TABLE_NAME_SMALL'][$i]; ?>"
class="scroll_tab_struct"
src="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/exec.png'); ?>"/>
</td>
<td width="1px">
<input class="scroll_tab_checkbox"
title="<?= __('Hide'); ?>"
id="check_vis_<?= $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"
style="margin:0;"
type="checkbox"
value="<?= $GLOBALS['PMD_URL']["TABLE_NAME"][$i]; ?>"
<?php if ($checked) : ?>checked="checked"<?php endif; ?> />
</td>
<td class="pmd_Tabs"
onmouseover="this.className='pmd_Tabs2'"
onmouseout="this.className='pmd_Tabs'"
pmd_url_table_name="<?= $GLOBALS['PMD_URL']['TABLE_NAME'][$i]; ?>">
<?= $GLOBALS['PMD_OUT']["TABLE_NAME"][$i]; ?>
</td>
</tr>
<?php endfor; ?>
</table>
</div>
<!-- end id_scroll_tab -->
<div class="center">
<?= __('Number of tables:'); ?> <?= $name_cnt; ?>
</div>
<div id="layer_menu_sizer" onmousedown="layer_menu_cur_click=1">
<div class="floatleft">
<img class="icon"
data-right="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/resizeright.png'); ?>"
src="<?= $_SESSION['PMA_Theme']->getImgPath('pmd/resize.png'); ?>"/>
</div>
</div>
</div>
<!-- end layer_menu -->

View File

@ -0,0 +1,103 @@
<table id="query_where" style="display:none;"width="5%" cellpadding="0" cellspacing="0">
<tbody>
<tr>
<td class="frams1" width="10px">
</td>
<td class="frams5" width="99%" >
</td>
<td class="frams2" width="10px">
<div class="bor">
</div>
</td>
</tr>
<tr>
<td class="frams8">
</td>
<td class="input_tab">
<table width="168" class="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" class="center nowrap">
<strong>
WHERE
</strong>
</td>
</tr>
</thead>
<tbody id="rename_to">
<tr>
<td width="58" class="nowrap">
<?= __('Operator'); ?>
</td>
<td width="102">
<select name="erel_opt" id="erel_opt">
<option value="--" selected="selected">
--
</option>
<option value="=" >
=
</option>
<option value="&gt;">
&gt;
</option>
<option value="&lt;">
&lt;
</option>
<option value="&gt;=">
&gt;=
</option>
<option value="&lt;=">
&lt;=
</option>
<option value="NOT">
NOT
</option>
<option value="IN">
IN
</option>
<option value="EXCEPT">
<?= __('Except'); ?>
</option>
<option value="NOT IN">
NOT IN
</option>
</select>
</td>
</tr>
<tr>
<td class="nowrap">
<?= __('Value'); ?>
<br />
<?= __('subquery'); ?>
</td>
<td>
<textarea id="eQuery" value="" cols="18">
</textarea>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" class="center nowrap">
<input type="button" id="ok_edit_where" class="butt" name="Button" value="<?= __('OK'); ?>" />
<input type="button" class="butt" name="Button" value="<?= __('Cancel'); ?>" onclick="document.getElementById('query_where').style.display = 'none'" />
</td>
</tr>
</tbody>
</table>
</td>
<td class="frams6">
</td>
</tr>
<tr>
<td class="frams4">
<div class="bor">
</div>
</td>
<td class="frams7">
</td>
<td class="frams3">
</td>
</tr>
</tbody>
</table>

View File

@ -0,0 +1,93 @@
<tbody id="tbl_summary_row">
<tr>
<th class="print_ignore"></th>
<th class="tbl_num nowrap">
<?php
printf(_ngettext('%s table', '%s tables', $num_tables),
PMA\libraries\Util::formatNumber($num_tables, 0)); ?>
</th>
<?php if ($server_slave_status): ?>
<th> <?= __('Replication'); ?> </th>
<?php endif; ?>
<?php
$sum_colspan = ($db_is_system_schema ? 4 : 7);
if ($GLOBALS['cfg']['NumFavoriteTables'] == 0) {
$sum_colspan--;
} ?>
<th colspan="<?= $sum_colspan; ?>" class="print_ignore" ><?= __('Sum'); ?></th>
<?php
$row_count_sum = PMA\libraries\Util::formatNumber($sum_entries, 0);
// If a table shows approximate rows count, display update-all-real-count anchor.
$row_sum_url = array();
if (isset($approx_rows)) {
$row_sum_url = array(
'ajax_request' => true,
'db' => $GLOBALS['db'],
'real_row_count' => 'true',
'real_row_count_all' => 'true'
);
}
$cell_text = ($approx_rows)
? '<a href="db_structure.php' . PMA_URL_getCommon($row_sum_url)
. '" class="ajax row_count_sum">' . '~' . $row_count_sum . '</a>'
: $row_count_sum;
?>
<th class="value tbl_rows"><?= $cell_text; ?></th>
<?php if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)): ?>
<?php
// MySQL <= 5.5.2
$default_engine = $GLOBALS['dbi']->fetchValue(
"SELECT @@storage_engine;"
);
if (empty($default_engine)) {
// MySQL >= 5.5.3
$default_engine = $GLOBALS['dbi']->fetchValue(
"SELECT @@default_storage_engine;"
);
}
?>
<th class="center">
<dfn title="<?php printf(__('%s is the default storage engine on this MySQL server.'),
$default_engine); ?>"><?= $default_engine; ?></dfn>
</th>
<th>
<?php if (! empty($db_collation)): ?>
<dfn title="<?= PMA_getCollationDescr($db_collation) , ' (' , __('Default') , ')'; ?>">
<?= $db_collation; ?>
</dfn>
<?php endif; ?>
</th>
<?php endif; ?>
<?php if ($is_show_stats): ?>
<?php
list($sum_formatted, $unit) = PMA\libraries\Util::formatByteDown(
$sum_size, 3, 1
);
list($overhead_formatted, $overhead_unit)
= PMA\libraries\Util::formatByteDown($overhead_size, 3, 1);
?>
<th class="value tbl_size"><?= $sum_formatted , ' ' , $unit; ?></th>
<th class="value tbl_overhead"><?= $overhead_formatted , ' ' , $overhead_unit; ?></th>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureComment']): ?>
<th></th>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureCreation']): ?>
<th class="value tbl_creation">
<?= ($create_time_all
? PMA\libraries\Util::localisedDate(strtotime($create_time_all))
: '-'); ?>
</th>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']): ?>
<th class="value tbl_last_update"><?= ($update_time_all
? PMA\libraries\Util::localisedDate(strtotime($update_time_all))
: '-'); ?></th>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastCheck']): ?>
<th class="value tbl_last_check"><?= ($check_time_all
? PMA\libraries\Util::localisedDate(strtotime($check_time_all))
: '-');?></th>
<?php endif; ?>
</tr>
</tbody>

View File

@ -0,0 +1,3 @@
<a href="sql.php<?= $tbl_url_query; ?>&amp;pos=0">
<?= $title; ?>
</a>

View File

@ -0,0 +1,3 @@
<a href="sql.php<?= $tbl_url_query; ?>&amp;pos=0" title="<?= $title; ?>">
<?= $truename; ?>
</a>

View File

@ -0,0 +1,42 @@
<div class="clearfloat print_ignore">
<img class="selectallarrow" src="<?= $pmaThemeImage , 'arrow_' , $text_dir , '.png'; ?>" width="38" height="22" alt="<?php __('With selected:'); ?>" />
<input type="checkbox" id="tablesForm_checkall" class="checkall_box" title="<?= __('Check all'); ?>" />
<label for="tablesForm_checkall"><?= __('Check all'); ?></label>
<?php if ($overhead_check != ''): ?>
/ <a href="#" onclick="unMarkAllRows('tablesForm'); <?= $overhead_check; ?> return false;"><?= __('Check tables having overhead'); ?></a>
<?php endif; ?>
<select name="submit_mult" style="margin: 0 3em 0 3em;">
<option value="<?= __('With selected:'); ?>" selected="selected"><?= __('With selected:'); ?></option>
<option value="copy_tbl"><?= __('Copy table')?></option>
<option value="show_create" ><?= __('Show create'); ?></option>
<option value="export" ><?= __('Export'); ?></option>
<?php if (!$db_is_system_schema
&& !$GLOBALS['cfg']['DisableMultiTableMaintenance']): ?>
<optgroup label="<?= __('Delete data or table'); ?>">
<option value="empty_tbl" ><?= __('Empty'); ?></option>
<option value="drop_tbl" ><?= __('Drop'); ?></option>
</optgroup>
<optgroup label="<?= __('Table maintenance'); ?>">
<option value="analyze_tbl" ><?= __('Analyze table'); ?></option>
<option value="check_tbl" ><?= __('Check table'); ?></option>
<option value="checksum_tbl" ><?= __('Checksum table'); ?></option>
<option value="optimize_tbl" ><?= __('Optimize table'); ?></option>
<option value="repair_tbl" ><?= __('Repair table'); ?></option>
</optgroup>
<optgroup label="<?= __('Prefix'); ?>">
<option value="add_prefix_tbl" ><?= __('Add prefix to table'); ?></option>
<option value="replace_prefix_tbl" ><?= __('Replace table prefix'); ?></option>
<option value="copy_tbl_change_prefix" ><?= __('Copy table with prefix'); ?></option>
</optgroup>
<?php endif; ?>
<?php if (isset($GLOBALS['cfgRelation']['centralcolumnswork'])
&& $GLOBALS['cfgRelation']['centralcolumnswork']): ?>
<optgroup label="<?= __('Central columns'); ?>">
<option value="sync_unique_columns_central_list" ><?= __('Add columns to central list'); ?></option>
<option value="delete_unique_columns_central_list" ><?= __('Remove columns from central list'); ?></option>
<option value="make_consistent_with_central_list" ><?= __('Make consistent with central list'); ?></option>
</optgroup>
<?php endif; ?>
</select>
<?= implode("\n", $hidden_fields); ?>
</div>

View File

@ -0,0 +1,3 @@
<a class="truncate_table_anchor ajax" href="sql.php<?= $tbl_url_query; ?>&amp;sql_query=<?= $sql_query; ?>&amp;message_to_show=<?= $message_to_show; ?>">
<?= $title; ?>
</a>

View File

@ -0,0 +1,15 @@
<?php
// Check if current table is already in favorite list.
$fav_params = array('db' => $db,
'ajax_request' => true,
'favorite_table' => $current_table['TABLE_NAME'],
(($already_favorite ? 'remove' : 'add') . '_favorite') => true
);
?>
<a id="<?= md5($current_table['TABLE_NAME']); ?>_favorite_anchor"
class="ajax favorite_table_anchor"
href="<?= 'db_structure.php' , PMA_URL_getCommon($fav_params); ?>"
title="<?= $already_favorite ? __("Remove from Favorites") : __("Add to Favorites"); ?>"
data-favtargets="<?= md5($db . "." . $current_table['TABLE_NAME']); ?>" >
<?= !$already_favorite ? $titles['NoFavorite'] : $titles['Favorite']; ?>
</a>

View File

@ -0,0 +1,7 @@
<p class="print_ignore">
<a href="#" id="printView">
<?= PMA\libraries\Util::getIcon('b_print.png', __('Print'), true); ?>
</a>
<a href="db_datadict.php<?= $url_query; ?>" target="print_view">
<?= PMA\libraries\Util::getIcon('b_tblanalyse.png', __('Data dictionary'), true); ?></a>
</p>

View File

@ -0,0 +1,3 @@
<a href="tbl_select.php<?= $tbl_url_query; ?>">
<?= $title; ?>
</a>

View File

@ -0,0 +1,35 @@
<div class="show_create_results">
<h2><?= __('Showing create queries'); ?></h2>
<?php
$views = array();
$tables = array();
foreach ($db_objects as $object) {
if ($GLOBALS['dbi']->getTable($db, $object)->isView()) {
$views [] = $object;
} else {
$tables [] = $object;
}
}
?>
<?php if (! empty($tables)): ?>
<?= PMA\libraries\Template::get('database/structure/show_create_row')->render(
array(
'db' => $db,
'title' => __('Tables'),
'raw_title' => 'Table',
'db_objects' => $tables
)
) ?>
<?php endif; ?>
<?php if (! empty($views)): ?>
<?= PMA\libraries\Template::get('database/structure/show_create_row')->render(
array(
'db' => $db,
'title' => __('Views'),
'raw_title' => 'View',
'db_objects' => $views
)
) ?>
<?php endif; ?>
</div>

View File

@ -0,0 +1,22 @@
<fieldset>
<legend><?= $title; ?></legend>
<table class="show_create">
<thead>
<tr>
<th><?= $raw_title; ?></th>
<th>Create <?= $raw_title; ?></th>
</tr>
</thead>
<tbody>
<?php $odd = true; ?>
<?php foreach ($db_objects as $object): ?>
<?php $row_class = ($odd) ? 'odd' : 'even'; ?>
<tr class="<?= $row_class; ?>">
<td><strong><?= PMA_mimeDefaultFunction($object); ?></strong></td>
<td><?= PMA_mimeDefaultFunction($GLOBALS['dbi']->getTable($db, $object)->showCreate()); ?></td>
</tr>
<?php $odd = ! $odd; ?>
<?php endforeach; ?>
</tbody>
</table>
</fieldset>

View File

@ -0,0 +1,70 @@
<?php
$requested_sort = 'table';
$requested_sort_order = $future_sort_order = $initial_sort_order;
// If the user requested a sort
if (isset($_REQUEST['sort'])) {
$requested_sort = $_REQUEST['sort'];
if (isset($_REQUEST['sort_order'])) {
$requested_sort_order = $_REQUEST['sort_order'];
}
}
$order_img = '';
$order_link_params = array();
$order_link_params['title'] = __('Sort');
// If this column was requested to be sorted.
if ($requested_sort == $sort) {
if ($requested_sort_order == 'ASC') {
$future_sort_order = 'DESC';
// current sort order is ASC
$order_img = ' ' . PMA\libraries\Util::getImage(
's_asc.png',
__('Ascending'),
array('class' => 'sort_arrow', 'title' => '')
);
$order_img .= ' ' . PMA\libraries\Util::getImage(
's_desc.png',
__('Descending'),
array('class' => 'sort_arrow hide', 'title' => '')
);
// but on mouse over, show the reverse order (DESC)
$order_link_params['onmouseover'] = "$('.sort_arrow').toggle();";
// on mouse out, show current sort order (ASC)
$order_link_params['onmouseout'] = "$('.sort_arrow').toggle();";
} else {
$future_sort_order = 'ASC';
// current sort order is DESC
$order_img = ' ' . PMA\libraries\Util::getImage(
's_asc.png',
__('Ascending'),
array('class' => 'sort_arrow hide', 'title' => '')
);
$order_img .= ' ' . PMA\libraries\Util::getImage(
's_desc.png',
__('Descending'),
array('class' => 'sort_arrow', 'title' => '')
);
// but on mouse over, show the reverse order (ASC)
$order_link_params['onmouseover'] = "$('.sort_arrow').toggle();";
// on mouse out, show current sort order (DESC)
$order_link_params['onmouseout'] = "$('.sort_arrow').toggle();";
}
}
$_url_params = array(
'db' => $_REQUEST['db'],
'pos' => 0, // We set the position back to 0 every time they sort.
'sort' => $sort,
'sort_order' => $future_sort_order,
);
if (PMA_isValid($_REQUEST['tbl_type'], array('view', 'table'))) {
$_url_params['tbl_type'] = $_REQUEST['tbl_type'];
}
if (! empty($_REQUEST['tbl_group'])) {
$_url_params['tbl_group'] = $_REQUEST['tbl_group'];
}
$url = 'db_structure.php' . PMA_URL_getCommon($_url_params);
echo PMA\libraries\Util::linkOrButton(
$url, $title . $order_img, $order_link_params
);

View File

@ -0,0 +1,187 @@
<tr class="<?= ($odd_row ? 'odd' : 'even') , ($table_is_view ? ' is_view' : '') ?>"
id="row_tbl_<?= $curr; ?>">
<td class="center print_ignore">
<input type="checkbox"
name="selected_tbl[]"
class="checkall"
value="<?= htmlspecialchars($current_table['TABLE_NAME']); ?>"
id="checkbox_tbl_<?= $curr; ?>" />
</td>
<th>
<?= $browse_table_label , $tracking_icon; ?>
</th>
<?php if ($server_slave_status): ?>
<td class="center">
<?= ($ignored ? PMA\libraries\Util::getImage('s_cancel.png', __('Not replicated')) : ''); ?>
<?= ($do ? PMA\libraries\Util::getImage('s_success.png', __('Replicated')) : ''); ?>
</td>
<?php endif; ?>
<?php
//Favorite table anchor.
?>
<?php if ($GLOBALS['cfg']['NumFavoriteTables'] > 0): ?>
<td class="center print_ignore">
<?= PMA\libraries\Template::get('database/structure/favorite_anchor')->render(
array(
'db' => $db,
'current_table' => $current_table,
'titles' => $titles,
'already_favorite' => $already_favorite
)
); ?>
</td>
<?php endif; ?>
<td class="center print_ignore">
<?= $browse_table; ?>
</td>
<td class="center print_ignore">
<a href="tbl_structure.php<?= $tbl_url_query; ?>">
<?= $titles['Structure']; ?>
</a>
</td>
<td class="center print_ignore">
<?= $search_table; ?>
</td>
<?php if (!$db_is_system_schema): ?>
<td class="insert_table center print_ignore">
<a href="tbl_change.php<?= $tbl_url_query; ?>"><?= $titles['Insert']; ?></a>
</td>
<td class="center print_ignore"><?= $empty_table; ?></td>
<td class="center print_ignore">
<a class="ajax drop_table_anchor <?= ($table_is_view || $current_table['ENGINE'] == null) ? ' view' : '' ?>"
href="sql.php<?= $tbl_url_query; ?>&amp;reload=1&amp;purge=1&amp;sql_query=<?= urlencode($drop_query); ?>&amp;message_to_show=<?= urlencode($drop_message); ?>" >
<?= $titles['Drop']; ?>
</a>
</td>
<?php endif; ?>
<?php if (isset($current_table['TABLE_ROWS']) &&
($current_table['ENGINE'] != null || $table_is_view)): ?>
<?php
// Get the row count.
$row_count = PMA\libraries\Util::formatNumber($current_table['TABLE_ROWS'], 0);
// Content to be appended into 'tbl_rows' cell.
// If row count is approximate, display it as an anchor to get real count.
?>
<td class="value tbl_rows"
data-table="<?= htmlspecialchars($current_table['TABLE_NAME']); ?>">
<?php if ($approx_rows): ?>
<a href="db_structure.php<?= PMA_URL_getCommon(
array(
'ajax_request' => true,
'db' => $GLOBALS['db'],
'table' => $current_table['TABLE_NAME'],
'real_row_count' => 'true'
)
); ?>" class="ajax real_row_count">
<bdi>
~<?= $row_count; ?>
</bdi>
</a>
<?php else: ?>
<?= $row_count; ?>
<?php endif; ?>
<?= $show_superscript; ?>
</td>
<?php if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)): ?>
<td class="nowrap">
<?php if (!empty($current_table['ENGINE'])): ?>
<?= $current_table['ENGINE']; ?>
<?php elseif ($table_is_view): ?>
<?= __('View'); ?>
<?php endif; ?>
</td>
<?php if (mb_strlen($collation)): ?>
<td class="nowrap">
<?= $collation; ?>
</td>
<?php endif; ?>
<?php endif; ?>
<?php if ($is_show_stats): ?>
<td class="value tbl_size">
<a href="tbl_structure.php<?= $tbl_url_query ?>#showusage">
<span><?= $formatted_size; ?></span>
<span class="unit"><?= $unit; ?></span>
</a>
</td>
<td class="value tbl_overhead">
<?= $overhead; ?>
</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureComment']): ?>
<?php $comment = $current_table['Comment']; ?>
<td>
<?php if (mb_strlen($comment) > $GLOBALS['cfg']['LimitChars']): ?>
<abbr title="<?= htmlspecialchars($comment); ?>">
<?= htmlspecialchars(
mb_substr(
$comment, 0, $GLOBALS['cfg']['LimitChars']
)
); ?>
...
</abbr>
<?php else: ?>
<?= htmlspecialchars($comment); ?>
<?php endif; ?>
</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureCreation']): ?>
<td class="value tbl_creation">
<?= $create_time ? PMA\libraries\Util::localisedDate(strtotime($create_time)) : '-'; ?>
</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']): ?>
<td class="value tbl_last_update">
<?= $update_time ? PMA\libraries\Util::localisedDate(strtotime($update_time)) : '-'; ?>
</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastCheck']): ?>
<td class="value tbl_last_check">
<?= $check_time ? PMA\libraries\Util::localisedDate(strtotime($check_time)) : '-'; ?>
</td>
<?php endif; ?>
<?php elseif ($table_is_view): ?>
<td class="value tbl_rows">-</td>
<td class="nowrap">
<?= __('View'); ?>
</td>
<td class="nowrap">---</td>
<?php if ($is_show_stats): ?>
<td class="value tbl_size">-</td>
<td class="value tbl_overhead">-</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureComment']): ?>
<td></td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureCreation']): ?>
<td class="value tbl_creation">-</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']): ?>
<td class="value tbl_last_update">-</td>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastCheck']): ?>
<td class="value tbl_last_check">-</td>
<?php endif; ?>
<?php else: ?>
<td colspan="<?= $colspan_for_structure - ($db_is_system_schema ? 6 : 9); ?>"
class="center">
<?= __('in use'); ?>
</td>
<?php endif; ?>
</tr>

View File

@ -0,0 +1,126 @@
<?php
$cnt = 0; // Let's count the columns...
if ($db_is_system_schema) {
$action_colspan = 3;
} else {
$action_colspan = 6;
}
if ($GLOBALS['cfg']['NumFavoriteTables'] > 0) {
$action_colspan++;
}
?>
<form method="post" action="db_structure.php" name="tablesForm" id="tablesForm">
<?= PMA_URL_getHiddenInputs($db); ?>
<table class="data">
<thead>
<tr>
<th class="print_ignore"></th>
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Table'),
'sort' => 'table',
'initial_sort_order' => 'ASC'
)
); ?></th>
<?php if ($replication): ?>
<th><?= __('Replication'); ?></th>
<?php endif; ?>
<th colspan="<?= $action_colspan; ?>" class="print_ignore">
<?= __('Action'); ?>
</th>
<!-- larger values are more interesting so default sort order is DESC-->
<th>
<?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Rows'),
'sort' => 'records',
'initial_sort_order' => 'DESC'
)
); ?>
<?= PMA\libraries\Util::showHint(PMA_sanitize(
__('May be approximate. Click on the number to get the exact'
. ' count. See [doc@faq3-11]FAQ 3.11[/doc].'))); ?>
</th>
<?php if (!($GLOBALS['cfg']['PropertiesNumColumns'] > 1)): ?>
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Type'),
'sort' => 'type',
'initial_sort_order' => 'ASC'
)
); $cnt++; ?></th>
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Collation'),
'sort' => 'collation',
'initial_sort_order' => 'ASC'
)
); $cnt++; ?></th>
<?php endif; ?>
<?php if ($GLOBALS['is_show_stats']): ?>
<!-- larger values are more interesting so default sort order is DESC -->
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Size'),
'sort' => 'size',
'initial_sort_order' => 'DESC'
)
); $cnt++; ?></th>
<!-- larger values are more interesting so default sort order is DESC -->
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Overhead'),
'sort' => 'overhead',
'initial_sort_order' => 'DESC'
)
); $cnt++; ?></th>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureComment']): ?>
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Comment'),
'sort' => 'comment',
'initial_sort_order' => 'ASC'
)
); $cnt++; ?></th>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureCreation']): ?>
<!-- newer values are more interesting so default sort order is DESC -->
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Creation'),
'sort' => 'creation',
'initial_sort_order' => 'DESC'
)
); $cnt++; ?></th>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastUpdate']): ?>
<!-- newer values are more interesting so default sort order is DESC -->
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Last update'),
'sort' => 'last_update',
'initial_sort_order' => 'DESC'
)
); $cnt++; ?></th>
<?php endif; ?>
<?php if ($GLOBALS['cfg']['ShowDbStructureLastCheck']): ?>
<!-- newer values are more interesting so default sort order is DESC -->
<th><?= PMA\libraries\Template::get('database/structure/sortable_header')->render(
array(
'title' => __('Last check'),
'sort' => 'last_check',
'initial_sort_order' => 'DESC'
)
); $cnt++; ?></th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php $GLOBALS['colspan_for_structure'] = $cnt + $action_colspan + 3; ?>

View File

@ -0,0 +1,11 @@
<a href="tbl_tracking.php<?= $url_query; ?>&amp;table=<?= $truename; ?>">
<?php if ($is_tracked): ?>
<?= PMA\libraries\Util::getImage(
'eye.png', __('Tracking is active.')
); ?>
<?php else: ?>
<?= PMA\libraries\Util::getImage(
'eye_grey.png', __('Tracking is not active.')
); ?>
<?php endif; ?>
</a>