+/**********************************************************************
+ Copyright (C) FrontAccounting, LLC.
+ Released under the terms of the GNU General Public License, GPL,
+ as published by the Free Software Foundation, either version 3
+ of the License, or (at your option) any later version.
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
+***********************************************************************/
+
+function add_user($user_id, $real_name, $password, $phone, $email, $role_id,
+ $language, $profile, $rep_popup, $pos)
+{
+ begin_transaction(__FUNCTION__, func_get_args());
+ $sql = "INSERT INTO ".TB_PREF."users (user_id, real_name, password"
+ .", phone, email, role_id, language, pos, print_profile, rep_popup)
+ VALUES (".db_escape($user_id).",
+ ".db_escape($real_name).", ".db_escape($password) .",".db_escape($phone)
+ .",".db_escape($email).", ".db_escape($role_id).", ".db_escape($language)
+ .", ".db_escape($pos).",".db_escape($profile).",".db_escape($rep_popup)
+ ." )";
+
+ $result = db_query($sql, "could not add user for $user_id");
+ commit_transaction();
+ return $result;
+}