Added the Persian language
[openemr.git] / interface / reports / patient_edu_web_lookup.php
bloba66938fffc21a02cbd653f796fb97cef66b05dae
1 <?php
2 // Copyright (C) 2011 Tony McCormick <tony@mi-squared.com>
3 // Brady Miller <brady@sparmy.com>
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // Open websearch for patient education materials
12 //SANITIZE ALL ESCAPES
13 $sanitize_all_escapes=true;
16 //STOP FAKE REGISTER GLOBALS
17 $fake_register_globals=false;
20 //Include required scripts/libraries
21 require_once("../globals.php");
24 // Reference website links
25 $websites = array(
26 'Medline' => 'http://vsearch.nlm.nih.gov/vivisimo/cgi-bin/query-meta?v%3Aproject=medlineplus&query=[%]&x=12&y=15',
27 'eMedicine' => 'http://search.medscape.com/reference-search?newSearchHeader=1&queryText=[%]',
28 'WebMD' => 'http://www.webmd.com/search/search_results/default.aspx?query=[%]&sourceType=undefined'
31 // Collect variables
32 $form_lookup_at = (isset($_POST['form_lookup_at'])) ? $_POST['form_lookup_at'] : '';
33 $form_diagnosis = (isset($_POST['form_diagnosis'])) ? $_POST['form_diagnosis'] : '';
36 <html>
37 <head>
38 <?php html_header_show();?>
39 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
40 <script type="text/javascript" src="../../library/js/jquery.1.3.2.js"></script>
42 <script type="text/javascript">
43 function searchResultsPopup(search_term,link) {
44 link_formatted = link.replace("[%]",encodeURIComponent(search_term));
45 top.restoreSession();
46 window.open(link_formatted);
48 </script>
50 <title><?php echo htmlspecialchars( xl('Find Patient Education Materials'), ENT_NOQUOTES); ?></title>
51 </head>
53 <body class="body_top">
55 <span class='title'><?php echo htmlspecialchars( xl('Web Search'), ENT_NOQUOTES); ?> - <?php echo htmlspecialchars( xl('Patient Education Materials'), ENT_NOQUOTES); ?></span>
57 <form method='post' action='patient_edu_web_lookup.php' id='theform' onsubmit='return top.restoreSession()'>
59 <div id="report_parameters">
61 <table>
62 <tr>
63 <td>
64 <div style='float:left'>
65 <table class='text'>
66 <tr>
67 <td>
68 <?php echo htmlspecialchars( xl('Search in'), ENT_NOQUOTES);
69 echo '&nbsp;&nbsp;';
70 echo "<select name='form_lookup_at'>\n";
71 foreach ($websites as $key => $value) {
72 echo " <option value='" . htmlspecialchars($key, ENT_QUOTES) . "'";
73 if ($key == $form_lookup_at) echo ' selected';
74 echo ">" . htmlspecialchars( xl($key), ENT_NOQUOTES) . "</option>\n";
76 echo "</select>"; ?>
77 </td>
78 </tr>
79 <tr>
80 <td>
81 <input type='text' name='form_diagnosis' size='60' value='<?php echo htmlspecialchars($form_diagnosis, ENT_QUOTES); ?>'
82 title='<?php echo htmlspecialchars( xl('Search Text'), ENT_QUOTES); ?>'>
83 </td>
84 </tr>
85 </table>
87 </div>
89 </td>
90 <td align='left' valign='middle' height="100%">
91 <table style='border-left:1px solid; width:100%; height:100%' >
92 <tr>
93 <td>
94 <div style='margin-left:15px'>
95 <a href='#' class='css_button' onclick='$("#theform").submit();'>
96 <span>
97 <?php echo htmlspecialchars( xl('Submit'), ENT_NOQUOTES); ?>
98 </span>
99 </a>
101 </div>
102 </td>
103 </tr>
104 </table>
105 </td>
106 </tr>
107 </table>
109 </div> <!-- end of parameters -->
111 <div class='text'>
112 <?php
113 echo htmlspecialchars( xl('Please input search criteria above, and click Submit to view results. (Results will be displayed in a pop up window)'), ENT_NOQUOTES);
115 </div>
116 <div class='text'>
117 <?php if (!empty($form_diagnosis) && !empty($form_lookup_at)) { ?>
118 <script type="text/javascript">
119 searchResultsPopup('<?php echo addslashes($form_diagnosis); ?>','<?php echo addslashes($websites[$form_lookup_at]) ?>');
120 </script>
121 <?php } ?>
122 </div>
123 </form>
124 </body>
125 </html>