Tryag File Manager
Home
-
Turbo Force
Current Path :
/
home
/
cluster1
/
data
/
bu01
/
1121861
/
html
/
jlex
/
php5
/
Upload File :
New :
File
Dir
/home/cluster1/data/bu01/1121861/html/jlex/php5/query_result.php5
<? include_once("mysql_to_xml.php5"); include_once("query_object.php5"); class query_result { /******************************* get_project_defaults ****************************/ function get_project_defaults($defaults_file) { $defaults = array(); $defaults_xml = simplexml_load_file($defaults_file); foreach($defaults_xml->children() as $tag=>$value) { $defaults[$tag] = "".$value; } return $defaults; } /**********************************************************************************************************/ function query_database($form_vars) { if(array_key_exists("query_object",$_SESSION)) { $query_object = $_SESSION["query_object"]; if($query_object->get_project() != $form_vars["project"]) $query_object = new query_object(); } else { $query_object = new query_object(); } $project = $form_vars["project"]; $defaults_file = "../$project/defaults.xml"; $defaults = array(); if(file_exists($defaults_file)) { $defaults = $this->get_project_defaults($defaults_file); } if(array_key_exists("pre_processing_script",$defaults)) { $pre_processing_script = "../$project/".$defaults["pre_processing_script"]; if(file_exists($pre_processing_script)) { include($pre_processing_script); } } $query_object->fill_query_object($form_vars,$defaults); $converter = new mysql_to_xml(); $page = $query_object->get_page(); if($page == "") { $query_object = $converter->query_database($query_object); } $query_object = $converter->convert_resultset_to_xml($query_object); $_SESSION["query_object"] = $query_object; $post_processing_script = "../$project/".$query_object->get_post_processing_script(); if($post_processing_script != "../$project/") { include($post_processing_script); //$query_object->print_values(); } else { //$query_object->print_values(); header("Content-Type: application/xml"); $xml = $query_object->get_xml(); echo $xml; } } } //error_reporting(0); session_start(); $form_vars = array_merge($_POST, $_GET); $qr = new query_result(); $qr->query_database($form_vars); ?>