2 include_once("../globals.php");
3 require_once("$srcdir/options.inc.php");
4 require_once("$srcdir/erx_javascript.inc.php");
6 if (isset($_GET["fid"])) {
7 $my_fid = $_GET["fid"];
10 if (isset($_POST["fid"])) {
11 $my_fid = $_POST["fid"];
13 if ($_POST["mode"] == "facility")
17 <script type="text/javascript">
19 parent.$.fn.fancybox.close();
29 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
30 <link rel
="stylesheet" type
="text/css" href
="../../library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
31 <script type
="text/javascript" src
="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
32 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative'] ?>/jquery-min-1-9-1/index.js"></script
>
33 <script type
="text/javascript" src
="../../library/js/common.js"></script
>
34 <script type
="text/javascript" src
="../../library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
35 <script type
="text/javascript" src
="../main/calendar/modules/PostCalendar/pnincludes/AnchorPosition.js"></script
>
36 <script type
="text/javascript" src
="../main/calendar/modules/PostCalendar/pnincludes/PopupWindow.js"></script
>
37 <script type
="text/javascript" src
="../main/calendar/modules/PostCalendar/pnincludes/ColorPicker2.js"></script
>
39 <!-- validation library
-->
40 <!--//Not lbf forms use the new validation, please make sure you have the corresponding values in the list Page validation-->
41 <?php
$use_validate_js = 1;?
>
42 <?php
require_once($GLOBALS['srcdir'] . "/validation/validation_script.js.php"); ?
>
44 //Gets validation rules from Page Validation list.
45 //Note that for technical reasons, we are bypassing the standard validateUsingPageRules() call.
46 $collectthis = collectValidationPageRules("/interface/usergroup/facility_admin.php");
47 if (empty($collectthis)) {
48 $collectthis = "undefined";
51 $collectthis = $collectthis["facility-form"]["rules"];
55 <script type
="text/javascript">
58 * validation on the form with new client side validation (using validate.js).
59 * this enable to add new rules for this form in the pageValidation list.
61 var collectvalidation
= <?php
echo($collectthis); ?
>;
63 function submitform() {
65 var valid
= submitme(1, undefined
, 'facility-form', collectvalidation
);
68 <?php
if($GLOBALS['erx_enable']){ ?
>
71 for(i
=0;i
<f
.length
;i++
){
72 if(f
[i
].type
=='text' && f
[i
].value
)
74 if(f
[i
].name
== 'facility' || f
[i
].name
== 'Washington')
76 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
77 alertMsg +
= checkFacilityName(f
[i
].name
,f
[i
].value
);
79 else if(f
[i
].name
== 'street')
81 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
82 alertMsg +
= checkAlphaNumeric(f
[i
].name
,f
[i
].value
);
84 else if(f
[i
].name
== 'phone' || f
[i
].name
== 'fax')
86 alertMsg +
= checkPhone(f
[i
].name
,f
[i
].value
);
88 else if(f
[i
].name
== 'federal_ein')
90 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,10);
91 alertMsg +
= checkFederalEin(f
[i
].name
,f
[i
].value
);
102 top
.restoreSession();
103 document
.forms
[0].submit();
106 $
(document
).ready(function(){
107 $
("#cancel").click(function() {
108 parent
.$
.fn
.fancybox
.close();
112 * add required/star sign to required form fields
114 for (var prop in collectvalidation
) {
115 //if (collectvalidation[prop].requiredSign)
116 if (collectvalidation
[prop
].presence
)
117 jQuery("input[name='" + prop +
"']").after('*');
120 var cp
= new ColorPicker('window');
121 // Runs when a color is clicked
122 function pickColor(color
) {
123 document
.getElementById('ncolor').value
= color
;
126 function pick(anchorname
,target
) {
127 var cp
= new ColorPicker('window');
131 function displayAlert()
133 if(document
.getElementById('primary_business_entity').checked
==false)
134 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.'));?>");
135 else if(document
.getElementById('primary_business_entity').checked
==true)
136 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.'));?>");
141 <body
class="body_top" style
="width:600px;height:330px !important;">
146 <span
class="title"><?php
xl('Edit Facility','e'); ?
></span
> 
; 
; 
;</td
><td
>
147 <a
class="css_button large_button" name
='form_save' id
='form_save' onclick
='submitform()' href
='#' >
148 <span
class='css_button_span large_button_span'><?php
xl('Save','e');?
></span
>
150 <a
class="css_button large_button" id
='cancel' href
='#'>
151 <span
class='css_button_span large_button_span'><?php
xl('Cancel','e');?
></span
>
157 <form name
='facility-form' id
="facility-form" method
='post' action
="facilities.php" target
="_parent">
158 <input type
=hidden name
=mode value
="facility">
159 <input type
=hidden name
=newmode value
="admin_facility"> <!-- Diffrentiate Admin
and add post backs
-->
160 <input type
=hidden name
=fid value
="<?php echo $my_fid;?>">
161 <?php
$facility = sqlQuery("select * from facility where id=?", array($my_fid)); ?
>
163 <table border
=0 cellpadding
=0 cellspacing
=1 style
="width:630px;">
165 <td width
='150px'><span
class='text'><?php
xl('Name','e'); ?
>: </span
></td
>
166 <td width
='220px'><input type
='entry' name
='facility' size
='20' value
='<?php echo htmlspecialchars($facility['name
'], ENT_QUOTES) ?>'></td
>
167 <td width
='200px'><span
class='text'><?php
xl('Phone','e'); ?
> <?php
xl('as','e'); ?
> (000) 000-0000:</span
></td
>
168 <td width
='220px'><input type
='entry' name
='phone' size
='20' value
='<?php echo htmlspecialchars($facility['phone
'], ENT_QUOTES) ?>'></td
>
171 <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
>
172 <td
><span
class='text'><?php
xl('Fax','e'); ?
> <?php
xl('as','e'); ?
> (000) 000-0000:</span
></td
>
173 <td
><input type
='entry' name
='fax' size
='20' value
='<?php echo htmlspecialchars($facility['fax
'], ENT_QUOTES) ?>'></td
>
177 <td
><span
class=text
><?php
xl('City','e'); ?
>: </span
></td
>
178 <td
><input type
=entry size
=20 name
=city value
="<?php echo htmlspecialchars($facility{"city
"}, ENT_QUOTES) ?>"></td
>
179 <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
>
184 if($facility['tax_id_type']=='SY'){
192 <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
>
193 <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
>
196 <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
>
197 <td width
="21"><span
class=text
><?
php ($GLOBALS['simplified_demographics'] ?
xl('Facility Code','e') : xl('Facility NPI','e')); ?
>:
198 </span
></td
><td
><input type
=entry size
=20 name
=facility_npi value
="<?php echo htmlspecialchars($facility{"facility_npi
"}, ENT_QUOTES) ?>"></td
>
201 <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
>
202 <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
>
206 <td
><span
class='text'><?php
xl('Billing Location','e'); ?
>: </span
></td
>
207 <td
><input type
='checkbox' name
='billing_location' value
='1' <?php
if ($facility['billing_location'] != 0) echo 'checked'; ?
>></td
>
208 <td rowspan
='2'><span
class='text'><?php
xl('Accepts Assignment','e'); ?
><br
>(<?php
xl('only if billing location','e'); ?
>): </span
></td
>
209 <td
><input type
='checkbox' name
='accepts_assignment' value
='1' <?php
if ($facility['accepts_assignment'] == 1) echo 'checked'; ?
>></td
>
212 <td
><span
class='text'><?php
xl('Service Location','e'); ?
>: </span
></td
>
213 <td
><input type
='checkbox' name
='service_location' value
='1' <?php
if ($facility['service_location'] == 1) echo 'checked'; ?
>></td
>
218 $resPBE=sqlStatement("select * from facility where primary_business_entity='1' and id!=?", array($my_fid));
219 if(sqlNumRows($resPBE)>0)
220 $disabled='disabled';
223 <td
><span
class='text'><?php
xl('Primary Business Entity','e'); ?
>: </span
></td
>
224 <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
>
228 <td
><span
class='text'><?php
echo htmlspecialchars(xl('Color'),ENT_QUOTES
); ?
>: </span
></td
> <td
><input type
=entry name
=ncolor id
=ncolor size
=20 value
="<?php echo htmlspecialchars($facility{"color
"}, ENT_QUOTES) ?>"></td
>
229 <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
>
232 <td
><span
class=text
><?php
xl('POS Code','e'); ?
>: </span
></td
>
234 <select name
="pos_code">
238 foreach ($pc->get_pos_ref() as $pos) {
239 echo "<option value=\"" . $pos["code"] . "\" ";
240 if ($facility['pos_code'] == $pos['code']) {
243 echo ">" . $pos['code'] . ": ". text($pos['title']);
252 <td
><span
class="text"><?php
xl('Billing Attn','e'); ?
>:</span
></td
>
253 <td colspan
="4"><input type
="text" name
="attn" size
="45" value
="<?php echo htmlspecialchars($facility['attn'], ENT_QUOTES) ?>"></td
>
256 <td
><span
class="text"><?php
xl('CLIA Number','e'); ?
>:</span
></td
>
257 <td colspan
="4"><input type
="text" name
="domain_identifier" size
="45" value
="<?php echo htmlspecialchars($facility['domain_identifier'], ENT_QUOTES) ?>"></td
>
260 <td
><span
class="text"><?php
xl('Facility ID','e'); ?
>:</span
></td
>
261 <td colspan
="4"><input type
="text" name
="facility_id" size
="45" value
="<?php echo htmlspecialchars($facility['facility_code'], ENT_QUOTES) ?>"></td
>
263 <tr height
="20" valign
="bottom">
264 <td colspan
=2><span
class="text"><font
class="mandatory">*</font
> <?php
echo xl('Required','e');?
></span
></td
>