From 303ad13c4057a8e2f0c8fcf2719350ee1509e4ea Mon Sep 17 00:00:00 2001 From: bradymiller Date: Fri, 7 Aug 2009 23:22:08 +0000 Subject: [PATCH] facility_id bug fix --- interface/usergroup/usergroup_admin.php | 15 +++++++++------ setup.php | 2 +- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/interface/usergroup/usergroup_admin.php b/interface/usergroup/usergroup_admin.php index c06657c83..c6c6c25db 100644 --- a/interface/usergroup/usergroup_admin.php +++ b/interface/usergroup/usergroup_admin.php @@ -23,7 +23,7 @@ if (isset($_POST["mode"])) { } } - if ($doit == true) { + if ($doit == true) { $prov_id = idSqlStatement("insert into users set " . "username = '" . trim(formData('rumple' )) . "', password = '" . trim(formData('newauthPass' )) . @@ -37,10 +37,13 @@ if (isset($_POST["mode"])) { "', upin = '" . trim(formData('upin' )) . "', npi = '" . trim(formData('npi' )). "', taxonomy = '" . trim(formData('taxonomy' )) . - "', facility = '" . trim(formData('facility' )) . + "', facility_id = '" . trim(formData('facility_id' )) . "', specialty = '" . trim(formData('specialty' )) . "', see_auth = '" . trim(formData('see_auth' )) . "'"); + //set the facility name from the selected facility_id + sqlStatement("UPDATE users, facility SET users.facility = facility.name WHERE facility.id = '" . trim(formData('facility_id')) . "' AND users.username = '" . trim(formData('rumple')) . "'"); + sqlStatement("insert into groups set name = '" . trim(formData('groupname')) . "', user = '" . trim(formData('rumple')) . "'"); @@ -53,7 +56,7 @@ if (isset($_POST["mode"])) { $ws = new WSProvider($prov_id); } else { - $alertmsg .= "User " . trim(formData('rumple')) . " already exists. "; + $alertmsg .= xl('User','','',' ') . trim(formData('rumple')) . xl('already exists.','',' '); } } else if ($_POST["mode"] == "new_group") { @@ -167,15 +170,15 @@ foreach ($result2 as $iter) { : -: - + ".mysql_error()." (#".mysql_errno().")\n"; flush(); -- 2.11.4.GIT