Highway to PSR2
[openemr.git] / contrib / forms / example2 / print.php
blobaa2b5674bf05b4352fab331903c41edf8eee3692
1 <?php
2 /*
3 * Sports Physical Form created by Jason Morrill: January 2009
4 */
6 include_once("../../globals.php");
7 include_once("$srcdir/api.inc");
9 /** CHANGE THIS - name of the database table associated with this form **/
10 $table_name = "form_example";
12 /** CHANGE THIS name to the name of your form **/
13 $form_name = "My Example Form";
15 /** CHANGE THIS to match the folder you created for this form **/
16 $form_folder = "example";
18 formHeader("Form: ".$form_name);
19 $returnurl = 'encounter_top.php';
21 /* load the saved record */
22 $record = formFetch($table_name, $_GET["id"]);
24 /* remove the time-of-day from the date fields */
25 if ($record['form_date'] != "") {
26 $dateparts = explode(" ", $record['form_date']);
27 $record['form_date'] = $dateparts[0];
30 if ($record['dob'] != "") {
31 $dateparts = explode(" ", $record['dob']);
32 $record['dob'] = $dateparts[0];
35 if ($record['sig_date'] != "") {
36 $dateparts = explode(" ", $record['sig_date']);
37 $record['sig_date'] = $dateparts[0];
41 <html><head>
42 <?php html_header_show();?>
44 <!-- supporting javascript code -->
45 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
46 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/textformat.js"></script>
48 <!-- page styles -->
49 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
50 <link rel="stylesheet" href="../../forms/<?php echo $form_folder; ?>/style.css" type="text/css">
52 </head>
54 <body class="body_top">
56 Printed on <?php echo date("F d, Y", time()); ?>
58 <form method=post action="">
59 <span class="title"><?php xl($form_name, 'e'); ?></span><br>
61 <!-- container for the main body of the form -->
62 <div id="print_form_container">
64 <div id="print_general">
65 <table>
66 <tr><td>
67 Date:
68 <input type='text' size='10' name='form_date' id='form_date'
69 value='<?php echo stripslashes($record['form_date']);?>'
70 title='<?php xl('yyyy-mm-dd', 'e'); ?>'
72 </td></tr>
73 <tr><td>
74 Name: <input id="name" name="name" type="text" size="50" maxlength="250" value="<?php echo stripslashes($record['name']);?>">
75 Date of Birth:
76 <input type='text' size='10' name='dob' id='dob'
77 value='<?php echo stripslashes($record['dob']);?>'
78 title='<?php xl('yyyy-mm-dd Date of Birth', 'e'); ?>'
80 </td></tr>
81 <tr><td>
82 Phone: <input name="phone" id="phone" type="text" size="15" maxlength="15" value="<?php echo stripslashes($record['phone']);?>">
83 </td></tr>
84 <tr><td>
85 Address: <input name="address" id="address" type="text" size="80" maxlength="250" value="<?php echo stripslashes($record['address']);?>">
86 </td></tr>
87 </table>
88 </div>
90 <div id="print_bottom">
91 Use this space to express notes <br>
92 <textarea name="notes" id="notes" cols="80" rows="4"><?php echo stripslashes($record['notes']);?></textarea>
93 <br><br>
94 <div style="text-align:right;">
95 Signature?
96 <input type="radio" id="sig" name="sig" value="y" <?php if ($record["sig"] == 'y') {
97 echo "CHECKED";
98 } ?>>Yes
100 <input type="radio" id="sig" name="sig" value="n" <?php if ($record["sig"] == 'n') {
101 echo "CHECKED";
102 } ?>>No
103 &nbsp;&nbsp;
104 Date of signature:
105 <input type='text' size='10' name='sig_date' id='sig_date'
106 value='<?php echo stripslashes($record['sig_date']);?>'
107 title='<?php xl('yyyy-mm-dd', 'e'); ?>' />
108 </div>
109 </div>
111 </div> <!-- end form_container -->
113 </form>
115 </body>
117 <script language="javascript">
118 window.print();
119 window.close();
120 </script>
122 </html>