<?php

include("../config.php");
session_start();

if(isset($_SESSION["user_login"])){
	$userid = $_SESSION["user_login"];
}else{
		header("location: ../register-login.php");
	}
	
	
	
	
	
	
	
		//Get and credit the referer if this user was invited or referred
		if(isset($_GET["ref"])){
		$refID = htmlspecialchars($_GET["ref"]);		//result will look like : "ref=eEF3d_22"
		
		//split to get the referer user ID (the user who referred somebody) 
		$refererID = explode("_", $refID)[1];
		 
		//Check if the referer ID is valid and not same user inviting himself
		$stmt=$pdo->prepare("SELECT invite_ref, userid FROM users WHERE userid = :refererID");
		$stmt->bindParam(":refererID", $refererID, PDO::PARAM_STR);
		$stmt->execute();
		if($stmt->rowCount()>0){
			
		$check = $stmt->fetch();
		if($check["invite_ref"] == $refID && $check["userid"] !== $userid){
			
		
		//check if referee(the one invited) has been referred before
		$stmt=$pdo->prepare("SELECT * FROM referral WHERE referee = :userid");
		$stmt->bindParam(":userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		if($stmt->rowCount()<1){
			
	
		//Insert refs to referral table
		$bonus = 3;		//$3 per ref
		$status = "pending";		
		$query=$pdo->prepare("INSERT INTO referral(userid,referee,bonus,status)VALUES(:refererID,:referee,:bonus,:status)");
		$query->bindParam(":refererID", $refererID, PDO::PARAM_STR);
		$query->bindParam(":referee", $userid, PDO::PARAM_STR);
		$query->bindParam(":bonus", $bonus, PDO::PARAM_STR);
		$query->bindParam(":status", $status, PDO::PARAM_STR);
		$query->execute();
			
		}
		}
		}
	}
	
	
	
		//Check if the referred user (referee) have made payment so you can credit the referer(one who invited)
		
		//Get the referred user (referee) id using the userid(one who invited) - fetch one referee 1 at a time
		$stmt=$pdo->prepare("SELECT * FROM referral WHERE userid = :userid AND status='pending' LIMIT 1");
		$stmt->bindParam(":userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		if($stmt->rowCount()>0){
			
		$checkRef = $stmt->fetch();
			
		
		$refereeId = $checkRef["referee"];		//referee ID
		$theRow = $checkRef["id"];				//The row Id of the selected row above (will be used to update row staus as paid)
			
			
		//if there's any pending referee, then get the referee id and check if he has a deposit history
		
		//Check Referee transactions history if there's any approved deposit
		$query=$pdo->prepare("SELECT * FROM transactions WHERE userid = :userid AND type='investment' AND status='approved' ");
		$query->bindParam("userid", $refereeId, PDO::PARAM_STR);
		$query->execute();
		if($query->rowCount()>0){
			
		//if user has transacted b4, then credit the referer (one who referred) with $3
		
		//Get his account Bal and Add $3
		$stmt=$pdo->prepare("SELECT * FROM account WHERE userid = :userid");
		$stmt->bindParam(":userid",$userid, PDO::PARAM_STR);
		$stmt->execute();
		$refBal=$stmt->fetch();
		
		//Increment balance with $3
		$newBal = $refBal["balance"] + 3;
		
		
		//Update the Acct. Balance of referer (one who referred somebody) 
		$query=$pdo->prepare("UPDATE account SET balance = :balance WHERE userid=:userid");
		$query->bindParam(":balance", $newBal, PDO::PARAM_STR);
		$query->bindParam(":userid", $userid, PDO::PARAM_STR);
		$query->execute();
		
		if($query){
		//Now mark Ref status as paid by upating ref table
		$stmt=$pdo->prepare("UPDATE referral SET status ='paid' WHERE id=:id");
		$stmt->bindParam(":id", $theRow, PDO::PARAM_STR);
		$stmt->execute();
		}
		
		
		}	
		}
		
		
	
	
	
		
		
	
	
	
	
	
		//get user info
		$stmt=$pdo->prepare("SELECT * FROM users WHERE userid = :userid");
		$stmt->bindParam(":userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$row=$stmt->fetch();
		$userimage = (!empty($row["profilepix"]) ? "../img/users/".$row["profilepix"]: "../img/avatar.png");
		
		
		//redirect incase it was admin
		if($row["type"]=="admin"){
			header("location: ../admin/dashboard.php");
		}
		
		
		
		//Get User Account Balance
		$stmt="SELECT * FROM account WHERE userid = :userid";
		$stmt=$pdo->prepare($stmt);
		$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$actBal=$stmt->fetch();
		
		
		//Count User pending investment transactions
		$stmt="SELECT COUNT(*) AS invest FROM transactions WHERE userid = :userid AND type='investment' AND status='pending' ";
		$stmt=$pdo->prepare($stmt);
		$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$invest=$stmt->fetch();
		
		//Count User pending Withdrawal transactions
		$stmt="SELECT COUNT(*) AS withdraw FROM transactions WHERE userid = :userid AND type='withdrawal' AND status='pending' ";
		$stmt=$pdo->prepare($stmt);
		$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$withdraw=$stmt->fetch();
		
		
		
		
		
		
		
		
		
		
	//Get the percentage profit of user AND ALSO VALIDATE if user is due for payment after 5days of deposit using the due dates on DB and curr. date
		$stmt=$pdo->prepare("SELECT * FROM duedate WHERE userid = :userid");
		$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$dueDate=$stmt->fetch();
		if($stmt->rowCount()>0){
			
		//get the previous user percentage profit from account table above if not yet redeemed or already redeemed and add it to the new profit
		$prevPercentage = $actBal["profits"];										//previous profit 
		
		$percentProfit = $dueDate["percentage_profit"] + $prevPercentage;			//% profit + the previous % profit
		$dateOfProfit = $dueDate["due_date"];										//date to pay user
		$depDate = $dueDate["deposit_date"];										//deposit date
		$deposit = 0;																//Reset the active deposit to "0" for new deposit
		
		
		
		//compare current date and dueDate from DB, if thesame, then update user account profit with the percentage Profit from 'duedate' table
		//(If time is altered by Admin then add it to currentTime and compare)
		
		//if date was altered by admin (data +1 or +2 or -2 will be entered in the alterTime col. showing addition or subs of time), you need to explode them to have spaces btwn each other incase admin updated more tan once, then implode to retain space. use strtotime() to add it to current dateTime if alterTime col is empty, then set to zero so our strtotime won't be null
		
		if(!empty($dueDate["alterTime"])){
					$exp = explode(" ", $dueDate["alterTime"]);
					$Dtimers = implode(" ", $exp);
				}else{
					//if not altered set it to +0
					$Dtimers = "+0 days";
				}
				
		if(date("Y-m-d H:i:s A", strtotime($Dtimers)) > date("Y-m-d H:i:s A", strtotime($dateOfProfit))){
			
		$stmt = $pdo->prepare("UPDATE account SET profits=:profits, deposit=:deposit WHERE userid=:userid");
		$stmt->bindParam(":profits",$percentProfit,PDO::PARAM_STR);
		$stmt->bindParam(":deposit",$deposit,PDO::PARAM_STR);
		$stmt->bindParam(":userid",$userid,PDO::PARAM_STR);
		$stmt->execute();
		
		//if successfully updated clear duedate table
		if($stmt){
		$stmt = $pdo->prepare("DELETE FROM duedate WHERE userid=:userid");
		$stmt->bindParam(":userid",$userid,PDO::PARAM_STR);
		$stmt->execute();
		}

		
		}
		}
?>






<!DOCTYPE html>
<html lang="en">


<head>
  <meta charset="utf-8" />
  <title> Dashboard | Swiss Wealth pro</title>
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta name="keywords" content="trade, trading, forex, investing, invest, investment, investor, money, chart, bitcoin, ethereum, USDT, coins, cryptocurrencies, crypto, profit, market, online money, money online,">
    <meta name="description" content="we provides a full investment service focused on the Bitcoin and cryptocurrency trading market. A certified legal investment company incorporated and headquartered in Australia.">
    <meta name="author" content="Swiss Wealth pros">
	
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />


        <!-- Bootstrap Css -->

        <link href="assets/css/bootstrap.min.css" id="bootstrap-stylesheet" rel="stylesheet" type="text/css" />

        <!-- Icons Css -->

        <link href="assets/css/icons.min.css" rel="stylesheet" type="text/css" />

        <!-- App Css-->

        <link href="assets/css/app.min.css" id="app-stylesheet" rel="stylesheet" type="text/css" />

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


</head>

<body>
 

	<div class='coversoverlay'>
	<center><img src="../img/loader.gif" style="width:60px; margin-top:20%;"></center>
	</div>

  <!-- Begin page -->
  <div id="wrapper">
  
  

    <!-- Topbar Start -->
	<?php
	include("header.php");
	?>
    <!-- end Topbar -->
	
	

    <!-- ========== Left Sidebar Start ========== -->
    <div class="left-side-menu">

      <div class="slimscroll-menu">

        <!-- User box -->
        <div class="user-box text-center ">

          <div class="dropdown">
            <a href="#" class="user-name dropdown-toggle h5 mt-2 mb-1 d-block" data-toggle="dropdown" aria-expanded="false"></a>
            <div class="dropdown-menu user-pro-dropdown">




            </div>
          </div>


        </div>

        <!--- Sidemenu -->
        <?php include("sidebar.php");?>
		
        <!-- End Sidebar -->
        <div class="clearfix"></div>

      </div>
      <!-- Sidebar -left -->

    </div>
    <!-- Left Sidebar End -->

    <!-- ============================================================== -->
    <!-- Start Page Content here -->
    <!-- ============================================================== -->
    <div class="content-page">
      <div class="content">

        <!-- Start Content-->
        <div class="container-fluid">
          <div id="google_translate_element"></div>

          <div class="row" style="margin-top:20px;">


            <div class="col-xl-4 col-md-6">
              <div class="card-box" style="background-image: radial-gradient(ellipse closest-side, rgb(245 250 255),#d5e1ed);">
			  
                <h4 class="header-title mt-0 mb-3">Account Balance</h4>
				<div style="diplay:flex;margin-top:-20px; margin-bottom:10px">
				<span style="color:#496d8b;font-size:14px;font-weight:500">Last transaction &nbsp; </span>
				<span style="color:#6c6c6c;font-size:14px;">
			
				
				<?php 
				//get last transaction from transaction table
				$stmt="SELECT dateTime FROM transactions WHERE userid = :userid ORDER BY id DESC";
				$stmt=$pdo->prepare($stmt);
				$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
				$stmt->execute();
				$Ltrans=$stmt->fetch();
				if($stmt->rowCount() >0){
				echo date("jS F, Y", strtotime($Ltrans["dateTime"]));}else{echo "No transaction";}?></span>
				</div>
			
			
                <div class="widget-box-2">
                  <div class="widget-detail-2 text-right">

                    <h2 id="bals" class="font-weight-normal mb-1">$ <?php echo number_format(intval($actBal["balance"]));?>.00</h2>
					
                  
				
				<a href="transactions.php" style="font-size:14px;margin-top:-5px; margin-bottom:-10px">
				<button class="btn btn-sm btn-primary btnss">
				<?php if($withdraw["withdraw"] >0){echo 'You\'ve '.$withdraw["withdraw"].' pending withdrawal';}else{echo "No pending withdrawals";}?>
				&nbsp; <i class="fa fa-caret-right"></i></button></a>
			
	</div>
                </div>
				
              </div>
            </div><!-- end col -->












            <div class="col-xl-4 col-md-6">
           <div class="card-box" style="background-image: radial-gradient(ellipse closest-side, rgb(245 250 255),#d5e1ed);">


         <!--Show reading CountDown if User Invested-->    
		<?php if(!empty($dueDate["deposit_date"])){ ?>	
				
		<!--CountDown-->
		<div style="font-size:13px;color:#4b7a91; margin-top:-10px;margin-bottom:5px;">
		<font style="color:#396f89; margin:10px 0px;font-size:13px"><b>Countdown&nbsp;</b></font>
		<?php
		//Get difference btwn deposit time and duedate
		
		$timers = (!empty($dueDate["alterTime"]) ? $dueDate["alterTime"] : "+0 days");
			
		$curdate = date("Y-m-d H:i:s", strtotime($timers));
		$dDate = date("Y-m-d H:i:s", strtotime($dueDate["due_date"]));
		
		$timeZ = new DateTimeZone('UTC');
		$curDate = new DateTime($curdate, $timeZ);
		$due_date = new DateTime($dDate, $timeZ);
		
		//('%r%y years, %m Months, %d days, %h hours, %i minutes, %s seconds');
		
		//for days plans
		if($dueDate["plan"] == "Bronze" || $dueDate["plan"] == "Silver"){
			echo $curDate->diff($due_date)->format('%h hour(s), %i minute(s)');
		}else{
			echo $curDate->diff($due_date)->format('%d day(s), %h hour(s), %i minute(s)');
		}
		
		?>
		</div>	
		<?php } ?>		
				
		<!--/CountDown-->	
				
				
				
				
				<h4 class="header-title mt-0 mb-3">Total Profits</h4>
		
				
				<?php 
				//calculate daily percentage out of the deposit amount by user
				if(!empty($dueDate["deposit_date"])){ 
				
				$deposit_date = $dueDate["deposit_date"];								//date of deposit
				$profits = $dueDate["percentage_profit"];								//percentage profit
				$plan = $dueDate["plan"];												//Investment Plan
				
		
					
					
					
				//FOR BRONZE - 3DAYS PROFIT
				if($plan == "Bronze"){
				
				//24hr format deposit date
				$NewDepositD = date("m-d-Y H:i:s A", strtotime($dueDate["timing"]));
				
				
				//if Admin Altered timing - explode times into array(so they would be spaced, implode to string with spaces) - will be added to current using strtotime() then used to compare DB time to  read percentage state 
				if(!empty($dueDate["alterTime"])){
					$exp = explode(" ", $dueDate["alterTime"]);
					$timers = implode(" ", $exp);
				}else{
					$timers = "+0 days";
				}
				
				
				
				
				//Define the next 3days (incrementing the deposit time by 1day each for the 2days)
				//Since we are using hours - increment by seconds (1hr = 60 * 60 * 1)
				
				 $halfDay = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*12);			//next 1 halfday
				 $day1 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*24);				//next day
				 $DayAndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*36);		//a day & half
				
				 $day2 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*48);				//day 2
				 $day2AndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*60);		//2days & half
				 $day3 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*72);				//3rd day
				
				
				
				
					//setting percentage reading and profit per 24hrs
					//(Since profit will increment every 24hrs (3 successions) to complete 1day divide %profit by 2 * by 1,2 and 3 respectively)
					
					//if current date is > than the deposit date in DB
					if(date("m-d-Y H:i:s A") > $NewDepositD){
					$dailyProfit = 8;
					$percent = 6;	//set progress-bar %
					}
					
					//first 12hrs - half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $halfDay){
					$dailyProfit = $profits / 6 * 1;
					$percent = 16.7;	//set progress-bar %
					}
					
					//24th hour - 1st day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day1){
					$dailyProfit = $profits / 6 * 2;
					$percent = 33.4;	//set progress-bar %					
					}
	
					//36th hour - day & half (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $DayAndHalf){
					$dailyProfit = $profits / 6 * 3;
					$percent = 50.1;	//set progress-bar %					
					}
					
					//48th hour - 2nd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2){
					$dailyProfit = $profits / 6 * 4;
					$percent = 66.8;	//set progress-bar %					
					}
					
					//60th hour - 2 & half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2AndHalf){
					$dailyProfit = $profits / 6 * 5;
					$percent = 83.5;	//set progress-bar %					
					}
					
					//72nd hour - 3rd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day3){
					$dailyProfit = $profits / 6 * 6;
					$percent = 99.5;	//set progress-bar %					
					}
	
					}//End Starter
					
					
					
					
					
						
					
				//FOR SILVER - 3DAYS PROFIT
				if($plan == "Silver"){
				
				//24hr format deposit date
				$NewDepositD = date("m-d-Y H:i:s A", strtotime($dueDate["timing"]));
				
				//if Admin Altered timing - explode times into array - will be added to current using strtotime() then used to compare DB time to  read percentage state 
				if(!empty($dueDate["alterTime"])){
					$exp = explode(" ", $dueDate["alterTime"]);
					$timers = implode(" ", $exp);
				}else{
					$timers = "+0 days";
				}
				
				
				
				//Define the next 3days (incrementing the deposit time by 1day each for the 2days)
				//Since we are using hours - increment by seconds (1hr = 60 * 60 * 1)
				
				 $halfDay = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*12);			//next 1 halfday
				 $day1 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*24);				//next day
				 $DayAndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*36);		//a day & half
				
				 $day2 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*48);				//day 2
				 $day2AndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*60);		//2days & half
				 $day3 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*72);				//3rd day
				
				
				
				
					//setting percentage reading and profit per 24hrs
					//(Since profit will increment every 24hrs (3 successions) to complete 1day divide %profit by 2 * by 1,2 and 3 respectively)
					
					//if current date is > than the deposit date in DB
					if(date("m-d-Y H:i:s A") > $NewDepositD){
					$dailyProfit = 8;
					$percent = 6;	//set progress-bar %
					}
					
					//first 12hrs - half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $halfDay){
					$dailyProfit = $profits / 6 * 1;
					$percent = 16.7;	//set progress-bar %
					}
					
					//24th hour - 1st day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day1){
					$dailyProfit = $profits / 6 * 2;
					$percent = 33.4;	//set progress-bar %					
					}
	
					//36th hour - day & half (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $DayAndHalf){
					$dailyProfit = $profits / 6 * 3;
					$percent = 50.1;	//set progress-bar %					
					}
					
					//48th hour - 2nd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2){
					$dailyProfit = $profits / 6 * 4;
					$percent = 66.8;	//set progress-bar %					
					}
					
					//60th hour - 2 & half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2AndHalf){
					$dailyProfit = $profits / 6 * 5;
					$percent = 83.5;	//set progress-bar %					
					}
					
					//72nd hour - 3rd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day3){
					$dailyProfit = $profits / 6 * 6;
					$percent = 99.5;	//set progress-bar %					
					}
	
					}//End Standard
					
					
					
					
					
				

					
					
				//FOR GOLD - 3DAYS PROFIT
				if($plan == "Gold"){
				
				//24hr format deposit date
				$NewDepositD = date("m-d-Y H:i:s A", strtotime($dueDate["timing"]));
				
				//if Admin Altered timing - explode times into array - will be added to current using strtotime() then used to compare DB time to  read percentage state 
				if(!empty($dueDate["alterTime"])){
					$exp = explode(" ", $dueDate["alterTime"]);
					$timers = implode(" ", $exp);
				}else{
					$timers = "+0 days";
				}
				
				
				
				
				//Define the next 3days (incrementing the deposit time by 1day each for the 2days)
				//Since we are using hours - increment by seconds (1hr = 60 * 60 * 1)
				
				 $halfDay = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*12);			//next 1 halfday
				 $day1 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*24);				//next day
				 $DayAndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*36);		//a day & half
				
				 $day2 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*48);				//day 2
				 $day2AndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*60);		//2days & half
				 $day3 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*72);				//3rd day
				
				
				
				
					//setting percentage reading and profit per 24hrs
					//(Since profit will increment every 24hrs (3 successions) to complete 1day divide %profit by 2 * by 1,2 and 3 respectively)
					
					//if current date is > than the deposit date in DB
					if(date("m-d-Y H:i:s A") > $NewDepositD){
					$dailyProfit = 8;
					$percent = 6;	//set progress-bar %
					}
					
					//first 12hrs - half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $halfDay){
					$dailyProfit = $profits / 6 * 1;
					$percent = 16.7;	//set progress-bar %
					}
					
					//24th hour - 1st day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day1){
					$dailyProfit = $profits / 6 * 2;
					$percent = 33.4;	//set progress-bar %					
					}
	
					//36th hour - day & half (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $DayAndHalf){
					$dailyProfit = $profits / 6 * 3;
					$percent = 50.1;	//set progress-bar %					
					}
					
					//48th hour - 2nd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2){
					$dailyProfit = $profits / 6 * 4;
					$percent = 66.8;	//set progress-bar %					
					}
					
					//60th hour - 2 & half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2AndHalf){
					$dailyProfit = $profits / 6 * 5;
					$percent = 83.5;	//set progress-bar %					
					}
					
					//72nd hour - 3rd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day3){
					$dailyProfit = $profits / 6 * 6;
					$percent = 99.5;	//set progress-bar %					
					}
	
					}//End Gold
					
					
					
					
					


					
					
				//FOR PLATINUM - 3DAYS PROFIT
				if($plan == "Platinum"){
				
				//24hr format deposit date
				$NewDepositD = date("m-d-Y H:i:s A", strtotime($dueDate["timing"]));
				
				//if Admin Altered timing - explode times into array - will be added to current using strtotime() then used to compare DB time to  read percentage state 
				if(!empty($dueDate["alterTime"])){
					$exp = explode(" ", $dueDate["alterTime"]);
					$timers = implode(" ", $exp);
				}else{
					$timers = "+0 days";
				}
				
				
				
				
				//Define the next 3days (incrementing the deposit time by 1day each for the 2days)
				//Since we are using hours - increment by seconds (1hr = 60 * 60 * 1)
				
				 $halfDay = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*12);			//next 1 halfday
				 $day1 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*24);				//next day
				 $DayAndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*36);		//a day & half
				
				 $day2 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*48);				//day 2
				 $day2AndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*60);		//2days & half
				 $day3 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*72);				//3rd day
				
				
				
				
					//setting percentage reading and profit per 24hrs
					//(Since profit will increment every 24hrs (3 successions) to complete 1day divide %profit by 2 * by 1,2 and 3 respectively)
					
					//if current date is > than the deposit date in DB
					if(date("m-d-Y H:i:s A") > $NewDepositD){
					$dailyProfit = 8;
					$percent = 6;	//set progress-bar %
					}
					
					//first 12hrs - half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $halfDay){
					$dailyProfit = $profits / 6 * 1;
					$percent = 16.7;	//set progress-bar %
					}
					
					//24th hour - 1st day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day1){
					$dailyProfit = $profits / 6 * 2;
					$percent = 33.4;	//set progress-bar %					
					}
	
					//36th hour - day & half (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $DayAndHalf){
					$dailyProfit = $profits / 6 * 3;
					$percent = 50.1;	//set progress-bar %					
					}
					
					//48th hour - 2nd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2){
					$dailyProfit = $profits / 6 * 4;
					$percent = 66.8;	//set progress-bar %					
					}
					
					//60th hour - 2 & half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2AndHalf){
					$dailyProfit = $profits / 6 * 5;
					$percent = 83.5;	//set progress-bar %					
					}
					
					//72nd hour - 3rd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day3){
					$dailyProfit = $profits / 6 * 6;
					$percent = 99.5;	//set progress-bar %					
					}
	
					
					}//End PLATINUM
					
					
					
					
					
					
					//FOR VIP - 3DAYS PROFIT
				if($plan == "Vip"){
				
				//24hr format deposit date
				$NewDepositD = date("m-d-Y H:i:s A", strtotime($dueDate["timing"]));
				
				//if Admin Altered timing - explode times into array - will be added to current using strtotime() then used to compare DB time to  read percentage state 
				if(!empty($dueDate["alterTime"])){
					$exp = explode(" ", $dueDate["alterTime"]);
					$timers = implode(" ", $exp);
				}else{
					$timers = "+0 days";
				}
				
				
				
				
				//Define the next 3days (incrementing the deposit time by 1day each for the 2days)
				//Since we are using hours - increment by seconds (1hr = 60 * 60 * 1)
				
				 $halfDay = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*12);			//next 1 halfday
				 $day1 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*24);				//next day
				 $DayAndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*36);		//a day & half
				
				 $day2 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*48);				//day 2
				 $day2AndHalf = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*60);		//2days & half
				 $day3 = date("m-d-Y H:i:s A", strtotime($deposit_date)+ 60*60*72);				//3rd day
				
				
				
				
					//setting percentage reading and profit per 24hrs
					//(Since profit will increment every 24hrs (3 successions) to complete 1day divide %profit by 2 * by 1,2 and 3 respectively)
					
					//if current date is > than the deposit date in DB
					if(date("m-d-Y H:i:s A") > $NewDepositD){
					$dailyProfit = 8;
					$percent = 6;	//set progress-bar %
					}
					
					//first 12hrs - half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $halfDay){
					$dailyProfit = $profits / 6 * 1;
					$percent = 16.7;	//set progress-bar %
					}
					
					//24th hour - 1st day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day1){
					$dailyProfit = $profits / 6 * 2;
					$percent = 33.4;	//set progress-bar %					
					}
	
					//36th hour - day & half (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $DayAndHalf){
					$dailyProfit = $profits / 6 * 3;
					$percent = 50.1;	//set progress-bar %					
					}
					
					//48th hour - 2nd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2){
					$dailyProfit = $profits / 6 * 4;
					$percent = 66.8;	//set progress-bar %					
					}
					
					//60th hour - 2 & half day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day2AndHalf){
					$dailyProfit = $profits / 6 * 5;
					$percent = 83.5;	//set progress-bar %					
					}
					
					//72nd hour - 3rd day (If time is altered by Admin then add it to currentTime and compare)
					if(date("m-d-Y H:i:s A", strtotime($timers)) > $day3){
					$dailyProfit = $profits / 6 * 6;
					$percent = 99.5;	//set progress-bar %					
					}
	
					
					}//End VIP
					
					
					
					
					} 
				
				?>
				
				
				
				
				
				
				
				<div style="color:#6c6c6c;font-size:14px;margin-top:-20px">
				 <?php if(!empty($dueDate["deposit_date"])){ ?>
				 
				 <div class="progress" style="height:20px;margin-bottom:5px;">
				 <div class="progress-bar bg-success progress-animated animated progress-bar-striped" role="progress-bar" 
				 aria-valuenow="<?php echo $percent;?>" aria-valuemin="0" aria-valuemax="100" style="width:<?php echo $percent;?>%;">
				 <?php echo $percent;?>%</div>
				</div>
				
				Profit is actively reading
				
				 <?php }else{?>
				<div style="margin-bottom:27px">No active investment</div>
				
				 <?php }?>
				</div>
				
				
				
				
				
				
				<div style="font-size:14px;margin-top:-64px;float:right" id="result"></div>

                <div class="widget-box-2">
                <div class="widget-detail-2 text-right">

                <h2 id="prof" class="font-weight-normal mb-1">
				
				<!--Display The Reading Plan if user invested-->
				<?php 
				if(!empty($dueDate["deposit_date"])){ 
				if($plan == "Starter"){?>
				
				<span class="badge badge-primary" style="float:left; font-size:12px;font-weight:500;
				margin-top:10px;background:#087495;box-shadow:#bbb 0.1em 0.1em 0.2em;"><i class="flaticon-wallet"></i> Bronze Plan</span>
				<?php }?>
				
				<?php if($plan == "Silver"){?>
				<span class="badge badge-primary" style="float:left; font-size:12px;font-weight:500;
				margin-top:10px;background:#1cb366;box-shadow:#bbb 0.1em 0.1em 0.2em;"><i class="flaticon-wallet"></i> Silver Plan</span>
				<?php }?>
				
				<?php if($plan == "Gold"){?>
				<span class="badge badge-primary" style="float:left; font-size:12px;font-weight:500;
				margin-top:10px;background:#ff8a45;box-shadow:#bbb 0.1em 0.1em 0.2em;"><i class="fa  fa-star"></i> Gold Plan</span>
				<?php }?>
				
				<?php if($plan == "Platinum"){?>
				<span class="badge badge-primary" style="float:left; font-size:12px;font-weight:500;
				margin-top:10px;background:#ff8a45;box-shadow:#bbb 0.1em 0.1em 0.2em;"><i class="fa  fa-star"></i> Platinum Plan</span>
				<?php }?>
				
				<?php if($plan == "Vip"){?>
				<span class="badge badge-primary" style="float:left; font-size:12px;font-weight:500;
				margin-top:10px;background:#f5226a;box-shadow:#bbb 0.1em 0.1em 0.2em;"><i class="fa fa-bolt"></i> Vip Plan</span>
				<?php } }?>
				
			
				
				
				
				
				
				$ 
				<?php 
				//if profit is reading add it to previous profit in profit column (acct table) whether previous profit is redeemed or not
				if(isset($dailyProfit)){echo round($actBal["profits"] + $dailyProfit, 2);}
				
				//else if no reading profit then just show the previous profit, whether previous profit is redeemed or not
				else{echo round($actBal["profits"], 2);}
				 ?>
				
				
				</h2>
				
				<div id="redeem" style="font-size:14px;margin-top:-5px; margin-bottom:-10px" class="btn btn-sm btn-primary btnss">
				<span id="noLoad">Redeem to account &nbsp; <i class="fa fa-caret-right"></i></span>
				<span id="loadR" class="display-none"> Redeeming <i class="fa fa-spinner fa-pulse"></i></span>
				</div>
                </div>
				  
                 
				 
				  
                </div>
              </div>

            </div><!-- end col -->
            
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
			
	
			
			
			
            <div class="col-xl-4 col-md-6">
             <div class="card-box" style="background-image: radial-gradient(ellipse closest-side, rgb(245 250 255),#d5e1ed);">



                <h4 class="header-title mt-0 mb-3">Active Deposits</h4>
				<div style="color:#6c6c6c;font-size:14px;margin-top:-20px;margin-bottom:25px">Currently approved active deposits</div>
				
                <div class="widget-box-2">
                  <div class="widget-detail-2 text-right">

                    <h2 class="font-weight-normal mb-1">$ <?php echo number_format(intval($actBal["deposit"]));?>.00</h2>
					
					
					<a href="transactions.php" style="font-size:14px;margin-top:-5px; margin-bottom:-10px" class="btn btn-sm btn-primary btnss">
						<?php if($invest["invest"] >0){echo 'You\'ve '.$invest["invest"].' pending deposit';}else{echo "No pending deposits";}?>
					&nbsp; <i class="fa fa-caret-right"></i></a>
				
                  </div>
                  
                </div>
              </div>
            </div><!-- end col -->


