Location: PHPKode > projects > Katyshop > katyshop_ro_0.3.2.1/web/profile.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");
$updateUser = SessionHandler::get("updateUser");
if(!is_a($updateUser, "User"))
{
	$updateUser = Factory::instantiateUser($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=profile" method="post">

<h1>Profil</h1>

<?php require_once(WEB_DIR . "/includes/print_messages.php"); ?>
<dl>
<dt></dt>
<dd>
<?php
$db = Application::getDb();
if($user->isCompanyLoggedIn() || $user->isPersonLoggedIn())
{
	$x = $db->tbAddress->getCount(array("id_user" => $user->id));
	if($x == 0)
	{
		?>
		<p>Nu aveti adrese. <a href="address.php?detail=true&id=0">Click aici pentru a adauga o noua adresa</a></p>
		<?php
	}
	else
	{
		?>
		<p><a href="address.php">Click aici pentru a vedea lista adreselor</a></p>
		<?php
	}
}
?>
<h2>Informatii pentru autentificare</h2>
<table>
<tr>
<td>Username</td><td><?php echo Escape::html(@$updateUser->username); ?></td>
</tr>
</table>
<?php
if(!$updateUser->isSuperadmin())
{
	?>
	<table id="tbl_change_password">
	<tr>
	<td>Parola</td><td><a href="javascript:changePassword(); ">Click aici pentru a schimba parola</a></td>
	</tr>
	</table>

	<table id="tbl_new_password" style="display: none; ">
	<tr>
	<td>Parola veche</td><td><input type="password" name="old_password"></td>
	</tr>
	<tr>
	<td>Noua parola</td><td><input type="password" name="password"></td>
	</tr>
	<tr>
	<td>Confirmare parola</td><td><input type="password" name="confirm_password"></td>
	</tr>
	<tr>
	<td>&nbsp;</td><td><input type="submit" value="Schimbati parola" class="button"></td>
	</tr>
	</table>
	<?php
}
?>
<table>
<tr>
<td>Email</td><td><?php echo Escape::html(@$updateUser->email); ?></td>
</tr>
<tr>
<td>Tip de cont</td><td><?php echo ucfirst(@$updateUser->acc_type);	?></td>
</tr>
</table>

<div id="div_person" style="display: none; ">
	<h2>Informatii personale</h2>
	<table>
	<tr>
	<td>Sex</td>
	<td>
		<?php
		$chkFemale = (@$updateUser->gender == "female") ? "checked" : "";
		$chkMale = (@$updateUser->gender == "male") ? "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>Prenume</td><td><input type="text" name="first_name" value="<?php echo Escape::htmlValue(@$updateUser->first_name); ?>"></td>
	</tr>
	<tr>
	<td>Nume</td><td><input type="text" name="last_name" value="<?php echo Escape::htmlValue(@$updateUser->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(@$updateUser->displayDate("birth_date")); ?>"></td>
	</tr>
	<tr>
	<td>Telefon</td><td><input type="text" name="phone" value="<?php echo Escape::htmlValue(@$updateUser->phone); ?>"></td>
	</tr>
	<tr>
	<td>Mobile</td><td><input type="text" name="mobile" value="<?php echo Escape::htmlValue(@$updateUser->mobile); ?>"></td>
	</tr>
	<tr>
	<td>Fax</td><td><input type="text" name="fax" value="<?php echo Escape::htmlValue(@$updateUser->fax); ?>"></td>
	</tr>
	<tr>
	<td>CNP</td><td><input type="text" name="cnp" value="<?php echo Escape::htmlValue(@$updateUser->cnp); ?>"></td>
	</tr>
	</table>
</div>

<div id="div_company" style="display: none; ">
	<h2>Informatii despre companie</h2>
	<table>
	<tr>
	<td>Numele companiei</td><td><input type="text" name="company_name" value="<?php echo Escape::htmlValue(@$updateUser->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(@$updateUser->reg_comert); ?>"></td>
	</tr>
	<tr>
	<td>CUI</td><td><input type="text" name="cui" value="<?php echo Escape::htmlValue(@$updateUser->cui); ?>"></td>
	</tr>
	<tr>
	<td>Banca</td><td><input type="text" name="bank" value="<?php echo Escape::htmlValue(@$updateUser->bank); ?>"></td>
	</tr>
	<tr>
	<td>IBAN</td><td><input type="text" name="iban" value="<?php echo Escape::htmlValue(@$updateUser->iban); ?>"></td>
	</tr>
	<tr>
	<td>Telefon companie</td><td><input type="text" name="comp_phone" value="<?php echo Escape::htmlValue(@$updateUser->comp_phone); ?>"></td>
	</tr>
	<tr>
	<td>Fax companie</td><td><input type="text" name="comp_fax" value="<?php echo Escape::htmlValue(@$updateUser->comp_fax); ?>"></td>
	</tr>
	<tr>
	<td>Email companie</td><td><input type="text" name="comp_email" value="<?php echo Escape::htmlValue(@$updateUser->comp_email); ?>"></td>
	</tr>
	</table>
</div>
<?php
if(is_a($updateUser, "UserPerson"))
{
	?>
	<script language="javascript">
	showPersonForm();
	</script>
	<?php
}
if (is_a($updateUser, "UserCompany"))
{
	?>
	<script language="javascript">
	showCompanyForm();
	</script>
	<?php
}
if(!$updateUser->isSuperadmin())
{
	?>
	<center><input type="submit" value="Actualizare" class="button"></center>
	<?php
}
?>
<br clear="all">
</dd>
</dl>
</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