minor bugsfixed documentation added

This commit is contained in:
ankitg
2010-08-17 00:23:57 +05:30
parent e6bb88117f
commit 369b5d00f8
3 changed files with 738 additions and 649 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -623,7 +623,6 @@ function Small_tab(t, re_load)
var id = document.getElementById('id_tbody_' + t);
var id_this = document.getElementById('id_hide_tbody_' + t);
var id_t = document.getElementById(t);
id_t.style.width = id_t.offsetWidth + 'px';
if (id_this.innerHTML == "v") {
//---CROSS
@@ -649,7 +648,6 @@ function Select_tab(t)
//----------
var id_t = document.getElementById(t);
window.scrollTo(parseInt(id_t.style.left) - 300, parseInt(id_t.style.top) - 300);
setTimeout(function(){document.getElementById('id_zag_' + t).className = 'tab_zag';}, 800);
}
//------------------------------------------------------------------------------
@@ -970,73 +968,75 @@ function getColorByTarget( target )
function Click_option(id_this,column_name,table_name)
{
var left = Glob_X - (document.getElementById(id_this).offsetWidth>>1);
document.getElementById(id_this).style.left = left + 'px';
var left = Glob_X - (document.getElementById(id_this).offsetWidth>>1);
document.getElementById(id_this).style.left = left + 'px';
// var top = Glob_Y - document.getElementById(id_this).offsetHeight - 10;
document.getElementById(id_this).style.top = (screen.height / 4) + 'px';
document.getElementById(id_this).style.visibility = "visible";
document.getElementById('option_col_name').innerHTML = '<strong>Options For "' +column_name+ '" column</strong>';
col_name = column_name;
tab_name = table_name;
document.getElementById(id_this).style.top = (screen.height / 4) + 'px';
document.getElementById(id_this).style.visibility = "visible";
document.getElementById('option_col_name').innerHTML = '<strong>Options For "' +column_name+ '" column</strong>';
col_name = column_name;
tab_name = table_name;
}
function Close_option()
{
document.getElementById('pmd_optionse').style.visibility = "hidden";
document.getElementById('pmd_optionse').style.visibility = "hidden";
}
function Select_all(id_this,owner)
{
var parent= document.form1;
downer =owner;
var i;
var tab = [];
for(i = 0; i < parent.elements.length; i++) {
if (parent.elements[i].type == "checkbox" && parent.elements[i].id.substring(0,(9 + id_this.length)) == 'select_' + id_this + '._') {
if(document.getElementById('select_all_' + id_this).checked == true) {
parent.elements[i].checked = true;
parent.elements[i].disabled = true;
var temp = '`' + id_this.substring(owner.length +1) + '`.*';
}
else {
parent.elements[i].checked = false;
parent.elements[i].disabled = false;
}
}
}
if(document.getElementById('select_all_' + id_this).checked == true) {
select_field.push('`' + id_this.substring(owner.length +1) + '`.*');
tab = id_this.split(".");
from_array.push(tab[1]);
}
else {
for (i =0; i < select_field.length; i++) {
if (select_field[i] == ('`' + id_this.substring(owner.length +1) + '`.*')) {
select_field.splice(i,1);
}
}
for(k =0 ;k < from_array.length;k++){
if(from_array[k] == id_this){
from_array.splice(k,1);
break;
}
}
}
Re_load();
var parent= document.form1;
downer =owner;
var i;
var tab = [];
for(i = 0; i < parent.elements.length; i++) {
if (parent.elements[i].type == "checkbox" && parent.elements[i].id.substring(0,(9 + id_this.length)) == 'select_' + id_this + '._') {
if(document.getElementById('select_all_' + id_this).checked == true) {
parent.elements[i].checked = true;
parent.elements[i].disabled = true;
var temp = '`' + id_this.substring(owner.length +1) + '`.*';
}
else {
parent.elements[i].checked = false;
parent.elements[i].disabled = false;
}
}
}
if(document.getElementById('select_all_' + id_this).checked == true) {
select_field.push('`' + id_this.substring(owner.length +1) + '`.*');
tab = id_this.split(".");
from_array.push(tab[1]);
}
else {
for (i =0; i < select_field.length; i++) {
if (select_field[i] == ('`' + id_this.substring(owner.length +1) + '`.*')) {
select_field.splice(i,1);
}
}
for(k =0 ;k < from_array.length;k++){
if(from_array[k] == id_this){
from_array.splice(k,1);
break;
}
}
}
Re_load();
}
function Table_onover(id_this,val)
function Table_onover(id_this,val,buil)
{
if(!val) {
document.getElementById("id_zag_" + id_this).className="tab_zag_2";
document.getElementById("id_zag_" + id_this + "_2").className="tab_zag_2";
}
else {
document.getElementById("id_zag_" + id_this).className="tab_zag";
document.getElementById("id_zag_" + id_this + "_2").className="tab_zag";
}
if(!val) {
document.getElementById("id_zag_" + id_this).className="tab_zag_2";
if(buil) {
document.getElementById("id_zag_" + id_this + "_2").className="tab_zag_2";
}
}
else {
document.getElementById("id_zag_" + id_this).className="tab_zag";
if(buil) {
document.getElementById("id_zag_" + id_this + "_2").className="tab_zag";
}
}
}
/* This function stores selected column information in select_field[]
@@ -1044,26 +1044,26 @@ function Table_onover(id_this,val)
*
*/
function store_column(id_this,owner,col) {
var i = 0;
var k = 0;
if (document.getElementById('select_' + owner + '.' + id_this + '._' + col).checked == true) {
select_field.push('`' + id_this + '`.`' + col +'`');
from_array.push(id_this);
}
else {
for(i; i < select_field.length ;i++) {
if (select_field[i] == ('`' + id_this + '`.`' + col +'`')) {
select_field.splice(i,1);
break;
}
}
for(k =0 ;k < from_array.length;k++){
if(from_array[k] == id_this){
from_array.splice(k,1);
break;
}
}
}
var i = 0;
var k = 0;
if (document.getElementById('select_' + owner + '.' + id_this + '._' + col).checked == true) {
select_field.push('`' + id_this + '`.`' + col +'`');
from_array.push(id_this);
}
else {
for(i; i < select_field.length ;i++) {
if (select_field[i] == ('`' + id_this + '`.`' + col +'`')) {
select_field.splice(i,1);
break;
}
}
for(k =0 ;k < from_array.length;k++){
if(from_array[k] == id_this){
from_array.splice(k,1);
break;
}
}
}
}
/**
@@ -1080,67 +1080,66 @@ function store_column(id_this,owner,col) {
**/
function add_object() {
var rel = document.getElementById('rel_opt');
var sum = 0;
var init = history_array.length;
if (rel.value != '--') {
if (document.getElementById('Query').value == "") {
document.getElementById('hint').innerHTML = "value/subQuery is empty" ;
document.getElementById('hint').style.visibility = "visible";
return;
}
var p = document.getElementById('Query');
var where_obj = new where(rel.value,p.value);//make where object
history_array.push(new history(col_name,where_obj,tab_name,h_tabs[downer + '.' + tab_name],"Where"));
sum = sum + 1;
rel.value = '--';
p.value = "";
}
if (document.getElementById('new_name').value !="") {
var rename_obj = new rename(document.getElementById('new_name').value);//make Rename object
history_array.push(new history(col_name,rename_obj,tab_name,h_tabs[downer + '.' + tab_name],"Rename"));
sum = sum + 1;
document.getElementById('new_name').value = "" ;
}
var rel = document.getElementById('rel_opt');
var sum = 0;
var init = history_array.length;
if (rel.value != '--') {
if (document.getElementById('Query').value == "") {
document.getElementById('hint').innerHTML = "value/subQuery is empty" ;
document.getElementById('hint').style.visibility = "visible";
return;
}
var p = document.getElementById('Query');
var where_obj = new where(rel.value,p.value);//make where object
history_array.push(new history(col_name,where_obj,tab_name,h_tabs[downer + '.' + tab_name],"Where"));
sum = sum + 1;
rel.value = '--';
p.value = "";
}
if (document.getElementById('new_name').value !="") {
var rename_obj = new rename(document.getElementById('new_name').value);//make Rename object
history_array.push(new history(col_name,rename_obj,tab_name,h_tabs[downer + '.' + tab_name],"Rename"));
sum = sum + 1;
document.getElementById('new_name').value = "" ;
}
if (document.getElementById('operator').value != '---') {
var aggregate_obj = new aggregate(document.getElementById('operator').value) ;
history_array.push(new history(col_name,aggregate_obj,tab_name,h_tabs[downer + '.' + tab_name],"Aggregate"));
sum = sum + 1;
document.getElementById('operator').value = '---';
var aggregate_obj = new aggregate(document.getElementById('operator').value) ;
history_array.push(new history(col_name,aggregate_obj,tab_name,h_tabs[downer + '.' + tab_name],"Aggregate"));
sum = sum + 1;
document.getElementById('operator').value = '---';
//make aggregate operator
}
if (document.getElementById('groupby').checked == true ) {
history_array.push(new history(col_name,'GroupBy',tab_name,h_tabs[downer + '.' +tab_name],"GroupBy"));
sum = sum + 1;
document.getElementById('groupby').checked = false;
//make groupby
}
if (document.getElementById('h_rel_opt').value != '--') {
if (document.getElementById('having').value == "") {
document.getElementById('hint').innerHTML = "value/subQuery is empty" ;
document.getElementById('hint').style.visibility = "visible";
return;
}
var p = document.getElementById('having');
var where_obj = new having(document.getElementById('h_rel_opt').value,p.value,document.getElementById('h_operator').value);//make where object
history_array.push(new history(col_name,where_obj,tab_name,h_tabs[downer + '.' + tab_name],"Having"));
sum = sum + 1;
document.getElementById('h_rel_opt').value = '--';
document.getElementById('h_operator').value = '---';
p.value = ""; //make having
}
if (document.getElementById('orderby').checked == true) {
history_array.push(new history(col_name,'OrderBy',tab_name,h_tabs[downer + '.' + tab_name],"OrderBy"));
sum = sum + 1;
document.getElementById('orderby').checked = false;
}
if (document.getElementById('groupby').checked == true ) {
history_array.push(new history(col_name,'GroupBy',tab_name,h_tabs[downer + '.' +tab_name],"GroupBy"));
sum = sum + 1;
document.getElementById('groupby').checked = false;
//make groupby
}
if (document.getElementById('h_rel_opt').value != '--') {
if (document.getElementById('having').value == "") {
document.getElementById('hint').innerHTML = "value/subQuery is empty" ;
document.getElementById('hint').style.visibility = "visible";
return;
}
var p = document.getElementById('having');
var where_obj = new having(document.getElementById('h_rel_opt').value,p.value,document.getElementById('h_operator').value);//make where object
history_array.push(new history(col_name,where_obj,tab_name,h_tabs[downer + '.' + tab_name],"Having"));
sum = sum + 1;
document.getElementById('h_rel_opt').value = '--';
document.getElementById('h_operator').value = '---';
p.value = ""; //make having
}
if (document.getElementById('orderby').checked == true) {
history_array.push(new history(col_name,'OrderBy',tab_name,h_tabs[downer + '.' + tab_name],"OrderBy"));
sum = sum + 1;
document.getElementById('orderby').checked = false;
//make orderby
}
document.getElementById('hint').innerHTML = sum + "object created" ;
}
document.getElementById('hint').innerHTML = sum + "object created" ;
document.getElementById('hint').style.visibility = "visible";
//output sum new objects created
var existingDiv = document.getElementById('ab');
existingDiv.innerHTML = display(init,history_array.length);
Close_option();
panel(0);
var existingDiv = document.getElementById('ab');
existingDiv.innerHTML = display(init,history_array.length);
Close_option();
panel(0);
}

