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