<?php
require_once("../check.php");
require_once("../core/setting.php");
?>
<!DOCTYPE html>
<head>
<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="../js/jquery-1.11.1.min.js"></script>
<script src="../jquerymoblie/jquery.mobile-1.4.1.min.js"></script>
<link rel="stylesheet" href="../jquerymoblie/jquery.mobile-1.4.1.min.css"/>
<style>
img{
    max-width:100%;
}
</style>
<div data-role="page" id="pageone">
  <div data-role="header">
    <h1>推荐好友赚钱</h1>
  </div>
  <div data-role="content" style="text-align: center;">
  <div style="text-align: left;">您的好友通过您的二维码或推广链接注册成功后，系统就自动跟踪统计您的下线提成。</div>
<?php
$baocuodengji = "L";
$size = "8";
$data = "http://".$setting['domain']."/reg.php?uid=".$uid;
    $PNG_TEMP_DIR = dirname(__FILE__).DIRECTORY_SEPARATOR.'temp'.DIRECTORY_SEPARATOR;
    $PNG_WEB_DIR = 'temp/';
    include "../phpqrcode/qrlib.php";    
    if (!file_exists($PNG_TEMP_DIR))
    mkdir($PNG_TEMP_DIR);
    $filename = $PNG_TEMP_DIR.'test.png';
    $errorCorrectionLevel = 'L';
    if (isset($baocuodengji) && in_array($baocuodengji, array('L','M','Q','H')))
    $errorCorrectionLevel = $baocuodengji;    
    $matrixPointSize = 6;
    if (isset($size))
        $matrixPointSize = min(max((int)$size, 1), 10);
    if (isset($data)) { 
        if (trim($data) == '')
            die('data cannot be empty! <a href="?">back</a>');
        $filename = $PNG_TEMP_DIR.'test'.md5($data.'|'.$errorCorrectionLevel.'|'.$matrixPointSize).'.png';
        QRcode::png($data, $filename, $errorCorrectionLevel, $matrixPointSize, 2);    
        
    } else {    
        echo 'You can provide data in GET parameter: <a href="?data=like_that">like that</a><hr/>';    
        QRcode::png('PHP QR Code :)', $filename, $errorCorrectionLevel, $matrixPointSize, 2);    
        
    }
    echo '<img src="'.$PNG_WEB_DIR.basename($filename).'" />';
?>
<div style="width:95%;height:auto;text-align:center;line-height:25px;font-size:14px;color: #838383;">
可使用面对面微信扫一扫<br />
或发送给好友进行邀请或微信朋友圈!<br />

<P></P>
<div style="border: 1px solid #B6B6B6;">
<div style="text-align: left;">
或复制以下信息发给好友[长按3秒后点复制]<br />
</div>
<div style="text-align: left;">http://<?php echo $_SERVER['HTTP_HOST'];?>/reg.php?uid=<?php echo $uid;?></div>
<p></p>
</div>
</div></div></div>