<div class="col-xl-4 col-md-6">
             <div class="card-box" style="background-image: radial-gradient(ellipse closest-side, rgb(245 250 255),#d5e1ed);">



                <h4 class="header-title mt-0 mb-3">Active shares</h4>
				<div style="color:#6c6c6c;font-size:14px;margin-top:-20px;margin-bottom:25px">Currently approved active shares</div>
				
                <div class="widget-box-2">
                  <div class="widget-detail-2 text-right">

                    <h2 class="font-weight-normal mb-1">$ <?php echo number_format(intval($actBal["shares"]));?>.00</h2>
					

 </div>
                  
                </div>
              </div>
            </div><!-- end col -->




			
            <div class="col-md-12">
              
			  <div class="card-box" style="background-image: radial-gradient(ellipse closest-side, rgba(225, 225, 225, 0),#f7f7f7), url(../img/recent.jpg); background-repeat:no-repeat; background-position:center">

                <h3 style="text-align: center;">Recent Transactions</h3>




			
		<?php	
		//Get Total Approved Investments
		$stmt=$pdo->prepare("SELECT SUM(amount) AS total FROM transactions WHERE type='investment' AND status='approved' AND userid = :userid");
		$stmt->bindParam(":userid",$userid, PDO::PARAM_STR);
		$stmt->execute();
		$sumInv = $stmt->fetch();
		
		
		//Get Total Approved Withdrawals
		$stmt=$pdo->prepare("SELECT SUM(amount) AS total FROM transactions WHERE type='withdrawal' AND status='approved' AND userid = :userid");
		$stmt->bindParam(":userid",$userid, PDO::PARAM_STR);
		$stmt->execute();
		$sumWith = $stmt->fetch();
		?>
		
		<br><div class="dropdown-divider" style="border-color:#e9eff5;"></div>
		<div style="color:#405972; font-size:15px; margin-top:4px;text-align:left">
		<b>Total Approved Investments</b><br>
		<div style="color:#2aab00;font-size:14px;margin-top:4px;">$ <?php echo number_format(intval($sumInv["total"]))?>.00</div>
		</div>
		<div class="dropdown-divider" style="border-color:#e9eff5;"></div>
		
		
		<div class="dropdown-divider" style="border-color:#e9eff5;"></div>
		<div style="color:#405972; font-size:15px; margin-top:4px;text-align:left">
		<b>Total Approved Withdrawals</b><br>
		<div style="color:#e13131;font-size:14px;margin-top:4px;">$ <?php echo number_format(intval($sumWith["total"]))?>.00</div>
		</div>
		<div class="dropdown-divider" style="border-color:#e9eff5;"></div>
		



				
		<?php	
		$stmt=$pdo->prepare("SELECT * FROM transactions WHERE userid = :userid ORDER BY id DESC LIMIT 5");
		$stmt->bindParam("userid", $userid, PDO::PARAM_STR);
		$stmt->execute();
		$tran=$stmt->fetchAll();
		$count = 1;
		if($stmt->rowCount()<1){
			echo '<h4 class="title" style="text-align: center;">No recorded transaction</h4>';
		}else{
		?>
				<div class="transact-con">
				<table class="table table-bordered">
				
				<thead class="thead-dark">
				<th>S/N</th>
				<th>Status</th>
				<th>Date</th>
				<th>Transaction</th>
				<th>Plan</th>
				<th>Amount</th>
				<th>Reference ID</th>
				
				</thead>
					
		<?php
		foreach($tran as $trans){	
		?>
		
		<tr>
		<td><?php echo $count++;?></td>
		<td><?php echo htmlspecialchars($trans["status"]);?></td>
		<td><?php echo date("d/m/y", strtotime($trans["dateTime"]));?></td>
		<td><?php echo htmlspecialchars($trans["type"]);?></td>
		<td><?php if(empty($trans["plan"])){echo "<center>- -</center>";}else{echo htmlspecialchars($trans["plan"]);}?></td>
		<td><?php echo "$ ". htmlspecialchars(number_format($trans["amount"]));?></td>
		<td><?php echo htmlspecialchars($trans["ref"]);?></td>
		</tr>
		
			
		<?php } }?>

		  </table>
		  </div>
		  
		  <br>
		  <?php if($stmt->rowCount()>4){ ?>
		  <a href="transactions.php" class="btn btn-secondary btn-block">View all transactions</a>
		  <?php }?>
          </div>
          </div>






 <!-- PAYMENT METHODS -->
 <div class="col-md-12 card-box" style="margin-bottom:20px;">
