Skip to content
Browse files

rollback

  • Loading branch information...
1 parent 0abe86b commit 717cb9372635dbdb7127ca89aefffd00c88e7ce9 @xianglei committed
Showing with 20 additions and 38 deletions.
  1. +11 −29 sqlQuery.php
  2. +1 −1 templates/sql_query.html
  3. +4 −4 templates/style.css
  4. +4 −4 templates/top.html
View
40 sqlQuery.php
@@ -109,8 +109,7 @@
echo '</table><br>';
include_once 'templates/sql_query.html';
}
-
- else//trashed codes
+ else
{
/*if(preg_match("/( {0,}select +\* +from)/i",@$_POST['sql']) && !preg_match("/limit/i", @$_POST['sql']) && !preg_match("/where/i", @$_POST['sql']))# if select * from with no limit died.
{
@@ -172,40 +171,24 @@
#$path = $env['http_url']."?time=".$sha1."&query=".urlencode($sql,$key);
$cookie = sha1($mtime);
- #echo "
- #<script>
- #function getReult()
- #{
- # document.getElementById('stderr').src='refresh.php?str=".$sha1."';
- #}
- #</script>
- #";
+ echo "
+ <script>
+ function getReult()
+ {
+ document.getElementById('stderr').src='refresh.php?str=".$sha1."';
+ }
+ </script>
+ ";
$sql = str_replace("%", "\000", $sql);//encode for like %
- #echo "<body onload=\"ajaxRequest('cliQuery.php?time=".$sha1."&query=".rawurlencode($sql)."' , GetResults)\">";
+ echo "<body onload=\"ajaxRequest('cliQuery.php?time=".$sha1."&query=".rawurlencode($sql)."' , getReult)\">";
echo "<input class=\"btn btn-success\" type=button value=\"".$lang['getResult']."\" onclick=\"window.open('getResult.php?str=".$sha1."')\">";
echo "<br><br>".$lang['fingerprintOfMapReduce']." ".$sha1;
echo "<br><br>";
echo "SQL: ".$sql;
echo "<br><br>";
- echo "<div id=\"stderr\" width=700 height=400 align=left></div>";
- echo "
- <script>
- function RunSql()
- {
- $.get(\"cliQuery.php?time=".$sha1."&query=".rawurlencode($sql)."\");
- }
- function GetResults()
- {
- $(\"#stderr\").load(\"refresh.php?str=".$sha1."\");
- }
- RunSql();
- GetResults();
- setInterval(GetResults, 2000)
- </script>
- ";
- #echo "<iframe id=stderr width=700 height=400 align=left src=refresh.php?str=".$sha1." border=0></iframe><br><br>";
+ echo "<iframe id=stderr width=700 height=400 align=left src=refresh.php?str=".$sha1." border=0></iframe><br><br>";
//}
/*else
{
@@ -285,7 +268,6 @@ function GetResults()
unset($timer);
}*/
}
-
//echo "</div>";
//echo "</div>";
$transport->close();
View
2 templates/sql_query.html
@@ -1,5 +1,5 @@
-<form method=post name=form action="sqlSubmitted.php">
+<form method=post name=form>
<div id="hiveudf">
<textarea cols="80" rows="10" name="sql" id="sql">select * from <?php echo $_GET['table'];?> limit 30</textarea>
</div>
View
8 templates/style.css
@@ -97,7 +97,7 @@ function realconfirm(text1,url)
}
}
-/*function getAjax(){
+function getAjax(){
var ajax;
try{
ajax=new ActiveXObject('Msxml2.XMLHTTP');
@@ -109,7 +109,7 @@ function realconfirm(text1,url)
}
}
return ajax;
-}*/
+}
function trim(s) {return s.replace(/(^[ | ]*)|([ | ]*$)/g, "");}
function $a(s) {return document.getElementsByName(s);}
@@ -117,7 +117,7 @@ function $a(s) {return document.getElementsByName(s);}
/**
* ajax调用函数
*/
-/*function ajaxRequest(url, callback){
+function ajaxRequest(url, callback){
var x=getAjax();
x.onreadystatechange=function(){
if(x.readyState != 4)
@@ -132,7 +132,7 @@ function $a(s) {return document.getElementsByName(s);}
function getReult()
{
document.getElementById('stderr').src='refresh.php?str=<?php echo $sha1;?>'
-}*/
+}
function getQueryPlan()
{
View
8 templates/top.html
@@ -97,7 +97,7 @@
}
}
-/*function getAjax(){
+function getAjax(){
var ajax;
try{
ajax=new ActiveXObject('Msxml2.XMLHTTP');
@@ -109,7 +109,7 @@
}
}
return ajax;
-}*/
+}
function trim(s) {return s.replace(/(^[ | ]*)|([ | ]*$)/g, "");}
function $a(s) {return document.getElementsByName(s);}
@@ -117,7 +117,7 @@
/**
* ajax调用函数
*/
-/*function ajaxRequest(url, callback){
+function ajaxRequest(url, callback){
var x=getAjax();
x.onreadystatechange=function(){
if(x.readyState != 4)
@@ -132,7 +132,7 @@
function getReult()
{
document.getElementById('stderr').src='refresh.php?str=<?php echo $sha1;?>'
-}*/
+}
function getQueryPlan()
{

0 comments on commit 717cb93

Please sign in to comment.
Something went wrong with that request. Please try again.