<?php
session_start();
include "connect.php";
$currentpage=100;
$activepage="HomePage";
if(!isset($_SESSION['Master_login'])){ header("location:index.php");}
$users = $_SESSION['user'];
$q_sql00="SELECT * FROM `user_tbl` WHERE user_name = '$users'";
$q_query00=mysqli_query($conn,$q_sql00." ORDER BY id DESC");
$row00=mysqli_fetch_array($q_query00);
$co1 = 0;
function team_list($user_unique_id,$conn,$sno,$user_unique_id2){ // find chain
					 
			  $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)){
				 $user_unique_id = $row_agent['user_unique_id'];
		
				 if($user_unique_id == $user_unique_id2){
					$GLOBALS['co1'] = $GLOBALS['co1'] + 1;
				 }
				 
				 $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);
				}
			}
			  }

	if(isset($_POST['Submit'])){
    date_default_timezone_set('Asia/Kolkata'); 
		
	$c_date = date('d-m-Y');
	$c_time = date('h:i a');
	$send_id1 = $_POST['send_id'];
	$receive_id = $_POST['receive_id'];
	$pay_amount = $_POST['pay_amount'];
	$pay_mode = $_POST['pay_mode'];
	 
	$res = mysqli_query($conn,"SELECT * FROM `user_tbl`  WHERE user_unique_id  = '$send_id1'");
	$row_user = mysqli_fetch_assoc($res);
	$num_user = mysqli_num_rows($res);
	$send_id = $row_user['id'];
	$member_rank = $row_user['rank'];
	$user_refferal_code = $row_user['user_refferal_code'];

	
	$earn_wallet = 0;
	if($pay_mode == "1"){
		$q_sql_select = "SELECT * FROM `smart_wallet` WHERE user_id = '".$row00['id']."'";
		$q_query_select = mysqli_query($conn,$q_sql_select);
		$row_select = mysqli_fetch_assoc($q_query_select);
		
		$q_query2 = mysqli_query($conn,"SELECT SUM(payment_tbl.pay_amount) AS pay_amount FROM `payment_tbl` WHERE user_id = '".$row00['id']."' AND status = 1 ");
		$row_agent2 = mysqli_fetch_array($q_query2);
				
		$earn_wallet = $row_select['amt'] - $row_agent2['pay_amount'];
	}else{
	  $q_sql_select = "SELECT * FROM `user_wallet` WHERE user_id = '".$row00['id']."'";
	  $q_query_select = mysqli_query($conn,$q_sql_select);
		$row_select = mysqli_fetch_assoc($q_query_select);
		$earn_wallet = $row_select['amt'];
	 }
	
	
	$q_pack = "SELECT * FROM `purchase_package_tbl` WHERE user_id = '$send_id' AND pkg_id = '$receive_id'";
	$res_pack = mysqli_query($conn,$q_pack);
	$num_pack = mysqli_num_rows($res_pack);
	
	team_list($row00['user_unique_id'],$conn,0,$send_id1);
	 
	if($num_user > 0){ // check user
	
	if($num_pack == 0){ // check package
		
		if($member_rank + 1 == $receive_id){ // check skip package
			
	if($earn_wallet >= $pay_amount){
		if( $GLOBALS['co1'] > 0 || $row00['user_unique_id'] == $send_id1){
		if($receive_id == "1"){
	$q_sql_update = "INSERT INTO `active_tbl_details`(`id`, `user_id`, `c_date`, `c_time`) VALUES 
	(NULL,'$send_id','$c_date','$c_time')";
	$q_query_update = mysqli_query($conn,$q_sql_update); 
	
	$q_sql_update1 = "UPDATE `user_tbl` SET `pay_status` = '1',`rank` = '1' WHERE id = '$send_id'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	
	$q_sql_update11 = "INSERT INTO `purchase_package_tbl`(`id`, `user_id`, `c_date`, `c_time`, `amt`, `pkg_id`, `topup_by`) 
	VALUES (NULL,'$send_id','$c_date','$c_time','$pay_amount','$receive_id','".$row00['id']."')";
	$q_query_update11 = mysqli_query($conn,$q_sql_update11);
	// royalty commission
	$res_reff = mysqli_query($conn,"SELECT user_tbl.* FROM `user_tbl` JOIN active_tbl_details ON active_tbl_details.user_id = user_tbl.id  WHERE user_tbl.user_unique_id  = '$user_refferal_code'");
	$row_reff = mysqli_fetch_assoc($res_reff);
	$num_reff = mysqli_num_rows($res_reff);
	if($num_reff > 0){
	if(date('Y-m-d') <= date('Y-m-d',strtotime('+ 3 days',strtotime($row_reff['c_date'])))){
	$res_direct = mysqli_query($conn,"SELECT user_tbl.* FROM `user_tbl` JOIN active_tbl_details ON active_tbl_details.user_id = user_tbl.id  WHERE user_tbl.user_refferal_code  = '".$row_reff['user_unique_id']."'");
	$row_direct = mysqli_fetch_assoc($res_direct);
	$num_direct = mysqli_num_rows($res_direct);
	if($num_direct >= 10){
	 $q_sql_update1 = "UPDATE `user_tbl` SET `rank_date` = '$c_date',`royalty_rank` = '1' WHERE id = '".$row_reff['id']."'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	} 
	} else if(date('Y-m-d') <= date('Y-m-d',strtotime('+ 7 days',strtotime($row_reff['c_date'])))){
	$res_direct = mysqli_query($conn,"SELECT user_tbl.* FROM `user_tbl` JOIN active_tbl_details ON active_tbl_details.user_id = user_tbl.id  WHERE user_tbl.user_refferal_code  = '".$row_reff['user_unique_id']."'");
	$row_direct = mysqli_fetch_assoc($res_direct);
	$num_direct = mysqli_num_rows($res_direct);
	if($num_direct >= 25){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank_date2` = '$c_date',`royalty_rank` = '2' WHERE id = '".$row_reff['id']."'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	}
	
	}else if(date('Y-m-d') <= date('Y-m-d',strtotime('+ 15 days',strtotime($row_reff['c_date'])))){
	$res_direct = mysqli_query($conn,"SELECT user_tbl.* FROM `user_tbl` JOIN active_tbl_details ON active_tbl_details.user_id = user_tbl.id  WHERE user_tbl.user_refferal_code  = '".$row_reff['user_unique_id']."'");
	$row_direct = mysqli_fetch_assoc($res_direct);
	$num_direct = mysqli_num_rows($res_direct);
	if($num_direct >= 40){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank_date3` = '$c_date',`royalty_rank` = '3' WHERE id = '".$row_reff['id']."'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	}
	
	}else if(date('Y-m-d') <= date('Y-m-d',strtotime('+ 25 days',strtotime($row_reff['c_date'])))){
	$res_direct = mysqli_query($conn,"SELECT user_tbl.* FROM `user_tbl` JOIN active_tbl_details ON active_tbl_details.user_id = user_tbl.id  WHERE user_tbl.user_refferal_code  = '".$row_reff['user_unique_id']."'");
	$row_direct = mysqli_fetch_assoc($res_direct);
	$num_direct = mysqli_num_rows($res_direct);
	if($num_direct >= 70){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank_date3` = '$c_date',`royalty_rank` = '4' WHERE id = '".$row_reff['id']."'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	}
	
	}  
	

	
	}
	// royalty commission
		}else if($receive_id == "2"){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank` = '2' WHERE id = '$send_id'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	
	$q_sql_update11 = "INSERT INTO `purchase_package_tbl`(`id`, `user_id`, `c_date`, `c_time`, `amt`, `pkg_id`, `topup_by`) 
	VALUES (NULL,'$send_id','$c_date','$c_time','$pay_amount','$receive_id','".$row00['id']."')";
	$q_query_update11 = mysqli_query($conn,$q_sql_update11);
	}else if($receive_id == "3"){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank` = '3' WHERE id = '$send_id'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	
	$q_sql_update11 = "INSERT INTO `purchase_package_tbl`(`id`, `user_id`, `c_date`, `c_time`, `amt`, `pkg_id`, `topup_by`) 
	VALUES (NULL,'$send_id','$c_date','$c_time','$pay_amount','$receive_id','".$row00['id']."')";
	$q_query_update11 = mysqli_query($conn,$q_sql_update11);
	}else if($receive_id == "4"){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank` = '4' WHERE id = '$send_id'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	
	$q_sql_update11 = "INSERT INTO `purchase_package_tbl`(`id`, `user_id`, `c_date`, `c_time`, `amt`, `pkg_id`, `topup_by`) 
	VALUES (NULL,'$send_id','$c_date','$c_time','$pay_amount','$receive_id','".$row00['id']."')";
	$q_query_update11 = mysqli_query($conn,$q_sql_update11);
	}else if($receive_id == "5"){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank` = '5' WHERE id = '$send_id'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	
	$q_sql_update11 = "INSERT INTO `purchase_package_tbl`(`id`, `user_id`, `c_date`, `c_time`, `amt`, `pkg_id`, `topup_by`) 
	VALUES (NULL,'$send_id','$c_date','$c_time','$pay_amount','$receive_id','".$row00['id']."')";
	$q_query_update11 = mysqli_query($conn,$q_sql_update11);
	}else if($receive_id == "6"){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank` = '6' WHERE id = '$send_id'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	
	$q_sql_update11 = "INSERT INTO `purchase_package_tbl`(`id`, `user_id`, `c_date`, `c_time`, `amt`, `pkg_id`, `topup_by`) 
	VALUES (NULL,'$send_id','$c_date','$c_time','$pay_amount','$receive_id','".$row00['id']."')";
	$q_query_update11 = mysqli_query($conn,$q_sql_update11);
	}else if($receive_id == "7"){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank` = '7' WHERE id = '$send_id'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	
	$q_sql_update11 = "INSERT INTO `purchase_package_tbl`(`id`, `user_id`, `c_date`, `c_time`, `amt`, `pkg_id`, `topup_by`) 
	VALUES (NULL,'$send_id','$c_date','$c_time','$pay_amount','$receive_id','".$row00['id']."')";
	$q_query_update11 = mysqli_query($conn,$q_sql_update11);
	}else if($receive_id == "8"){
	$q_sql_update1 = "UPDATE `user_tbl` SET `rank` = '8' WHERE id = '$send_id'";
	$q_query_update1 = mysqli_query($conn,$q_sql_update1);
	
	$q_sql_update11 = "INSERT INTO `purchase_package_tbl`(`id`, `user_id`, `c_date`, `c_time`, `amt`, `pkg_id`, `topup_by`) 
	VALUES (NULL,'$send_id','$c_date','$c_time','$pay_amount','$receive_id','".$row00['id']."')";
	$q_query_update11 = mysqli_query($conn,$q_sql_update11);
	}
	
	if($pay_mode == "1"){
		$q_sql_update2 = "INSERT INTO `payment_tbl`(`user_id`, `pay_amount`, `c_date`, `status`) VALUES ('".$row00['id']."','$pay_amount','$c_date',1)";
	}else{
	$q_sql_update2 = "UPDATE `user_wallet` SET `amt` = amt - $pay_amount WHERE user_id = '".$row00['id']."'";
	}
	$q_query_update2 = mysqli_query($conn,$q_sql_update2);
	
if($q_query_update11){
		 echo "<script>alert('Payment successful!');   window.location = 'purchase_package.php'; </script>";		
				//header("location:home.php");			
		}else{
		 echo "<script>alert('Error!');   window.location = 'purchase_package.php'; </script>";		 
		}
		
		}else{
		 echo "<script>alert('can not topup to cross member!');   window.location = 'purchase_package.php'; </script>";		 
		} // check cross member
		
		}else{
		 echo "<script>alert('Insufficient balance!');   window.location = 'purchase_package.php'; </script>";		 
		}
		
		}else{
		 echo "<script>alert('Member can not skip package');   window.location = 'purchase_package.php'; </script>";		 
		}
		
		}else{
		 echo "<script>alert('Member already bought this package');   window.location = 'purchase_package.php'; </script>";		 
		}
		
		}else{
		 echo "<script>alert('Member dose not exist');   window.location = 'purchase_package.php'; </script>";		 
		}
		
}


?><!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>Right Choices</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>
$(document).ready(function(){
    $("#send_id").keyup(function(){
       var txt = $("#send_id").val();
	   if(txt !="" ){
      $.post("fetch_ajax_value.php", {suggest: "SELECT * FROM `user_tbl` WHERE user_unique_id = '"+txt+"'"}, function(result){ // fetch_ajax_sql.php
           $("#send_name").val(result);
       });
	   }
   });
   });
</script>   
<script>
function change(send_id,receive_id,pay_amount){
  $('#myModal').modal('show'); 
  $("#send_id").val(send_id);
	 $("#receive_id").val(receive_id);
	 $("#pay_amount").val(pay_amount);
	  var txt = $("#send_id").val();
	   if(txt !="" ){
      $.post("fetch_ajax_value.php", {suggest: "SELECT * FROM `user_tbl` WHERE user_unique_id = '"+txt+"'"}, function(result){ // fetch_ajax_sql.php
           $("#send_name").val(result);
       });
	   }
}
/*  $(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">
        <!-- ============================================================== -->
        <!-- 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">
             <div class="row page-titles">
                <div class="col-md-5 align-self-center">
                    <h3 class="text-themecolor">Purchase Package</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">Purchase Package</li>
                    </ol>
                </div>
                <div>
                 </div>
            </div>
              <div class="container-fluid">
                 
                 <div class="card-group">
					<div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-12">
								<?php 
									
			/*$query_sel1 = "SELECT * FROM `user_tbl` WHERE id > '$id' AND pay_status = 1";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			$num = mysqli_num_rows($result_sel1);*/
									?>
								<h2 class="text-success"><i class="mdi mdi-shopping text-success"></i> Package </h2> 
									
                                   <h3 class="text-purple" ><i class="mdi mdi-currency-inr text-purple"></i> 555</h3>
								<?php  $q_sql_select5 = "SELECT * FROM `user_tbl` WHERE id = '".$row00['id']."'";
										$q_query_select5 = mysqli_query($conn,$q_sql_select5);
									$row_select = mysqli_fetch_assoc($q_query_select5); 
									$num = mysqli_num_rows($q_query_select5);
									//if($row_select['rank_date'] == ""){
									?>
	<a class="btn btn-info"  href="#" onclick="change(<?php echo "'".$row00['user_unique_id']."','1','555'"; ?>);" ><i class="fa fa-check"></i>Purchase Package</a></div>
                                
                            </div>
                        </div>
                    </div>
                    <!-- Column -->
                   <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-12">
								<?php 
									
			/*$query_sel1 = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'  AND pay_status = 1";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			$num = mysqli_num_rows($result_sel1);*/
									?>
								<h2 class="text-success"><i class="mdi mdi-shopping text-success"></i> Package </h2> 
									
                                   <h3 class="text-purple" ><i class="mdi mdi-currency-inr text-purple"></i> 1000</h3>
								   <a class="btn btn-info"  href="#" onclick="change(<?php echo "'".$row00['user_unique_id']."','2','1000'"; ?>);" ><i class="fa fa-check"></i>Purchase Package</a></div>
                                
                            </div>
                        </div>
                    </div>
                </div>
				 <div class="card-group">
					<div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-12">
								<?php 
									
			/*$query_sel1 = "SELECT * FROM `user_tbl` WHERE id > '$id' AND pay_status = 1";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			$num = mysqli_num_rows($result_sel1);*/
									?>
								<h2 class="text-success"><i class="mdi mdi-shopping text-success"></i> Package </h2> 
									
                                   <h3 class="text-purple" ><i class="mdi mdi-currency-inr text-purple"></i> 2000</h3>
								   <a class="btn btn-info"  href="#" onclick="change(<?php echo "'".$row00['user_unique_id']."','3','2000'"; ?>);" ><i class="fa fa-check"></i>Purchase Package</a></div>
                                
                            </div>
                        </div>
                    </div>
                    <!-- Column -->
                   <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-12">
								<?php 
									
			/*$query_sel1 = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'  AND pay_status = 1";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			$num = mysqli_num_rows($result_sel1);*/
									?>
								<h2 class="text-success"><i class="mdi mdi-shopping text-success"></i> Package </h2> 
									
                                   <h3 class="text-purple" ><i class="mdi mdi-currency-inr text-purple"></i> 3000</h3>
								   <a class="btn btn-info"  href="#" onclick="change(<?php echo "'".$row00['user_unique_id']."','4','3000'"; ?>);" ><i class="fa fa-check"></i>Purchase Package</a></div>
                                
                            </div>
                        </div>
                    </div>
                </div>
				<div class="card-group">
					<div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-12">
								<?php 
									
			/*$query_sel1 = "SELECT * FROM `user_tbl` WHERE id > '$id' AND pay_status = 1";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			$num = mysqli_num_rows($result_sel1);*/
									?>
								<h2 class="text-success"><i class="mdi mdi-shopping text-success"></i> Package </h2> 
									
                                   <h3 class="text-purple" ><i class="mdi mdi-currency-inr text-purple"></i> 5000</h3>
								  <a class="btn btn-info"  href="#" onclick="change(<?php echo "'".$row00['user_unique_id']."','5','5000'"; ?>);" ><i class="fa fa-check"></i>Purchase Package</a></div>
                                
                            </div>
                        </div>
                    </div>
                    <!-- Column -->
                   <div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-12">
								<?php 
									
			/*$query_sel1 = "SELECT * FROM `user_tbl` WHERE user_refferal_code = '$user_unique_id'  AND pay_status = 1";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			$num = mysqli_num_rows($result_sel1);*/
									?>
								<h2 class="text-success"><i class="mdi mdi-shopping text-success"></i> Package </h2> 
									
                                   <h3 class="text-purple" ><i class="mdi mdi-currency-inr text-purple"></i> 10000</h3>
								  <a class="btn btn-info"  href="#" onclick="change(<?php echo "'".$row00['user_unique_id']."','6','10000'"; ?>);" ><i class="fa fa-check"></i>Purchase Package</a></div>
                                
                            </div>
                        </div>
                    </div>
                </div>
				<div class="card-group">
					<div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-12">
								<?php 
									
			/*$query_sel1 = "SELECT * FROM `user_tbl` WHERE id > '$id' AND pay_status = 1";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			$num = mysqli_num_rows($result_sel1);*/
									?>
								<h2 class="text-success"><i class="mdi mdi-shopping text-success"></i> Package </h2> 
									
                                   <h3 class="text-purple" ><i class="mdi mdi-currency-inr text-purple"></i> 20000</h3>
								   <a class="btn btn-info"  href="#" onclick="change(<?php echo "'".$row00['user_unique_id']."','7','20000'"; ?>);" ><i class="fa fa-check"></i>Purchase Package</a></div>
                                
                            </div>
                        </div>
                    </div>
					<div class="card">
                        <div class="card-body">
                            <div class="row">
                                <div class="col-12">
								<?php 
									
			/*$query_sel1 = "SELECT * FROM `user_tbl` WHERE id > '$id' AND pay_status = 1";
			$result_sel1 = mysqli_query($conn,$query_sel1);
			$num = mysqli_num_rows($result_sel1);*/
									?>
								<h2 class="text-success"><i class="mdi mdi-shopping text-success"></i> Package </h2> 
									
                                   <h3 class="text-purple" ><i class="mdi mdi-currency-inr text-purple"></i> 30000</h3>
								   <a class="btn btn-info"  href="#" onclick="change(<?php echo "'".$row00['user_unique_id']."','8','30000'"; ?>);" ><i class="fa fa-check"></i>Purchase Package</a></div>
                                
                            </div>
                        </div>
                    </div>
                    <!-- Column -->
                </div>
				<!-- <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>
                </div>
				
             
                <div class="row">
                    <div class="col-12" style="height:1000px;">
					</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>
				<div id="myModal" class="modal fade">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <h4 class="modal-title">Payment Details</h4>
            </div>
            <div class="modal-body">
			<form action="" method='post' enctype='multipart/form-data'> 
				<div class="form-row mt-1">
										   <input type="hidden" name="receive_id" id="receive_id" >
									<div class="form-group col-6 m-0">
                                       
                                       <label for="send_id" class="col-form-label s-12">Member Id</label>
									    <input  id="send_id"  name="send_id" placeholder="Enter Member Id" class="form-control r-0 light s-12 "  type="text"> 
                                    </div>
										<div class="form-group col-6 m-0">
                                       
                                       <label for="send_name" class="col-form-label s-12">Name.</label>
									    <input  id="send_name"  name="send_name" placeholder="Name" class="form-control r-0 light s-12 " readonly type="text"> 
                                    </div>									
									<div class="form-group col-6 m-0">
                                       
                                       <label for="pay_amount" class="col-form-label s-12">Pay Amt.</label>
									    <input  id="pay_amount"  name="pay_amount" placeholder="Pay Amt" class="form-control r-0 light s-12 " readonly type="text"> 
                                    </div>
									<div class="form-group col-6 m-0">
                                       
                                       <label for="pay_mode" class="col-form-label s-12">Pay mode.</label>
									    <select class="custom-select select2" id="selectBox1" name="pay_mode"  required>
							 <option value="">Select One</option>
							 <option value="1" > Earning Balance </option>
							 <option value="2" > Wallet Balance </option>
						 </select>   </div>
									 </div>
									 <div class="form-row mt-1">
									<div class="form-group col-6 m-0">
									</br><input type="submit" id="btnValidate" class="btn btn-primary btn-lg" name="Submit" value="Pay">
									 </div>
									 </div>
				</form>
            </div>
        </div>
    </div>
</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>