2 require_once("../globals.php");
3 require_once("../../library/acl.inc");
7 /* Inserting New facility */
8 if (isset($_POST["mode"]) && $_POST["mode"] == "facility" && $_POST["newmode"] != "admin_facility") {
9 $insert_id=sqlInsert("INSERT INTO facility SET " .
10 "name = '" . trim(formData('facility' )) . "', " .
11 "phone = '" . trim(formData('phone' )) . "', " .
12 "fax = '" . trim(formData('fax' )) . "', " .
13 "street = '" . trim(formData('street' )) . "', " .
14 "city = '" . trim(formData('city' )) . "', " .
15 "state = '" . trim(formData('state' )) . "', " .
16 "postal_code = '" . trim(formData('postal_code' )) . "', " .
17 "country_code = '" . trim(formData('country_code')) . "', " .
18 "federal_ein = '" . trim(formData('federal_ein' )) . "', " .
19 "website = '" . trim(formData('website' )) . "', " .
20 "email = '" . trim(formData('email' )) . "', " .
21 "color = '" . trim(formData('ncolor' )) . "', " .
22 "service_location = '" . trim(formData('service_location' )) . "', " .
23 "billing_location = '" . trim(formData('billing_location' )) . "', " .
24 "accepts_assignment = '" . trim(formData('accepts_assignment' )) . "', " .
25 "pos_code = '" . trim(formData('pos_code' )) . "', " .
26 "domain_identifier = '" . trim(formData('domain_identifier' )) . "', " .
27 "attn = '" . trim(formData('attn' )) . "', " .
28 "tax_id_type = '" . trim(formData('tax_id_type' )) . "', " .
29 "primary_business_entity = '" . trim(formData('primary_business_entity' )) . "', ".
30 "facility_npi = '" . trim(formData('facility_npi')) . "',".
31 "facility_code = '" . trim(formData('facility_id')) . "'");
34 /* Editing existing facility */
35 if ($_POST["mode"] == "facility" && $_POST["newmode"] == "admin_facility")
37 sqlStatement("update facility set
38 name='" . trim(formData('facility')) . "',
39 phone='" . trim(formData('phone')) . "',
40 fax='" . trim(formData('fax')) . "',
41 street='" . trim(formData('street')) . "',
42 city='" . trim(formData('city')) . "',
43 state='" . trim(formData('state')) . "',
44 postal_code='" . trim(formData('postal_code')) . "',
45 country_code='" . trim(formData('country_code')) . "',
46 federal_ein='" . trim(formData('federal_ein')) . "',
47 website='" . trim(formData('website')) . "',
48 email='" . trim(formData('email')) . "',
49 color='" . trim(formData('ncolor')) . "',
50 service_location='" . trim(formData('service_location')) . "',
51 billing_location='" . trim(formData('billing_location')) . "',
52 accepts_assignment='" . trim(formData('accepts_assignment')) . "',
53 pos_code='" . trim(formData('pos_code')) . "',
54 domain_identifier='" . trim(formData('domain_identifier')) . "',
55 facility_npi='" . trim(formData('facility_npi')) . "',
56 attn='" . trim(formData('attn')) . "' ,
57 primary_business_entity='" . trim(formData('primary_business_entity')) . "' ,
58 tax_id_type='" . trim(formData('tax_id_type')) . "' ,
59 facility_code = '" . trim(formData('facility_id')) . "'
60 where id='" . trim(formData('fid')) . "'" );
66 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
67 <link rel
="stylesheet" type
="text/css" href
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
68 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js?v=<?php echo $v_js_includes; ?>"></script
>
69 <script type
="text/javascript" src
="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-1-3-2/index.js"></script
>
70 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script
>
71 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
72 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-ui.js"></script
>
74 <script type
="text/javascript">
77 $
(document
).ready(function(){
83 $
(".addfac_modal").fancybox( {
84 'overlayOpacity' : 0.0,
85 'showCloseButton' : true,
91 $
(".medium_modal").fancybox( {
92 'overlayOpacity' : 0.0,
93 'showCloseButton' : true,
101 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
104 <body
class="body_top">
109 <b
><?php
xl('Facilities','e'); ?
></b
> 
;</td
><td
>
110 <a href
="facilities_add.php" class="iframe addfac_modal css_button"><span
><?php
xl('Add','e');?
></span
></a
>
114 <div
class="tabContainer" style
="width:550px;">
116 <table cellpadding
="1" cellspacing
="0" class="showborder">
117 <tr
class="showborder_head" height
="22">
118 <th style
="border-style:1px solid #000" width
="140px"><?php
xl('Name','e'); ?
></th
>
119 <th style
="border-style:1px solid #000" width
="320px"><?php
xl('Address','e'); ?
></th
>
120 <th style
="border-style:1px solid #000"><?php
xl('Phone','e'); ?
></th
>
124 $fres = sqlStatement("select * from facility order by name");
127 for ($iter3 = 0;$frow = sqlFetchArray($fres);$iter3++
)
128 $result2[$iter3] = $frow;
129 foreach($result2 as $iter3) {
130 $varstreet="";//these are assigned conditionally below,blank assignment is done so that old values doesn't get propagated to next level.
133 $varstreet=$iter3{street
};
134 if ($iter3{street
}!="")$varstreet=$iter3{street
}.",";
135 if ($iter3{city
}!="")$varcity=$iter3{city
}.",";
136 if ($iter3{state
}!="")$varstate=$iter3{state
}.",";
139 <td valign
="top" class="text"><b
><a href
="facility_admin.php?fid=<?php echo $iter3{id};?>" class="iframe medium_modal"><span
><?php
echo htmlspecialchars($iter3{name
});?
></span
></a
></b
> 
;</td
>
140 <td valign
="top" class="text"><?php
echo htmlspecialchars($varstreet.$varcity.$varstate.$iter3{country_code
}." ".$iter3{postal_code
}); ?
> 
;</td
>
141 <td
><?php
echo htmlspecialchars($iter3{phone
});?
> 
;</td
>
146 if (count($result2)<=0)
149 <td colspan
="3" style
="text-align:center;font-weight:bold;"> <?php
echo xl( "Currently there are no facilities." ); ?
></td
>
157 <script language
="JavaScript">
159 if ($alertmsg = trim($alertmsg)) {
160 echo "alert('$alertmsg');\n";