<?php session_start(); //mysql_set_charset('utf-8');
 include'include/config.php';
 include 'include/security.class.php';
 date_default_timezone_set("Asia/Kolkata");
 
// $ret = mysql_query("select * from net_regestion where username = '$id'");
	//$fgt = mysql_fetch_assoc($ret);
	
   // $query= mysql_query("SELECT * FROM coment where userid = '".$fgt['id']."'");
    //$total=mysql_num_rows($query);
   // $query_point= mysql_query("SELECT * FROM search where users_id = '".$fgt['id']."'");
   // $point = mysql_fetch_assoc($query_point);
    
  $today=date("d-m-Y");
//    $users_id=$fgt['id'];
   $yesterday=date('d-m-Y',strtotime("-1 days"));
   //  $sql= mysql_query("insert into search(users_id,date)values('".$users_id."','".$today."')");
 
 ?>
<!DOCTYPE html>
<html lang="en">
<head>
    <!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-D81SYXF11T"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-D81SYXF11T');
</script>

<meta charset="UTF-8">
<title>SATTA MATKA KING | FASTEST SATTA MATKA LIVE RESULTS | KALYAN MATKA | SATTAMATKA</title>

<script async src="chat.js"></script>

<meta http-equiv="refresh" content="900" />
  <meta http-equiv="content-language" content="en-us" />
  <meta name="robots" content="index, follow" />
<meta name="description" content="Sattamatka - Satta Matka - One of the most visited satta website amongst people engaged In Satta Matka. Check Kalyan SattaMatka Fastest Kalyan Matka live Results. We provide fastest matka results apart from other players."/>
<meta name="keywords" content="satta matka, sattamatka, matka results, matka tips, matka charts, kalyan matka, kalyan matka results, newstarday matka,new star day matka,mumbai ratan matka,main matka,matka satta, matka satta result, satta king"/>
<link rel="canonical" href="https://me.satta143.in/">
<link href="https://fonts.googleapis.com/css2?family=Kalam:wght@700&display=swap" rel="stylesheet">
<meta name='dmca-site-verification' content='ZW5CL3FxYlRoaVN5NDZOOUtSaVE2QT090' />
<meta name="viewport" content="width=device-widt
<!-- Google tag (gtag.js) -->
<script async src="https://www.googletagmanager.com/gtag/js?id=G-028WX5K9LM"></script>
<script>
  window.dataLayer = window.dataLayer || [];
  function gtag(){dataLayer.push(arguments);}
  gtag('js', new Date());

  gtag('config', 'G-028WX5K9LM');
</script>h, initial-scale=1.0" />
<link rel="stylesheet" href="/css/top10.css" />
<style>body{

	font-style: italic;

    background-color: #000 !important;
    overflow-x: hidden;

}
.header {

   
    text-align: center;

    color: #f7dd89;

    margin-top: 5px;

}

.mb-0, .my-0 {

    margin-bottom: 0!important;

}

.blinking {
    animation: blinkingText 1.2s infinite;
}

.ptb-10 {

    padding: 10px 0;

}

img {

    vertical-align: middle;

    border-style: none;

}

.text1 {

    background-color: #d3e3c6;

    text-align: center;

    font-size: 17px;

    font-weight: 500;

    border: 2px solid #f7dd89;

    font-style: normal;

    padding-left: 20px!important;

    padding-right: 20px!important;

}



.italic {

    font-style: italic;

}

.fnt-14 {
    font-size: 14px;
    font-family: Helvetica Neue;
    font-weight: bold;
}

p {

    margin-bottom: 0!important;

}

.container-fluid {

    padding-right: 0px !important;

    padding-left: 0px !important;

}

.navbar {

    padding: 0px !important;

}


.live {

    width: 100%;

    float: left;

    text-align: center;

    color: #fff;

    background-color: #343150;

}

.days {

    text-align: center;

    color: #1a946f;

    background-color: #ecede7;

    padding: 8px;

    border-bottom: 2px solid #133469;

}

.days h4 {

    font-size: 22px;

    font-weight: bold;

    color: #090909;

    margin-bottom: 0;

}

