diff --git a/pmd/images/query_builder.png b/pmd/images/query_builder.png new file mode 100644 index 000000000..6d0f5544b Binary files /dev/null and b/pmd/images/query_builder.png differ diff --git a/pmd/scripts/history.js b/pmd/scripts/history.js index a80e25529..1c76f15c6 100644 --- a/pmd/scripts/history.js +++ b/pmd/scripts/history.js @@ -342,7 +342,7 @@ var aggregate = function(noperator) { this.set_operator(noperator); }; -function build_query() { +function build_query(formtitle, fadin) { var q_select = "SELECT "; var temp; for(i = 0;i < select_field.length; i++) { @@ -357,15 +357,28 @@ function build_query() { q_select += select_field[i] + temp +","; } } - q_select = q_select.substring(0,q_select.length - 1); //PDF_save() - document.getElementById('hint').innerHTML = q_select; - document.getElementById('hint').style.visibility = "visible"; + q_select = q_select.substring(0,q_select.length - 1); + var box = document.getElementById('box'); + document.getElementById('filter').style.display='block'; + var btitle = document.getElementById('boxtitle'); + btitle.innerHTML = formtitle; + if(fadin) + { + gradient("box", 0); + fadein("box"); + } + else + { + box.style.display='block'; + } + document.getElementById('textSqlquery').innerHTML = q_select; +// document.getElementById('hint').style.visibility = "visible"; } function check_aggregate(id_this) { var i = 0; for(i;i < history_array.length;i++) { - var temp = '\'' + history_array[i].get_tab() + '\'.\'' +history_array[i].get_column_name() +'\''; + var temp = '`' + history_array[i].get_tab() + '`.`' +history_array[i].get_column_name() +'`'; if(temp == id_this && history_array[i].get_type() == "Aggregate") { return history_array[i].get_obj().get_operator() + '(' + id_this +')'; } @@ -376,10 +389,37 @@ function check_aggregate(id_this) { function check_rename(id_this) { var i = 0; for (i;i < history_array.length;i++) { - var temp = '\'' + history_array[i].get_tab() + '\'.\'' +history_array[i].get_column_name() +'\''; + var temp = '`' + history_array[i].get_tab() + '`.`' +history_array[i].get_column_name() +'`'; if(temp == id_this && history_array[i].get_type() == "Rename") { - return " AS \'" + history_array[i].get_obj().getrename_to() +"\',"; + return " AS `" + history_array[i].get_obj().getrename_to() +"`"; } } return ""; -} \ No newline at end of file +} +function gradient(id, level) +{ + var box = document.getElementById(id); + box.style.opacity = level; + box.style.MozOpacity = level; + box.style.KhtmlOpacity = level; + box.style.filter = "alpha(opacity=" + level * 100 + ")"; + box.style.display="block"; + return; +} + + +function fadein(id) +{ + var level = 0; + while(level <= 1) + { + setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10); + level += 0.01; + } +} + +function closebox() +{ + document.getElementById('box').style.display='none'; + document.getElementById('filter').style.display='none'; +} diff --git a/pmd/scripts/move.js b/pmd/scripts/move.js index 13018fe41..26667f03e 100644 --- a/pmd/scripts/move.js +++ b/pmd/scripts/move.js @@ -33,6 +33,7 @@ var timeoutID; var layer_menu_cur_click = 0; var step = 10; var old_class; +var downer; //------------------------------------------------------------------------------ //------------------------------------------------------------------------------ @@ -986,6 +987,7 @@ function Close_option() function Select_all(id_this,owner) { var parent= document.form1; + downer =owner; var i; 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 + '._') { @@ -1069,32 +1071,32 @@ function add_object() { } 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[tab_name],"Where")); + 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[tab_name],"Rename")); + 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[tab_name],"Aggregate")); + 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[tab_name],"GroupBy")); + 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('orderby').checked == true) { - history_array.push(new history(col_name,'OrderBy',tab_name,h_tabs[tab_name],"OrderBy")); + 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 diff --git a/pmd/styles/default/style1.css b/pmd/styles/default/style1.css index d1ef1fa6d..5a5c5d486 100644 --- a/pmd/styles/default/style1.css +++ b/pmd/styles/default/style1.css @@ -516,3 +516,68 @@ h2.active { text-align: center; background-color: #DBE4E8; } + +#filter { + display: none; + position: absolute; + top: 0%; + left: 0%; + width: 100%; + height: 100%; + background-color: #CCA; + z-index:10; + opacity:0.5; + filter: alpha(opacity=50); +} + +#box { + display: none; + position: absolute; + top: 20%; + left: 30%; + width: 500px; + height: 220px; + padding: 48px; + margin:0; + border: 1px solid black; + background-color: white; + z-index:101; + overflow: visible; +} + +#boxtitle { + position:absolute; + float:center; + top:0; + left:0; + width:593px; + height:20px; + padding:0; + padding-top:4px; + left-padding:8px; + margin:0; + border-bottom:4px solid #3CF; + background-color: #D0DCE0; //#09c; + color:black; + font-weight:bold; + padding-left: 2px; + font-family:"Times New Roman", Times, serif; + font-size:16px; + text-align:left; +} + +#tblfooter { + background-color: D3DCE3; + float: right; + padding-top:10px; + color: black; + font-weight: normal; +} + +input.btn { + color:#333; + font: bold 84%'trebuchet ms',helvetica,sans-serif; + background-color: #D0DCE0; +} + + diff --git a/pmd_general.php b/pmd_general.php index 2c94c2d80..a364e46f7 100644 --- a/pmd_general.php +++ b/pmd_general.php @@ -27,6 +27,7 @@ $hidden = "hidden"; +