<?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>Mesaje primite de la vizitatori</h1>
<?php require_once(WEB_DIR . "/includes/print_messages.php"); ?>
<?php
if(@$_GET["action"] == "detail")
{
$db = Application::getDb();
$m = $db->tbContactMessage->getRecordById(@$_GET["id"]);
if($m->id == 0)
{
?>
Mesajul nu a putut fi gasit
<?php
}
else
{
?>
<dl>
<dt class="title"><b>Vizualizare mesaj</b></dt>
<dd>
<p><a href="admin/contact_message.php">« Click aici pentru a va intoarce la lista de mesaje</a></p>
<table>
<tr>
<td>Nume vizitator</td><td><?php echo Escape::html($m->sender_name); ?></td>
</tr>
<tr>
<td>Email vizitator</td><td><a href="mailto:<?php echo Escape::htmlValue($m->sender_email); ?>"><?php echo Escape::html($m->sender_email); ?></a></td>
</tr>
<tr>
<td>Subiect</td><td><?php echo Escape::html($m->subject); ?></td>
</tr>
<tr>
<td>Mesaj</td><td><?php echo Escape::html($m->message); ?></td>
</tr>
</table>
</dd>
</dl>
<div style="background-color: white; margin-left: 10px; color: 000077; ">
<p><b>Atentie!</b> Detaliile utilizatorului au fost inregistrate la momentul cand mesajul a fost trimis.
Este posibil ca intre timp el sa isi fi schimbat aceste informatii folosind formularul de profil.</p>
<p>Totusi, chiar daca si-a schimbat datele, acestea sunt informatiile originale pe care le stiam
despre el la momentul cand a trimis mesajul.</p>
</div>
<dl>
<dt class="title"><b>Detalii utilizator</b></dt>
<dd>
<?php echo nl2br(Escape::html($m->user_details)); ?>
</dd>
</dl>
<?php
}
}
else
{
?>
<dl>
<dt class="title"><b>Lista mesaje</b></dt>
<dd>
<form action="admin/contact_message.php" method="get">
<?php echo Tools::http_build_hidden_inputs($_GET, array("title", "username")); ?>
<b style="display: block; ">Cautare</b>
<table cellspacing="0" style="text-align: right; ">
<tr>
<td>ID: <input type="text" name="id" value="<?php echo Escape::htmlValue(@$_GET["id"]); ?>"></td>
</tr>
<tr>
<td>Nume vizitator: <input type="text" name="sender_name" value="<?php echo Escape::htmlValue(@$_GET["sender_name"]); ?>"></td>
<td>Email: <input type="text" name="sender_email" value="<?php echo Escape::htmlValue(@$_GET["sender_email"]); ?>"></td>
</tr>
<tr>
<td>Subiect: <input type="text" name="subject" value="<?php echo Escape::htmlValue(@$_GET["subject"]); ?>"></td>
<td>Mesaj: <input type="text" name="message" value="<?php echo Escape::htmlValue(@$_GET["message"]); ?>"></td>
</tr>
<tr>
<td><input type="submit" value="Cauta" class="button"></td>
</tr>
</table>
</form>
<?php
if(empty($_GET["order_by"]))
{
$_GET["order_by"] = "id";
$_GET["order_by"] = "desc";
}
$db = Application::getDb();
$list = $db->tbContactMessage->search($_GET, @$_GET["start"], @$_GET["rowsPerPage"], @$_GET["order_by"], @$_GET["order_direction"]);
$messagesCount = $db->tbContactMessage->getCount($_GET, @$_GET["start"], @$_GET["rowsPerPage"], @$_GET["order_by"], @$_GET["order_direction"]);
if($messagesCount > 0)
{
?>
<table class="cuborder" cellspacing="0">
<tr>
<th nowrap><?php echo pagination_columnHead("ID", "id"); ?></th>
<th nowrap><?php echo pagination_columnHead("Vizitator", "sender_name"); ?></th>
<th nowrap><?php echo pagination_columnHead("Email", "sender_email"); ?></th>
<th nowrap><?php echo pagination_columnHead("Subiect", "subject"); ?></th>
<th nowrap><?php echo pagination_columnHead("Data", "date_sent"); ?></th>
</tr>
<?php
for($i = 0; $i < count($list); $i++)
{
$m = $list[$i];
?>
<tr onmouseover="this.style.backgroundColor='#ddeeff'; " onmouseout="this.style.backgroundColor='#ffffff'; ">
<td><?php echo Escape::html($m->id); ?></td>
<td><?php echo Escape::html($m->sender_name); ?></td>
<td><?php echo Escape::html($m->sender_email); ?></td>
<td onclick="redirect('admin/contact_message.php?action=detail&id=<?php echo Escape::htmlValue($m->id); ?>'); ">
<a href="admin/contact_message.php?action=detail&id=<?php echo Escape::htmlValue($m->id); ?>"><?php echo Escape::html($m->subject); ?></a>
</td>
<td><?php echo Escape::html($m->date_sent); ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5" align="right">
<?php
echo pagination_listPages($messagesCount);
echo pagination_rowsPerPage();
?>
</td>
</tr>
</table>
<?php
}
else
{
?>
Nu au putut fi gasite mesaje pe baza criteriilor de cautare folosite.
<?php
}
?>
</dd>
</dl>
<?php
}
?>
</div>
<?php require_once(WEB_DIR . "/includes/right.php"); ?>
<?php require_once(WEB_DIR . "/includes/footer.php"); ?>
</div>
</div>
</div>
</body>
</html>