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')) . "'");
35 /* Editing existing facility */
36 if ($_POST["mode"] == "facility" && $_POST["newmode"] == "admin_facility")
38 sqlStatement("update facility set
39 name='" . trim(formData('facility')) . "',
40 phone='" . trim(formData('phone')) . "',
41 fax='" . trim(formData('fax')) . "',
42 street='" . trim(formData('street')) . "',
43 city='" . trim(formData('city')) . "',
44 state='" . trim(formData('state')) . "',
45 postal_code='" . trim(formData('postal_code')) . "',
46 country_code='" . trim(formData('country_code')) . "',
47 federal_ein='" . trim(formData('federal_ein')) . "',
48 website='" . trim(formData('website')) . "',
49 email='" . trim(formData('email')) . "',
50 color='" . trim(formData('ncolor')) . "',
51 service_location='" . trim(formData('service_location')) . "',
52 billing_location='" . trim(formData('billing_location')) . "',
53 accepts_assignment='" . trim(formData('accepts_assignment')) . "',
54 pos_code='" . trim(formData('pos_code')) . "',
55 domain_identifier='" . trim(formData('domain_identifier')) . "',
56 facility_npi='" . trim(formData('facility_npi')) . "',
57 attn='" . trim(formData('attn')) . "' ,
58 primary_business_entity='" . trim(formData('primary_business_entity')) . "' ,
59 tax_id_type='" . trim(formData('tax_id_type')) . "'
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"></script
>
69 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.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";