Location: PHPKode > projects > Katyshop > katyshop_ro_0.3.2.1/web/register.php
<?php
/**
 * Product: Katyshop
 * @version 0.3.2.1
 * @author Catalin Hulea - hide@address.com
 * @copyright Copyright (C) 2007 Catalin Hulea
 * @license GNU General Public License version 3
 * 			You can find a copy of GNU GPL v3 at this path: /docs/LICENSE
 * @link https://sourceforge.net/projects/katyshop
 *
 * 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 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
 * 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, see <http://www.gnu.org/licenses/>.
 *
 */
require_once(dirname(__FILE__) . "/init.php");

$user = Application::getUser();
if($user->isUserLoggedIn())
	Tools::redirect("index.php");

$registerUser = SessionHandler::get("registerUser");
if(!is_a($registerUser, "User"))
	$registerUser = new User();
?>
<html>
<head>
<title><?php echo APP_NAME; ?></title>
<?php require_once(WEB_DIR . "/includes/html_head.php"); ?>
</head>

<body>
<div id="container">
<?php require_once(WEB_DIR . "/includes/header.php"); ?>
<div id="middle">
<div id="left_vertical_line">
<?php require_once(WEB_DIR . "/includes/left.php"); ?>
<div id="content">

<form action="formparser/user.php?action=register" method="post">

<h1>Inregistrare cont nou</h1>

<?php require_once(WEB_DIR . "/includes/print_messages.php"); ?>

<dl>
<dt class="title"><b>Informatii pentru autentificare</b></dt>
<dd>
<table>
<tr>
<td><span style="color:red">*</span> Username</td><td><input type="text" name="username" value="<?php echo Escape::htmlValue(@$registerUser->username); ?>"></td>
</tr>
<tr>
<td><span style="color:red">*</span> Parola</td><td><input type="password" name="password"></td>
</tr>
<tr>
<td><span style="color:red">*</span> Confirmare parola</td><td><input type="password" name="confirm_password"></td>
</tr>
<tr>
<td><span style="color:red">*</span> Email</td><td><input type="text" name="email" value="<?php echo Escape::htmlValue(@$registerUser->email); ?>"></td>
</tr>
<tr>
<td><span style="color:red">*</span> Tip cont</td>
<td>
	<?php
	$chkPerson = (in_array(@$registerUser->acc_type, array("person", ""))) ? "checked" : "";
	$chkCompany = (@$registerUser->acc_type == "company") ? "checked" : "";
	?>
	<input type="radio" name="acc_type" value="person" onclick="hideCompanyForm(); " id="acc_type_person" <?php echo $chkPerson; ?>> <label for="acc_type_person">Persoana fizica</label>
	<input type="radio" name="acc_type" value="company" onclick="showCompanyForm(); " id="acc_type_company" <?php echo $chkCompany; ?>> <label for="acc_type_company">Companie</label>
</td>
</tr>
</table>
</dd>
</dl>

<dl>
<dt class="title"><b>Informatii personale</b></dt>
<dd>
<table>
<tr>
<td><span style="color:red">*</span> Sex</td>
<td>
	<?php
	$chkFemale = (@$registerUser->gender == "female") ? "checked" : "";
	$chkMale = (@$registerUser->gender == "female") ? "" : "checked";
	?>
	<input type="radio" name="gender" value="female" id="gender_female" <?php echo $chkFemale; ?>> <label for="gender_female">Doamna</label>
	<input type="radio" name="gender" value="male" id="gender_male" <?php echo $chkMale; ?>> <label for="gender_male">Domn</label>
</td>
</tr>
<tr>
<td><span style="color:red">*</span> Prenume</td><td><input type="text" name="first_name" value="<?php echo Escape::htmlValue(@$registerUser->first_name); ?>"></td>
</tr>
<tr>
<td><span style="color:red">*</span> Nume</td><td><input type="text" name="last_name" value="<?php echo Escape::htmlValue(@$registerUser->last_name); ?>"></td>
</tr>
<tr>
<td>Data nasterii <br> (dd/mm/yyyy)</td><td><input type="text" name="birth_date" value="<?php echo Escape::htmlValue(@$registerUser->displayDate("birth_date")); ?>"></td>
</tr>
<tr>
<td>Telefon</td><td><input type="text" name="phone" value="<?php echo Escape::htmlValue(@$registerUser->phone); ?>"></td>
</tr>
<tr>
<td>Mobil</td><td><input type="text" name="mobile" value="<?php echo Escape::htmlValue(@$registerUser->mobile); ?>"></td>
</tr>
<tr>
<td>Fax</td><td><input type="text" name="fax" value="<?php echo Escape::htmlValue(@$registerUser->fax); ?>"></td>
</tr>
<tr>
<td>CNP</td><td><input type="text" name="cnp" value="<?php echo Escape::htmlValue(@$registerUser->cnp); ?>"></td>
</tr>
</table>
</dd>
</dl>

<div id="div_company" style="display: none; ">
	<dl>
	<dt class="title"><b>Informatii companie</b></dt>
	<dd>
	<table>
	<tr>
	<td><span style="color:red">*</span> Nume companie</td><td><input type="text" name="company_name" value="<?php echo Escape::htmlValue(@$registerUser->company_name); ?>"></td>
	</tr>
	<tr>
	<td>Numar de inregistrare la registrul comertului</td><td><input type="text" name="reg_comert" value="<?php echo Escape::htmlValue(@$registerUser->reg_comert); ?>"></td>
	</tr>
	<tr>
	<td>CUI</td><td><input type="text" name="cui" value="<?php echo Escape::htmlValue(@$registerUser->cui); ?>"></td>
	</tr>
	<tr>
	<td>Banca</td><td><input type="text" name="bank" value="<?php echo Escape::htmlValue(@$registerUser->bank); ?>"></td>
	</tr>
	<tr>
	<td>IBAN</td><td><input type="text" name="iban" value="<?php echo Escape::htmlValue(@$registerUser->iban); ?>"></td>
	</tr>
	<tr>
	<td>Telefon companie</td><td><input type="text" name="comp_phone" value="<?php echo Escape::htmlValue(@$registerUser->comp_phone); ?>"></td>
	</tr>
	<tr>
	<td>Fax companie</td><td><input type="text" name="comp_fax" value="<?php echo Escape::htmlValue(@$registerUser->comp_fax); ?>"></td>
	</tr>
	<tr>
	<td>Email companie</td><td><input type="text" name="comp_email" value="<?php echo Escape::htmlValue(@$registerUser->comp_email); ?>"></td>
	</tr>
	</table>
	</dd>
	</dl>
</div>

<?php
if(!is_a($registerUser, "UserCompany"))
{
	?>
	<script language="javascript">
	hideCompanyForm();
	</script>
	<?php
}
elseif (is_a($registerUser, "UserCompany"))
{
	?>
	<script language="javascript">
	showCompanyForm();
	</script>
	<?php
}
?>
<p style="text-align: center; background-color: white; padding: 5px; "><input type="submit" value="Inregistrare" class="button"></p>
</form>

</div>
<?php require_once(WEB_DIR . "/includes/right.php"); ?>
<?php require_once(WEB_DIR . "/includes/footer.php"); ?>
</div>
</div>
</div>
</body>
</html>
Return current item: Katyshop