PDA

View Full Version : سوال: رفع مشکل



iman65
شنبه 04 اردیبهشت 1389, 07:41 صبح
با سلام خدمت دوستان عزیز
یک راهنمایی می خواستم در مورد سایت مسابقات فوتبال
سایت من یک مشکلی داره اونم اینه که وقتی مسابقه ای در سایت قرار میدم زمان باقیمانده تا پایان مسابقه رو به کاربر نشون نمی ده . در صورتی که این قابلیت در سایت وجود داره ولی گاهی اوقات اتفاقی و شانسی نشون میده
می خواستم راهنمایی بفرمایید
صفحه کد رو ضمیمه کردم ولی خود کدها رو در اینجا هم قرار دادم
تشکر
کدها :


<?
include'licens.php';
$Str_Charset= 'UTF-8';
$_SERVER['QUERY_STRING']= htmlentities(addslashes((string)$_SERVER['QUERY_STRING']), ENT_COMPAT, $Str_Charset);
$_SERVER['REQUEST_URI']= htmlentities(addslashes((string)$_SERVER['REQUEST_URI']), ENT_COMPAT, $Str_Charset);
$_SERVER['HTTP_USER_AGENT']= htmlentities(addslashes((string)$_SERVER['HTTP_USER_AGENT']), ENT_COMPAT, $Str_Charset);
unset($Str_Charset);
error_reporting(0);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" dir="rtl">
<head>
<title>منوی کاربری</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="fa">
<link href="/css_style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/tree_menu/stlib.js"></script>
</head>
<script>
function repeat()
{
show_time();
setTimeout("repeat()",1000);
}
function show_time()
{
xmlhttp=GetXmlHttpObject();
if (xmlhttp==null)
{
alert ("Browser does not support HTTP Request");
return;
}
var url="get_date.php";
//url=url+"?s_date="+s_date+"&f_date="+f_date+"&f_hour="+f_hour;
url=url+"?sid="+Math.random();
xmlhttp.onreadystatechange=stateChanged;
xmlhttp.open("GET",url,true);
xmlhttp.send(null);
}

function stateChanged()
{
if (xmlhttp.readyState==4)

document.getElementById("show").innerHTML=xmlhttp.responseText;

//else{
//document.getElementById("show").innerHTML='<br><br><center><img src=Image/1.gif></center>' ;
//}
}


function transData(name,id) {
xmlHttp = GetXmlHttpObject();
if (xmlHttp == null) {
alert ('مرورگر شما Ajax را پشتیبانی نمی کند.');
return;
}

if(!id)
id=9999;
if ((name=="id_race2") || (id==9999))
{
var id_race=id;
var url = 'natijeh.php';
url = url + '?v1=' + id_race;
url = url + '&sid=' + Math.random();
xmlHttp.onreadystatechange = stateChanged1;
xmlHttp.open('GET', url, true);
xmlHttp.send(null);
}

}

function stateChanged1() {
if (xmlHttp.readyState == 1 || xmlHttp.readyState == 'loading')
{ document.getElementById('response1').style.display ='none';
document.getElementById('loading1').style.display= 'block';
}
if (xmlHttp.readyState == 4 || xmlHttp.readyState == 'complete') {
document.getElementById('loading1').style.display= 'none';
document.getElementById('response1').style.display ='block';
var myarray=xmlHttp.responseText;
document.getElementById('response1').innerHTML = xmlHttp.responseText;

window.setTimeout("transData('id_race2',document.getElementById('id_r ace2').value)",90000);
}
}

</script>
</script>

<body onload="repeat(),transData(1,9999)" >
<?
include 'up-imn.php';
?>
<table width="960px" cellpadding="0" cellspacing="0" border="0" align="center">
<tr >
<td colspan="2">
<?
include'top_page_main.php';

?>
</td>
</tr>
<!-- چك لاگين به سايت-->
<tr style="height:2px" >
<td colspan="2">
<div id="login"></div>
</td>
</tr>
<!-- چك لاگين به سايت-->

