<extend name="Public/manage" />
<block name="head">
	<link href="__CSS__/user_zxy.css" rel="stylesheet">
	<script src="__JS__/bootstrap-select.min.js"></script>
</block>
<block name="location">
	<a class="z_nav" href="{:U('Apply/apply')}">账号中心</a>
	<a class="z_nav curt_nav" href="{:U('Apply/contract')}">银行账号</a>
</block>
<block name="body" >
                        <div class="matter_right_content">
							<div class="title">
								<i class="usebase_icon"></i> 
								<span>合同管理</span>
							</div>
                            <div class="btn_group contract_btn_group clearfix zwm_contract">
                                <form action="" method="post" class="search_form zclearfix">
                                    <div class="form_group11" >
                                        <select name="status" class="form_control" id="zwm_zt">
                                            <option value="">所有状态</option>
                                            <option value="1">已签署</option>
                                            <option value="2">待签署</option>
                                            <option value="4">已确认</option>
                                        </select>
                                    </div>
        
                                    <div class="form_group" ><input name="game_name" value="{:I('game_name')}" class="form_control" style="width:200px;display:inline" placeholder="请输入游戏名称" type="text"></div>
                                    <div class="form_group"><button type="button" id="search" url="{:U('contract')}" class="btn btn_primary user_btn">查询</button></div>
                                </form>
                            </div>
                            <hr>
                            <div class="table_container contract_table">
                                <div class="table_responsive">
			        <table class="table table_striped table_hover" >
			            <thead>
				            <tr>
				            	<th>创建时间</th>
								<th>游戏名称</th>
								<th>合同编号</th>
								<th>签约日期</th>
								<th>终止日期</th>
								<th>"锁定"</th>
								<th>操作</th>
				            </tr>
			            </thead>
                        <tbody>
                        <volist name="data" id="vo">
                            <tr>
                                <td>{:time_format($vo['create_time'])}</td>
                                <td>{$vo.game_name}</td>
                                <td>{$vo.contract_number}</td>
                                <td>{:empty($vo['start_time']) ? '' : time_format($vo['start_time'])}</td>
                                <td>{:empty($vo['end_time']) ? '' : time_format($vo['end_time'])}</td>
                                <td>{:get_info_status($vo['status'],28)}</td>
                                <td>
                                    <eq name="vo.status" value="2">
                                    <a  href="#detail" class="btn btn_primary sign_contract" data-values="" data-ga-id="{$vo.id}" data-toggle="modal" data-target="#detailModal">立即签署</a>
                                    </eq>
                                </td>
                            </tr>
                        </volist>
                        </tbody>
			        </table><notempty name="data">
                                    <div class="pagination_wrap">
                                        {$_page}
                                    </div><else />			<div class="text_format">                        <img src="__IMG__/zwmimages/gamemanagement_icon_matadata.png">                        <p class="p_lineh30">暂无数据</p>                    </div>
                                    </notempty>
                                </div>
                            </div>

                            <div class="alert alert_info contract_alert" style="margin-top:0;">
                            相关说明:<br>
                            1、您的合同在线提交完成后,我们会邮寄合同,请您确认并加盖公章后,邮寄给我们;<br>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;邮寄地址:江苏省徐州市云龙区郭庄路新锐领地A2号楼1-204,304<br>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;收件人:XXX&nbsp;&nbsp;&nbsp;<br>
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;联系方式:010-59974316<br>
                            2、请您在收到合同后7个工作日内回寄,以免影响游戏上线<br>
                            3、如您对合同中的条款有疑义,请联系我们的相关人员修改  <br>
                            </div>
                        </div>
                

        
        <script>

            $(function() {
                $("#search").click(function () {
                    var url = $(this).attr('url');
                    var query = $('.search_form').find('input').serialize();
                    query += "&" + $('.search_form').find('select').serialize();
                    query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g, '');
                    query = query.replace(/^&/g, '');
                    if (url.indexOf('?') > 0) {
                        url += '&' + query;
                    } else {
                        url += '?' + query;
                    }
                    window.location.href = url;
                });


                Think.setValue("status", "{:I('status')}");
                $.VMenu.show('#menu');
                $.VMenu.open('m1.4');

                $(".sign_contract").click(function () {
                    var id = $(this).attr('data-ga-id');
                    $("#contract_id").val(id);
                })

                $(".submit_btn").click(function () {
                    var ag = $("#agree").is(':checked');
                    var pr = $("#promise").is(':checked');
                    if (ag && pr) {
                        $("#agree_form").submit();
                    } else {
                        layer.msg("请确认合同并同意承诺");
                    }
                });
				
				
				 $('#zwm_zt').selectpicker({
				    size: 15
			    });
            });
        </script>
