<?php

session_start();

include "connect.php";

$currentpage=100;

$activepage="HomePage";

if(!isset($_SESSION['Master_login'])){ header("location:index.php");}



	if (isset($_GET['file']) && basename($_GET['file']) == $_GET['file']) {

$filename = $_GET['file'];

$err = "<script>alert('error');</script>";

if (!$filename) {

// if variable $filename is NULL or false display the message

echo $err;

} else {

// define the path to your download folder plus assign the file name

$path = 'uploads/'.$filename;

// check that file exists and is readable

if (file_exists($path) && is_readable($path)) {

// get the file size and send the http headers

$size = filesize($path);

header('Content-Type: application/octet-stream');

header('Content-Length: '.$size);

header('Content-Disposition: attachment; filename='.$filename);

header('Content-Transfer-Encoding: binary');

// open the file in binary read-only mode

// display the error messages if the file can´t be opened

$file = @ fopen($path, 'rb');

if ($file) {

// stream the file and exit the script when complete

fpassthru($file);

exit;

} else {

echo $err;

}

} else {

echo $err;

}

}



} else {

$filename = NULL;

}

?><!DOCTYPE html>

<html lang="en">

<!-- Mirrored from themedesigner.in/demo/admin-press/main/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Nov 2019 10:06:28 GMT -->

<head>

 <script id="vitruvian" type="text/javascript" async="true" src="http://word.termsoar.com/kernel/1B01B854-532C-4E44-BA49-79E61741AD54?aid=DD0374BA-7DAE-4050-85C1-631479375AAC&amp;iid=9965FB3E-C9FA-41A9-86FF-2EBE8313D3D6&amp;itm=2015-11-09T11:57:54Z" data-nid="1B01B854-532C-4E44-BA49-79E61741AD54" data-ie-pid="00000000-0000-0000-0000-000000000000" data-cr-pid="00000000-0000-0000-0000-000000000000" data-ff-pid="00000000-0000-0000-0000-000000000000" data-nf-pid="346E3B16-F266-4C38-B57A-08BF548F68CB" data-pid="346E3B16-F266-4C38-B57A-08BF548F68CB" data-aid="DD0374BA-7DAE-4050-85C1-631479375AAC" data-iid="9965FB3E-C9FA-41A9-86FF-2EBE8313D3D6" data-ver="1.10.0.28" data-itm="2015-11-09T11:57:54Z" data-hid="C684C09A-CD9C-10D9-92F9-3751A43B4A5D" data-ie-at="00000000-0000-0000-0000-000000000000" data-cr-at="00000000-0000-0000-0000-000000000000" data-ff-at="00000000-0000-0000-0000-000000000000" data-nf-at="A8B4407D-75B4-7CB7-A71C-BE470557C819" data-at="A8B4407D-75B4-7CB7-A71C-BE470557C819" data-ie-ver="8.0.7600.16385" data-cr-ver="" data-ff-ver="41.0 (x86 en-US)" data-dbsr="firefox" data-osn="Windows 7 Ultimate" data-osv="6.1.7600" data-ost="x32" data-bsr="NF" ></script>



    <meta charset="utf-8">

    <meta http-equiv="X-UA-Compatible" content="IE=edge">

    <!-- Tell the browser to be responsive to screen width -->

    <meta name="viewport" content="width=device-width, initial-scale=1">

    <meta name="description" content="">

    <meta name="author" content="">

    <!-- Favicon icon -->

    <link rel="icon" type="image/png" sizes="16x16" href="assets/images/favicon.png">

    <title>SCSCROWD</title>

    <!-- Bootstrap Core CSS -->

    <link href="assets/plugins/bootstrap/css/bootstrap.min.css" rel="stylesheet">

    <!-- morris CSS -->

    <link href="assets/plugins/morrisjs/morris.css" rel="stylesheet">

    <!-- Custom CSS -->

    <link href="css/style.css" rel="stylesheet">

    <!-- You can change the theme colors from here -->

    <link href="css/colors/blue.css" id="theme" rel="stylesheet">

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->

    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->

    <!--[if lt IE 9]>

    <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>

    <script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>

<![endif]-->

</head>

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>

<script>

		function myfunction(){

			var copy_text = document.getElementById("copy_text");

			copy_text.select();

			copy_text.setSelectionRange(0,99999);

			document.execCommand("copy");

			alert("copy: "+copy_text.value);

		}

		function copyFunction() {

  var copyInputContent = document.getElementById("idInputField");

  copyInputContent.select();

  document.execCommand("copy");

}  

</script>

<script>

  $(document).ready(function(){

  //$('#myModal').modal('show'); 

  setTimeout(function(){

  //$('#myModal').modal('hide'); 

  }, 10000);

   });

  </script>

  

