saveVariables(); if (isset($_POST["command"])){ switch($_POST["command"]){ case "done": $tablePrinter->donePrinting($_GET["backurl"]); break; case "print": //let's build the whereclause $whereclause=""; $dataprint=""; switch($_POST["therecords"]){ case "all": $dataprint="All Records"; break; case "savedsearch": if($_POST["savedsearches"]!="" and $_POST["savedsearches"]!="NA") { $querystatement="SELECT name,sqlclause FROM usersearches WHERE id=".$_POST["savedsearches"]; $queryresult=$db->query($querystatement); If(!$queryresult) $error = new appError(500,"Could not retrieve saved search. ".$querystatement); $therecord=$db->fetchArray($queryresult); $whereclause="WHERE ".$therecord["sqlclause"]; $dataprint=$therecord["name"]; } break; case "selected": foreach($tablePrinter->theids as $theid){ $whereclause.=" or ".$tablePrinter->maintable.".id=".$theid; } $whereclause="where ".substr($whereclause,3); $dataprint="Selected Records"; break; } $_SESSION["printing"]["whereclause"]=$whereclause; $_SESSION["printing"]["dataprint"]=$dataprint; //next let's do the sort $sortorder=""; switch($_POST["thesort"]){ case "single": $sortorder=" ORDER BY ".$tablePrinter->maintable.".".$_POST["singlefield"]." ".$_POST["order"]; break; case "savedsort": if($_POST["savedsorts"]!="" and $_POST["savedsorts"]!="NA") { $querystatement="SELECT sqlclause FROM usersearches WHERE id=".$_POST["savedsorts"]; $queryresult=$db->query($querystatement); If(!$queryresult) $error = new appError(500,"Could not retrieve saved search. ".$querystatement); $therecord=$db->fetchArray($queryresult); $sortorder=" ORDER BY ".$therecord["sqlclause"]; } break; } $_SESSION["printing"]["sortorder"]=$sortorder; if(isset($_POST["choosereport"])){ $tablePrinter->openwindows=""; for($i=0;$iquery($querystatement); if(!$queryresult) $error = new appError(100,"Could not Retreive Report Information"); $reportrecord=$db->fetchArray($queryresult); $fakeExtForIE=""; if($reportrecord["type"]=="PDF Report") $fakeExtForIE="&ext=.pdf"; $dateTimeStamp="&ts=".mktime(); // make the url unique to avoid using browser cache //javascript open each report in new window $tablePrinter->openwindows.="window.open('".APP_PATH.$reportrecord["reportfile"]."?tid=".urlencode($tablePrinter->tableid).$dateTimeStamp.$fakeExtForIE."','print".$i."');\n"; } } } break; } } $pageTitle="Print/Export"; $phpbms->showMenu = false; $phpbms->cssIncludes[] = "pages/print.css"; $phpbms->jsIncludes[] = "common/javascript/print.js"; $phpbms->topJS[] = $tablePrinter->showJavaScriptArray(); if($tablePrinter->openwindows) $phpbms->bottomJS[] = $tablePrinter->openwindows; include("header.php"); ?>

" />
report information numRows($tablePrinter->reports)){ $db->seek($tablePrinter->reports,0); $therecord=$db->fetchArray($tablePrinter->reports); } else { $therecord["id"]=0; $therecord["reportfile"]=""; $therecord["name"]=""; $therecord["type"]=""; $therecord["description"]=""; } ?>

name
" /> " /> " size="32" maxlength="64" readonly="readonly" />

type
" size="20" maxlength="64" readonly="readonly" />

description

select report(s)

available reports
displayReportList()?>

data


showSaved($tablePrinter->savedSearches,"savedsearches");?>


sort


showSaved($tablePrinter->savedSorts,"savedsorts");?>


showFieldSort()?>


customizng reports

Many reports feature a logo and your company infromation. This information can be set administratively in the configuration area

Need more reports, or want to cuztomize an existing report to meet your specific needs?
if you are unfamiliar with PHP, or programming phpBMS, you can try visiting the phpBMS project site, or visit Kreotek's website for more information.

Pop-Up Windows

Each report will display in its own window. If you have disabled pop-ups within your browser's options or are running a third-party pop-up blocker, the report may not show.