<?php
require 'conn/conn.php';
require 'conn/function.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>批量生成短链接 - <?php echo $C_title?></title>
    <meta name="description" content="<?php echo $C_description?>" />
    <meta name="keywords" content="<?php echo $C_keyword?>" />
    <link href="media/<?php echo $C_ico?>" rel="shortcut icon" />
  	<link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/css/bootstrap.min.css">  
  	<script src="https://cdn.staticfile.org/jquery/2.1.1/jquery.min.js"></script>
  	<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
  	<style type="text/css">
		body{background: #f7f7f7}
	</style>
</head>
<body>
<?php require 'wap_header.php';?>
<div style="padding: 10px">
            <form class="form-horizontal" id="form">
            <div class="panel panel-info">
              <div class="panel-heading">批量生成短链</div>
              <div class="panel-body">
                <form id="form">
                  <p><textarea class="form-control" name="url" placeholder="请输入 http:// 或 https:// 开头的网址，每行一个" id="url" rows="15"></textarea></p>
                  <p class="d">
                    <select name="type" style="width: 100px;height: 30px">
                      <option value="0">普通跳转</option>
                      <option value="1">防红跳转</option>
                      <option value="2">强开直链</option>
                    </select>
                    <?php 
                    if(strpos($C_dwzon,"-2")!==false){echo "<label><input type=\"radio\" name=\"d\" value=\"-2\"> ".$_SERVER["HTTP_HOST"]."</label> ";}

                    $sql="select D_id,D_domain from sl_domain where D_show=1";
                    $result = mysqli_query($conn,  $sql);
                    if (mysqli_num_rows($result) > 0) {
                    while($row = mysqli_fetch_assoc($result)) {
                            echo "<label><input type=\"radio\" name=\"d\" value=\"".$row["D_id"]."\"> ".$row["D_domain"]."</label> ";
                        }
                    }
                    
                  if(strpos($C_extra,"1")!==false){echo "<label><input type=\"radio\" name=\"d\" value=\"-101\"> 微信随机通道</label> ";}
                  if(strpos($C_extra,"2")!==false){echo "<label><input type=\"radio\" name=\"d\" value=\"-102\"> QQ随机通道</label> ";}
                  ?>
                  </p>
                  
                  <button type="button" onclick="creat_urls()" class="btn btn-primary btn-block" >生成短链接</button>
                </form>
                <span id="msg"></span>
              </div>
            </div>
            </form>
   
            <form class="form-horizontal" id="form">
            <div class="panel panel-info">
              <div class="panel-heading">返回结果</div>
              <div class="panel-body" id="return">
                点击生成按钮后，显示返回结果
              </div>
            </div>
            </form>

</div>
<script type="text/javascript">
$(".d").find("label input:first").attr("checked","checked");
</script>
<script src="js/wap_main.js?v=0928"></script>
<?php require 'wap_footer.php';?>
</body>
</html>