</block><block name="pop">					<div class="modal fade" id="detailModal" tabindex="-1" role="dialog" aria-labelledby="detailModalLabel" aria-hidden="true" style="display: none;">            <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" id="myModalLabel">                            确认合同信息                        </h4>                    </div>                    <form>                    <div class="modal-body">                        <div id="detailInfo">                            <div class="alert alert_info">以下信息将填入电子合同,请确认是否正确,如有误请到“<a href="{:U('Apply/apply')}">基本信息</a>”修改。</div>                            <div class="form-group">                                <label class="mrc mrc_colum2_5 control-label">                                    <span class="pull-right">签约合同</span>                                </label>                                <div class="mrc mrc_colum5 input-format">                                    <span>{$content.title}</span>                                </div>                                <div class="clearfix"></div>                            </div>                            <div class="form-group">                                <label class="mrc mrc_colum2_5 control-label">                                    <span class="pull-right">开发者名称</span>                                </label>                                <div class="mrc mrc_colum5 input-format">                                    <span>{$develop.nickname}</span>                                </div>                                <div class="clearfix"></div>                            </div>                            <div class="form-group">                                <label class="mrc mrc_colum2_5 control-label">                                    <span class="pull-right">联系地址</span>                                </label>                                <div class="mrc mrc_colum5 input-format">                                    <span>{$develop.address}</span>                                </div>                                <div class="clearfix"></div>                            </div>                            <div class="form-group">                                <label class="mrc mrc_colum2_5 control-label">                                    <span class="pull-right">联系人</span>                                </label>                                <div class="mrc mrc_colum5 input-format">                                    <span>{$develop.link_man}</span>                                </div>                                <div class="clearfix"></div>                            </div>                            <div class="form-group">                                <label class="mrc mrc_colum2_5 control-label">                                    <span class="pull-right">联系电话</span>                                </label>                                <div class="mrc mrc_colum5 input-format">                                    <span>{$develop.mobile_phone}</span>                                </div>                                <div class="clearfix"></div>                            </div>                            <div class="form-group">                                <label class="mrc mrc_colum2_5 control-label">                                    <span class="pull-right">联系邮箱</span>                                </label>                                <div class="mrc mrc_colum5 input-format">                                    <span>{$develop.email}</span>                                </div>                                <div class="clearfix"></div>                            </div>                                                </div>                    </div>                    <div class="modal-footer" style="text-align: center;">                        <input type="hidden" name="" value="">                        <!-- <input type="submit" class="btn btn_primary" value="确认并继续">&nbsp;&nbsp; -->                        <button type="button" class="btn btn_primary" data-dismiss="modal" data-toggle="modal" data-target="#detailModal2">确认并继续</button>                        <button type="button" class="btn btnclose" data-dismiss="modal" aria-hidden="true">取消</button>                    </div>                    </form>                </div>            </div>        </div>                <div class="modal fade" id="detailModal2" tabindex="-1" role="dialog" aria-labelledby="detailModalLabel" aria-hidden="true" style="display: none;">            <style>.modal-footer p{text-align: left;color: #7c7c7c;} .modal-footer p:nth-of-type(2){margin-bottom:15px;} .modal-footer p label{font-weight:normal;padding-left:5px;cursor:pointer;}</style>            <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" id="myModalLabel">                            提交电子合同                        </h4>                    </div>                    <form  action="{:U('Apply/sign_contract')}" method="post" id="agree_form">                    <div class="modal-body">                        <div id="detailInfo">                            <div class="alert alert_info">请确认并提交该电子合同,如对合同中的条款有疑义,联系我们相关人员修改。</div>                                                    <div class="form-group">                                {$content.content}                                <div class="clearfix"></div>                            </div>                        </div>                    </div>                    <div class="modal-footer" style="text-align: center;">                        <p><input type="checkbox" id="agree" ><label for="agree">我已同意合同内容,并同意签署次合同</label></p>                        <p><input type="checkbox" id="promise" ><label for="promise">我承诺在7日内回寄加盖公司合同章和纸质合同文件</label></p>                        <input id="contract_id" type="hidden" name="contract_id" value="">                        <input type="button" class="btn btn_primary submit_btn" value="立即提交">&nbsp;&nbsp;                        <button type="button" class="btn btnclose" data-dismiss="modal" aria-hidden="true">取消</button>                    </div>                    </form>                </div>            </div>        </div>        </block>