<tr>

<td valign="top" width="230px">
<?include 'right.php';?>
</td>

<td valign="top" width="730px" >
<!--ايجاد جدول وسط-->

<table id="color-safahatedakheli" width="730px" cellpadding="0" cellspacing="0" border="0" style="margin-right:3px">
<tr align="center">
<td>


<!--ايجاد چهار جدول صفحه اصلي -->
<table id="color-safahatedakheli" width="100%" cellpadding="0" cellspacing="0" border="0" >
<tr align="right">
<!--ايجاد جدول آخرين نتايج و رده بندي -->
<td valign="top">
<table align="right" width="300px" border="0" cellpadding="0" cellspacing="0">
<tr><td>


<!--مسابقات فعال-->
<table id="color-safahatedakheli" width="300px" cellpadding="0" cellspacing="1" border="0" >
<tr style="font-size:9pt;color:#3A332B;"><td>
<div id="show"></div>
<!--
<img src="../image_site/race_1.gif" width="300" height="130"><br>
<img src="../image_site/race_2.gif" width="300" height="130"><br>
<img src="../image_site/race_3.gif" width="300" height="130"> -->
</td></tr>

</table><br>

</td></tr>
</table>




</td>
<!--انتهاي ايجاد جدول نتايج و رده بندي -->
<!--ايجاد جدول داغترين و آخرين اخبار -->
<td valign="top" width="100%" >
<table align="center" width="100%" border="0">
<tr><td>
<!--ايجاد جدول آخرين نتايج فوتبال-->
<table width="100%" cellpadding="0" cellspacing="1" border="0" bgcolor="C#‎9C4FA" style="margin-right:0px">
<tr style="background-image:url(/image_site/default.jpg); height:60px;font-size:9pt;color:#000000;font-weight:bold"><td valign="top" align="left"><div style="margin-top:8px;margin-left:15px">
&nbsp;&nbsp; نتايج زنده مسابقات</div >
</td></tr>

<tr id="color-safahatedakheli" align="right">
<td>
<form name="natijeh" style="margin-top:5px;margin-bottom:1px">
<table id="color-safahatedakheli" cellpadding="2" cellspacing="1" border="0" width="100%" align="right">
<tr>
<td id="color-safahatedakheli" align="left" style="width: 100px" >
نـام مسابقـه :
</td>
<td id="color-safahatedakheli" align="right">

<select name="id_race2" id="id_race2" style="background:#EFEFEF;color:#000000;width:150px;font-family:tahoma;font-size:8pt;font-weight:bold" onchange='transData(this.name,this.value)' >
<option value="">انتخاب مسابقه</option>
<?
$q=mysql_query("SELECT * from race where status=1 order by date_end ");
while($n=mysql_fetch_array($q))
{$n1=$n['type_race'];
$q1=mysql_query("select * from name_race where id=$n1");
$n1=mysql_fetch_array($q1);
echo "<option value=$n[id_race]>$n1[name] $n[name_race]</option>";
}
?>
</select>

</td>
</tr>
</tr></form>
<tr><td colspan="2">
<div id="loading1" style="display:none;" align="center">
<center>
<img src="../image/loading.gif" alt="loading..." /><br>
<font color="#000000">لطفاً منتظر بمانيد ...</font>
</center>
</div>
<div align='center' id='response1'style="line-height:180% ;margin-top:5px"></div>
<p>

<!-- شروع نمايش اخبار-->

<!-- انتهاي نمايش اخبار-->


</td>
</tr>
</table><br>
<!-- انتهاي جدول اخبار-->
</td></tr>
<tr><td>


<!-- انتهاي داعترين اخبار-->
</td></tr>
</table>




</td>
<!--انتهاي جدول اخبار -->
</tr>
</table>
<!--انتهاي ايجاد چهار جدول اصلي -->
</td>
</tr>
</table>
<!--انتهاي جدول وسط-->

</td>
</tr>
</table>



</body>
</html>