<?php
  session_start();    
  include "../config.php";
  include "../fungsi.php";

  $grup = mysqli_real_escape_string($con,$_GET['g']);
  $idr = mysqli_real_escape_string($con,$_GET['r']);
  
  $query = mysqli_query($con,"SELECT grup.v2 as v2,gtm.id_member as id, grup.v1 as v1 FROM grup,gtm WHERE md5(grup.id)='$grup' and md5(gtm.id_member)='$idr' ORDER BY grup.v2 asc LIMIT 0,1");
    $check = mysqli_fetch_array($query,MYSQLI_NUM);
    if (isset($check[0]) && $check[2]==1) {
        $link =$check[0];
        $_SESSION["ref"] = $check[1];
        //$link = 'http://yantonaim.web.id/bonus/';
        echo "<script language='JavaScript'>document.location='$link'</script>";
    }else{
        echo "<script>alert('Link Tidak Valid');window.location='../'</script>";    
    }
  
  
  
  
	        
 