-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtryscore-yesday.php
More file actions
143 lines (120 loc) · 6.05 KB
/
tryscore-yesday.php
File metadata and controls
143 lines (120 loc) · 6.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
<?php
@session_start();
@header("Content-type: text/html; charset=utf-8");
$cachedir='cache'; // ชื่อแฟ้มเก็บไฟล์แคช
$file='tryscore-yesday.html'; // ชื่อไฟล์เว็บ
$cachefile=$cachedir.'/'.$file;
$cachetime =120; // ระยะเวลา 100 วินาที
// Serve from the cache if it is younger than $cachetime
if (file_exists($cachefile) && (time() - $cachetime < filemtime($cachefile))) {
include($cachefile);
//echo " <p style='color:gray;font-size:0.7em;'> ข้อมูลเมื่อ ".date('jS F Y H:i', filemtime($cachefile))." </p> "; // แสดงข้อความเวลาที่บันทึก
//exit;
}else{
ob_start();
require_once "service/service.php";
require_once "creation/creation.init.php";
$date = date('Y-m-d');
$date1 = date("Y-m-d", strtotime("+1 day", strtotime($date)));
?>
<table width="780" border="0" align="center" cellspacing="1" bgcolor="#202020" style="margin-top:5px;">
<tr>
<td height="42" colspan="9" background="images/bg-menu1.jpg" bgcolor="#004000"><div align="center" class="style5">
<div align="left"> <span class="style24">ผลบอลและทายสกอร์ ประจำวันที่ <?php echo thai_date_fullmonth(strtotime("+1 day", strtotime($date)));?></span></div>
</div></td>
</tr>
<tr>
<td width="8%" height="40" bgcolor="#000000"><div align="center" class="style27"><span class="style28">เวลา</span></div></td>
<td width="8%" bgcolor="#000000"><div align="center" class="style27"><span class="style28">ลีก</span></div></td>
<td width="15%" bgcolor="#000000"><div align="center" class="style27"><span class="style28">ทีมเจ้าบ้าน</span></div></td>
<td width="5%" bgcolor="#000000"><div align="center" class="style27"><span class="style28">ราคา</span></div></td>
<td width="15%" bgcolor="#000000"><div align="center" class="style27"><span class="style28">ทีมเยือน</span></div></td>
<td width="14%" bgcolor="#000000"><div align="center" class="style27"><span class="style28">ทายผล</span></div></td>
<td width="12%" bgcolor="#000000"><div align="center" class="style27"><span class="style28">Comment</span></div></td>
<td width="10%" bgcolor="#000000"><div align="center" class="style27"><span class="style28">ทรรศนะ</span></div></td>
</tr>
<?php
$sql="
SELECT
*
FROM
matchHDC
WHERE
Date >= '".$date1." 00:00:00' AND Predict='Y'
ORDER BY
Status = '1' asc,
Status = '2' asc,
Status = '3' asc,
Status = '0' asc,
Status = '-1' asc,
Date asc
;";
//echo $sql;
$query=mysql_query($sql);
$tmpl ='';
while($row=mysql_fetch_assoc($query)){
$loopp++;
if($loopp % 2 == 0){
$bgb ="#282828";
}else{
$bgb ="#1D1D1D";
}
//$current_time = $row['time_match'];
//$new_time = strtotime($row['Date']);
$new_time = strtotime($row['Date']);
?>
<tr bgcolor="<?=$bgb?>">
<td height="35"><div align="center"><span class="style18"><?php echo date('H:i', $new_time);?></span></div></td>
<td bgcolor="<?php echo CheckColor($row['LeagueShortName']);?>" style="color:<?php echo color_inverse(CheckColor($row['LeagueShortName'])); ?>"><div align="center" class="style28" style="cursor:pointer;" title="<?php echo $row['LeagueEngName'];?>"><?php echo $row['LeagueShortName'];?></div></td>
<td ><div align="right" style="padding-right:5px"><span class="style18">
<? if (strlen(number_format($row['AsianHandicap'],2))=='4') { ?><div style="color:#FF2B30;">* <? } ?>
<?php echo trim($row['HomeName']);?>
<? if (strlen(number_format($row['AsianHandicap'],2))=='4') { ?></div><? } ?>
</span></div></td>
<td><div class="style20" style="width:100%; margin:auto; padding:5px; background: #333333;">
<div align="center" class="style25"><?php if($row['Predict']=='Y'){ echo str_replace("-", "", $row['AsianHandicap']); }else{ echo '-'; } ?></div>
</div></td>
<td ><div align="left" style="padding-left:5px"><span class="style18">
<? if (strlen(number_format($row['AsianHandicap'],2))=='5') { ?><span style="color:#FF2B30;">* <? } ?>
<?php echo $row['AwayName'];?>
<? if (strlen(number_format($row['AsianHandicap'],2))=='5') { ?></span><? } ?>
</span></div></td>
<td>
<?php //if($ScoreHomeFullTime == '?'){
if($new_time > time() and $new_time < $datestop){
?>
<a href="javascript:;" onclick="openplaygame(<?php echo $row['MatchID'];?>)"><img src="images/brt1.png" width="70" height="35" border="0" /></a>
<?php }else{ ?>
<a href="javascript:;" onclick="openplaygame(<?php echo $row['MatchID'];?>)"><img src="images/off.png" width="70" height="35" border="0" /></a>
<?php } ?>
<?php if(Counttry($row['MatchID'])>0){ echo '<span class="badge yullow">'.Counttry($row['MatchID']).'</span >'; } ?>
</td>
<td>
<a href="javascript:;" onclick="opencomment(<?php echo $row['MatchID'];?>)"><img src="images/brt2.png" width="70" height="35" border="0" /></a>
<?php if(Countcomment($row['MatchID'])>0){ echo '<span class="badge redc">'.Countcomment($row['MatchID']).'</span >'; } ?>
</td>
<td><span class="style18"><?php echo $row['tded'];?>
<?php
if($row['MatchID']%2 == 0){
echo trim($row['AwayName']);
}
else{
echo trim($row['HomeName']);
}
?></span></td>
</tr>
<?php
}
mysql_free_result($query);
?>
</table>
<?php
$cachedata = ob_get_contents();
// BOTTOM of your script
$fp = fopen($cachefile, 'w'); // open the cache file for writing
fwrite($fp, $cachedata); // save the contents of output buffer to the file
fclose($fp); // close the file
ob_end_clean();
ob_end_flush(); // Send the output to the browser
echo $cachedata;
}