<!DOCTYPE html>
<html lang=zh-cn>
<head>
    <meta charset=utf-8>
    <title>纵横计量支付系统</title>
    <meta name=description content=计量支付>
    <meta name=copyright content=smartcost.com.cn>
    <link rel=stylesheet href={{rootUrl}}global/css/bootstrap.css>
    <link rel=stylesheet href={{rootUrl}}global/css/style.css>
    <script src={{rootUrl}}global/js/jquery-1.9.1.min.js></script>
    <script src={{rootUrl}}global/js/bootstrap.js></script>
    <script src={{rootUrl}}global/js/jl.js></script>
</head>
<body>
<div class="wrapHeader">
    <h1 class="mainLogo" title="纵横计量支付"></h1>
    <div class="sysTools"><a title="返回首页" href="index.html"><i class="icon-circle-arrow-left icon-white"></i></a>&nbsp;&nbsp;&nbsp;<a
            title="纵横官网" target="_blank" href="http://smartcost.com.cn"><i class="icon-home icon-white"></i></a></div>
</div>
<!-- include "top" -->
<div class="warpAdmin">
    <div class="adminSidebar fL">
        <ul>
            <li><a href="{{rootUrl}}manage/user/list" class="now">用户列表</a></li>
            <li><a href="{{rootUrl}}manage/user/add">添加用户</a></li>
        </ul>
    </div>
    <div class="adminContent">
        <div class="adminMain">
            <form class="form-horizontal" method="post" enctype="multipart/form-data">
                <fieldset>
                    <legend>编辑用户</legend>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">邮箱（登录使用）</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" name="email" value="{{users.uemail}}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">单位（公司）</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" name="company" value="{{profile.company}}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">职位</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" name="jobs" value="{{profile.jobs}}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">姓名</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" name="name" value="{{profile.name}}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">联系电话</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" name="phone" value="{{profile.phone}}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" name="remark" value="{{profile.remark}}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">短信通知</label>
                        <div class="col-sm-3">
                            <input class="form-control" type="text" disabled="disabled" value="{{profile.mobile}}">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-sm-2 control-label">电子签名</label>
                        <div class="col-sm-3">
                            <img id="signpic" src="{{rootUrl}}{{profile.signpath}}" width="150px"> <a href="#addsign" data-toggle="modal">更新</a>
                        </div>
                    </div>
                    <div class="alert alert-danger">
                        <strong>请谨慎编辑用户!</strong> 编辑后将影响该用户曾参与的所有标段数据。
                    </div>
                    <div class="form-group">
                        <label class="col-sm-1 control-label"></label>
                        <div class="col-sm-3">
                            <input type="submit" class="btn btn-normal btn-danger" value="完成编辑"/>
                        </div>
                    </div>
                </fieldset>
                <!-- 更新签名 -->
                <div id="addsign" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header">
                                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                                <h4 class="modal-title">更新电子签名</h4>
                            </div>
                            <div class="modal-body">
                                <div class="form">
                                    <form class="form-horizontal">
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">上传签名图</label>
                                            <div class="col-sm-10">
                                                <input type="file" name="sign" id="uploadsign" value="" accept="image/png">
                                                <p class="text-danger"><span class="glyphicon glyphicon-warning-sign"></span> 上传签名图大小为：600 x 300</p>
                                            </div>
                                        </div>
                                        <div class="form-group">
                                            <label class="col-sm-2 control-label">生成签名图</label>
                                            <div class="col-sm-10">
                                                <p class="help-block"><a href="http://sign.6jlzf.cn" target="_blank" class="btn btn-default">打开 HWPenSign</a></p>
                                            </div>
                                        </div>
                                    </form>
                                </div>
                            </div>
                            <div class="modal-footer">
                                <button class="btn btn-default" data-dismiss="modal" aria-hidden="true">关闭</button>
                                <button class="btn btn-primary" sign-url="" id="updatesignbtn" data-dismiss="modal" aria-hidden="true">更新</button>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 更新签名 -->
            </form>

            <div class="tabbable">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#tab1" data-toggle="tab">该用户审批标段</a></li>
                    <li><a href="#tab2" data-toggle="tab">该用户创建标段</a></li>
                    <li><a href="#tab3" data-toggle="tab">该用户创建项目</a></li>
                </ul>
                <div class="tab-content">
                    <div class="tab-pane active" id="tab1">
                        <table class="table table-striped">
                            <thead>
                            <tr><th>标段名称</th><th>所属项目</th></tr>
                            </thead>
                            <tbody>
                            <!-- loop mnflist -->
                            <tr><td>{{mnflist' value.pmname}}</td><td>{{mnflist' value.pname}}</td></tr>
                            <!-- endloop -->
                            </tbody>
                        </table>
                    </div>
                    <div class="tab-pane" id="tab2">
                        <table class="table table-striped">
                            <thead>
                            <tr><th>标段名称</th><th>所属项目</th><th>创建时间</th></tr>
                            </thead>
                            <tbody>
                            <!-- loop mnflist2 -->
                            <tr><td>{{mnflist2' value.pmname}}</td><td>{{mnflist2' value.pname}}</td><td>{{mnflist2' value.intime}}</td></tr>
                            <!-- endloop -->
                            </tbody>
                        </table>
                    </div>
                    <div class="tab-pane" id="tab3">
                        <table class="table table-striped">
                            <thead>
                            <tr><th>项目名称</th><th>创建时间</th></tr>
                            </thead>
                            <tbody>
                            <!-- loop prolist -->
                            <tr><td>{{prolist' value.pname}}</td><td>{{prolist' value.intime}}</td></tr>
                            <!-- endloop -->
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <!--		    <div class="userPrj">
                                    <legend>该用户参与的标段</legend>
                                    <table class="table table-striped">
                                        <thead>
                                            <tr><th>项目名称</th><th>标段名称</th></tr>
                                        </thead>
                                        <tbody>
                                            <tr><td>XXXX项目</td><td>A标段</td></tr>
                                            <tr><td>XXXX项目</td><td>B标段</td></tr>
                                            <tr><td>XXXX项目</td><td>C标段</td></tr>
                                        </tbody>
                                    </table>
                                </div>-->
        </div>
    </div>
</div>
<script type="text/javascript">autoFlashHeight();</script>
<script>
    $(function(){
        $('#uploadsign').change(function(){
            var objUrl = getObjectURL(this.files[0]) ;
            $('#updatesignbtn').attr('sign-url',objUrl);
        });
        $('#updatesignbtn').click(function(){
            $('#signpic').attr('src',$(this).attr('sign-url'));
            $(this).attr('sign-url','');
        })
    });
    function getObjectURL(file) {
        var url = null;
        if (window.createObjectURL != undefined) {
            url = window.createObjectURL(file)
        } else if (window.URL != undefined) {
            url = window.URL.createObjectURL(file)
        } else if (window.webkitURL != undefined) {
            url = window.webkitURL.createObjectURL(file)
        }
        return url;
    };
</script>
</body>