<?php
/*================================================================+\
|| # PHPRetro - An extendable virtual hotel site and management
|+==================================================================
|| # Copyright (C) 2009 Yifan Lu. All rights reserved.
|| # http://www.yifanlu.com
|| # Parts Copyright (C) 2009 Meth0d. All rights reserved.
|| # http://www.meth0d.org
|| # All images, scripts, and layouts
|| # Copyright (C) 2009 Sulake Ltd. All rights reserved.
|+==================================================================
|| # PHPRetro is provided "as is" and comes without
|| # warrenty of any kind. PHPRetro is free software!
|| # License: GNU Public License 3.0
|| # http://opensource.org/licenses/gpl-license.php
\+================================================================*/

$page['dir'] = '\7vpba0cuy2gcy0d1ch1njin4holc5hiztxuhk4b01ozu2';
$page['housekeeping'] = true;
$page['rank'] = 5;
require_once('../includes/core.php');
require_once('./includes/hksession.php');
$data = new housekeeping_sql;
$lang->addLocale("housekeeping.logs");

$page['name'] = $lang->loc['pagename.logs'];
$page['category'] = "dashboard";
require_once('./templates/housekeeping_header.php');

$type = $_GET['type'];

if(isset($_POST['search'])){
	$sql = $data->select7($input->FilterText($_POST['query']));
	$search_results = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n"; $i = 0;
	while($row = $db->fetch_row($sql)){
		if($input->IsEven($i)){ $even = "even"; }else{ $even = "odd"; }
		$search_results .= "<tr id=\"".$even."\"><td><a href=\"".PATH."/7vpba0cuy2gcy0d1ch1njin4holc5hiztxuhk4b01ozu2/logs?roomid=".$row[0]."\">".$row[1]."</a></td><td class=\"selectid\">".$row[0]."</td></tr>\n";
		$i++;
	}
	$search_results .= "</tr></table>";
}else{
	$search_results = "<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tr><td><b>".$lang->loc['search.desc']."</b></td></tr></table>";
}

$icon = "logs.png";
$description = $lang->loc['logs.display.desc'];
$content = "";
$content .= 
'<div class="contentdisplay">
<table height="100%"><tbody>
<tr class="header">
<th width="50">'.$lang->loc['user'].'</th>
<th width="350">'.$lang->loc['message'].'</th>
<th width="50">'.$lang->loc['room'].'</th>
<th width="50">'.$lang->loc['time'].'</th>
</tr>';
$sql = $data->select4(1000,0,$input->FilterText($_GET['roomid']));
$i = 0;
while($row = $db->fetch_row($sql)){
$i++;
if($input->IsEven($i)){ $even = ' class="even"'; }else{ $even = ''; }
$content .= 
'<tr'.$even.'>
<td>'.$input->HoloText($row[0]).'</td>
<td>'.$input->HoloText($row[3]).'</td>
<td>'.$input->HoloText($row[1]).'</td>
<td>'.$input->HoloText($row[2]).'</td>
</tr>';
}
$content .= 
'</tbody></table>
</div>';
?>
<div class="page_title">
 <img src="<?php echo PATH; ?>/7vpba0cuy2gcy0d1ch1njin4holc5hiztxuhk4b01ozu2/images/icons/<?php echo $icon; ?>" class="pticon">
 <span class="page_name_shadow"><?php echo $lang->loc['pagename.logs']; ?></span>

 <span class="page_name"><?php echo $lang->loc['pagename.logs']; ?></span>
</div>
<div class="page_main">

<table border="0" cellpadding="0" cellspacing="0" height="100%">
<tbody>
<tr height="100%" />
<td class="page_main_left">
<div class="left_date"><?php echo date('l F j, Y | g:iA'); ?></div>
<div class="hr"></div>
<div class="text">
 <p><?php echo $description; ?></p>
 </div>
<form name="users_search" action="<?php echo PATH; ?>/7vpba0cuy2gcy0d1ch1njin4holc5hiztxuhk4b01ozu2/logs" method="POST">
 <div class="text">
   <div class="user_listview_bg">
    <div id="listview">
     <div class="Scroller-Container">
<?php echo $search_results; ?>
     </div>
    </div>

    <div id="Scrollbar-Container">
     <img src="<?php echo PATH; ?>/7vpba0cuy2gcy0d1ch1njin4holc5hiztxuhk4b01ozu2/images/up_arrow.gif" class="Scrollbar-Up" />
     <div class="Scrollbar-Track">
       <img src="<?php echo PATH; ?>/7vpba0cuy2gcy0d1ch1njin4holc5hiztxuhk4b01ozu2/images/scrollbar_handle.gif" class="Scrollbar-Handle" />
     </div>
     <img src="<?php echo PATH; ?>/7vpba0cuy2gcy0d1ch1njin4holc5hiztxuhk4b01ozu2/images/down_arrow.gif" class="Scrollbar-Down" />
    </div>
   </div>
<div class="searcuser">

<input type="text" name="query" id="searchname" value="">
<button type="submit" name="search" id="button_search"><?php echo $lang->loc['search']; ?></button>
</div>
</div>
</form>
</td>
 <td class="page_main_right">
<div class="center">
<?php echo $content; ?>
</div>
 </td>
</tr>
</tbody>
</table>

</div>
<?php require_once('./templates/housekeeping_footer.php'); ?>