<?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(dirname(__FILE__)) . "/init.php");
require_once(WEB_DIR . "/includes/req_admin.php");
?>
<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 . "/admin/includes/left.php"); ?>
<div id="content">
<h1>Vizualizare adrese utilizator</h1>
<?php require_once(WEB_DIR . "/includes/print_messages.php"); ?>
<?php
// show list of addresses
$db = Application::getDb();
$u = $db->tbUser->getUserById(@$_GET["id_user"]);
$u = Factory::instantiateUser($u);
?>
<h2>
<a href="admin/user.php?action=detail&id=<?php echo intval($u->id); ?>"><?php echo Escape::html($u->username); ?></a>
(<?php echo Escape::html(@$u->first_name . " " . @$u->last_name); ?>)
</h2>
<?php
$list = $db->tbAddress->getRecordsByUserId(@$_GET["id_user"], @$_GET["condition"]);
if(count($list) > 0)
{
?>
<?php
for($i = 0; $i < count($list); $i++)
{
$a = $list[$i];
?>
<table style="border-bottom: 1px solid #000000; width: 375px; ">
<tr valign="top">
<td width="150">
<input type="checkbox" <?php echo ($a->primary_addr == 1) ? "checked" : ""; ?> onclick="this.form.submit(); "> Adresa primara<br>
<input type="checkbox" <?php echo ($a->delivery == 1) ? "checked" : ""; ?> onclick="this.form.submit(); "> Livrare<br>
<input type="checkbox" <?php echo ($a->invoiceing == 1) ? "checked" : ""; ?> onclick="this.form.submit(); "> Facturare<br>
</td>
<td>
Judet <?php echo $a->county; ?><br>
Oras <?php echo $a->city; ?><br>
<?php echo $a->address; ?>
</td>
</tr>
</table>
<?php
}
}
else
{
?>
<p>Nu a putut fi gasita nici o adresa</p>
<?php
}
?>
</div>
<?php require_once(WEB_DIR . "/includes/right.php"); ?>
<?php require_once(WEB_DIR . "/includes/footer.php"); ?>
</div>
</div>
</div>
</body>
</html>