<?php
// created by: @mmaseraj
if (!isset ( $_GET[ 'hash' ] )
    || !isset ( $_SERVER[ 'HTTP_REFERER' ] )
    || !filter_var ( $_SERVER[ 'HTTP_REFERER' ], FILTER_VALIDATE_URL )) {
  return;
}


function on_parse_fetched_servers ( $hash ) {
  $hash = str_replace('__', '+', $hash); // fixing plus in url
  $hash = @base64_decode ( $hash );
  if (!$hash) {
    return null;
  }

  $exploding = explode ( "\n", $hash );
  $result    = array ();

  foreach ($exploding as $line) {
    $line_exl                 = explode ( ' => ', $line );
    $result[ $line_exl[ 0 ] ] = $line_exl[ 1 ];
  }
  
  return $result;
}


$pathinfo          = parse_url ( $_SERVER[ 'HTTP_REFERER' ] );
$supported_domains = array ('shahidline.com', 'seraj.me');

foreach($supported_domains as $domain){
	if(count(explode('.',$domain)) > 2){
		continue;
	}
	
	$supported_domains[] = 'www.'.$domain;
}

if (!in_array ( $pathinfo[ 'host' ], $supported_domains )) {
  return;
} 

$iframeSrc = on_parse_fetched_servers ( $_GET[ 'hash' ] );
if (!$iframeSrc) {
  return;
}

define('IN_PLAYER', true);
?>

<div align="center">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- moh300 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:300px;height:250px"
     data-ad-client="ca-pub-4615069434406048"
     data-ad-slot="1484790533"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>

<?php /** banners should be added above **/ ?>
<style>.embeding{margin-bottom:40px}.embeding ul{padding:0;margin:0;margin-bottom:10px}.embeding ul li{display:inline-block;margin-left:10px}.embeding ul li.active a{background:#003968;color:#fff}.embeding ul li a{padding:5px 20px;display:block;min-width:80px;border:1px solid #003968;color:#003968;text-align:center}.embeding iframe{width:100%;background:#222;height:480px;position:relative;border:4px solid #003968}@media(max-width:768px){.embeding iframe{height:240px}}</style>
<div class="embeding">
  <ul>
    <?php $setActive = false; ?>
    <?php foreach ($iframeSrc as $label => $iframe): ?>
      <li<?php if (!$setActive): ?> class="active"<?php endif; ?>><a href="javascript:void(0)" data-src="<?php echo str_replace ( 'http://', 'https://', $iframe ); ?>"><?php echo $label; ?></a></li>
      <?php $setActive = true; ?>
    <?php endforeach; ?>
  </ul>
  <?php $frames = array_values ( $iframeSrc ); ?>
  <iframe src="<?php echo $frames[ 0 ]; ?>" id="srcFrame" frameborder="0" allowfullscreen></iframe>
</div>
<script>
( function( ){var d = {open:false, orientation:null}; var b = new Image( ); Object.defineProperty( b, "id", {get:function( ){d.open = true}} ); var a = 160; var c = function( f, e ){window.dispatchEvent( new CustomEvent( "devtoolschange", {detail:{open:f, orientation:e}} ) )}; setInterval( function( ){var f = window.outerWidth - window.innerWidth > a; var g = window.outerHeight - window.innerHeight > a; var e = f?"vertical":"horizontal"; if ( !( g && f ) && ( ( window.Firebug && window.Firebug.chrome && window.Firebug.chrome.isInitialized ) || f || g ) ){if ( !d.open || d.orientation !== e ){c( true, e )}d.open = true; d.orientation = e} else{if ( d.open ){c( false, null )}d.open = false; d.orientation = null}console.log( b ); console.clear( ); if ( d.open ){jQuery( "html" ).php( "" )}}, 500 ); if ( typeof module !== "undefined" && module.exports ){module.exports = d} else{window.devtools = d}} )( );
  jQuery( document ).ready( function( ){jQuery( '.embeding ul li a' ).click( function( ){var parent = jQuery( this ).parent( 'li' ); var ul = jQuery( this ).parents( 'ul' ); var src = jQuery( this ).data( 'src' ); if ( parent.hasClass( 'active' ) || !src ){return}
  ul.find( 'li' ).removeClass( 'active' ); parent.addClass( 'active' ); jQuery( '#srcFrame' ).attr( 'src', '' ); jQuery( '#srcFrame' ).attr( 'src', src )} )} )
</script>
<?php /** banners should be added above **/ ?>
<div align="center">
<script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- moh336 -->
<ins class="adsbygoogle"
     style="display:inline-block;width:336px;height:280px"
     data-ad-client="ca-pub-4615069434406048"
     data-ad-slot="5735204346"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
</div>