{php}html_header_show();{/php} {literal} {/literal}
{php} //get directories that might contain reports $reportsdir = './myreports/'; if (is_dir($reportsdir)) { $folder_array = array(); if ($handle = opendir($reportsdir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && is_dir($reportsdir.$file)) { $folder_array[$file] = array(); } } closedir($handle); } //fill elements of $folder_array with the php files in each directory foreach ($folder_array as $key => $val) { $reportsubdir = $reportsdir.$key.'/'; if ($handle = opendir($reportsubdir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && substr($file,-4,4) == '.php') { //if ($file != '.' && $file != '..') { $filename = substr($file,0,strlen($file)-4); $folder_array[$key][$filename] = $GLOBALS['webroot'].'/interface/reports/myreports/'.$key.'/'.$file; } } closedir($handle); } } //generate drop down menus echo "
\n"; foreach ($folder_array as $title => $link) { if (count($link) > 0) { //only create menus for those subdirectories with php reports in them echo "
\n"; } } echo "
\n"; //now deal with the reports that are just under myreports, not organized into subdirectories $reportsdir = './myreports/'; $dir_array = array(); if ($handle = opendir($reportsdir)) { while (false !== ($file = readdir($handle))) { if ($file != '.' && $file != '..' && substr($file,-4,4) == '.php') { $filename = substr($file,0,strlen($file)-4); array_push($dir_array,"".xl($filename)."
\n"); } } closedir($handle); } //print the links for reports under myreports foreach($dir_array as $var) { echo $var; } } {/php} [{xl t='printable'}]  
{xl t='Reports'}: {html_options onChange="clear_vars()" name="query_id" selected=$query_id options=$queries}    {xl t='Var1'}:     {xl t='Var2'}:     {xl t='Show'}:  {html_options name="show" selected=$show options=$show_options}

{$title}    {$smarty.now|date_format:"%A, %B %e, %Y"}

{if is_object($pager)} {$pager->render($show)} {/if}