Boss timer fail :(

04/22/2019 22:49 nicki93#1
I am in this sphere new and I do not understand much.
please if anyone can help me only with the addition of the first boss because I do not quite understand php
as I said I'm new and I'm not with you in the php language thank you in advance

$boss1 = date_format($date_create($detail['ActionTime']),"H:i:s", strtotime("+43200"));

PHP Code:
<?php
function mssql_escape_string($data) {
if(!isset(
$data) or empty($data)) return '';
if(
is_numeric($data)) return $data;
$non_displayables = array(
'/%0[0-8bcef]/'// url encoded 00-08, 11, 12, 14, 15
'/%1[0-9a-f]/'// url encoded 16-31
'/[\x00-\x08]/'// 00-08
'/\x0b/'// 11
'/\x0c/'// 12
'/[\x0e-\x1f]/' // 14-31
);
foreach(
$non_displayables as $regex)
$data preg_replace($regex,'',$data);
$data str_replace("'","''",$data);
return 
$data;
}

$host '127.0.0.1';
$dbuser 'Shaiya'// put here your DB login
$dbpass 'Shaiya123'// put here your password DB
$database 'PS_GameLog';
$conn =  [MENTION=311501]ODB[/MENTION]c_connect("Driver={SQL Server};Server=$host;Database=$database"$dbuser$dbpass) or die("Database Connection Error!");
$boss1 odbc_exec($conn"SELECT [ActionTime] FROM [dbo].[Boss_Death_Log] WHERE [MobID]='901'order by ActionTime desc");
$detail=odbc_fetch_array($boss1);

//Here need to add an if where you see if the time i expired or not! in case is not expired show the countdown else need to return something like "UP NOW".

$boss1 date_format($date_create($detail['ActionTime']),"H:i:s"strtotime("+43200"));

echo 
"
<table cellspacing=1 cellpadding=4 border=1 style=\"border-style:hidden;\">
<tr>
<th>Boss Name</th>
<th>Kill Zeit</th>
<th>Respawn</th>
</tr>"
;
echo 
"<tr>";
echo 
"<td>Asiris</td><td>"substr($s['ActionTime'],019) ."</td><td>"$boss1 ."</td>";
04/23/2019 07:25 mr.hellraven#2
msql>?
04/23/2019 17:38 nicki93#3
Quote:
Originally Posted by mr.hellraven View Post
msql>?
nope mssql
07/03/2019 03:06 jenny2011#4
Quote:
I am in this sphere new and I do not understand much.
please if anyone can help me only with the addition of the first boss because I do not quite understand php
as I said I'm new and I'm not with you in the php language thank you in advance

$boss1 = date_format($date_create($detail['ActionTime']),"H:i:s", strtotime("+43200"));

PHP-Code:
<?php
function mssql_escape_string($data) {
if(!isset($data) or empty($data)) return '';
if(is_numeric($data)) return $data;
$non_displayables = array(
'/%0[0-8bcef]/', // url encoded 00-08, 11, 12, 14, 15
'/%1[0-9a-f]/', // url encoded 16-31
'/[\x00-\x08]/', // 00-08
'/\x0b/', // 11
'/\x0c/', // 12
'/[\x0e-\x1f]/' // 14-31
);
foreach($non_displayables as $regex)
$data = preg_replace($regex,'',$data);
$data = str_replace("'","''",$data);
return $data;
}

$host = '127.0.0.1';
$dbuser = 'Shaiya'; // put here your DB login
$dbpass = 'Shaiya123'; // put here your password DB
$database = 'PS_GameLog';
$conn = @[Only registered and activated users can see links. Click Here To Register...]c_connect("Driver={SQL Server};Server=$host;Database=$database", $dbuser, $dbpass) or die("Database Connection Error!");
$boss1 = odbc_exec($conn, "SELECT [ActionTime] FROM [dbo].[Boss_Death_Log] WHERE [MobID]='901'order by ActionTime desc");
$detail=odbc_fetch_array($boss1);

//Here need to add an if where you see if the time i expired or not! in case is not expired show the countdown else need to return something like "UP NOW".

$boss1 = date_format($date_create($detail['ActionTime']),"H:i:s", strtotime("+43200"));

echo "
<table cellspacing=1 cellpadding=4 border=1 style=\"border-style:hidden;\">
<tr>
<th>Boss Name</th>
<th>Kill Zeit</th>
<th>Respawn</th>
</tr>";
echo "<tr>";
echo "<td>Asiris</td><td>". substr($s['ActionTime'],0, 19) ."</td><td>". $boss1 ."</td>";

German

Ist nicht Perfekt. Aber vielleicht hilft es ja.
Bitte beachte, das du >> SQLSRV <<brauchst.


PHP Code:
<html>
<meta http-equiv="refresh" content="20">
<head>
<style type="text/css">
html, body {height:100%; margin:0; padding:0;}
#page-background {position:fixed; top:0; left:0; width:50%; height:50%;}
#content {position:relative; z-index:1; padding:10px;}
body,th {
color: #f0d693;
font-size: 15px;
}
td {
    font-size: 13px;
    color: #f0d693;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#FFFFFF">
<div id="page-background"></div>
<div id="content">
<?php

//    Connect to server with Shaiya credentials using PDO
$sqlUser 'Shaiya'//    YOUR SHAIYA ACCOUNT NAME
$sqlPass 'Shaiya123';    //    YOUR SHAIYA ACCOUNT PASSWORD
$database 'PS_UserData';

try {
$conn = new PDO("sqlsrv:Server=127.0.0.1;Database=$database"$sqlUser$sqlPass);
}
catch (
PDOException $e){
die(
$e->getMessage());
}

echo 
'<table width="275"> 
<tr class="boss-record">
<th class="boss-record"><span style="color:CD661D; margin: 3px;">-----------------</th>
<th class="boss-record"><span style="color:CD661D; margin: 3x;">-----------------</th>
<th class="boss-record"><span style="color:CD661D; margin: 3x;">-----------------</th>
</tr>'
;

@
$time date("Y-m-d H:i:s.000");

// add here more bosses, just the MobID.
@$bosses = array(=> '2785');

foreach (
$bosses as $key => $value) {
$query $conn->prepare ("SELECT TOP 1 [MobName], [CharName], [ActionTime] FROM PS_GameLog.dbo.Boss_Death_Log WHERE MobID= ? ORDER BY ActionTime DESC");
$query->bindValue(1$valuePDO::PARAM_INT);
$query->execute();
$boss $query->fetch(PDO::FETCH_NUM);

if (
$boss[0] != NULL){

// WHEN YOU ADD A MOB REMEMBER TO ADD THE TIME
switch ($value){
case 
2785$hours 12; break;

}

@
$nextTime date("Y-m-d H:i:s"strtotime($boss[2].'+'.$hours.' hours'));

if (
$nextTime $time){
$time_Result '<span style="color:green; margin: 3px;">Boss is Ready</span>';
} else{

$newTime strtotime($nextTime);
$time1 strtotime($time);

$countdown $newTime $time1;
$days_left gmdate("d"$countdown);
$hours_left gmdate("H"$countdown);
$min_left gmdate("i"$countdown);
$sec_left gmdate("s"$countdown);
$daysstr "d";
if (
$days_left != "1"){
$daysstr "d";
}else{
$daysstr "";
$days_left "";
}
$hstr "h";
if (
$hours_left != "1"){
$hstr "h";
}
$mstr "m";
if (
$min_left != "1"){
$mstr "m";
}
$sstr "s";
if (
$sec_left != "1"){
$sstr "s";
}

$time_Result ''.$days_left.' '.$daysstr.' '.$hours_left.' '.$hstr.' '.$min_left.' '.$mstr.' '.$sec_left.' '.$sstr.' '; } echo ' '


echo 
'
<tr>
<td>'
.$boss[0].'</td>
<td>'
.$boss[1].'</td>
<td>'
.$time_Result.'</td>
</tr>'
;
?>