2 require_once("../globals.php");
3 require_once("../../library/acl.inc");
4 require_once("$srcdir/sha1.js");
5 require_once("$srcdir/sql.inc");
6 require_once("$srcdir/formdata.inc.php");
7 require_once("$srcdir/options.inc.php");
8 require_once(dirname(__FILE__
) . "/../../library/classes/WSProvider.class.php");
9 require_once("$srcdir/erx_javascript.inc.php");
17 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
18 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
19 <link rel
="stylesheet" type
="text/css" href
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.css" media
="screen" />
20 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script
>
21 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery.1.3.2.js"></script
>
22 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/common.js"></script
>
23 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/fancybox/jquery.fancybox-1.2.6.js"></script
>
24 <script src
="checkpwd_validation.js" type
="text/javascript"></script
>
26 <script language
="JavaScript">
27 function trimAll(sString
)
29 while (sString
.substring(0,1) == ' ')
31 sString
= sString
.substring(1, sString
.length
);
33 while (sString
.substring(sString
.length
-1, sString
.length
) == ' ')
35 sString
= sString
.substring(0,sString
.length
-1);
40 function submitform() {
41 if (document
.forms
[0].rumple
.value
.length
>0 && document
.forms
[0].stiltskin
.value
.length
>0 && document
.getElementById('fname').value
.length
>0 && document
.getElementById('lname').value
.length
>0) {
44 //Checking if secure password is enabled or disabled.
45 //If it is enabled and entered password is a weak password, alert the user to enter strong password.
46 if(document
.new_user
.secure_pwd
.value
== 1){
47 var password
= trim(document
.new_user
.stiltskin
.value
);
49 var pwdresult
= passwordvalidate(password
);
51 alert("<?php echo xl('The password must be at least eight characters, and should'); echo '\n'; echo xl('contain at least three of the four following items:'); echo '\n'; echo xl('A number'); echo '\n'; echo xl('A lowercase letter'); echo '\n'; echo xl('An uppercase letter'); echo '\n'; echo xl('A special character');echo '('; echo xl('not a letter or number'); echo ').'; echo '\n'; echo xl('For example:'); echo ' healthCare@09'; ?>");
55 } //secure_pwd if ends here
56 // ViCareplus : As per NIST standard, SHA1 encryption algorithm is used
57 document
.forms
[0].newauthPass
.value
=SHA1(document
.forms
[0].stiltskin
.value
);
58 document
.forms
[0].stiltskin
.value
='';
59 <?php
if($GLOBALS['erx_enable']){ ?
>
62 for(i
=0;i
<f
.length
;i++
){
63 if(f
[i
].type
=='text' && f
[i
].value
)
65 if(f
[i
].name
== 'rumple')
67 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
68 alertMsg +
= checkUsername(f
[i
].name
,f
[i
].value
);
70 else if(f
[i
].name
== 'fname' || f
[i
].name
== 'mname' || f
[i
].name
== 'lname')
72 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
73 alertMsg +
= checkUsername(f
[i
].name
,f
[i
].value
);
75 else if(f
[i
].name
== 'federaltaxid')
77 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,10);
78 alertMsg +
= checkFederalEin(f
[i
].name
,f
[i
].value
);
80 else if(f
[i
].name
== 'state_license_number')
82 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,10);
83 alertMsg +
= checkStateLicenseNumber(f
[i
].name
,f
[i
].value
);
85 else if(f
[i
].name
== 'npi')
87 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,35);
88 alertMsg +
= checkTaxNpiDea(f
[i
].name
,f
[i
].value
);
90 else if(f
[i
].name
== 'federaldrugid')
92 alertMsg +
= checkLength(f
[i
].name
,f
[i
].value
,30);
93 alertMsg +
= checkAlphaNumeric(f
[i
].name
,f
[i
].value
);
103 document
.forms
[0].submit();
105 if (document
.forms
[0].rumple
.value
.length
<=0)
107 document
.forms
[0].rumple
.style
.backgroundColor
="red";
108 alert("<?php xl('Required field missing: Please enter the User Name','e');?>");
109 document
.forms
[0].rumple
.focus();
112 if (document
.forms
[0].stiltskin
.value
.length
<=0)
114 document
.forms
[0].stiltskin
.style
.backgroundColor
="red";
115 alert("<?php echo xl('Please enter the password'); ?>");
116 document
.forms
[0].stiltskin
.focus();
119 if(trimAll(document
.getElementById('fname').value
) == ""){
120 document
.getElementById('fname').style
.backgroundColor
="red";
121 alert("<?php xl('Required field missing: Please enter the First name','e');?>");
122 document
.getElementById('fname').focus();
125 if(trimAll(document
.getElementById('lname').value
) == ""){
126 document
.getElementById('lname').style
.backgroundColor
="red";
127 alert("<?php xl('Required field missing: Please enter the Last name','e');?>");
128 document
.getElementById('lname').focus();
133 function authorized_clicked() {
134 var f
= document
.forms
[0];
135 f
.calendar
.disabled
= !f
.authorized
.checked
;
136 f
.calendar
.checked
= f
.authorized
.checked
;
142 <body
class="body_top">
144 <span
class="title"><?php
xl('Add User','e'); ?
></span
> 
;</td
>
146 <a
class="css_button" name
='form_save' id
='form_save' href
='#' onclick
="return submitform()">
147 <span
><?php
xl('Save','e');?
></span
></a
>
148 <a
class="css_button large_button" id
='cancel' href
='#'>
149 <span
class='css_button_span large_button_span'><?php
xl('Cancel','e');?
></span
>
157 <form name
='new_user' method
='post' target
="_parent" action
="usergroup_admin.php"
158 onsubmit
='return top.restoreSession()'>
159 <input type
=hidden name
=mode value
=new_user
>
160 <input type
=hidden name
=secure_pwd value
="<?php echo $GLOBALS['secure_password']; ?>">
161 <span
class="bold"> 
;</span
>
163 <table border
=0 cellpadding
=0 cellspacing
=0 style
="width:600px;">
165 <td style
="width:150px;"><span
class="text"><?php
xl('Username','e'); ?
>: </span
></td
><td style
="width:220px;"><input type
=entry name
=rumple style
="width:120px;"> <span
class="mandatory"> 
;*</span
></td
>
166 <td style
="width:150px;"><span
class="text"><?php
xl('Password','e'); ?
>: </span
></td
><td style
="width:250px;"><input type
="entry" style
="width:120px;" name
=stiltskin
><span
class="mandatory"> 
;*</span
></td
>
169 <td
><span
class="text"<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>><?php
xl('Groupname','e'); ?
>: </span
></td
>
171 <select name
=groupname
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
173 $res = sqlStatement("select distinct name from groups");
175 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
176 $result2[$iter] = $row;
177 foreach ($result2 as $iter) {
178 print "<option value='".$iter{"name"}."'>" . $iter{"name"} . "</option>\n";
182 <td
><span
class="text"><?php
xl('Provider','e'); ?
>: </span
></td
><td
>
183 <input type
='checkbox' name
='authorized' value
='1' onclick
='authorized_clicked()' />
184  
; 
;<span
class='text'><?php
xl('Calendar','e'); ?
>:
185 <input type
='checkbox' name
='calendar' disabled
/>
189 <td
><span
class="text"><?php
xl('First Name','e'); ?
>: </span
></td
><td
><input type
=entry name
='fname' id
='fname' style
="width:120px;"><span
class="mandatory"> 
;*</span
></td
>
190 <td
><span
class="text"><?php
xl('Middle Name','e'); ?
>: </span
></td
><td
><input type
=entry name
='mname' style
="width:120px;"></td
>
193 <td
><span
class="text"><?php
xl('Last Name','e'); ?
>: </span
></td
><td
><input type
=entry name
='lname' id
='lname' style
="width:120px;"><span
class="mandatory"> 
;*</span
></td
>
194 <td
><span
class="text"><?php
xl('Default Facility','e'); ?
>: </span
></td
><td
><select style
="width:120px;" name
=facility_id
>
196 $fres = sqlStatement("select * from facility where service_location != 0 order by name");
198 for ($iter = 0;$frow = sqlFetchArray($fres);$iter++
)
199 $result[$iter] = $frow;
200 foreach($result as $iter) {
202 <option value
="<?php echo $iter{id};?>"><?php
echo $iter{name
};?
></option
>
210 <td
><span
class="text"><?php
xl('Federal Tax ID','e'); ?
>: </span
></td
><td
><input type
=entry name
='federaltaxid' style
="width:120px;"></td
>
211 <td
><span
class="text"><?php
xl('Federal Drug ID','e'); ?
>: </span
></td
><td
><input type
=entry name
='federaldrugid' style
="width:120px;"></td
>
214 <td
><span
class="text"><?php
xl('UPIN','e'); ?
>: </span
></td
><td
><input type
="entry" name
="upin" style
="width:120px;"></td
>
215 <td
class='text'><?php
xl('See Authorizations','e'); ?
>: </td
>
216 <td
><select name
="see_auth" style
="width:120px;">
218 foreach (array(1 => xl('None'), 2 => xl('Only Mine'), 3 => xl('All')) as $key => $value)
220 echo " <option value='$key'";
221 echo ">$value</option>\n";
227 <td
><span
class="text"><?php
xl('NPI','e'); ?
>: </span
></td
><td
><input type
="entry" name
="npi" style
="width:120px;"></td
>
228 <td
><span
class="text"><?php
xl('Job Description','e'); ?
>: </span
></td
><td
><input type
="entry" name
="specialty" style
="width:120px;"></td
>
231 <!-- (CHEMED
) Calendar UI preference
-->
233 <td
><span
class="text"><?php
xl('Taxonomy','e'); ?
>: </span
></td
>
234 <td
><input type
="entry" name
="taxonomy" style
="width:120px;" value
="207Q00000X"></td
>
235 <td
><span
class="text"><?php
xl('Calendar UI','e'); ?
>: </span
></td
><td
><select name
="cal_ui" style
="width:120px;">
237 foreach (array(3 => xl('Outlook'), 1 => xl('Original'), 2 => xl('Fancy')) as $key => $value)
239 echo " <option value='$key'";
240 if ($key == $iter['cal_ui']) echo " selected";
241 echo ">$value</option>\n";
246 <!-- END (CHEMED
) Calendar UI preference
-->
249 <td
><span
class="text"><?php
xl('State License Number','e'); ?
>: </span
></td
>
250 <td
><input type
="text" name
="state_license_number" style
="width:120px;"></td
>
251 <td
class='text'><?php
xl('NewCrop eRX Role','e'); ?
>:</td
>
253 <?php
echo generate_select_list("erxrole", "newcrop_erx_role", $iter['newcrop_user_role'],'','--Select Role--','','','',array('style'=>'width:120px')); ?
>
257 <?php
if ($GLOBALS['inhouse_pharmacy']) { ?
>
259 <td
class="text"><?php
xl('Default Warehouse','e'); ?
>: </td
>
262 echo generate_select_list('default_warehouse', 'warehouse',
266 <td
class="text"><?php
xl('Invoice Refno Pool','e'); ?
>: </td
>
269 echo generate_select_list('irnpool', 'irnpool', '',
270 xl('Invoice reference number pool, if used'));
277 // List the access control groups if phpgacl installed
278 if (isset($phpgacl_location) && acl_check('admin', 'acl')) {
281 <td
class='text'><?php
xl('Access Control','e'); ?
>:</td
>
282 <td
><select name
="access_group[]" multiple style
="width:120px;">
284 $list_acl_groups = acl_get_group_title_list();
285 $default_acl_group = 'Administrators';
286 foreach ($list_acl_groups as $value) {
287 if ($default_acl_group == $value) {
288 // Modified 6-2009 by BM - Translate group name if applicable
289 echo " <option value='$value' selected>" . xl_gacl_group($value) . "</option>\n";
292 // Modified 6-2009 by BM - Translate group name if applicable
293 echo " <option value='$value'>" . xl_gacl_group($value) . "</option>\n";
298 <td
><span
class="text"><?php
xl('Additional Info','e'); ?
>: </span
></td
>
299 <td
><textarea name
=info style
="width:120px;" cols
=27 rows
=4 wrap
=auto
></textarea
></td
>
302 <tr height
="25"><td colspan
="4"> 
;</td
></tr
>
310 <input type
="hidden" name
="newauthPass">
316 <tr
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
319 <form name
='new_group' method
='post' action
="usergroup_admin.php"
320 onsubmit
='return top.restoreSession()'>
322 <input type
=hidden name
=mode value
=new_group
>
323 <span
class="bold"><?php
xl('New Group','e'); ?
>:</span
>
325 <span
class="text"><?php
xl('Groupname','e'); ?
>: </span
><input type
=entry name
=groupname size
=10>
327 <span
class="text"><?php
xl('Initial User','e'); ?
>: </span
>
330 $res = sqlStatement("select distinct username from users where username != ''");
331 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
332 $result[$iter] = $row;
333 foreach ($result as $iter) {
334 print "<option value='".$iter{"username"}."'>" . $iter{"username"} . "</option>\n";
339 <input type
="submit" value
=<?php
xl('Save','e'); ?
>>
345 <tr
<?php
if ($GLOBALS['disable_non_default_groups']) echo " style='display:none'"; ?
>>
348 <form name
='new_group' method
='post' action
="usergroup_admin.php"
349 onsubmit
='return top.restoreSession()'>
350 <input type
=hidden name
=mode value
=new_group
>
351 <span
class="bold"><?php
xl('Add User To Group','e'); ?
>:</span
>
354 <?php
xl('User','e'); ?
>
358 $res = sqlStatement("select distinct username from users where username != ''");
359 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
360 $result3[$iter] = $row;
361 foreach ($result3 as $iter) {
362 print "<option value='".$iter{"username"}."'>" . $iter{"username"} . "</option>\n";
367 <span
class="text"><?php
xl('Groupname','e'); ?
>: </span
>
368 <select name
=groupname
>
370 $res = sqlStatement("select distinct name from groups");
372 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
373 $result2[$iter] = $row;
374 foreach ($result2 as $iter) {
375 print "<option value='".$iter{"name"}."'>" . $iter{"name"} . "</option>\n";
380 <input type
="submit" value
=<?php
xl('Add User To Group','e'); ?
>>
388 if (empty($GLOBALS['disable_non_default_groups'])) {
389 $res = sqlStatement("select * from groups order by name");
390 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
391 $result5[$iter] = $row;
393 foreach ($result5 as $iter) {
394 $grouplist{$iter{"name"}} .= $iter{"user"} .
395 "(<a class='link_submit' href='usergroup_admin.php?mode=delete_group&id=" .
396 $iter{"id"} . "' onclick='top.restoreSession()'>Remove</a>), ";
399 foreach ($grouplist as $groupname => $list) {
400 print "<span class='bold'>" . $groupname . "</span><br>\n<span class='text'>" .
401 substr($list,0,strlen($list)-2) . "</span><br>\n";
406 <script language
="JavaScript">
408 if ($alertmsg = trim($alertmsg)) {
409 echo "alert('$alertmsg');\n";
412 $
(document
).ready(function(){
413 $
("#cancel").click(function() {
414 parent
.$
.fn
.fancybox
.close();