.days span {

    font-weight: bold;

    color: #9c0000;

    font-size: 21px;

}

.refresh{

	background-color: #2c2841!important;

	border: 1px solid #2c2841!important;

	padding: 1px 10px!important;

	font-size: 15px!important;

	font-style: italic;

	font-weight: bold!important;

}


.bg-grey {

    background-color: #dddcda;

    border: 2px solid #a2872f ;

}

.f-w-700 {

    font-weight: 700!important;

}

.p-m-n p {

    margin: 0;

    color: #000;

    text-align: center;



}

p {

    margin-bottom: 0!important;

}

.container-fluid {

    width: 100%;

    padding-right: 15px;

    padding-left: 15px;

    margin-right: auto;

    margin-left: auto;

}



.brd-tb-white {

    border-top: 5px #4f3413 solid;

    border-bottom: 5px #fff solid #4f3413;

}

.bg-darkgreen {

    background-color: #4f3413;

}

.clr-white {

    color: #fff;

}

.bg-light-green {

    background-color: #f3f4ee;

}

.cl-br {

    color: #000000;

}

.bg-light-green h4 {

    font-size: 22px;

    font-weight: 700;

    margin-bottom: -5px!important;
    font-family: -apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif,'Apple Color Emoji','Segoe UI Emoji','Segoe UI Symbol';

}

.bg-light-green p {

    color: #ad0c1b;

    font-weight: 700;

    font-size: 22px;
    margin-top: 3px;

}

.ptb-10 {

    padding: 10px 0;

}

.bg-light-green .btn-orange {

    padding: 1px 27px;

    font-size: 25px!important;

    background-color: #6b4312!important;

    border-color: #6b4312!important;

    font-style: italic!important;

    font-weight: bold;

}

.bgdark-blue {

    background-color: #7b824e;

}



.ptb-10 {

    padding: 10px 0;

}

.table-bordered {

    border: none!important;

}

.table {

    margin-bottom: 0!important;

}

.mytble2 {

    background-color: #f1ebd3!important;

    font-size:15px;

    font-weight: 600;

    margin-bottom: 5px!important;

}

.mytble2 tr:nth-child(odd) {

    color: #7b824e;

}

.tb2-tr {

    background-color: #c5b78a!important;

}

.mytble2 td, .mytble2 th {

    border: 2px solid #7b824e!important;

    font-weight: bold!important;

    padding: 0px!important;

}

.tb2-tr th {

    color: #1f2a46;

}

.table-bordered th {

    color: #54345d;

}

.h2, h2 {

    font-size: 15px!important;

    font-weight: 700!important;

}









</style>
</head>
<body style="margin-left:0px;margin-right:0px;">

<div align="center">   
<span style="font-size: 35px!important;margin-top: 16px;font-weight: 700!important;font-family: kalam,cursive;color: #e2ae13;">Satta143.In</h2></a>
</div>
    <div class="" style="background-color:darkred !important">
        <div class="live ptb-10 italic">
            <h2 class="f-w-700">TOP 10 MOST SEARCHED USERS <br /> OF GUESSING FORM</h2>
        </div>
    </div>
    <div style="background-color:white !important;height:70px;">
    </div>
    <div class="" style="margin-top:0px;">
        <div class="liveCustom ptb-10" style="height:35px !important">
            <h4 style="font-size:medium !important" class="f-w-700">ALL TIME</h4>
        </div>
    </div>
     <div class="container-fluid">
