<?php
	$feed=isset($_GET['feed'])?$_GET['feed']:'gift';	
	$caption=isset($_GET['caption'])?$_GET['caption']:'กรอกรหัสเชิญรับรางวัลใหญ่！';
	$name = 'CODE:'.$_GET['code'] ?? 15859392;
	$conent = 'http://superpoker.vip/img/feed/'.$feed.'.jpg';	
	$code = $_GET['code'] ?? 15859392;
	$url = 'http://superpoker.vip/m/gift.php?feed='.$feed.'&caption='.$caption.'&name='.$name.'&type=2&code='.$code;
	
    $paramList = $_GET;
    $paramStr = '?';
    foreach ($paramList as $n => $val) {
        $paramStr .= $n.'='.$val.'&';
    }
    $paramStr = rtrim($paramStr, '&');
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=0.66"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="format-detection" content="telephone=no">  
<meta name="Keywords" content="poker,texas,ซูเปอร์,,ไพ่เท็กซัส,ไพ่,เกมไพ่,ไพ่เก้าเก,เกมส์ไพ่,poker,ซุปเปอร์เท็กซัสโป๊กเกอร์" />
<meta name="description" content="ไพ่เท็กซัสซูเปอร์ คือเกมส์ไพ่เท็กซัสที่หรูหราและสนุกตื่นเต้นที่สุดในโลก" />
<meta property="og:type" content="game" />
<meta property="fb:app_id"      content="458312474533498" /> 
<meta property="og:image"       content="<?php echo $conent;?>" />
<meta property="og:url"         content="<?php echo $url;?>" />
<meta property="og:title"       content="<?php echo $caption;?>" />
<meta property="og:description" content="<?php echo $name;?>" />
<meta property="al:ios:url"          content="superpoker-th://" />
<meta property="al:ios:app_store_id" content="1267293867" />
<meta property="al:ios:app_name"     content="ไพ่เท็กซัสซูเปอร์" >
   <title>ไพ่เท็กซัสซูเปอร์</title>
    <style>
    @charset "UTF-8";
    /* CSS Document */
    .menu {
        margin:0 auto;
        border:1pt solid #999999;
        border-radius:5px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px;
    }
    .menu a {
        text-decoration:none; 
        height:100%; 
        display:block;
        border-radius:5px;
        -webkit-border-radius: 5px;
        -moz-border-radius: 5px; color:#333;
    }
    .menu a:visited {
        text-decoration:none; 
        color:#000000;
    }
    .menu a:active {
        text-decoration:none;
    }
    .link-web{
        width:210px;
        height:40px;
        margin:0 auto;
        border-radius:4px;
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px;
        /*text-shadow:0 2px 0 #FFF;*/
        font-family: "", "";
        font-size:18px;
    }
    .link-web a{ 
        text-decoration:none; 
        width:210px; 
        height:40px; 
        display:block;
        border-radius:4px;
        -webkit-border-radius: 4px;
        -moz-border-radius: 4px; 
        background-color: #F5F5F5;
        border:1px dashed #cccccc;
        color:#333;
    }
    .link-web a:visited{
        text-decoration:none; 
        color:#333;
    }
    .link-web a:active{ 
        text-decoration:none; 
        color:#333;
    }
    .font-arial{
        font-family: "微软雅黑", "", Arial, "Arial Black";
    }
    .font-italic{
        font-style:italic;
    }
    .font-blod{
        font-weight:bold;
    }
    .font-app{
        text-align:left;
        font-size:25px;
        color: #666666;
    }
    .font-app-display{
        text-align:left;
        font-size:20px;
        color:#999999;
        text-shadow:0 2px 0 #FFF;
    }
    .font02{ 
        font-size:18px; color:#999999;
        text-align:left;
    }
    .dp_copy{ 
        margin-top:10px; 
        text-align:center; 
        color:#919090; 
        font-size:22px; 
    }
    </style>
    <script>
    // function GetQueryString(name)
    // {
    //      var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
    //      var r = window.location.search.substr(1).match(reg);
    //      if(r!=null)return  unescape(r[2]); return null;
    // }
    // var imgName = GetQueryString('feed');
    //console.log(imgName);
    //var meta = document.getElementsByTagName('meta');
    //console.log(meta[18].getAttribute('content'));
    //meta[19].setAttribute('content', 'http://superpoker.vip/img/feed/'+imgName);
    //console.log(meta[18].getAttribute('content'));
    // Android
    var URL = "superant://superpoker-th<?php echo $paramStr;?>";
    var MARKET = "market://details?id=com.superant.superpoker.th";

    // IOS
    var IOS = "superpoker-th://<?php echo $paramStr;?>";
    var ITUNES = "https://itunes.apple.com/th/app/ไพ-เท-กซ-สซ-เปอร/id1267293867";//appstore

    // PC
    var PCURL  = "https://apps.facebook.com/superpoker-th/";

    function onLoad() {
        if (navigator.userAgent.match(/Android/)) {
            var iframe = document.createElement("iframe");
            iframe.style.visibility = 'hidden';
            iframe.style.border = "none";
            iframe.style.width = "1px";
            iframe.style.height = "1px";
            iframe.src = URL;
            iframe.onload = function () { window.location = MARKET; };
            document.body.appendChild(iframe);
//            window.location.href = 'http://superpoker.vip/m/SuperPoker-release-1.3.0_onLine.apk';
        } else if (navigator.userAgent.match(/(iPhone|iPad|iPod)/i)) {
            // IOS
            setTimeout(function() {
                    window.location = ITUNES;
            }, 500);
            window.location = IOS;
        } else {
             window.location.href = PCURL;
        }
    }
    </script>
