<include file="public@header"/>
<style>
.home_info li em {
	float: left;
	width: 120px;
	font-style: normal;
}
li {
	list-style: none;
    margin:3px;
}
.w-left {
    width:40%;
    float:left;
    margin-left:5%
}
.btn-lg{
    font-size: 16px
}
.w-right {
    width:40%;
    float:right;
    margin-right:10%
}
.tips{
    display: none;
    position: fixed;
    top: 20%;
    left: 40%;
    min-width: 200px;
    max-width: 700px;
    transform: translate(-50%,-50%);
    z-index: 99999;
    text-align: center;
    padding: 15px;
    border-radius: 5px;
    color:black;
    background-color: #f2dede;
    border-color: #d6e9c6;
    }
.edits{
    cursor:pointer;
    color:coral;
}
</style>
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInUp js-check-wrap">
        <div class="tips"></div><!-- 提示框 -->
        <h4 class="well">当前共有<span style="color:red"> {$count} </span>条申请信息</h4>

	<div>
        <foreach name="data" item="vo">
           <if condition="$key%2==0"><div style="clear:both"><else /></if>
            <div <if condition="$key%2==0"> class="wrap w-left" <else /> class="wrap w-right"</if> >
                <h4 class="well">第<span style="color:red"> {$key+1} </span>条申请信息</h4>
                <div class="home_info">
                    <eq name="vo.type" value="1">    
    
                        <ul>
                            <li><em>申请来源</em> <span style="color:blue;font-weight: bold">用户提交</span>&nbsp;&nbsp;</li>
                            <li><em>申请人姓名：</em> <span>{$vo.u_name}(id:{$vo.user_id})</span>&nbsp;&nbsp;</li>
                            <li><em>国籍：</em> <span>{$vo.country}</span>&nbsp;&nbsp;</li>
                            <li><em>生日：</em> <span>{$vo.birthday}</span>&nbsp;&nbsp;</li>
                            <li><em>证件照id：</em> <span>{$vo.photo_id}</span>&nbsp;&nbsp;</li>
                            <li><em>证件照1：</em> <span>
                                <neq name="vo.photo_id1" value="">
                                    <img 
                                        <eq name="vo['photo_id1'][0]" value="h">
                                            src="{$vo.photo_id1}"
                                        <else />
                                            src="http://{$server}/upload/{$vo.photo_id1}"
                                        </eq> 
                                    width="15%" min-height="200px" min-width="200px" height="15%" >
                                </neq>
                            </span>&nbsp;&nbsp;</li>
                            <li><em>证件照2：</em> <span>
                                    <neq name="vo.photo_id2" value="">
                                        <img 
                                            <eq name="vo['photo_id2'][0]" value="h">
                                                src="{$vo.photo_id2}"
                                            <else />
                                                src="http://{$server}/upload/{$vo.photo_id2}"
                                            </eq> 
                                        width="15%" min-height="200px" min-width="200px" height="15%" >
                                    </neq>
                                </span>&nbsp;&nbsp;</li>
                            <li><em>居住地</em> <span>{$vo.address}</span>&nbsp;&nbsp;</li>
                            <li><em>申请时间：</em> <span>{$vo.create_at|date="Y-m-d H:i",###}</span>&nbsp;&nbsp;</li>
                        </ul>

                    <else />
                    <?php  
                        $rz_data= json_decode($vo['rz_data']  ,true); 
                        $zm=array_change_key_case($rz_data['zm_data']['data']);
                        $fm=array_change_key_case($rz_data['fm_data']['data']);
                        if( !empty($zm['idphototreshold'])){
                            $zmfhd= $zm['idphototreshold'];
                        }else if( !empty($zm['idphotothreshold'])){
                            $zmfhd= $zm['idphotothreshold'];
                        }else{
                            $zmfhd=0;
                        }
                        $zmfhd_bfb = (int)(  $zmfhd * 100);
                        if( !empty($fm['idphototreshold'])){
                            $fmfhd= $fm['idphototreshold'];
                        }else if( !empty($fm['idphotothreshold'])){
                            $fmfhd= $fm['idphotothreshold'];
                        }else{
                            $fmfhd=0;
                        }
                        $fmfhd_bfb = (int)(  $fmfhd * 100);                 
                    ?>
                         <ul>
                            <li><em>申请来源</em> <span style="color:green;font-weight: bold">服务接口验证</span>&nbsp;&nbsp;</li>
                            <li><em>申请人姓名：</em> <span>{$vo.u_name}(id:{$vo.user_id})</span>&nbsp;&nbsp;</li>
                            <li><em>国籍：</em> <span>{$vo.country}</span>&nbsp;&nbsp;</li>
                            <li><em>生日：</em> <span>{$vo.birthday}</span>&nbsp;&nbsp;</li>
                            <li><em>证件照id：</em> <span>{$vo.photo_id}</span>&nbsp;&nbsp;</li>
                            <li><em>居住地</em> <span>{$vo.address}</span>&nbsp;&nbsp;</li>
                            <li></em>证件照正面可信度：</em> <span style="color:green"> {$zmfhd_bfb}%</span>&nbsp;&nbsp;</li>
                            <li></em>证件照背面可信度：</em> <span style="color:green">{$fmfhd_bfb}%</span>&nbsp;&nbsp;</li>
                            <li><em>申请时间：</em> <span>{$vo.create_at|date="Y-m-d H:i",###}</span>&nbsp;&nbsp;</li>
                        </ul>


                    </eq>
                    <div style="text-align:center">
                        <span class="label label-info btn-lg" name="{$vo.id}" style="cursor:pointer"  title="{$vo.id}" onclick="ajaxupdate(this,'1')"> 通过</span>  
                        <span class="label label-success btn-lg" name="{$vo.id}"  style="cursor:pointer"  title="{$vo.id}" onclick="ajaxupdate(this,'3')">拒绝</span>
                    </div>
                </div>
            </div>
            <if condition="$key%2==1"></div> <else /></if>
        </foreach>
    </div>
    <script src="__PUBLIC__/js/common.js"></script>
    <script>
        function ajaxupdate(datas,type){
            var id=datas.title;
            // console.log(datas);
            console.log(id);console.log(type);
            $.ajax({
                url:"{:url('UserAuth/ajaxupdate') }",
                type:"post",
                data:{ids:id,types:type},
                success:function(data){
                    console.log(data);
                    $('.tips').text(data).fadeIn().delay(1500).fadeOut();	
					document.location.reload();
                },
                error:function (error){
                    console.log(error);
                }
            })
        }
    
    </script>
    </body>
</body>
</html>