2 include_once("../globals.php");
3 include_once("$srcdir/md5.js");
4 include_once("$srcdir/sql.inc");
5 require_once("$srcdir/classes/POSRef.class.php");
6 require_once("$srcdir/options.inc.php");
7 require_once("$srcdir/erx_javascript.inc.php");
9 if (isset($_GET["fid"])) {
10 $my_fid = $_GET["fid"];
13 if (isset($_POST["fid"])) {
14 $my_fid = $_POST["fid"];
16 if ($_POST["mode"] == "facility")
20 <script type="text/javascript">
22 parent.$.fn.fancybox.close();
32 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
33 <link rel
="stylesheet" type
="text/css" href
="../../library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
34 <script type
="text/javascript" src
="../../library/dialog.js"></script
>
35 <script type
="text/javascript" src
="../../library/js/jquery.1.3.2.js"></script
>
36 <script type
="text/javascript" src
="../../library/js/common.js"></script
>
37 <script type
="text/javascript" src
="../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
38 <script type
="text/javascript" src
="../main/calendar/modules/PostCalendar/pnincludes/AnchorPosition.js"></script
>
39 <script type
="text/javascript" src
="../main/calendar/modules/PostCalendar/pnincludes/PopupWindow.js"></script
>
40 <script type
="text/javascript" src
="../main/calendar/modules/PostCalendar/pnincludes/ColorPicker2.js"></script
>
41 <script type
="text/javascript">
42 function submitform() {
43 <?php
if($GLOBALS['erx_enable']){ ?
>
46 for(i
=0;i
<f
.length
;i++
){
47 if(f
[i
].type
=='text' && f
[i
].value
)
49 if(f
[i
].name
== 'facility' || f
[i
].name
== 'Washington')
51 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
52 alertMsg +
= checkFacilityName(f
[i
].name
,f
[i
].value
);
54 else if(f
[i
].name
== 'street')
56 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
57 alertMsg +
= checkAlphaNumeric(f
[i
].name
,f
[i
].value
);
59 else if(f
[i
].name
== 'phone' || f
[i
].name
== 'fax')
61 alertMsg +
= checkPhone(f
[i
].name
,f
[i
].value
);
63 else if(f
[i
].name
== 'federal_ein')
65 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,10);
66 alertMsg +
= checkFederalEin(f
[i
].name
,f
[i
].value
);
76 if (document
.forms
[0].facility
.value
.length
>0 && document
.forms
[0].ncolor
.value
!= '') {
78 document
.forms
[0].submit();
80 if(document
.forms
[0].facility
.value
.length
<=0){
81 document
.forms
[0].facility
.style
.backgroundColor
="red";
82 document
.forms
[0].facility
.focus();
84 else if(document
.forms
[0].ncolor
.value
== ''){
85 document
.forms
[0].ncolor
.style
.backgroundColor
="red";
86 document
.forms
[0].ncolor
.focus();
91 $
(document
).ready(function(){
92 $
("#cancel").click(function() {
93 parent
.$
.fn
.fancybox
.close();
96 var cp
= new ColorPicker('window');
97 // Runs when a color is clicked
98 function pickColor(color
) {
99 document
.getElementById('ncolor').value
= color
;
102 function pick(anchorname
,target
) {
103 var cp
= new ColorPicker('window');
107 function displayAlert()
109 if(document
.getElementById('primary_business_entity').checked
==false)
110 alert("<?php echo addslashes(xl('Primary Business Entity tax id is used as account id for NewCrop ePrescription. Changing the facility will affect the working in NewCrop.'));?>");
111 else if(document
.getElementById('primary_business_entity').checked
==true)
112 alert("<?php echo addslashes(xl('Once the Primary Business Facility is set, it should not be changed. Changing the facility will affect the working in NewCrop ePrescription.'));?>");
117 <body
class="body_top" style
="width:600px;height:330px !important;">
122 <span
class="title"><?php
xl('Edit Facility','e'); ?
></span
> 
; 
; 
;</td
><td
>
123 <a
class="css_button large_button" name
='form_save' id
='form_save' onclick
='submitform()' href
='#' >
124 <span
class='css_button_span large_button_span'><?php
xl('Save','e');?
></span
>
126 <a
class="css_button large_button" id
='cancel' href
='#'>
127 <span
class='css_button_span large_button_span'><?php
xl('Cancel','e');?
></span
>
133 <form name
='facility' method
='post' action
="facilities.php" target
="_parent">
134 <input type
=hidden name
=mode value
="facility">
135 <input type
=hidden name
=newmode value
="admin_facility"> <!-- Diffrentiate Admin
and add post backs
-->
136 <input type
=hidden name
=fid value
="<?php echo $my_fid;?>">
137 <?php
$facility = sqlQuery("select * from facility where id='$my_fid'"); ?
>
139 <table border
=0 cellpadding
=0 cellspacing
=1 style
="width:630px;">
141 <td width
='150px'><span
class='text'><?php
xl('Name','e'); ?
>: </span
></td
>
142 <td width
='220px'><input type
='entry' name
='facility' size
='20' value
='<?php echo htmlspecialchars($facility['name
'], ENT_QUOTES) ?>'><font
class="mandatory"> 
;*</font
></td
>
143 <td width
='200px'><span
class='text'><?php
xl('Phone','e'); ?
> <?php
xl('as','e'); ?
> (000) 000-0000:</span
></td
>
144 <td width
='220px'><input type
='entry' name
='phone' size
='20' value
='<?php echo htmlspecialchars($facility['phone
'], ENT_QUOTES) ?>'></td
>
147 <td
><span
class=text
><?php
xl('Address','e'); ?
>: </span
></td
><td
><input type
=entry size
=20 name
=street value
="<?php echo htmlspecialchars($facility["street
"], ENT_QUOTES) ?>"></td
>
148 <td
><span
class='text'><?php
xl('Fax','e'); ?
> <?php
xl('as','e'); ?
> (000) 000-0000:</span
></td
>
149 <td
><input type
='entry' name
='fax' size
='20' value
='<?php echo htmlspecialchars($facility['fax
'], ENT_QUOTES) ?>'></td
>
153 <td
><span
class=text
><?php
xl('City','e'); ?
>: </span
></td
>
154 <td
><input type
=entry size
=20 name
=city value
="<?php echo htmlspecialchars($facility{"city
"}, ENT_QUOTES) ?>"></td
>
155 <td
><span
class=text
><?php
xl('Zip Code','e'); ?
>: </span
></td
><td
><input type
=entry size
=20 name
=postal_code value
="<?php echo htmlspecialchars($facility{"postal_code
"}, ENT_QUOTES) ?>"></td
>
160 if($facility['tax_id_type']=='SY'){
168 <td
><span
class=text
><?php
xl('State','e'); ?
>: </span
></td
><td
><input type
=entry size
=20 name
=state value
="<?php echo htmlspecialchars($facility{"state
"}, ENT_QUOTES) ?>"></td
>
169 <td
><span
class=text
><?php
xl('Tax ID','e'); ?
>: </span
></td
><td
><select name
=tax_id_type
><option value
="EI" <?php
echo $ein;?
>><?php
xl('EIN','e'); ?
></option
><option value
="SY" <?php
echo $ssn;?
>><?php
xl('SSN','e'); ?
></option
></select
><input type
=entry size
=11 name
=federal_ein value
="<?php echo htmlspecialchars($facility{"federal_ein
"}, ENT_QUOTES) ?>"></td
>
172 <td
><span
class=text
><?php
xl('Country','e'); ?
>: </span
></td
><td
><input type
=entry size
=20 name
=country_code value
="<?php echo htmlspecialchars($facility{"country_code
"}, ENT_QUOTES) ?>"></td
>
173 <td width
="21"><span
class=text
><?
php ($GLOBALS['simplified_demographics'] ?
xl('Facility Code','e') : xl('Facility NPI','e')); ?
>:
174 </span
></td
><td
><input type
=entry size
=20 name
=facility_npi value
="<?php echo htmlspecialchars($facility{"facility_npi
"}, ENT_QUOTES) ?>"></td
>
177 <td
><span
class=text
><?php
xl('Website','e'); ?
>: </span
></td
><td
><input type
=entry size
=20 name
=website value
="<?php echo htmlspecialchars($facility{"website
"}, ENT_QUOTES) ?>"></td
>
178 <td
><span
class=text
><?php
xl('Email','e'); ?
>: </span
></td
><td
><input type
=entry size
=20 name
=email value
="<?php echo htmlspecialchars($facility{"email
"}, ENT_QUOTES) ?>"></td
>
182 <td
><span
class='text'><?php
xl('Billing Location','e'); ?
>: </span
></td
>
183 <td
><input type
='checkbox' name
='billing_location' value
='1' <?php
if ($facility['billing_location'] != 0) echo 'checked'; ?
>></td
>
184 <td rowspan
='2'><span
class='text'><?php
xl('Accepts Assignment','e'); ?
><br
>(<?php
xl('only if billing location','e'); ?
>): </span
></td
>
185 <td
><input type
='checkbox' name
='accepts_assignment' value
='1' <?php
if ($facility['accepts_assignment'] == 1) echo 'checked'; ?
>></td
>
188 <td
><span
class='text'><?php
xl('Service Location','e'); ?
>: </span
></td
>
189 <td
><input type
='checkbox' name
='service_location' value
='1' <?php
if ($facility['service_location'] == 1) echo 'checked'; ?
>></td
>
194 $resPBE=sqlStatement("select * from facility where primary_business_entity='1' and id!='".$my_fid."'");
195 if(sqlNumRows($resPBE)>0)
196 $disabled='disabled';
199 <td
><span
class='text'><?php
xl('Primary Business Entity','e'); ?
>: </span
></td
>
200 <td
><input type
='checkbox' name
='primary_business_entity' id
='primary_business_entity' value
='1' <?php
if ($facility['primary_business_entity'] == 1) echo 'checked'; ?
> <?php
if($GLOBALS['erx_enable']){ ?
> onchange
='return displayAlert()' <?php
} ?
> <?php
echo $disabled;?
>></td
>
204 <td
><span
class='text'><?php
echo htmlspecialchars(xl('Color'),ENT_QUOTES
); ?
>: </span
><span
class="mandatory"> 
;*</span
></td
> <td
><input type
=entry name
=ncolor id
=ncolor size
=20 value
="<?php echo htmlspecialchars($facility{"color
"}, ENT_QUOTES) ?>"></td
>
205 <td
>[<a href
="javascript:void(0);" onClick
="pick('pick','newcolor');return false;" NAME
="pick" ID
="pick"><?php
echo htmlspecialchars(xl('Pick'),ENT_QUOTES
); ?
></a
>]</td
><td
> 
;</td
>
208 <td
><span
class=text
><?php
xl('POS Code','e'); ?
>: </span
></td
>
210 <select name
="pos_code">
214 foreach ($pc->get_pos_ref() as $pos) {
215 echo "<option value=\"" . $pos["code"] . "\" ";
216 if ($facility['pos_code'] == $pos['code']) {
219 echo ">" . $pos['code'] . ": ". $pos['title'];
228 <td
><span
class="text"><?php
xl('Billing Attn','e'); ?
>:</span
></td
>
229 <td colspan
="4"><input type
="text" name
="attn" size
="45" value
="<?php echo htmlspecialchars($facility['attn'], ENT_QUOTES) ?>"></td
>
232 <td
><span
class="text"><?php
xl('CLIA Number','e'); ?
>:</span
></td
>
233 <td colspan
="4"><input type
="text" name
="domain_identifier" size
="45" value
="<?php echo htmlspecialchars($facility['domain_identifier'], ENT_QUOTES) ?>"></td
>
235 <tr height
="20" valign
="bottom">
236 <td colspan
=2><span
class="text"><font
class="mandatory">*</font
> <?php
echo xl('Required','e');?
></span
></td
>