fix redundant escaping of quotes
[openemr.git] / custom / refercare.php
blobec6f12978124f55ecf0dce623f82c974343bea02
1 <?
2 // Copyright (C) 2005 Rod Roark <rod@sunsetsystems.com>
3 //
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 /////////////////////////////////////////////////////////////////////
10 // This program invokes ReferCare to create a new referral.
11 /////////////////////////////////////////////////////////////////////
13 include_once("../interface/globals.php");
15 $query = "SELECT * FROM patient_data WHERE pid = '$pid' LIMIT 1";
16 $row = sqlFetchArray(sqlStatement($query));
18 $phone = "";
19 if ($row['phone_home']) {
20 $phone .= "Home: " . $row['phone_home'];
22 if ($row['phone_biz']) {
23 if ($phone) $phone .= "; ";
24 $phone .= "Work: " . $row['phone_biz'];
26 if ($row['phone_cell']) {
27 if ($phone) $phone .= "; ";
28 $phone .= "Cell: " . $row['phone_cell'];
30 if ($row['phone_contact']) {
31 if ($phone) $phone .= "; ";
32 $phone .= "Contact: " . $row['phone_contact'];
35 $rcurl = "https://www.refercare.org/edit_referral.php?chart=$pid";
36 $rcurl .= "&lastname=" . htmlentities(trim($row['lname']), ENT_QUOTES);
37 $rcurl .= "&firstname=" . htmlentities(trim($row['fname']), ENT_QUOTES);
38 $rcurl .= "&ssn=" . htmlentities(trim($row['ss']) , ENT_QUOTES);
39 $rcurl .= "&dob=" . htmlentities(trim($row['DOB']) , ENT_QUOTES);
40 $rcurl .= "&contactinfo=" . htmlentities(trim($phone) , ENT_QUOTES);
42 <html>
43 <head>
44 <link rel=stylesheet href="<?echo $css_header;?>" type="text/css">
45 <title>Create a Referral</title>
46 </head>
47 <body>
48 <script language="JavaScript">
49 window.location.href='<?php echo $rcurl ?>';
50 </script>
51 </body>
52 </html>