include("admin/config/config.php");
if (!isset($group_vote)){
$group_vote="no";
}
#-----------------------------
if (!isset($numrows)){
$numrows=0;
}
if (!isset($index_)){
$index_=1;
}
$pagestart=22;
if (!isset($indexstart)){
$indexstart=0;
}else{
$indexstart=($index_-1)*$pagestart;
}
if (!isset($code1)){
//$code1="";
$code1="Random";
$code1=strtolower($code1);
}else{
$code1=strtolower($code1);
}
if ($indexstart==0){
$code1=strtolower($code1);
if($code1 =="all"){
$query="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc";
$sql_result = mysql_query($query);
}
if($code1 ==""){
$query="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc ";
$sql_result = mysql_query($query);
}
if($code1 =="random"){
$query="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink ORDER BY RAND() ";
$sql_result = mysql_query($query);
}
if($code1 =="count"){
$query="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.count_ desc";
$sql_result = mysql_query($query);
}
if($code1 =="vote"){
$query="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.vode_ desc";
$sql_result = mysql_query($query);
}
if($code1 !=0 and $group_vote=="no"){
$query="select * from group_games,sub_games where group_games.g_id_games=$code1 and group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc";
$sql_result = mysql_query($query);
}
if($code1==0 and $group_vote !="no"){
$query="select * from group_games,sub_games where sub_games.index_vode='$group_vote' and group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc";
$sql_result = mysql_query($query);
}
$numrowsAll=mysql_num_rows($sql_result);
#echo "$numrowsAll ---";
}
?>
หน้าแรก เกม |
เกมล่าสุด
|
ระบบสุ่มเกม |
เรียงตามคนเข้าชม
|
เรียงตามจำนวนคนโหวต
|
if (!isset($chk_file)){
$chk_file="1";
}
$query="select * from group_games order by g_name_games";
$sql_result = mysql_query($query);
$i=0;
$ii=0;
while ($row=mysql_fetch_object($sql_result))
{
$ii++;
$dataname=$row->g_name_games ;
$dataid=$row->g_id_games;
$datasum_sub=$row->g_datasum_sub;
?>
(
) |
}?>
★★★★★ |
★★★★ |
★★★ |
★★ |
★ |
|
|
|
|
if($code1 =="random"){
$query_2="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink ORDER BY RAND() LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
}
if($code1 ==""){
$query_2="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc ";
$sql_result_2 = mysql_query($query_2);
}
if($code1 =="all"){
$query_2="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
}
if($code1 =="count"){
$query_2="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.count_ desc LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
}
if($code1 =="vote"){
$query_2="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.vode_ desc LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
}
if($code1 !=0 and $group_vote=="no"){
$query_2="select * from group_games,sub_games where group_games.g_id_games=$code1 and group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
}
if($code1==0 and $group_vote !="no"){
$query_2="select * from group_games,sub_games where sub_games.index_vode='$group_vote' and group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
}
?>
|
$count_=0;
if ($sql_result_2)
while ($row_2=mysql_fetch_object($sql_result_2))
{
$name_show=$row_2->g_name_games ;
$id_show=$row_2->g_id_games;
$idlink_show=$row_2->sub_idlink;
$pic_show=$row_2->namefile_pic;
$forder_show=$row_2->sub_namefile;
$subid_show=$row_2->sub_id;
$subname_show=$row_2->sub_name;
if ($count_<4){
?>
|
}else{
break;
}
$count_++;
}
?>
|
|
|
function chkcolor($numval){
if ($numval % 2){
$color_="#BADC98";
}else{
$color_="#D3E9BE";
}
return $color_;
}
#$query_2="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink";
#$sql_result_2 = mysql_query($query_2);
// if ($code1==""){
// $query_2="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc LIMIT $indexstart,$pagestart ";
// }else{
if($code1 ==""){
//if ($code1==""){
$query_2="select * from group_games,sub_games where group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
#echo "ssss";
}
if($code1 !=0 and $group_vote=="no"){
$query_2="select * from group_games,sub_games where group_games.g_id_games=$code1 and group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
#echo "1111";
}
if($code1==0 and $group_vote !="no"){
$query_2="select * from group_games,sub_games where sub_games.index_vode='$group_vote' and group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc LIMIT $indexstart,$pagestart ";
$sql_result_2 = mysql_query($query_2);
#echo "222";
}
// $query_2="select * from group_games,sub_games where group_games.g_id_games=$code1 and group_games.g_id_games=sub_games.sub_idlink order by sub_games.sub_id desc LIMIT $indexstart,$pagestart ";
//}
$sql_result_2 = mysql_query($query_2);
if ($sql_result_2) {
$numrows=mysql_num_rows($sql_result_2);
} else {
$numrows = 0;
}
//echo $count_." ".$numrows;
if ($numrows>4){
?>
|
$count_=0;
$colum_=0;
$row_=1;
while ($row_2=mysql_fetch_object($sql_result_2))
{
$name_show=$row_2->g_name_games ;
$id_show=$row_2->g_id_games;
$idlink_show=$row_2->sub_idlink;
$pic_show=$row_2->namefile_pic;
$forder_show=$row_2->sub_namefile;
$subid_show=$row_2->sub_id;
$subname_show=$row_2->sub_name;
$subdetail_show=$row_2->sub_detail;
$count_show=$row_2->count_;
$clickvote_show=$row_2->clickvode;
$vote_show=$row_2->vode_;
$typevote_show=$row_2->index_vode;
$h1="";
$h2="";
$h1= split(' ', $subdetail_show);
$dtel=str_replace(chr(13).chr(10)," ",$subdetail_show);
if ($count_>=4){
if ($colum_<2){
?>
| | | |