<h4 style="font-size: 16px;color: #F46B45;letter-spacing: 5px;margin:50px auto 10px auto;font-weight: 500;">PAYMENT METHODS</h4>
<h3 style="font-size:25px;color:#111;margin-bottom:6px;position:relative;font-weight:600;">Accepted Payment Method</h3>
<div class="line_shape line_shape2"></div>


<div style="display:flex;flex-wrap:wrap;justify-content: space-between; margin: 40px auto 10px auto;">

<div class="payM">
<center><img src="../img/bitcoin-logo.png" width="140px"></center>
</div>

<div class="payM">
<center><img src="../img/ethereum-logo.png" width="140px"></center>
</div>

<div class="payM">
<center><img src="../img/usdt.png" width="200px" style="margin-top:-8px;"></center>
</div>

</div>
</div>

 <!--/ PAYMENT METHODS -->





            <!-- TradingView Widget BEGIN -->

            <div class="col-xl-12" style="margin:auto; padding:0px!important">
              <div class="card-box">
                <div class="tradingview-widget-container" style="margin-bottom:60px;">
                  <h2>Forex Market Fundamental Data</h2>
                  <div class="tradingview-widget-container__widget"></div>

                  <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-forex-heat-map.js" async>
                    {
                      "width": "100%",
                      "height": "500",
                      "currencies": [
                        "EUR",
                        "USD",
                        "JPY",
                        "GBP",
                        "CHF",
                        "AUD",
                        "CAD",
                        "NZD",
                        "CNY"
                      ],
                      "isTransparent": false,
                      "colorTheme": "light",
                      "locale": "en"
                    }
                  </script>
                </div><br><br>

              </div>
            </div>
            <!-- TradingView Widget END -->



            <!-- TradingView Widget BEGIN -->
            <div class="col-xl-12 col-md-12" style="padding:0px!important">
              <div class="card-box">

                <div class="tradingview-widget-container">
                  <h2>Advanced Real-Time Chart </h2>
                  <div id="tradingview_3102a"></div>

                  <script type="text/javascript" src="https://s3.tradingview.com/tv.js"></script>
                  <script type="text/javascript">
                    new TradingView.widget({
                      "width": "100%",
                      "height": "610",
                      "symbol": "NASDAQ:AAPL",
                      "interval": "D",
                      "timezone": "Etc/UTC",
                      "theme": "light",
                      "style": "1",
                      "locale": "en",
                      "toolbar_bg": "#f1f3f6",
                      "enable_publishing": false,
                      "allow_symbol_change": true,
                      "container_id": "tradingview_3102a"
                    });
                  </script>
                </div>
                <!-- TradingView Widget END -->

                <br>

              </div>
            </div>
			
			
			
			
            <!-- TradingView Widget BEGIN -->

            <div class="col-xl-12 col-md-12" style="padding:0px!important">
              <div class="card-box">
                <div class="tradingview-widget-container" style="margin-bottom:60px;">
                  <h2>Market Data</h2>
                  <div class="tradingview-widget-container__widget"></div>

                  <script type="text/javascript" src="https://s3.tradingview.com/external-embedding/embed-widget-market-quotes.js" async>
                    {
                      "width": "100%",
                      "height": "500",
                      "symbolsGroups": [{
                          "name": "Indices",
                          "originalName": "Indices",
                          "symbols": [{
                              "name": "FOREXCOM:SPXUSD",
                              "displayName": "S&P 500"
                            },
                            {
                              "name": "FOREXCOM:NSXUSD",
                              "displayName": "Nasdaq 100"
                            },
                            {
                              "name": "FOREXCOM:DJI",
                              "displayName": "Dow 30"
                            },
                            {
                              "name": "INDEX:NKY",
                              "displayName": "Nikkei 225"
                            },
                            {
                              "name": "INDEX:DEU30",
                              "displayName": "DAX Index"
                            },
                            {
                              "name": "FOREXCOM:UKXGBP",
                              "displayName": "FTSE 100"
                            }
                          ]
                        },
                        {
                          "name": "Commodities",
                          "originalName": "Commodities",
                          "symbols": [{
                              "name": "CME_MINI:ES1!",
                              "displayName": "S&P 500"
                            },
                            {
                              "name": "CME:6E1!",
                              "displayName": "Euro"
                            },
                            {
                              "name": "COMEX:GC1!",
                              "displayName": "Gold"
                            },
                            {
                              "name": "NYMEX:CL1!",
                              "displayName": "Crude Oil"
                            },
                            {
                              "name": "NYMEX:NG1!",
                              "displayName": "Natural Gas"
                            },
                            {
                              "name": "CBOT:ZC1!",
                              "displayName": "Corn"
                            }
                          ]
                        },
                        {
                          "name": "Bonds",
                          "originalName": "Bonds",
                          "symbols": [{
                              "name": "CME:GE1!",
                              "displayName": "Eurodollar"
                            },
                            {
                              "name": "CBOT:ZB1!",
                              "displayName": "T-Bond"
                            },
                            {
                              "name": "CBOT:UB1!",
                              "displayName": "Ultra T-Bond"
                            },
                            {
                              "name": "EUREX:FGBL1!",
                              "displayName": "Euro Bund"
                            },
                            {
                              "name": "EUREX:FBTP1!",
                              "displayName": "Euro BTP"
                            },
                            {
                              "name": "EUREX:FGBM1!",
                              "displayName": "Euro BOBL"
                            }
                          ]
                        },
                        {
                          "name": "Forex",
                          "originalName": "Forex",
                          "symbols": [{
                              "name": "FX:EURUSD"
                            },
                            {
                              "name": "FX:GBPUSD"
                            },
                            {
                              "name": "FX:USDJPY"
                            },
                            {
                              "name": "FX:USDCHF"
                            },
                            {
                              "name": "FX:AUDUSD"
                            },
                            {
                              "name": "FX:USDCAD"
                            }
                          ]
                        }
                      ],
                      "showSymbolLogo": true,
                      "colorTheme": "light",
                      "isTransparent": false,
                      "locale": "en"
                    }
                  </script>
                </div>


              </div>
            </div>
            <br>
           
		   




          </div>
          <!-- end row -->

        </div> <!-- container-fluid -->

      </div> <!-- content -->
      </div> <!-- content page-->
      </div> <!-- wrapper-->







      <!-- Right bar overlay-->
      <div class="rightbar-overlay"></div>


	    <!-- Vendor js -->

        <script src="assets/js/vendor.min.js"></script>
        <!-- knob plugin -->

        <script src="assets/libs/jquery-knob/jquery.knob.min.js"></script>
        <!--Morris Chart-->

        <script src="assets/libs/morris-js/morris.min.js"></script>

        <script src="assets/libs/raphael/raphael.min.js"></script>
        <!-- Dashboard init js-->

        <script src="assets/js/pages/dashboard.init.js"></script>
        <!-- App js -->

        <script src="assets/js/app.min.js"></script>
	  
	  
	  
	  
	  
	  
	  
	  
	  <script type="text/javascript">
        function googleTranslateElementInit() {
          new google.translate.TranslateElement({
            pageLanguage: 'en'
          }, 'google_translate_element');
        }
      </script>
      <script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>







