Can someone help me please? Client wants to move their hosting to my account, however there is a PHP countdown ticker that counts down to the next game. The database is hidden, and the company its hosted with went out of business and changed hands twice and the new company refuses to respond to our inquiry. I do have the ticker PHP and corresponding javascript file. I will post here, but where do I begin with the database? Any help would be greatly appreciated. Thanks
This is the ticker.php file
<?
$query = "
SELECT DATE_FORMAT( DTTM, '%c/%d/%Y %r' ) as DTM, DTTM as ndate , Opponent
FROM game_countdown
WHERE DTTM > CURDATE( )
ORDER BY DTTM ASC
LIMIT 1 ";
$db->execute($query);
$db->move_cursor(0);
@extract($db->get_results());
?>
<script language="javascript" src="js/countdown.js"></script>
<script language="javascript">
var cd1 = new countdown('cd1');
cd1.TargetDate = "<?=$DTM ?>";
</script>
<div id="opponent"><?=$Opponent?> : <?=date("n/d g:i A",strtotime($ndate))?></div>
<table width=224 height=35 cellpadding=0 cellspacing=0>
<tr>
<td height=13></td>
<td height=13></td>
</tr>
<tr>
<td class="ttime" id=day align=left valign="bottom" width=112> </td>
<td class="ttime" id=hour align=left valign="bottom" width=112> </td>
</tr>
<tr>
<td class="ttime" id=min width=112 valign="bottom" style="padding-top: 8px;"> </td>
<td class="ttime" id=sec valign="bottom" width=112 style="padding-top: 8px;"> </td>
</tr>
</table>
<script language="javascript">
<!--
cd1.Setup();
//-->
</script>
Here is the corresponding JS file
function countdown(obj)
{
this.obj = obj;
this.TargetDate = "12/31/2020 5:00 AM";
this.CountActive = true;
this.DisplayStr;
this.Calcage = cd_CalcTime;
this.CountBack = cd_CountBack;
this.Setup = cd_Setup;
}
function cd_CalcTime(secs, num1, num2)
{
s = ((Math.floor(secs/num1))%num2).toString();
if (s.length < 2) s = "0" + s;
return (s);
}
function cd_CountBack(secs)
{
document.getElementById('day').innerHTML = this.Calcage(secs,86400,100000);
document.getElementById('hour').innerHTML = this.Calcage(secs,3600,24);
document.getElementById('min').innerHTML = this.Calcage(secs,60,60);
document.getElementById('sec').innerHTML = this.Calcage(secs,1,60);
if (this.CountActive) setTimeout(this.obj +".CountBack(" + (secs-1) + ")", 990);
}
function cd_Setup()
{
var dthen = new Date(this.TargetDate);
var dnow = new Date();
ddiff = new Date(dthen-dnow);
gsecs = Math.floor(ddiff.valueOf()/1000);
this.CountBack(gsecs);
}