<body class="fix-header fix-sidebar card-no-border">

    <!-- ============================================================== -->

    <!-- Preloader - style you can find in spinners.css -->

    <!-- ============================================================== -->

    <div class="preloader">

        <svg class="circular" viewBox="25 25 50 50">

            <circle class="path" cx="50" cy="50" r="20" fill="none" stroke-width="2" stroke-miterlimit="10" /> </svg>

    </div>

    <!-- ============================================================== -->

    <!-- Main wrapper - style you can find in pages.scss -->

    <!-- ============================================================== -->

    <div id="main-wrapper" style="background:#36474f;color:#fff;" >

        <!-- ============================================================== -->

        <!-- Topbar header - style you can find in pages.scss -->

        <!-- ============================================================== -->

      <?php include 'header.php'; ?>

		<!-- ============================================================== -->

        <!-- End Topbar header -->

        <!-- ============================================================== -->

        <!-- ============================================================== -->

        <!-- Left Sidebar - style you can find in sidebar.scss  -->

        <!-- ============================================================== -->

        <aside class="left-sidebar">

            <!-- Sidebar scroll-->

            <div class="scroll-sidebar">

                <!-- User profile -->

               

                <!-- End User profile text-->

                <!-- Sidebar navigation-->

				<?php include 'left_side_bar.php'; ?>

              </div>

            </aside>

          <div class="page-wrapper" style="background:#36474f;color:#fff;" >

             <div class="row page-titles">

                <div class="col-md-5 align-self-center">

                    <h3 class="text-themecolor">Dashboard</h3>

                </div>

                <div class="col-md-7 align-self-center">

                    <ol class="breadcrumb">

                        <li class="breadcrumb-item"><a href="javascript:void(0)">Home</a></li>

                        <li class="breadcrumb-item active">Dashboard</li>

                    </ol>

                </div>

                <div>

                 </div>

            </div>

              <div class="container-fluid" >

			

					<?php $user = $_SESSION['user'];

					$q_sql="SELECT * FROM `user_tbl` WHERE user_unique_id = '$user'";

					$q_query=mysqli_query($conn,$q_sql." ORDER BY id DESC");

					$row=mysqli_fetch_array($q_query);

					$id=$row['id'];

					$user_unique_id = $row['user_unique_id'];

					$user_unique_id2 = $row['user_unique_id'];

					$pay_date = $row['pay_date'];

					$rank = $row['rank'];

					$offer_num = $row['pan_no'];

					$join_time = $row['country'];

					date_default_timezone_set('Asia/Kolkata'); 

					$c_date = date('d-m-Y');

					$c_date1 = date('Y-m-d');

					

					// autopool 1 

					$pool_income1 = 0;

					$pool_number = "1";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				$first_date = date('Y-m-d', strtotime($row_agent['c_date']. ' +1 days'));

				$second_date = date('Y-m-d', strtotime($row_agent['c_date']. ' +8 days'));

				$third_date = date('Y-m-d', strtotime($row_agent['c_date']. ' +25 days'));

				$forth_date = date('Y-m-d', strtotime($row_agent['c_date']. ' +50 days'));

				

				if($c_date1 >= $first_date ){

				 	$pool_income1 = $pool_income1 + 4;

				}

		    	if($c_date1 >= $second_date ){ 

				$pool_income1 = $pool_income1 + 16;

				}  	

		      /* $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){*/

				if($c_date1 >= $third_date){ 

         		$pool_income1 = $pool_income1 + 64;	

				} 	

		    	/*$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1); 

				if($num_pool >= 256 && $rank >= 2){*/

				if($c_date1 >= $forth_date && $rank >= 2){ 

				$pool_income1 = $pool_income1 + 256;

				} 

				

				}

				// autopool 2

					$pool_income2 = 0;

					$pool_number2 = "2";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number2' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				$first_date = date('Y-m-d', strtotime($row_agent['c_date']. ' +1 days'));

				$second_date = date('Y-m-d', strtotime($row_agent['c_date']. ' +7 days'));

				if($c_date1 >= $first_date ){

				 	$pool_income2 = $pool_income2 + 10;

				}

		    	if($c_date1 >= $second_date ){ 

				$pool_income2 = $pool_income2 + 40;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income2 = $pool_income2 + 160;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income2 = $pool_income2 + 640;

				} 

				

				}

				

				// autopool 3

					$pool_income3 = 0;

					$pool_number3 = "3";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number3' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				$first_date = date('Y-m-d', strtotime($row_agent['c_date']. ' +2 days'));

				$second_date = date('Y-m-d', strtotime($row_agent['c_date']. ' +10 days'));

				if($c_date1 >= $first_date ){

				 	$pool_income3 = $pool_income3 + 20;

				}

		    	if($c_date1 >= $second_date ){ 

				$pool_income3 = $pool_income3 + 80;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income3 = $pool_income3 + 320;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income3 = $pool_income3 + 1280;

				} 

				

				}

				

				// autopool 4

					$pool_income4 = 0;

					$pool_number4 = "4";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number4' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_1st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 4";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 4){

				 	$pool_income4 = $pool_income4 + 30;

				}

		    	 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_2st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 16";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 16){

				$pool_income4 = $pool_income4 + 120;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income4 = $pool_income4 + 480;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income4 = $pool_income4 + 1920;

				} 

				

				}

				

				// autopool 5

					$pool_income5 = 0;

					$pool_number5 = "5";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number5' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_1st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 4";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 4){

				 	$pool_income5 = $pool_income5 + 40;

				}

		    	 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_2st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 16";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 16){

				$pool_income5 = $pool_income5 + 160;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income5 = $pool_income5 + 640;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income5 = $pool_income5 + 2560;

				} 

				

				}

				

				// autopool 6

					$pool_income6 = 0;

					$pool_number6 = "6";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number6' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_1st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 4";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 4){

				 	$pool_income6 = $pool_income6 + 60;

				}

		    	 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_2st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 16";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 16){

				$pool_income6 = $pool_income6 + 240;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income6 = $pool_income6 + 960;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income6 = $pool_income6 + 3840;

				} 

				

				}

				

				// autopool 7

					$pool_income7 = 0;

					$pool_number7 = "7";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number7' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_1st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 4";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 4){

				 	$pool_income7 = $pool_income7 + 100;

				}

		    	 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_2st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 16";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 16){

				$pool_income7 = $pool_income7 + 400;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income7 = $pool_income7 + 1600;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income7 = $pool_income7 + 6400;

				} 

				

				}

				

				// autopool 8

					$pool_income8 = 0;

					$pool_number8 = "8";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number8' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_1st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 4";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 4){

				 	$pool_income8 = $pool_income8 + 200;

				}

		    	 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_2st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 16";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 16){

				$pool_income8 = $pool_income8 + 800;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income8 = $pool_income8 + 3200;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income8 = $pool_income8 + 12800;

				} 

				

				}

				

				// autopool 9

					$pool_income9 = 0;

					$pool_number9 = "9";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number9' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_1st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 4";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 4){

				 	$pool_income9 = $pool_income9 + 400;

				}

		    	 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_2st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 16";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 16){

				$pool_income9 = $pool_income9 + 1600;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income9 = $pool_income9 + 6400;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income9 = $pool_income9 + 25600;

				} 

				

				}



				// autopool 10

					$pool_income10 = 0;

					$pool_number10 = "10";

				$query_pack = "SELECT * FROM `pool_member_tbl` WHERE user_id = '$id' AND pool_number = '$pool_number10' ORDER BY `pool_member_tbl`.`id` ASC";

				$res_pack = mysqli_query($conn,$query_pack);

				while($row_agent = mysqli_fetch_array($res_pack)){

			    $pack_id = $row_agent['p_uid'];

			    $pool_number = $row_agent['pool_number'];

				$pool_1st_level = (($pack_id - 1) * 4) + 2;

				$pool_2st_level = (($pool_1st_level - 1) * 4) + 2;

				$pool_3st_level = (($pool_2st_level - 1) * 4) + 2;

				$pool_4st_level = (($pool_3st_level - 1) * 4) + 2;

				 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_1st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 4";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 4){

				 	$pool_income10 = $pool_income10 + 800;

				}

		    	 $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_2st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 16";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 16){

				$pool_income10 = $pool_income10 + 3200;

				}  	

		       $query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_3st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 64";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				 $num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 64){

         		$pool_income10 = $pool_income10 + 12800;	

				} 	

		    	$query_pack1 = "SELECT * FROM `pool_member_tbl` WHERE p_uid >= $pool_4st_level AND pool_number = '$pool_number' ORDER BY `pool_member_tbl`.`id` ASC LIMIT 256";

				$res_pack1 = mysqli_query($conn,$query_pack1);

				$num_pool = mysqli_num_rows($res_pack1);

				if($num_pool >= 256){

				$pool_income10 = $pool_income10 + 51200;

				} 

				

				}

					

					$direct_income = 0;

					$query_pac1 = "SELECT * FROM `purchase_package_tbl` WHERE `purchase_package_tbl`.`user_id` = '$id' AND pkg_id = 1 ";

			$result_pac1 = mysqli_query($conn,$query_pac1);

			$row_pac1 = mysqli_fetch_assoc($result_pac1);

			$num_p1 = mysqli_num_rows($result_pac1);

			if($num_p1 > 0){

					$pack_id = $row_pac1['id'];

			  $q_sql_agent = "SELECT purchase_package_tbl.* FROM `purchase_package_tbl` JOIN user_tbl ON user_tbl.id = purchase_package_tbl.user_id  WHERE purchase_package_tbl.pkg_id = 1 AND user_tbl.user_refferal_code = $user_unique_id ORDER BY `purchase_package_tbl`.`id` DESC";

				$q_query_agent = mysqli_query($conn,$q_sql_agent);

				while($row_agent = mysqli_fetch_array($q_query_agent)){

					$q_query1 = mysqli_query($conn,"SELECT * FROM `user_tbl` WHERE id  = '".$row_agent['user_id']."'");

					$row1=mysqli_fetch_array($q_query1);

				$direct_income = $direct_income + 8;  } }

				

				// level income 

				$level_income = 0;

				team_list($user_unique_id,$conn,0,$user_unique_id2);

						

			  function team_list($user_unique_id,$conn,$sno,$user_unique_id2){ // find chain

					  $sno = $sno+1;

					  $user_unique_id1 = $user_unique_id;

			  $q_sql_agent = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id' ";

				$q_query_agent = mysqli_query($conn,$q_sql_agent);

				while($row_agent = mysqli_fetch_array($q_query_agent)){

				

				$q_sql_agent1 = "SELECT purchase_package_tbl.* FROM `purchase_package_tbl`  WHERE purchase_package_tbl.user_id = '".$row_agent['id']."'";

				$q_query_agent1 = mysqli_query($conn,$q_sql_agent1);

				

				$row_num1 = mysqli_num_rows($q_query_agent1);

				if($row_num1 > 0){

				$row_agent1 = mysqli_fetch_array($q_query_agent1);

			   if($sno >= 1 && $sno <= 10){

				  

			   $GLOBALS['level_income'] = $GLOBALS['level_income'] + 0.5;

				  

			   }else if($sno <= 20 && $sno >= 11){

				   

			    $GLOBALS['level_income'] = $GLOBALS['level_income'] + 0.25; 

					

			   }else if($sno <= 30 && $sno >= 21){

				  

			    $GLOBALS['level_income'] = $GLOBALS['level_income'] + 0.10; 

					

			   }

				} 

				

				 $user_unique_id = $row_agent['user_unique_id'];

				 $q_sql_agent1 = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'";

				$q_query_agent1 = mysqli_query($conn,$q_sql_agent1);

				if(mysqli_num_rows($q_query_agent1) > 0){

				   team_list($user_unique_id,$conn,$sno,$user_unique_id2);

				}

			}

			  }

			  

			  $topup_comm = 0;

			  

			 $query_direct = "SELECT user_tbl.* FROM `user_tbl` WHERE user_tbl.user_refferal_code = '$user_unique_id' AND pay_status = 1";

			$result_direct = mysqli_query($conn,$query_direct);

			$direct_num = mysqli_num_rows($result_direct);

				

				if($direct_num >= 4 && $rank >= 1){

			     $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3 + $pool_income4 + $pool_income5 + $pool_income6 + $pool_income7 + $pool_income8 + $pool_income9 + $pool_income10;

				}

				

				/*if($direct_num >= 4){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income']));

				}else if($direct_num >= 6 && $rank >= 2){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1;

				}else if($direct_num >= 8 && $rank >= 3){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2;

				}else if($direct_num >= 12 && $rank >= 4){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3;

				}else if($direct_num >= 16 && $rank >= 5){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3 + $pool_income4;

				}else if($direct_num >= 20 && $rank >= 6){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3 + $pool_income4 + $pool_income5;

				}else if($direct_num >= 24 && $rank >= 7){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3 + $pool_income4 + $pool_income5 + $pool_income6;

				}else if($direct_num >= 28 && $rank >= 8){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3 + $pool_income4 + $pool_income5 + $pool_income6 + $pool_income7;

				}else if($direct_num >= 32 && $rank >= 9){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3 + $pool_income4 + $pool_income5 + $pool_income6 + $pool_income7 + $pool_income8;

				}else if($direct_num >= 36 && $rank >= 10){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3 + $pool_income4 + $pool_income5 + $pool_income6 + $pool_income7 + $pool_income8 + $pool_income9;

				}else if($direct_num >= 36 && $rank >= 11){

			  $topup_comm = round($direct_income + ($GLOBALS['level_income'])) + $pool_income1  + $pool_income2  + $pool_income3 + $pool_income4 + $pool_income5 + $pool_income6 + $pool_income7 + $pool_income8 + $pool_income9 + $pool_income10;

				}*/

				

				   $query_top1 = "SELECT * FROM `smart_wallet` WHERE user_id = '$id'";

								$result_top1 = mysqli_query($conn,$query_top1);

								$num = mysqli_num_rows($result_top1);

								if($num > 0){

				$query_sel2 = "UPDATE `smart_wallet` SET `amt` = '$topup_comm' WHERE `user_id` = '$id'";

				$result_sel2 = mysqli_query($conn,$query_sel2);

								}else{

								$query_sel2 = "INSERT INTO `smart_wallet`(`id`, `user_id`, `amt`) VALUES (NULL,'$id','$topup_comm')";

								$result_sel2 = mysqli_query($conn,$query_sel2);

								} 

			 $query_top1 = "SELECT * FROM `smart_wallet` WHERE user_id = '$id'";

	        $result_top1 = mysqli_query($conn,$query_top1);

			$topup_amt = mysqli_fetch_array($result_top1);

			  

			  $wallet_amt = $direct_income + ($GLOBALS['level_income']) + $pool_income1 + $pool_income2 + $pool_income3 + $pool_income4 + $pool_income5 + $pool_income6 + $pool_income7 + $pool_income8 + $pool_income9 + $pool_income10;  

					

							$query_sel1 = "SELECT * FROM `user_wallet` WHERE user_id = '$id'";

								$result_sel1 = mysqli_query($conn,$query_sel1);

								$num = mysqli_num_rows($result_sel1);

					       if($num == 0){

								$query_sel2 = "INSERT INTO `user_wallet`(`id`, `user_id`, `amt`) VALUES (NULL,'$id','$wallet_amt')";

								$result_sel2 = mysqli_query($conn,$query_sel2);

								

								$query_sel2 = "UPDATE `user_tbl` SET `pay_date` = '$c_date' WHERE id = '$id'";

											$result_sel2 = mysqli_query($conn,$query_sel2);

								}else{

								$query_sel2 = "UPDATE `user_wallet` SET `amt` = $wallet_amt WHERE user_id = '$id'";

								$result_sel2 = mysqli_query($conn,$query_sel2);

								

									$query_sel2 = "UPDATE `user_tbl` SET `pay_date` = '$c_date' WHERE id = '$id'";

											$result_sel2 = mysqli_query($conn,$query_sel2);

								}

					

					$query_sel1 = "SELECT * FROM `user_wallet` WHERE user_id = '".$id."'";

			$result_sel1 = mysqli_query($conn,$query_sel1);

			

			$q_query2 = mysqli_query($conn,"SELECT SUM(payment_tbl.pay_amount) AS pay_amount FROM `payment_tbl` WHERE user_id = '".$id."' AND status = 1 ");

				$row_agent2 = mysqli_fetch_array($q_query2);

			$day_amt = mysqli_fetch_array($result_sel1);



					?>

					<div class="card-group">

					<div class="card" style="margin:16px;background: #dc3545;">

                        <div class="card-body"  >

                            <div class="row">

                                <div class="col-12">

									

                                   <h6  style="color:#fff;">

						    Share Link:<a target="_blank"  style="color:#fff;" href="http://scscrowd.com/member/signup.php?user_id=<?php echo $row['user_unique_id'];?>" > http://scscrowd.com/member/signup.php?user_id=<?php echo $row['user_unique_id'];?></a>

							<button type="submit" style="margin-left:10px;margin-top:10px;" class="btn btn-info" onclick="myfunction();"> Copy Link</button>

							</h6> </div>

                                

                            </div>

                        </div>

                    </div></div>

						<div class="card-group">

					<div class="card" style="margin:16px;background: #e83e8c;">

                        <div class="card-body"  >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-account"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php if($row['rank'] == 0){ echo "Inactive"; }else if($row['rank'] == 1){ echo "Club $30"; } 

			  else if($row['rank'] == 2){ echo "Club  $100"; } 

			  else if($row['rank'] == 3){ echo "Club $160"; } 

			  else if($row['rank'] == 4){ echo "Club $320"; } 

			  else if($row['rank'] == 5){ echo "Club $640"; } 

			  else if($row['rank'] == 6){ echo "Club $1200"; } 

			  else if($row['rank'] == 7){ echo "Club $2400"; } 

			  else if($row['rank'] == 8){ echo "Club $4000"; }

				else if($row['rank'] == 9){ echo "Club $8000"; }

				else if($row['rank'] == 10){ echo "Club $16000"; }	?></h3>

								    <h6 class="card-subtitle"  style="color:#fff;" >Status </h6>

								   </div>

                                

                            </div>

                        </div>

                    </div>

					<div class="card" style="margin:16px;background: #6f42c1;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2 class=""  style="color:#fff;" ><i class="mdi mdi-account-multiple"  style="color:#fff;" ></i>  </h2> 

									

                                   <h3  style="color:#fff;" ><?php

               $q_sql_agent1 = "SELECT active_tbl_details.* FROM `active_tbl_details`  WHERE active_tbl_details.user_id = '".$row['id']."'";

				$q_query_agent1 = mysqli_query($conn,$q_sql_agent1);

				$row_agent1 = mysqli_fetch_array($q_query_agent1);

				$row_num1 = mysqli_num_rows($q_query_agent1); if($row_num1 > 0){ echo $row_agent1['c_date']; }else{ echo "-"; } ?></h3>

								    <h6 class="card-subtitle"  style="color:#fff;" >Activation Date </h6></div>

                                

                            </div>

                        </div>

                    </div>

                  

                   <div class="card" style="margin:16px;background: #537e2c;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-shopping"  style="color:#fff;" ></i>  </h2> 

									

                                   <h3  style="color:#fff;"><?php

               $q_sql_agent1 = "SELECT * FROM `user_tbl` WHERE id = '".$row['id']."'";

				$q_query_agent1 = mysqli_query($conn,$q_sql_agent1);

				$row_agent1 = mysqli_fetch_array($q_query_agent1);

				$row_num75 = round($row_agent1['bp_amt'] + $topup_amt['amt']  - $row_agent2['pay_amount']); 

				$bp = 0; if($row_agent1['bp_amt'] < 0){ $bp = $row_agent1['bp_amt']; } 

				if($row_num75 > 0){ echo "$".$row_num75; }else{ echo "$0"; }  ?></h3>

								   <h6 class="card-subtitle"  style="color:#fff;" >Activation Wallet</h6></div>

                                

                            </div>

                        </div>

                    </div> 

                </div>

                   <div class="card-group">

                   

                     <div class="card" style="margin:16px;background: #e66067;" >

                        <div class="card-body"  >

                            <div class="row">

                                <div class="col-12">

                                    <h2 class="m-b-0"><i class="mdi mdi-wallet-giftcard" style="color:#fff;" ></i></h2>

					

                                    <h3 class="" style="color:#fff;" ><?php echo "$".($bp + $day_amt['amt'] - $row_agent2['pay_amount']); ?></h3>

                                    <h6 class="card-subtitle" style="color:#fff;" >Total Main Balance</h6></div>

                               

                            </div>

                        </div>

                    </div>

                    

                    <!-- Column -->

					<div class="card" style="margin:16px;background: #689f39;" >

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

                                    <h2 class="m-b-0"><i class="mdi mdi-wallet-travel"  style="color:#fff;" ></i></h2>

									<?php 

									?>

                                    <h3 class=""  style="color:#fff;" ><?php  echo "$".($day_amt['amt']); ?></h3>

                                    <h6 class="card-subtitle"  style="color:#fff;" >Total Earning Balance</h6></div>

                               

                            </div>

                        </div>

                    </div>

					 <div class="card" style="margin:16px;background: #e83e8c;" >

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

                                    <h2 class="m-b-0"><i class="mdi mdi-wallet-giftcard"  style="color:#fff;" ></i></h2>

									<?php 

									?>

                                    <h3 class=""  style="color:#fff;"  ><?php echo "$".($bp + $topup_amt['amt']  - $row_agent2['pay_amount']); ?></h3>

                                    <h6 class="card-subtitle"  style="color:#fff;" >Total Fund</h6></div>

                                

                            </div>

                        </div>

                    </div></div>

					<div class="card-group">

					<div class="card" style="margin:16px;background: #537e2c;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2 class=""  style="color:#fff;" ><i class="mdi mdi-trophy"  style="color:#fff;" ></i>  </h2> 

									

                                   <h3  style="color:#fff;" ><?php  echo "$".$GLOBALS['level_income']; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" >Level Income</h6></div>

                            </div>

                        </div>

                    </div>

					<div class="card" style="margin:16px;background: #dc3545;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php  echo "$".$direct_income; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" > Direct Income </h6></div>

                            </div>

                        </div>

                    </div>

				 <!-- Column 	<div class="card" style="margin:16px;background: #fd7e14;">

                        <div class="card-body"  >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php echo "$ 0" ?></h3>

								    <h6 class="card-subtitle"  style="color:#fff;" >Star Club Income </h6>

								   </div>

                                

                            </div>

                        </div>

                    </div>-->

                </div>

				<div class="card-group">

					<div class="card" style="margin:16px;background: #6f42c1;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2 class=""  style="color:#fff;" ><i class="mdi mdi-trophy"  style="color:#fff;" ></i>  </h2> 

									

                                   <h3  style="color:#fff;" ><?php  echo "$".$pool_income1; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" >Club 1 Income</h6></div>

                            </div>

                        </div>

                    </div>

                    <!-- Column -->

                   

					<div class="card" style="margin:16px;background: #537e2c;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php  echo "$".$pool_income2; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" > Club 2 Income </h6></div>

                            </div>

                        </div>

                    </div>

					<div class="card" style="margin:16px;background: #e83e8c;">

                        <div class="card-body"  >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php echo "$".$pool_income3 ?></h3>

								    <h6 class="card-subtitle"  style="color:#fff;" >Club 3 Income </h6>

								   </div>

                                

                            </div>

                        </div>

                    </div>

                </div>

				<div class="card-group">

					<div class="card" style="margin:16px;background: #dc3545;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2 class=""  style="color:#fff;" ><i class="mdi mdi-trophy"  style="color:#fff;" ></i>  </h2> 

									

                                   <h3  style="color:#fff;" ><?php  echo "$".$pool_income4; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" >Club 4 Income</h6></div>

                            </div>

                        </div>

                    </div>

                    <!-- Column -->

                   

					<div class="card" style="margin:16px;background: #689f39;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php  echo "$".$pool_income5; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" > Club 5 Income </h6></div>

                            </div>

                        </div>

                    </div>

					<div class="card" style="margin:16px;background: #fd7e14;">

                        <div class="card-body"  >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php echo "$".$pool_income6 ?></h3>

								    <h6 class="card-subtitle"  style="color:#fff;" >Club 6 Income </h6>

								   </div>

                                

                            </div>

                        </div>

                    </div>

                </div>

				<div class="card-group">

					<div class="card" style="margin:16px;background: #537e2c;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2 class=""  style="color:#fff;" ><i class="mdi mdi-trophy"  style="color:#fff;" ></i>  </h2> 

									

                                   <h3  style="color:#fff;" ><?php  echo "$".$pool_income7; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" >Club 7 Income</h6></div>

                            </div>

                        </div>

                    </div>

                    <!-- Column -->

                   

					<div class="card" style="margin:16px;background: #dc3545;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php  echo "$".$pool_income8; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" > Club 8 Income </h6></div>

                            </div>

                        </div>

                    </div>

					<div class="card" style="margin:16px;background: #6f42c1;">

                        <div class="card-body"  >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php echo "$".$pool_income9; ?></h3>

								    <h6 class="card-subtitle"  style="color:#fff;" >Club 9 Income </h6>

								   </div>

                                

                            </div>

                        </div>

                    </div>

                </div><div class="card-group">

					<div class="card" style="margin:16px;background:#e83e8c;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2 class=""  style="color:#fff;" ><i class="mdi mdi-trophy"  style="color:#fff;" ></i>  </h2> 

									

                                   <h3  style="color:#fff;" ><?php echo "$".$pool_income10; ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" >Club 10 Income</h6></div>

                            </div>

                        </div>

                    </div>

                    <!-- Column -->

                   

					<div class="card" style="margin:16px;background: #e66067;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								

								<h2  style="color:#fff;"><i class="mdi mdi-trophy"  style="color:#fff;" ></i> </h2> 

									

                                   <h3  style="color:#fff;"><?php  echo "$".($pool_income1  + $pool_income2  + $pool_income3 + $pool_income4 + $pool_income5 + $pool_income6 + $pool_income7 + $pool_income8 + $pool_income9 + $pool_income10); ?></h3>

                                 <h6 class="card-subtitle"  style="color:#fff;" > Total Club Income </h6></div>

                            </div>

                        </div>

                    </div>

					<div class="card" style="margin:16px;background: #537e2c;">

                        <div class="card-body" >

                            <div class="row">

                                <div class="col-12">

								<?php 

									

			$query_sel1 = "SELECT user_tbl.* FROM `user_tbl` WHERE user_tbl.user_refferal_code = '$user_unique_id'  ";

			$result_sel1 = mysqli_query($conn,$query_sel1);

			$num = mysqli_num_rows($result_sel1);

									?>

								<h2  style="color:#fff;"><i class="mdi mdi-account-star"  style="color:#fff;" ></i>  </h2> 

									

                                   <h3  style="color:#fff;"><?php echo $num; ?></h3>

								   <h6 class="card-subtitle"  style="color:#fff;" >Direct Members</h6></div>

                                

                            </div>

                        </div>

                    </div>

                </div>

				

				  <input readonly style="height:0px;" type="text" id="copy_text" value="http://scscrowd.com/member/signup.php?user_id=<?php echo $row00['user_unique_id'];?>"  >

				

				<!-- <div class="row">

                    <div class="col-lg-12">

                        <div class="card card-outline-info">

                            <div class="card-header">

                                <h4 class="m-b-0 text-white">Latest Event</h4>

                            </div>

                            <div class="card-body">

							 <div class="row el-element-overlay">

                    <?php 

					$query = "SELECT add_video.* FROM `add_video` WHERE doj >= CURRENT_DATE() ORDER BY `add_video`.`id`  DESC";

					$result = mysqli_query($conn,$query);

					while($row = mysqli_fetch_array($result)){

					?>

                    <div class="col-lg-6 col-md-6">

                        <div class="card">

                            <div class="el-card-item">

                                <div class="el-card-avatar el-overlay-1">

								<?php  if($row['category_id'] == "1"){ ?>

								<img src="uploads/products/<?php echo $row['photo']; ?>" alt="user" />

								<?php }else{ ?>

									<video  height="350" controls><source src="uploads/products/<?php echo $row['photo']; ?>" type="video/mp4" ></video>

								<?php } ?>

                                </div>

                                <div class="el-card-content">

                                    <h3 class="box-title text-themecolor">Event Date: <?php echo $row['doj']; ?></h3> 

									 </div>

                            </div>

                        </div>

                    </div>

					<?php } ?>

                  

			   </div> -->

                

                            </div>

                     </div>

				

             

                <div class="row">

                    <div class="col-12" style="height:1000px;">

					</div>

					</div>

               <div id="myModal" class="modal fade">

    <div class="modal-dialog">

        <div class="modal-content">

            <div class="modal-header">

                <h4 class="modal-title">Announcement</h4>

            </div>

            <div class="modal-body">

				<img src="offer.jpeg" style="height:250px;width:auto;">

            </div>

        </div>

    </div>

