blatta wrote on Sunday, October 05, 2014:
I’ve been trying to develop a graphical display form for audiometric data. I’ve already managed to generate a form_audiogram table and the associated report, view, save, new, etc. php files with xmlformgen. Furthermore, I’ve managed to edit the forms to give me a generally acceptable report formatted in a tabular array. Ideally, however, my goal is to arrange things such that a graphical grid (attached as pure_tone_grid.png) is displayed in the background and then the necessary symbols (representative examples attached as X.png and O.png, although there are others as well) are printed on top of the underlying grid layer, thus displaying a completed audiogram (attached as audio.pdf).
The above example (audio.pdf) was generated by way of example from the following html code being placed in the localhost/test folder and being opened in Firefox. It displayed correctly in the browser and was printed correctly to the attached pdf file. I am confident that I can ultimately write the code to use php to retrieve my stored audio data and generate a visually acceptable audiogram if only I can solve a few problems. What is most attractive to me is that both the underlay grid and the overlying symbols are effectively printed on different transparent layers in the same screen space. They are both visible secondary to the transparency property of the png files.
Code:
<html>
<div style="position: absolute; top:0px; left:0px"><img src="pure_tone_grid.png"/></div>
<div style="position: absolute; top:60px; left:50px"><img src="O.png"/></div>
<div style="position: absolute; top:60px; left:78px"><img src="O.png"/></div>
<div style="position: absolute; top:60px; left:276px"><img src="X.png"/></div>
<div style="position: absolute; top:60px; left:304px"><img src="X.png"/></div>
</html>
Unfortunately, if I attempt to edit and incorporate the above code into the end of the audiogram report.php file such as this …
Code:
function audiogram_report($pid, $encounter, $cols, $id) {
…
$data = formFetch($table_name, $id);
if ($data) {
<html>
<div style="position: absolute; top:0px; left:0px"><img src=“../../forms/audiogram/images/pure_tone_grid.png"/></div>
<div style="position: absolute; top:60px; left:50px"><img src="../../forms/audiogram/images/O.png"/></div>
<div style="position: absolute; top:60px; left:78px"><img src="../../forms/audiogram/images /O.png"/></div>
<div style="position: absolute; top:60px; left:276px"><img src="../../forms/audiogram/images/X.png"/></div>
<div style="position: absolute; top:60px; left:304px"><img src="../../forms/audiogram/images/X.png"/></div>
</html>
}
…
}
… then the graphics print appropriately but in the wrong place (at the top of the window), as shown in Screen Shot 1.jpg.
Modifying the pure_tone_grid.png position attribute to “relative” and leaving the symbols as absolute behaves as expected, dropping the grid graphic into the correct place on the page but leaving the symbols in their original position (Screen Shot 2.jpg).
Finally, changing all the grid and symbol position properties to “relative”, as indicated below, keeps the grid in the desired position on the page but somehow the symbols are dropped even lower, now encroaching on the Patient Encounter section. Furthermore, it appears that their transparent behavior has somehow been affected and they are now printing sequentially lower on the page (Screen Shot 3.jpg).
Code:
function audiogram_report($table_name, $id);
…
if ($data) {
<html>
<div style="position: relative; top:0px; left:0px"><img src=“../../forms/audiogram/images/pure_tone_grid.png"/></div>
<div style="position: relative; top:60px; left:50px"><img src="../../forms/audiogram/images/O.png"/></div>
<div style="position: relative; top:60px; left:78px"><img src="../../forms/audiogram/images/O.png"/></div>
<div style="position: relative; top:60px; left:276px"><img src="../../forms/audiogram/images/X.png"/></div>
<div style="position: relative; top:60px; left:304px"><img src="../../forms/audiogram/images/X.png"/></div>
</html>
}
What’s going on here? And more importantly, is there anything I can do about it? Thanks for your help.