Program Operations Manual
From PikaDocs
We needed a way to display and update our Program Operations Manual online. What we ended up doing is simply creating a pika page (modeled after the homepage) that loads other HTML files into itself for display. We then converted our POMs into simple HTML files that load into the page and stored them in a simple structure inside our main Pika dir.
After the initial setting up of requiring pika_cms.php, etc. we make sure and grab our request variables:
$chapter = $_REQUEST['chapter']; $section = $_REQUEST['section'];
Then we decide what to load based on those variables:
if (!isset($chapter)) {
$chapter = "TOC";
$section = "POMS-TOC";
}
$file_name = 'poms/'.$chapter.'/'.$section.'.html';
if (!$file=fopen($file_name, "r")) {
echo ("oops! cannot open the file");
} else {
$my_file_size = filesize($file_name);
$a['my_content'] = fread($file, $my_file_size);
}
Then we build the list of chapters that appears to the right of the content.
$a['linklist'] = "<ul>
<li><a href='".$PHP_SELF."?chapter=TOC§ion=POMS-TOC'>Table of Contents</a>
<hr>
<li><a href='".$PHP_SELF."?chapter=1§ion=1-TOC'>Chapter I - TOC</a>
<li><a href='".$PHP_SELF."?chapter=1§ion=1-3'>Chapter I - Sec. 3</a>
<li><a href='".$PHP_SELF."?chapter=1§ion=1-6'>Chapter I - Sec. 6</a>
It goes on like that for a while... Then we close out the list and build our Pika page as usual.
<li><a href='".$PHP_SELF."?chapter=9§ion=9-6'>Chapter IX - Sec. 6</a>
<li><a href='".$PHP_SELF."?chapter=9§ion=9-7'>Chapter IX - Sec. 7</a>
<hr>
<li><a href='".$PHP_SELF."?chapter=fiscal§ion=Pikafiscal'>Fiscal Policies</a>
</ul>";
$plTemplate["content"] = pl_template($a, 'subtemplates/poms.html', 'yes');
$plTemplate["page_title"] = 'POMS';
$plTemplate['nav'] = "<a href=site_map.php class=light>$pikaNavRootLabel</a> > POMS > ".$section;
echo pl_template($plTemplate, 'templates/default.html');
echo pl_bench('results');
exit();