</head>
<!-- <body style="margin:0; padding:0; background:#EFEFEF;text-align:center" onload="onLoad()"> -->
<body style="margin:0; padding:0; background:#EFEFEF;text-align:center" onload="onLoad()">
    <div id="page-android" style="width:400px; height:800px; margin:0 auto; display:;">
        <div style="padding:50px 0 0px 0">
            <img src="http://superpoker.vip/img/icon144.jpg" alt="superpoker" />
        </div>
        <div class="font-arial" style="font-size:20px; line-height:34px; height:45px; text-shadow:0 2px 0 #FFF; color:#999999; text-shadow: white 2px 2px; font-weight: bold; letter-spacing:2px;">ไพ่เท็กซัสซูเปอร์</div>
        <p class="dp_copy">ไพ่เท็กซัสซูเปอร์ คือเกมส์ไพ่เท็กซัสที่หรูหราและสนุกตื่นเต้นที่สุดในโลก</p>
        <br/>
		<div class="font-arial" style=" width:400px; font-size:20px; line-height:30px; height:50px; color:#999999; letter-spacing:2px; text-align:left; margin: 0 auto;">เลือกเวอร์ชั่นที่ใช้ได้ในเครื่องของท่าน:</div>
        <br/>
		
		<div  style="width:400px; height:100px;">
            <a href="https://itunes.apple.com/th/app/ไพ-เท-กซ-สซ-เปอร/id1267293867" target="superpoker">
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="100px">
                    <tr>
                        <td width="100" align="center" valign="middle" >
                            <img src="http://superpoker.vip/img/ios.jpg" alt="" border="0"  />
                        </td>
                 
                       
                    </tr>
                </table>
            </a>
        </div>
        <div style="height:60px;"></div>
        <div style="width:400px; height:100px;">
            <a href="market://details?id=com.superant.superpoker.th">
<!--                <a href="http://superpoker.vip/m/SuperPoker-release-1.3.0_onLine.apk">-->
                <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" height="100px">
                    <tr>
                        <td width="100" align="center" valign="middle">
                            <img src="http://superpoker.vip/img/android.jpg" alt="" border="0" />
                        </td>

                    </tr>
                </table>
            </a>
        </div>
        <br/>
        <br/>
		 <br/>
        <br/>
        <a id="copy" style="height:20px; font-size:22px;font-family: 微软雅黑; text-shadow:0 2px 0 #FFF; text-align:center; margin:0px" href="https://www.facebook.com/superpoker.th">หน้าแฟนส์</a>
         <br/>
        <br/>
		 <br/>
		<div id="copy" style="height:18px; color:#999999; font-size:15px;font-family: 微软雅黑; text-shadow:0 2px 0 #FFF; text-align:center; margin:0px">Copyright © 2017 SuperAnt Technology Co., Ltd..All Rights Reserved.</div>
    </div>
</body>
</html>