<?php
// Step 1: Fetch the top 10 users by the count of their search entries
/*$ret = mysqli_query($con1, "
    SELECT users_id, COUNT(s_id) as user_count 
    FROM search 
    GROUP BY users_id 
    ORDER BY user_count DESC 
    LIMIT 10
");

// Step 2: Loop through the top 10 users and fetch additional details
while($rt = mysqli_fetch_assoc($ret)) {
    $users_id = $rt['users_id'];
    $user_count = $rt['user_count'];

    // Fetch user details from net_regestion table
    $sql1 = mysqli_query($con1, "SELECT * FROM net_regestion WHERE id = '$users_id'");
    $fgt = mysqli_fetch_assoc($sql1);
    
    // Display the user information
    ?>
    <div class="container-fluid">
        <div class="dayscustom" style="color:black;text-transform: uppercase;">
            <span><?php echo htmlspecialchars($fgt['username']); ?></span><br />
            <span>( <?php echo $user_count; ?> Times )</span>
        </div>
    </div>
    <?php
}*/
?>
<?php
// Fetch top 10 users by total search count (All Time) with a JOIN to get usernames
// Start timer
$start_time = microtime(true);
$ret = mysqli_query($con1, "
    SELECT s.users_id, nr.username, COUNT(s.s_id) AS user_count
    FROM search s
    LEFT JOIN net_regestion nr ON nr.id = s.users_id
    GROUP BY s.users_id
    ORDER BY user_count DESC
    LIMIT 10
");

// Loop through the results and display
while ($rt = mysqli_fetch_assoc($ret)) {
    $username = $rt['username'];
    $user_count = $rt['user_count'];
    ?>
    <div class="container-fluid">
        <div class="dayscustom" style="color:black;text-transform: uppercase;">
            <span><?php echo htmlspecialchars($username); ?></span><br />
            <span>( <?php echo $user_count; ?> Times )</span>
        </div>
    </div>
<?php

}
// End timer
$end_time = microtime(true);
$execution_time = $end_time - $start_time;
echo "<div style='text-align:center; margin-top:10px;'>Page execution time: " . round($execution_time, 4) . " seconds</div>";

?>



    </div>

    <style>

        .dayscustom {
            text-align: center;
            color: black;
            background-color: #eeeeee;
            border-bottom: 1px solid lightgray;
            font-style: normal;text-transform: uppercase";
            font-size: 12px;
        }

        .dayscustomalternate {
            text-align: center;
            color: black;
            background-color: white;
            border-bottom: 1px solid lightgray;
            font-style: normal;text-transform: uppercase";
            font-size: 12px;
        }

        .liveCustom {
            width: 100%;
            float: left;
            text-align: center;
            color: #fff;
            background-color: indianred;
        }
    </style>

    <div class="navbar">
        <div class="liveCustom ptb-10" style="height:35px !important">
            <h4 style="font-size:medium !important" class="f-w-700">Today</h4>
        </div>
    </div>
    <div class="container-fluid">
<?php
/*$ret1 = mysqli_query($con1, "
    SELECT users_id, COUNT(s_id) AS search_count 
    FROM search 
    WHERE date = '$today' 
    GROUP BY users_id 
    ORDER BY search_count DESC 
    LIMIT 10
");

while($rett1 = mysqli_fetch_assoc($ret1)) {
    $users_id1 = $rett1['users_id'];
    
    // Fetch user details from net_regestion table
    $sql11 = mysqli_query($con1, "SELECT * FROM net_regestion WHERE id = '$users_id1'");
    $fgt1 = mysqli_fetch_assoc($sql11);

    // Now you can directly use $rett1['search_count'] as needed
    ?>
    <div class="dayscustom" style="color:black;text-transform: uppercase;">
        <span><?php echo htmlspecialchars($fgt1['username']); ?></span><br />
        <span>( <?php echo $rett1['search_count']; ?> Times )</span>
    </div>
    <?php
}*/
?>
<?php
// Fetch top 10 users for today with usernames in a single query
$ret1 = mysqli_query($con1, "
    SELECT s.users_id, nr.username, COUNT(s.s_id) AS search_count
    FROM search s
    LEFT JOIN net_regestion nr ON nr.id = s.users_id
    WHERE s.date = '$today'
    GROUP BY s.users_id
    ORDER BY search_count DESC
    LIMIT 10
");

// Loop through the results and display
while ($rett1 = mysqli_fetch_assoc($ret1)) {
    $username = $rett1['username'];
    $search_count = $rett1['search_count'];
    ?>
    <div class="dayscustom" style="color:black;text-transform: uppercase;">
        <span><?php echo htmlspecialchars($username); ?></span><br />
        <span>( <?php echo $search_count; ?> Times )</span>
    </div>
<?php
}
?>


    
    
    <div class="navbar">
        <div class="liveCustom ptb-10" style="height:35px !important">
            <h4 style="font-size:medium !important" class="f-w-700">YesterDay</h4>
        </div>
    </div>
    
    <?php
// Fetch top 10 users for yesterday with usernames in a single query
$ret2 = mysqli_query($con1, "
    SELECT s.users_id, nr.username, COUNT(s.s_id) AS search_count
    FROM search s
    LEFT JOIN net_regestion nr ON nr.id = s.users_id
    WHERE s.date = '$yesterday'
    GROUP BY s.users_id
    ORDER BY search_count DESC
    LIMIT 10
");

// Loop through the results and display
while ($rett2 = mysqli_fetch_assoc($ret2)) {
    $username = $rett2['username'];
    $search_count = $rett2['search_count'];
    ?>
    <div class="container-fluid">
        <div class="dayscustom" style="color:black;text-transform: uppercase;">
            <span><?php echo htmlspecialchars($username); ?></span><br />
            <span>( <?php echo $search_count; ?> Times )</span>
        </div>
    </div>
<?php
}
?>


    <br>
   <center><div class="bdr-btm-white clr-white ptb-10">
        <button class="btn btn-primary btn-orange" onclick="window.location.href=window.location.href">Refresh</button>
    </div></center>


    <style>
        .table-bordered4 {
            border: 1px solid #dee2e6;
        }

        .mytble4 {
            font-size: 20px;
            font-weight: 600;
        }

        .table {
            margin-bottom: 0 !important;
            background-color: #fff7ed !important;
        }

        table.table.table-bordered4.mytble4.text-center.bg-33 tr:nth-child(1) th {
            color: #520b07 !important;
            font-weight: 700 !important;
            background-color: #fff7ed !important;
        }

        .mytble4 tr td, .mytble4 tbody tr th {
            border: 2px solid #37363c !important;
            background-color: #fff7ed !important;
        }

        .mytble4 tbody tr th, .mytble4 tr td {
            border: 2px solid #36373c !important;
            background-color: #fff7ed !important;
        }

        .mytble4 tbody tr th {
            font-weight: 700 !important;
            font-size: 15px;
        }

        table.table.table-bordered4.mytble4.text-center.bg-33 td {
            font-weight: 600 !important;
        }

        .mytble4 tr td, .mytble4 tbody tr th {
            border: 2px solid #37363c !important;
        }

        .mytble4 tbody tr th, .mytble4 tr td {
            border: 2px solid #36373c !important;
        }
    </style>

<style>
.fixed_menubar{
    display:block;
    width:100%;    background-color:#f2f2f2;
    border-top:1px solid #d9d9d9;
    height:68px;
    z-index:10;
    position:fixed;
    bottom:0;
}

.bottom_menus{
	width:25%;    
    float:left;
    cursor:pointer;
    text-align:center;
}
.bottom_menus>i{
    color:#bfbfbf;
    font-size:28px;
    padding:6px 0;
}
.bottom_menus>i:hover{
    color:#ff4d4d
}
.bottom_menus_title{
    color:#a6a6a6;
    font-weight:700;
    margin:0px 0 0 0;
    font-size:15px;
    font-family:myfont1;
	/* line-height:18px; */
	
}

.bb1{
	color:#133E8C;
}

@media only screen and (max-width:480px){
    .fixed_menubar{
        display:block;
        width:100%;        background-color:#f2f2f2;
        border-top:1px solid #d9d9d9;
        height:58px;
        z-index:10;
        position:fixed;
        bottom:0;
    }
	
    .bottom_menus{
        width:25%;    
        float:left;
        cursor:pointer;
        text-align:center;
    }
    .bottom_menus>img{
        
    }
    .bottom_menus_title{
        color:#a6a6a6;
        font-size:11px;
        font-family:myfont1;	
		line-height:12px;
    }
	.bb1{
		color:#133E8C;
	}
}

</style>
      <div class="fixed_menubar">
<a style="text-decoration:none;color:#003f6b !important" href="index.php">
<div class="bottom_menus">
<img src="/icon/home-grey.png" width="25" alt="satta-matka" style="margin:4px 0 0 0;"/>
<p class="bottom_menus_title ">Home</p>
</div>
</a>
         <a style="text-decoration:none;color:#003f6b !important" href="matka-guessing-forum.php">
            <div class="bottom_menus">
               <img src="/icon/guessing-forum-grey.png" width="25" alt="guessing-forum" style="margin:4px 0 0 0;"/>
               <p class="bottom_menus_title bb1">Guessing<br/>Forum</p>
            </div>
         </a>
		 
		 
         <a style="text-decoration:none;color:#003f6b !important" href="experts-forum.php">
            <div class="bottom_menus">
               <img src="/icon/experts-forum-grey.png" width="25" alt="experts-forum" style="margin:4px 0 0 0;"/>
               <p class="bottom_menus_title  ">Experts<br/>Forum</p>
            </div>
         </a>
         
		 <a style="text-decoration:none;color:#003f6b !important" href="javascript:void(0);" onclick="window.location.reload();">
         <div class="bottom_menus">
            <img src="icon/refresh2.png" width="25" alt="Refresh" style="margin:4px 0 0 0;"/>
            <p class="bottom_menus_title ">Refresh<br/>Page</p>
         </div>
         </a>
      </div><style>
.fixed_menubar{
    display:block;
    width:100%;    background-color:#f2f2f2;
    border-top:1px solid #d9d9d9;
    height:68px;
    z-index:10;
    position:fixed;
    bottom:0;
}

.bottom_menus{
	width:25%;    
    float:left;
    cursor:pointer;
    text-align:center;
}
.bottom_menus>i{
    color:#bfbfbf;
    font-size:28px;
    padding:6px 0;
}
.bottom_menus>i:hover{
    color:#ff4d4d
}
.bottom_menus_title{
    color:#a6a6a6;
    font-weight:700;
    margin:0px 0 0 0;
    font-size:15px;
    font-family:myfont1;
	/* line-height:18px; */
	
}

.bb1{
	color:#133E8C;
}

@media only screen and (max-width:480px){
    .fixed_menubar{
        display:block;
        width:100%;        background-color:#f2f2f2;
        border-top:1px solid #d9d9d9;
        height:58px;
        z-index:10;
        position:fixed;
        bottom:0;
    }
	
    .bottom_menus{
        width:25%;    
        float:left;
        cursor:pointer;
        text-align:center;
    }
    .bottom_menus>img{
        
    }
    .bottom_menus_title{
        color:#a6a6a6;
        font-size:11px;
        font-family:myfont1;	
		line-height:12px;
    }
	.bb1{
		color:#133E8C;
	}
}

</style>
      <div class="fixed_menubar">
<a style="text-decoration:none;color:#003f6b !important" href="index.php">
<div class="bottom_menus">
<img src="/icon/home-grey.png" width="25" alt="satta-matka" style="margin:4px 0 0 0;"/>
<p class="bottom_menus_title ">Home</p>
</div>
</a>
         <a style="text-decoration:none;color:#003f6b !important" href="matka-guessing-forum.php">
            <div class="bottom_menus">
               <img src="/icon/guessing-forum-grey.png" width="25" alt="guessing-forum" style="margin:4px 0 0 0;"/>
               <p class="bottom_menus_title bb1">Guessing<br/>Forum</p>
            </div>
         </a>
		 
		 
         <a style="text-decoration:none;color:#003f6b !important" href="experts-forum.php">
            <div class="bottom_menus">
               <img src="/icon/experts-forum-grey.png" width="25" alt="experts-forum" style="margin:4px 0 0 0;"/>
               <p class="bottom_menus_title  ">Experts<br/>Forum</p>
            </div>
         </a>
         
		 <a style="text-decoration:none;color:#003f6b !important" href="javascript:void(0);" onclick="window.location.reload();">
         <div class="bottom_menus">
            <img src="icon/refresh2.png" width="25" alt="Refresh" style="margin:4px 0 0 0;"/>
            <p class="bottom_menus_title ">Refresh<br/>Page</p>
         </div>
         </a>
      </div>
</body>
</html>