<?php
$action=$_GET["action"];
if($action=="query"){
    $code=t(trim($_POST["code"]));
    $no=t(trim($_POST["no"]));

    if(($_POST["code"]!=$_SESSION["CmsCode"] || $_POST["code"]=="" || $_SESSION["CmsCode"]=="")){
        $_SESSION["CmsCode"]="refresh";
        die("{\"code\":\"refresh\",\"msg\":\"请填写正确的计算结果！\"}");
    } else {
        $_SESSION["CmsCode"]="refresh";
        if($no!=""){
            $O=getlist("select * from sl_orders where (O_no='$no' or O_address='$no') and O_state=1");
            if(count($O)==0){
                die("{\"msg\":\"未查询到相关订单，请重新输入\"}");
            }else{
                $arr=array(
                    "msg"=>"success",
                    "data"=>$O
                );
                die(json_encode($arr));
            }
        }else{
            die("{\"msg\":\"请输入订单号或者预留的联系方式\"}");
        }
    }
}
?>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"> 
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <title>订单查询-<?php echo $C_webtitle;?></title>
    <meta name="keywords" content="<?php echo $C_keyword;?>">
    <meta name="description" content="<?php echo $C_description;?>">
    <link rel="shortcut icon" type="image/x-icon" href="../media/<?php echo $C_ico;?>">
    <link href="template/s1/static/css/main.css" rel="stylesheet">
    <link href="template/s1/static/css/message.css" rel="stylesheet">
    <script src="template/s1/static/js/jquery.min.js"></script>
    <script src="template/s1/static/js/message.min.js"></script>
    <script src="template/s1/static/js/main.js"></script>
    <style>
        .query_title{font-size: 22px;font-weight: bold;margin-bottom: 10px;color:#545454;margin-top: 5px;}
        .query_info{font-size: 12px;color: #999}
        .input_box{
    color: #999;
    background: #fcfcfc;
    border: solid 1px #EEE;
    border-radius: 5px;
    padding: 15px;
    margin-top: 20px;
}
.qued_btn{width: 100%;height: 50px;text-align:center;color:#fff;background:#492DD9;font-size:18px;border-radius:5px;line-height:50px; font-weight: bold;margin-top: 20px;box-shadow: 0 3px 3px 0 rgba(51,107,255,.26);
    }
    </style>

</head>
<body style="background:#f7f7f7">
    <div class="main">
        <div class="body">
            <img src="template/s1/static/images/back.png" onclick="history.back();" style="width:17px">

            <div style="float: right;color: #492DD9;">
                <img src="template/s1/static/images/after.png" style="width:17px;vertical-align: top;">
                <span>申请售后</span>
            </div>

            <div style="padding:22px">
                <form id="form">
                <img src="template/s1/static/images/card.png" style="width:35px">
                <div class="">
                    <div class="query_title">查询订单卡密</div>
                    <div class="query_info">填写下单时留的联系方式,或使用"card"开头的订单号查询</div>
                </div>
                <div class="input_box">
                    <img src="template/s1/static/images/order.png" style="width:14px;">
                    <input type="text" name="no" placeholder="输入预留联系方式或订单号(以'card'开头)" style="border:none;width:calc(100% - 50px);background:#fcfcfc ;margin-left:10px;outline:none;">
                </div>

                <div style="margin-top:20px;"><?php echo calculation("code")?></div>


                <div class="qued_btn" onclick="query()">
                    查询
                </div>
                </form>
            </div>

            <div style="padding:22px">
                    <div class="" style="margin-bottom: 10px;">
                        <img src="template/s1/static/images/warning.png" style="width:12px;">
                        <span id="fahuo_title" style="color:#492DD9;font-size: 14px;font-weight: bold;">温馨提示</span>
                    </div>
                    <div class="" id="fahuo" style="font-size:12.2px;color:#999;line-height:15px;">
                        1.建议输入下单时的留的联系方式查询(30天内可查到)
                        <br>
                        2.使用订单号(以"card"开头，可在支付账单找到)查询
                    </div>

                </div>

        </div>
    </div>

    <div style="font-size:12px;margin-top:20px;text-align:center;color:#999">
        <div><a href="http://beian.miit.gov.cn/" target="_blank"><?php echo $C_beian?></a></div>
        <div><?php echo $C_copyright?></div>
    </div>
</body>
</html>