<?php

$mod='blank';
include("../include/common.php");
$title='添加单号';
include './head.php';
if($islogin==1){}else exit("<script language='javascript'>window.location.href='./login.php';</script>");
?>
  <nav class="navbar navbar-fixed-top navbar-default">
    <div class="container">
      <div class="navbar-header">
        <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
          <span class="sr-only">导航按钮</span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
          <span class="icon-bar"></span>
        </button>
        <a class="navbar-brand" href="./">流量卡系统查询系统后台</a>
      </div><!-- /.navbar-header -->
      <div id="navbar" class="collapse navbar-collapse">
        <ul class="nav navbar-nav navbar-right">
          <li>
            <a href="./"><span class="glyphicon glyphicon-user"></span> 平台首页</a>
          </li>
        <li>
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-pushpin"></span> 单号管理<b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="add.php">添加单号</a><li>
			  <li><a href="list.php">单号列表</a></li>
			  <li><a href="search.php">搜索单号</a><li>
            </ul>
          </li>
		  <li>
            <a href="#" class="dropdown-toggle" data-toggle="dropdown"><span class="glyphicon glyphicon-cog"></span> 系统管理<b class="caret"></b></a>
            <ul class="dropdown-menu">
              <li><a href="./siteset.php">系统设置</a><li>
			  <li><a href="./passwd.php">修改密码</a></li>
            </ul>
          </li>
          <li><a href="./login.php?logout"><span class="glyphicon glyphicon-off"></span> 退出登陆</a></li>
        </ul>
      </div><!-- /.navbar-collapse -->
    </div><!-- /.container -->
  </nav><!-- /.navbar -->
  <div class="container" style="padding-top:70px;">
    <div class="col-xs-12 col-sm-10 col-lg-8 center-block" style="float: none;">
<?php
if(isset($_POST['qq']) && isset($_POST['note'])){
$qq=daddslashes($_POST['qq']);
$level=daddslashes($_POST['level']);
$note=daddslashes($_POST['note']);
$row=$DB->get_row("SELECT * FROM black_list WHERE qq='{$qq}' limit 1");
if($row!='')exit("<script language='javascript'>alert('后台已存在该用户！');history.go(-1);</script>");
	$sql="insert into `black_list` (`qq`,`date`,`level`,`note`) values ('".$qq."','".$date."','".$level."','".$note."')";
	$DB->query($sql);
exit("<script language='javascript'>alert('添加成功');window.location.href='add.php';</script>");
} ?>
      <div class="panel panel-primary">
        <div class="panel-heading"><h3 class="panel-title">添加单号</h3></div>
        <div class="panel-body">
          <form action="./add.php" method="post" class="form-horizontal" role="form">
            <div class="input-group">
              <span class="input-group-addon">手机号</span>
              <input type="text" name="qq" value="<?=@$_POST['qq']?>" class="form-control" placeholder="请输入客户手机号" autocomplete="off" required/>
            </div><br/>
			<div class="input-group">
			<span class="input-group-addon">快递类别</span>
			<select name="level" class="form-control">
			    <option value="天天快递">天天快递</option>
			    <option value="韵达快递">韵达快递</option>
			    <option value="顺丰快递">顺丰快递</option>
			    <option value="邮政快递">邮政快递</option>
			    <option value="中通快递">中通快递</option>
			    <option value="申通快递">申通快递</option>
			    <option value="圆通快递">圆通快递</option>
			</select></div><br>
            <div class="input-group">
              <span class="input-group-addon">物流单号</span>
              <input type="text" name="note" value="<?=@$_POST['note']?>" class="form-control" placeholder="请输入物流单号" autocomplete="off" required/>
            </div><br/>
            <div class="form-group">
              <div class="col-sm-12"><input type="submit" value="添加" class="btn btn-primary form-control"/></div>
            </div>
          </form>
        </div>
        <div class="panel-footer">
          <span class="glyphicon glyphicon-info-sign"></span> 添加单号！
        </div>
      </div>
    </div>
  </div>