<script>

$(document).ready(function(){
	$(".coversoverlay").hide();



	//Redeem Cash
	$("#redeem").click(function(){
		
		let redeem = "redeem";
		
		$.ajax({
			url:'function.php',
			method:'POST',
			data:{redeem:redeem},
			beforeSend:function(){
				$("#loadR").removeClass("display-none");
				$("#noLoad").addClass("display-none");
				},
			success:function(data){
			$("#result").html(data);
				
				$("#loadR").addClass("display-none");
				$("#noLoad").removeClass("display-none");
				
				
			}
		});
		
		
		
		
	});
	

















//Update header notification to read when clicked - button in header.php
	$(".getMsg").click(function(){
		
		let senderID = this.id
		
		$.ajax({
			url:'../processChat.php',
			method:'POST',
			data:{senderID:senderID},
			success:function(data){ }
		});
		
	});








});

</script>

<!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API=Tawk_API||{}, Tawk_LoadStart=new Date();
(function(){
var s1=document.createElement("script"),s0=document.getElementsByTagName("script")[0];
s1.async=true;
s1.src='https://embed.tawk.to/649b88c194cf5d49dc6039bd/1h3vosdlg';
s1.charset='UTF-8';
s1.setAttribute('crossorigin','*');
s0.parentNode.insertBefore(s1,s0);
})();
</script>
<!--End of Tawk.to Script-->

</body>

</html>