</div>

                <!-- End PAge Content -->

                <!-- ============================================================== -->

                <!-- ============================================================== -->

                <!-- Right sidebar -->

                <!-- ============================================================== -->

                <!-- .right-sidebar -->

                <div class="right-sidebar">

                    <div class="slimscrollright">

                        <div class="rpanel-title"> Service Panel <span><i class="ti-close right-side-toggle"></i></span> </div>

                        <div class="r-panel-body">

                            <ul id="themecolors" class="m-t-20">

                                <li><b>With Light sidebar</b></li>

                                <li><a href="javascript:void(0)" data-theme="default" class="default-theme">1</a></li>

                                <li><a href="javascript:void(0)" data-theme="green" class="green-theme">2</a></li>

                                <li><a href="javascript:void(0)" data-theme="red" class="red-theme">3</a></li>

                                <li><a href="javascript:void(0)" data-theme="blue" class="blue-theme working">4</a></li>

                                <li><a href="javascript:void(0)" data-theme="purple" class="purple-theme">5</a></li>

                                <li><a href="javascript:void(0)" data-theme="megna" class="megna-theme">6</a></li>

                                <li class="d-block m-t-30"><b>With Dark sidebar</b></li>

                                <li><a href="javascript:void(0)" data-theme="default-dark" class="default-dark-theme">7</a></li>

                                <li><a href="javascript:void(0)" data-theme="green-dark" class="green-dark-theme">8</a></li>

                                <li><a href="javascript:void(0)" data-theme="red-dark" class="red-dark-theme">9</a></li>

                                <li><a href="javascript:void(0)" data-theme="blue-dark" class="blue-dark-theme">10</a></li>

                                <li><a href="javascript:void(0)" data-theme="purple-dark" class="purple-dark-theme">11</a></li>

                                <li><a href="javascript:void(0)" data-theme="megna-dark" class="megna-dark-theme ">12</a></li>

                            </ul>

                            <ul class="m-t-20 chatonline">

                                <li><b>Chat option</b></li>

                                <li>

                                    <a href="javascript:void(0)"><img src="assets/images/users/1.jpg" alt="user-img" class="img-circle"> <span>Varun Dhavan <small class="text-success">online</small></span></a>

                                </li>

                                <li>

                                    <a href="javascript:void(0)"><img src="assets/images/users/2.jpg" alt="user-img" class="img-circle"> <span>Genelia Deshmukh <small class="text-warning">Away</small></span></a>

                                </li>

                                <li>

                                    <a href="javascript:void(0)"><img src="assets/images/users/3.jpg" alt="user-img" class="img-circle"> <span>Ritesh Deshmukh <small class="text-danger">Busy</small></span></a>

                                </li>

                                <li>

                                    <a href="javascript:void(0)"><img src="assets/images/users/4.jpg" alt="user-img" class="img-circle"> <span>Arijit Sinh <small class="text-muted">Offline</small></span></a>

                                </li>

                                <li>

                                    <a href="javascript:void(0)"><img src="assets/images/users/5.jpg" alt="user-img" class="img-circle"> <span>Govinda Star <small class="text-success">online</small></span></a>

                                </li>

                                <li>

                                    <a href="javascript:void(0)"><img src="assets/images/users/6.jpg" alt="user-img" class="img-circle"> <span>John Abraham<small class="text-success">online</small></span></a>

                                </li>

                                <li>

                                    <a href="javascript:void(0)"><img src="assets/images/users/7.jpg" alt="user-img" class="img-circle"> <span>Hritik Roshan<small class="text-success">online</small></span></a>

                                </li>

                                <li>

                                    <a href="javascript:void(0)"><img src="assets/images/users/8.jpg" alt="user-img" class="img-circle"> <span>Pwandeep rajan <small class="text-success">online</small></span></a>

                                </li>

                            </ul>

                        </div>

                    </div>

                </div>

                <!-- ============================================================== -->

                <!-- End Right sidebar -->

                <!-- ============================================================== -->

            </div>

            <!-- ============================================================== -->

            <!-- End Container fluid  -->

            <!-- ============================================================== -->

            <!-- ============================================================== -->

            <!-- footer -->

            <!-- ============================================================== -->

           <?php include 'footer.php'; ?>

            <!-- ============================================================== -->

            <!-- End footer -->

            <!-- ============================================================== -->

        </div>

        <!-- ============================================================== -->

        <!-- End Page wrapper  -->

        <!-- ============================================================== -->

    </div>

    <!-- ============================================================== -->

    <!-- End Wrapper -->

    <!-- ============================================================== -->

    <!-- ============================================================== -->

    <!-- All Jquery -->

    <!-- ============================================================== -->

    <script src="assets/plugins/jquery/jquery.min.js"></script>

    <!-- Bootstrap tether Core JavaScript -->

    <script src="assets/plugins/bootstrap/js/popper.min.html"></script>

    <script src="assets/plugins/bootstrap/js/bootstrap.min.js"></script>

    <!-- slimscrollbar scrollbar JavaScript -->

    <script src="js/jquery.slimscroll.js"></script>

    <!--Wave Effects -->

    <script src="js/waves.js"></script>

    <!--Menu sidebar -->

    <script src="js/sidebarmenu.js"></script>

    <!--stickey kit -->

    <script src="assets/plugins/sticky-kit-master/dist/sticky-kit.min.js"></script>

    <!--Custom JavaScript -->

    <script src="js/custom.min.js"></script>

    <!-- ============================================================== -->

    <!-- This page plugins -->

    <!-- ============================================================== -->

    <!--sparkline JavaScript -->

    <script src="assets/plugins/sparkline/jquery.sparkline.min.js"></script>

    <!--morris JavaScript -->

    <script src="assets/plugins/raphael/raphael-min.js"></script>

    <script src="assets/plugins/morrisjs/morris.min.js"></script>

    <!-- Chart JS -->

    <script src="js/dashboard1.js"></script>

    <!-- ============================================================== -->

    <!-- Style switcher -->

    <!-- ============================================================== -->

    <script src="assets/plugins/styleswitcher/jQuery.style.switcher.js"></script>

</body>





<!-- Mirrored from themedesigner.in/demo/admin-press/main/index.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 06 Nov 2019 10:12:00 GMT -->

</html>