View File

@@ -114,11 +114,14 @@ echo $script_tabs . $script_contr . $script_display_field;
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="#" onClick="build_query('SQL Query on Database', 0)" onmousedown="return false;"
class="M_butt" target="_self"
><img src="pmd/images/query_builder.png" alt="key" width="20" height="20"
title="<?php echo __('Build Query'); ?>" /></a
><a href="javascript:Top_menu_right(document.getElementById('key_Left_Right'));"
>
<?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>
@@ -227,9 +230,9 @@ 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="Table_onover('<?php echo $t_n_url ?>',0)"
onmouseout="Table_onover('<?php echo $t_n_url ?>',1)">
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];
@@ -238,9 +241,9 @@ for ($i = 0; $i < count($GLOBALS['PMD']["TABLE_NAME"]); $i++) {
?></td>
<?php
if(isset($_REQUEST['query'])) {
echo '<td class="tab_zag" onmouseover="Table_onover(\''.htmlspecialchars($t_n_url).'\',0)" id="id_zag_'.htmlspecialchars($t_n_url).'_2"';
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)">';
echo 'onmouseout="Table_onover(\''.htmlspecialchars($t_n_url).'\',1,1)">';
}?>
</tr>
</thead>
@@ -810,15 +813,16 @@ if($_REQUEST['query']) {
echo '<div id="filter"></div>';
echo '<div id="box">';
echo '<span id="boxtitle"></span>';
echo '<form method="GET" action="" target="_parent">';
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" class="btn">';
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="" />