<?php
//*Client Data System, Copyright (C) 2000, 2001 Tedd Kelleher. This is free software, subject to the
//*GNU GENERAL PUBLIC LICENSE, Version 2, June 1991 (in file named gpl.txt), which should accompany
//*any distribution of this file. Tedd Kelleher can be contacted at hide@address.com
$page_title = "View Reports";
$page_access_levels = ":10:20:30:40:";
$page_id = "query_report";
$page_profile = "Query Client Data";
$instructions .= "Query client data by selecting parameters below. ";
////Header for every page that finds the include directory, connects to db, authenticates user access
include("initialize_pointer.php");
if(!include($include_root."authenticate.inc")){echo "No Authentication"; exit; };
include($include_root."Questions_into_array_class.inc");
include($include_root."questions_display.inc");
include($include_root."Questions_answers_validation_class.inc");
//include($include_root."questions_into_tags_function.inc");
include($include_root."head.inc");
include($include_root."template_parser.inc");
include($include_root."page_elements_display.inc");
//include($include_root."client_id_class.inc");
//include($include_root."client_report_entry_class.inc");
include($include_root."client_profile_class.inc");
include($include_root."reports_class.inc");
include($include_root."report_date_questions_class.inc");
//include($include_root."relationships_class.inc");
include($include_root."query_class.inc");
include($include_root."query_report_class.inc");
include($include_root.'user_info_functions.inc');
include( $include_root.'encryption_class.inc' );
include( $include_root.'date_encrypted_functions.inc' );
convert_post_and_get_variable ("report_template");
if( ereg("[^0-9a-z\.\_]", $report_template) )
{
echo "Illegal report template name";
$report_template = "";
}
convert_post_and_get_variable ("query_page");
$report = new Query_report;
if ($query_page == "submitted" && $report_template)
{
echo $report->output_report ($report_template, $query_page, $form_answer);
}
else
{
if ( $report_template )
{
$tag_values["{REPORT}"] = $report->output_report ($report_template, $query_page, $form_answer);
$tag_values["{FORM_END}"] .= "\n<input type=\"submit\" name=\"".$name."\" value=\"Submit Query\" ".build_tabindex_html(8999).">";
$html_template = "generic_form.html";
//form_end ("Submit Query", 1);
}
else
{
$tag_values["{REPORTS_LIST}"] = $report->create_reports_list_table();
$html_template = "generic.html";
}
if ( $access_level == 10 )
{
$tag_values["{EDIT_LINK}"] = "<a href=\"".$system_directory."query_build.php\">Create/Edit Queries</a>";
}
$tag_values["{PAGE TITLE}"] = page_title_table();
$tag_values["{MENU}"] = menu();
$tag_values["{HEAD}"] = head ($page_title, $head_page_specific, $head_dynamic_style);
$tag_values["{FOOTER}"] = footer();
//echo "Template is: ".$html_template."<br>";
//$html_template = "generic_form.html";
template_parser ($html_template, $tag_values);
}
//include($include_root."variables.inc");
?>