<?php
include("module/stat-menu.php");
mysql_connect($L2JBS_config["mysql_host"],$L2JBS_config["mysql_login"],$L2JBS_config["mysql_password"]) or die('Error Mysql.');
mysql_select_db($L2JBS_config["mysql_db"]) or dir('Error DB.');
$result = mysql_query("SELECT * FROM `characters` WHERE `in_jail` = '1'") or die(mysql_error());
$row = mysql_num_rows($result);
if($row <= '0') {
echo "No Player in Jail now.<br>";
}
else {
$result1 = mysql_query("SELECT `char_name`,`level`,`jail_time`,`clanid` FROM `characters` WHERE `in_jail` = '1' ORDER by `jail_time` DESC limit $jail_limit");
echo "<table border='1'><tr>";
echo "<th class='Stil5'><center>Pos.</center></th>";
echo "<th class='Stil5'><center>Character Name</center></th>";
echo "<th class='Stil5'><center>Level</center></th>";
echo "<th class='Stil5'><center>Jail Time</center></th>";
echo "</tr>";
$i=1;
while ($row1 = mysql_fetch_row($result1))
{
$time1 = $row1[2]/86400;
$time2 = round($time1,4);
$time3 = bcdiv($time2,1,0); //Tage
$time4 = $time2-$time3; //Übrige Zeit
$time5 = $time4*86400;
$time6 = $time5/3600;
$time7 = round($time6,2);
$time8 = bcdiv($time7,1,0); //Stunden
$time9 = $time7-$time8; //Übrige Zeit
$timea = $time9*3600;
$timeb = $timea/60;
$timec = round($timeb,1);
$timed = bcdiv($timec,1,0); //Minuten
if($time3 >= '2') {
$day = 'Days'; }
else {
$day = 'Day'; }
if($time8 >= '2') {
$hour = 'Hours'; }
else {
$hour = 'Hour'; }
if($timed >= '2') {
$min = 'Mins'; }
else {
$min = 'Min'; }
if($row1[3] >= '1') {
$result2 = mysql_query("SELECT `clan_name` FROM `clan_data` WHERE `clan_id` = '$row1[4]'") or die(mysql_error());
$row2 = mysql_fetch_row($result2);
} else {
$clan_name = 'No Clan';
}
echo "<tr>";
echo "<td class='Stil5'><center>$i</center></td>";
echo "<td class='Stil5'><center>$row1[0]</center></td>";
echo "<td class='Stil5'><center>$row1[1]</center></td>";
echo "<td class='Stil5'><center>$time3 $day $time8 $hour $timed $min</center></td>";
echo "</tr>";
$i++;
}
echo "</table>";
mysql_close();
}
?>
|