Location: PHPKode > projects > PhpRechnung > phpRechnung/user/new.php
<?php
/*
	new.php

	phpRechnung - is easy-to-use Web-based multilingual accounting software.
	Copyright (C) 2001 - 2008 Edy Corak < phprechnung at ecorak dot net >

	This program is free software; you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation; either version 2 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
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program; if not, write to the Free Software
	Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

require_once("../include/phprechnung.inc.php");
require_once("../include/smarty.inc.php");
CheckUser();
CheckAdminGroup1();
CheckSession();

if(isset($_REQUEST['userID']))
{
	$userID = $_REQUEST['userID'];
	$smarty->assign("userID","$userID");
}
if(isset($_REQUEST['page']))
{
	$page = $_REQUEST['page'];
	$smarty->assign("page","$page");
}
if(isset($_REQUEST['infoID']))
{
	$infoID = $_REQUEST['infoID'];
	$smarty->assign("infoID","$infoID");
}
if(isset($_REQUEST['UserActive']))
{
	$UserActive = $_REQUEST['UserActive'];
	$smarty->assign("USERACTIVE","$UserActive");
}
if(isset($_REQUEST['FullName']))
{
	$FullName = $_REQUEST['FullName'];
	$smarty->assign("FULLNAME","$FullName");
}
if(isset($_REQUEST['UserName']))
{
	$UserName = $_REQUEST['UserName'];
	$smarty->assign("USERNAME","$UserName");
}
if(isset($_REQUEST['UserLanguage']))
{
	$UserLanguage = $_REQUEST['UserLanguage'];
	$smarty->assign("USERLANGUAGE","$UserLanguage");
}
if(isset($_REQUEST['UserGroup1']))
{
	$UserGroup1 = $_REQUEST['UserGroup1'];
	$smarty->assign("USERGROUP1","$UserGroup1");
}
if(isset($_REQUEST['UserGroup2']))
{
	$UserGroup2 = $_REQUEST['UserGroup2'];
	$smarty->assign("USERGROUP2","$UserGroup2");
}
if(isset($_REQUEST['UserActive_1']))
{
	$UserActive_1 = $_REQUEST['UserActive_1'];
	$smarty->assign("UserActive_1","$UserActive_1");
}
if(isset($_REQUEST['FullName_1']))
{
	$FullName_1 = $_REQUEST['FullName_1'];
	$smarty->assign("FullName_1","$FullName_1");
}
if(isset($_REQUEST['UserName_1']))
{
	$UserName_1 = $_REQUEST['UserName_1'];
	$smarty->assign("UserName_1","$UserName_1");
}
if(isset($_REQUEST['UserLanguage_1']))
{
	$UserLanguage_1 = $_REQUEST['UserLanguage_1'];
	$smarty->assign("UserLanguage_1","$UserLanguage_1");
}
if(isset($_REQUEST['UserGroup_1']))
{
	$UserGroup_1 = $_REQUEST['UserGroup_1'];
	$smarty->assign("UserGroup_1","$UserGroup_1");
}
if(isset($_REQUEST['Order']))
{
	$Order = $_REQUEST['Order'];
	$smarty->assign("Order","$Order");
}
if(isset($_REQUEST['Sort']))
{
	$Sort = $_REQUEST['Sort'];
	$smarty->assign("Sort","$Sort");
}
if(isset($_REQUEST['Mark']))
{
	$Mark = $_REQUEST['Mark'];
	$smarty->assign("Mark","$Mark");
}

$smarty->assign("Title","$a[user_admin] - $a[new]");
$smarty->assign("User_Active","$a[user_active]");
$smarty->assign("Full_Name","$a[fullname]");
$smarty->assign("User_Name","$a[username]");
$smarty->assign("User_Group","$a[usergroup]");
$smarty->assign("Language","$a[language]");
$smarty->assign("Password","$a[password]");
$smarty->assign("Repeat_Password","$a[repeat_password]");
$smarty->assign("NewEntry","$a[new_entry]");

// Database connection
//
DBConnect();

$query3 = $db->GetRow("SELECT MAX(USERID) AS MAX_USERID FROM {$TBLName}user");
if (!$query3)
	print($db->ErrorMsg());
else
	$UserID = $query3['MAX_USERID'];

	$smarty->assign("UserID",$UserID);

// Put choice yes / no in $choice_yes_no
//
$smarty->assign("choice_yes_no",array($choice_yes_no));

// Put available languages in $choose_language
//
$lang = asort($language);
$smarty->assign("choose_language",array($language));

// Put available groups in $choose_group
//
$usergroup = asort($group);
$smarty->assign("choose_group",array($group));

$smarty->display('user/new.tpl');

unset($_SESSION['NewID']);
?>
Return current item: PhpRechnung