Merge remote branch 'ankitg/master'

This commit is contained in:
Marc Delisle
2010-11-19 12:17:33 -05:00
12 changed files with 1616 additions and 12 deletions

View File

@@ -27,6 +27,7 @@ $hidden = "hidden";
<link rel="shortcut icon" href="pmd/images/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" type="text/css" href="pmd/styles/<?php echo $GLOBALS['PMD']['STYLE'] ?>/style1.css" />
<title>Designer</title>
<script src="./js/jquery/jquery-1.4.2.js" type="text/javascript"></script>
<script type="text/javascript">
// <![CDATA[
<?php
@@ -34,8 +35,18 @@ echo '
var server = "' . PMA_escapeJsString($server) . '";
var db = "' . PMA_escapeJsString($db) . '";
var token = "' . PMA_escapeJsString($token) . '";';
echo "\n";
if($_REQUEST['query']) {
echo '
$(document).ready(function(){
$(".trigger").click(function(){
$(".panel").toggle("fast");
$(this).toggleClass("active");
return false;
});
});';
}
?>
// ]]>
</script>
<?php
@@ -47,7 +58,8 @@ require_once './libraries/header_scripts.inc.php';
?>
<script src="js/messages.php<?php echo PMA_generate_common_url($params); ?>" type="text/javascript"></script>
<script src="pmd/scripts/ajax.js" type="text/javascript"></script>
<script src="pmd/scripts/move.js" type="text/javascript"></script>
<script src="pmd/scripts/history.js" type="text/javascript"></script>
<script src="pmd/scripts/move.js" type="text/javascript"></script>
<!--[if IE]>
<script src="pmd/scripts/iecanvas.js" type="text/javascript"></script>
<![endif]-->
@@ -98,11 +110,18 @@ echo $script_tabs . $script_contr . $script_display_field;
class="M_butt" target="_self"
><img title="<?php echo __('Toggle small/big'); ?>" alt="key" src="pmd/images/bottom.png"
/></a><img class="M_bord" src="pmd/images/bord.png" alt=""
/><a href="javascript:PDF_save();" onmousedown="return false;"
/><a href="javascript:PDF_save();" onmousedown="return false;"
class="M_butt" target="_self"
><img src="pmd/images/pdf.png" alt="key" width="20" height="20"
title="<?php echo __('Import/Export coordinates for PDF schema'); ?>" /></a>
<a href="javascript:Top_menu_right(document.getElementById('key_Left_Right'));"
title="<?php echo __('Import/Export coordinates for PDF schema'); ?>" /></a
>
<?php if($_REQUEST['query']){
echo '<a href="#" onClick="build_query(\'SQL Query on Database\', 0)" onmousedown="return false;"
class="M_butt" target="_self">';
echo '<img src="pmd/images/query_builder.png" alt="key" width="20" height="20" title="';
echo __('Build Query');
echo '"/></a>'; }?>
<a href="javascript:Top_menu_right(document.getElementById('key_Left_Right'));"
onmousedown="return false;" class="M_butt last" target="_self">
<img src="pmd/images/2rightarrow_m.png" id="key_Left_Right" alt=">"
title="<?php echo __('Move Menu'); ?>" /></a>
@@ -187,6 +206,13 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
">
<thead>
<tr>
<?php
if(isset($_REQUEST['query'])) {
echo '<td class="select_all">';
echo '<input type="checkbox" value="select_all_'.htmlspecialchars($t_n_url).'" style="margin: 0px;" ';
echo 'id="select_all_'.htmlspecialchars($t_n_url).'" title="select all" ';
echo 'onclick="Select_all(\''. htmlspecialchars($t_n_url) .'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\')"></td>';
}?>
<td class="small_tab" onmouseover="this.className='small_tab2';"
onmouseout="this.className='small_tab';"
id="id_hide_tbody_<?php echo $t_n_url ?>"
@@ -204,15 +230,21 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
onclick="Start_tab_upd('<?php echo $GLOBALS['PMD_URL']["TABLE_NAME_SMALL"][$i]; ?>');">
<img src="pmd/images/exec_small.png" alt="" /></td>
<td nowrap="nowrap" id="id_zag_<?php echo $t_n_url ?>" class="tab_zag"
onmousedown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"
onmouseover="this.className = 'tab_zag_2'"
onmouseout="this.className = 'tab_zag'">
onmousedown="cur_click=document.getElementById('<?php echo $t_n_url ?>');"/
onmouseover="Table_onover('<?php echo $t_n_url ?>',0,<?php echo (isset($_REQUEST['query'])? 1 : 0 )?> )"
onmouseout="Table_onover('<?php echo $t_n_url ?>',1,<?php echo (isset($_REQUEST['query']) ? 1 : 0 )?>)">
<span class='owner'>
<?php
echo $GLOBALS['PMD_OUT']["OWNER"][$i];
echo '.</span>';
echo $GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
?></td>
<?php
if(isset($_REQUEST['query'])) {
echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0,1)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
echo 'onmousedown="cur_click=document.getElementById(\''.htmlspecialchars($t_n_url).'\');"';
echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
}?>
</tr>
</thead>
<tbody id="id_tbody_<?php echo $t_n_url ?>"
@@ -243,6 +275,14 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
echo (isset($tables_all_keys[$t_n.".".$tab_column[$t_n]["COLUMN_NAME"][$j]]) ? 1 : 0);
}
?>)">
<?php
if(isset($_REQUEST['query'])) {
echo '<td class="select_all">';
echo '<input value="'.htmlspecialchars($t_n_url).urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'"';
echo 'type="checkbox" id="select_'.htmlspecialchars($t_n_url).'._'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
echo 'style="margin: 0px;" title="select_'.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'" ';
echo 'onclick="store_column(\''.urlencode($GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i]).'\',\''.htmlspecialchars($GLOBALS['PMD_OUT']["OWNER"][$i]).'\',\''.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'\')"></td>';
}?>
<td width="10px" colspan="3"
id="<?php echo $t_n_url.".".urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]) ?>">
<div style="white-space:nowrap">
@@ -276,6 +316,14 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
?>
</div>
</td>
<?php
if(isset($_REQUEST['query'])) {
//$temp = $GLOBALS['PMD_OUT']["OWNER"][$i].'.'.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i];
echo '<td class="small_tab_pref" onmouseover="this.className=\'small_tab_pref2\';"';
echo 'onmouseout="this.className=\'small_tab_pref\';"';
echo 'onclick="Click_option(\'pmd_optionse\',\''.urlencode($tab_column[$t_n]["COLUMN_NAME"][$j]).'\',\''.$GLOBALS['PMD_OUT']["TABLE_NAME_SMALL"][$i].'\')" >';
echo '<img src="pmd/images/exec_small.png" title="options" alt="" /></td> ';
} ?>
</tr>
<?php
}
@@ -390,6 +438,391 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
</tr>
</tbody>
</table>
<table id="pmd_optionse" style="visibility:<?php echo $hidden ?>;"
width="5%" border="0" 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" border="0" align="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" rowspan="2" id="option_col_name" nowrap="nowrap" align="center"></td>
</tr>
</thead>
<tbody id="where">
<tr><td align="center" nowrap="nowrap"><b>Where</b></td></tr>
<tr>
<td width="58" nowrap="nowrap">Relation operator</td>
<td width="102"><select name="rel_opt" id="rel_opt">
<option value="--" selected="selected"> -- </option>
<option value="=" > = </option>
<option value=">"> > </option>
<option value="<"> < </option>
<option value=">="> >= </option>
<option value="<="> <= </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 nowrap="nowrap">Value/<br />Subquery</td>
<td><textarea id="Query" value="" cols="18"></textarea>
</td>
</tr>
<tr><td align="center" nowrap="nowrap"><b>Rename To</b></td></tr>
<tr>
<td width="58" nowrap="nowrap">New Name</td>
<td width="102"><input type="text" value="" id="new_name"/></td>
</tr>
<tr><td align="center" nowrap="nowrap"><b>Aggregate</b></td></tr>
<tr>
<td width="58" nowrap="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 nowrap="nowrap" width="58" align="center"><b>Group By</b></td>
<td><input type="checkbox" value="groupby" id="groupby"/></td>
</tr>
<tr>
<td nowrap="nowrap" width="58" align="center"><b>Order By</b></td>
<td><input type="checkbox" value="orderby" id="orderby"/></td>
</tr>
<tr><td align="center" nowrap="nowrap"><b>Having</b></td></tr>
<tr>
<td width="58" nowrap="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" nowrap="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=">"> > </option>
<option value="<"> < </option>
<option value=">="> >= </option>
<option value="<="> <= </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" nowrap="nowrap">Value/<br/>subQuery</td>
<td width="102"><textarea id="having" value="" cols="18"></textarea></td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" align="center" nowrap="nowrap">
<input type="button" class="butt" name="Button"
value="<?php echo __('OK'); ?>" onclick="add_object()" />
<input type="button" class="butt" name="Button"
value="<?php echo __('Cancel'); ?>"
onclick="Close_option()" />
</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>
<table id="query_rename_to" style="visibility:<?php echo $hidden ?>;"
width="5%" border="0" 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" border="0" align="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" align="center" nowrap="nowrap"><strong>Rename To</strong></td>
</tr>
</thead>
<tbody id="rename_to">
<tr>
<td width="58" nowrap="nowrap">New Name</td>
<td width="102">
<input type="text" value="" id="e_rename"/>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" align="center" nowrap="nowrap">
<input type="button" class="butt" name="Button"
value="<?php echo __('OK'); ?>" onclick="edit('Rename')" />
<input type="button" class="butt" name="Button"
value="<?php echo __('Cancel'); ?>"
onclick="document.getElementById('query_rename_to').style.visibility = 'hidden';" />
</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>
<table id="query_having" style="visibility:<?php echo $hidden ?>;"
width="5%" border="0" 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" border="0" align="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" align="center" nowrap="nowrap"><strong>Having</strong></td>
</tr>
</thead>
<tbody id="rename_to">
<tr>
<td width="58" nowrap="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" nowrap="nowrap">Opeartor</td>
<td width="102"><select name="hrel_opt" id="hrel_opt">
<option value="--" selected="selected"> -- </option>
<option value="=" > = </option>
<option value=">"> > </option>
<option value="<"> < </option>
<option value=">="> >= </option>
<option value="<="> <= </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 nowrap="nowrap">Value/<br />Subquery</td>
<td><textarea id="hQuery" value="" cols="18"></textarea>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" align="center" nowrap="nowrap">
<input type="button" class="butt" name="Button"
value="<?php echo __('OK'); ?>" onclick="edit('Having')" />
<input type="button" class="butt" name="Button"
value="<?php echo __('Cancel'); ?>"
onclick="document.getElementById('query_having').style.visibility = 'hidden';" />
</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>
<table id="query_Aggregate" style="visibility:<?php echo $hidden ?>;"
width="5%" border="0" 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" border="0" align="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" align="center" nowrap="nowrap"><strong>Aggregate</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td width="58" nowrap="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="avg"> Count </option>
</select>
</td></tr>
</tbody>
<tbody>
<tr>
<td colspan="2" align="center" nowrap="nowrap">
<input type="button" class="butt" name="Button"
value="<?php echo __('OK'); ?>" onclick="edit('Aggregate')" />
<input type="button" class="butt" name="Button"
value="<?php echo __('Cancel'); ?>"
onclick="document.getElementById('query_Aggregate').style.visibility = 'hidden';" />
</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>
<table id="query_where" style="visibility:<?php echo $hidden ?>;"
width="5%" border="0" 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" border="0" align="center" cellpadding="2" cellspacing="0">
<thead>
<tr>
<td colspan="2" align="center" nowrap="nowrap"><strong>Where</strong></td>
</tr>
</thead>
<tbody id="rename_to">
<tr>
<td width="58" nowrap="nowrap">Opeartor</td>
<td width="102"><select name="erel_opt" id="erel_opt">
<option value="--" selected="selected"> -- </option>
<option value="=" > = </option>
<option value=">"> > </option>
<option value="<"> < </option>
<option value=">="> >= </option>
<option value="<="> <= </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 nowrap="nowrap">Value/<br />Subquery</td>
<td><textarea id="eQuery" value="" cols="18"></textarea>
</td>
</tr>
</tbody>
<tbody>
<tr>
<td colspan="2" align="center" nowrap="nowrap">
<input type="button" class="butt" name="Button"
value="<?php echo __('OK'); ?>" onclick="edit('Where')" />
<input type="button" class="butt" name="Button"
value="<?php echo __('Cancel'); ?>"
onclick="document.getElementById('query_where').style.visibility = 'hidden';" />
</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>
<?php
if($_REQUEST['query']) {
echo '<div class="panel">';
echo '<div style="clear:both;"></div>';
echo '<div id="ab"></div>';
echo '<div style="clear:both;"></div>';
echo '</div>';
echo '<a class="trigger" href="#">History</a>';
echo '<div id="filter"></div>';
echo '<div id="box">';
echo '<span id="boxtitle"></span>';
echo '<form method="post" action="pmd_general" target="_parent">';
echo '<textarea cols="80" name="sql_query" id="textSqlquery" rows="15"></textarea><div id="tblfooter">';
echo ' <input type="submit" name="submit_sql" class="btn">';
echo ' <input type="button" name="cancel" value="Cancel" onClick="closebox()" class="btn">';
echo '</div></p>';
echo '</form></div>';
} ?>
<!-- cache images -->
<img src="pmd/images/2leftarrow_m.png" width="0" height="0" alt="" />
<img src="pmd/images/rightarrow1.png" width="0" height="0" alt="" />