
<!---->
<div id="centre" class="layout">
		<div class="centreInner ">
            <form name = 'search_form' id='search_form' method='get' action ='' > 
				<div class="mainInner radius5 "> 
						
						<!---->
						
						<div class="titleTabBox">
								<div class="titleTab">
										<div class="titleTabB clearfix">
												<dl class="list">
														<dd class="item itemOn"> <a class="link" href="/my_loan/index/"> 申请贷款 </a></dd>
														<dd class="item"> <a class="link" href="/my_loan/record/">我的贷款</a> </dd>
												</dl>
										</div>
								</div>
						</div>
						<div class="tab_box_p_001">
                           
                            <a class="link  <?php if($type==1){echo 'linkOn';}?>" href="/my_loan/index/">二手房贷款</a>
                            <a class="link <?php if($type==2){echo 'linkOn';}?>" href="/my_loan/index/?type=2">抵押贷款</a>
                            <a class="link <?php if($type==3){echo 'linkOn';}?>" href="/my_loan/index/?type=3">信用贷款</a>
                            <a class="link <?php if($type==4){echo 'linkOn';}?>" href="/my_loan/index/?type=4">租房贷款</a> 
                        
                        </div>
						
						<!---->
						
						<div class="branchCommon_p_box">
								<div class="branchCommon branchCommon_pay radius5 ">
										<div class="hd">
												<table class="tableExpert">
														<tbody>
																<tr>
                                                                 <?php if($type==1){?>
																		<td class="td f w145">银行</td>
																		<td class="td w155">首套住房利率</td>
																		<td class="td w155">二套住房利率</td>
																		<td class="td w300">产品特点</td>
																		<td class="td">经纪人通道</td>
																<?php }elseif($type==4){?>
																        <td class="td f w145">产品名称</td>	
																		<td class="td w460">产品特点</td>
																		<td class="td">经纪人通道</td>
																<?php }else{?>
																	  <td class="td f w145">产品名称</td>
																		<td class="td w268">利率</td>	
																		<td class="td w300">产品特点</td>
																		<td class="td">经纪人通道</td>

																<?php }?>

																</tr>
														</tbody>
												</table>
										</div>
										<div class="mod">
												<table class="tableExpert">
                                                    <?php if($data_info){?>
                                                    <?php foreach($data_info as $key=>$value){     
                                                     $rate = explode('|',$value['rate']);    
                                                    ?>
                                                    <?php if($key%2==0){?>	<tr> <?php }else{ ?><tr class="bg"><?php } ?>
													         <?php if($type==1){?>
																<td class="td f w145"><div class="t_d_p_10"><?=$value['product']?></div></td>
                                                                <td class="td w155"><div class="t_d_p_10"><?php if(isset($rate[0])){echo $rate[0];}else{echo "──";}?></div></td>
                                                                <td class="td w155"><div class="t_d_p_10"><?php if(isset($rate[1])){ echo $rate[1];}else{echo "──";}?></div></td>
                                                                <td class="td w300"><div class="t_d_p_10"><?php if(isset($value['feature'])){echo $value['feature'];}else{echo "──";}?></div></td>
																<td class="td "><div class="t_d_p_10"><a href="javascript:void(0)" id="<?=$value['id']?>"  class="link_d">贷款申请</a></div></td>
															<?php }elseif($type==4){?>
																<td class="td f w145"><div class="t_d_p_10"><?=$value['product']?></div></td>
                                                                <td class="td w460"><div class="t_d_p_10"><?php if(isset($value['feature'])){echo $value['feature'];}else{echo "──";}?></div></td>
																<td class="td "><div class="t_d_p_10"><a href="javascript:void(0)" id="<?=$value['id']?>"  class="link_d">贷款申请</a></div></td>

															<?php }else{?>
																<td class="td f w145"><div class="t_d_p_10"><?=$value['product']?></div></td>
                                                                <td class="td w268"><div class="t_d_p_10"><?php if(isset($rate[0])){echo $rate[0];}else{echo "──";}?></div></td>           
                                                                <td class="td w300"><div class="t_d_p_10"><?php if(isset($value['feature'])){echo $value['feature'];}else{echo "──";}?></div></td>
																<td class="td "><div class="t_d_p_10"><a href="javascript:void(0)" id="<?=$value['id']?>"  class="link_d">贷款申请</a></div></td>

															<?php }?>
														</tr>
                                                        
														
													
                                                    <?php }?>
                                                    <?php }else{?>
													  <div class="itemInfoBach  radius4" style="text-align: center; line-height: 67px;">
                                                    没有符合条件的记录
                                                          </div>
                                                    <?php }?>
												</table>
										</div>
								</div>
                             <?php if (!empty($pagination)) { ?>
								<div class="picPreviewPagBox">
										<div class="picPreviewPag">
											 <?php echo $pagination; ?>	
										</div>
								</div>
                            <?php } ?>
                            <input type='hidden' name='page' value='<?=$page?>'>
                            <input type="hidden" id="tid" name="type" value="<?=$type?>">
                             <input type="hidden"  id="pid" name="type" value="">
							<div class="dk_jl_title"><strong class="blod">奖励规则说明</strong><span class="color">房豆奖励将会在贷款审核通过之后发放到您的租售宝账户中</span></div>
								<div class="dk_jl_table radius5">
										<table class="table">
                                            
												<tr class="bg">
														<th class="th w140">产品名称</th>
														<th class="th w195">奖励房豆</th>
														<th class="th w300">备注</th>
												</tr>
                                                
                                            <?php if(is_array($reward)&&!empty($reward)){?>
                                            <?php foreach ($reward as $key=>$value){?>
                                            
                                            <?php if($key%2==1){?><tr class="bg"><?php }else{ ?> <tr><?php }?>
                                                <td class="td td_f"><?=$value['name']?></td>
														<td class="td"><strong class="num"><?=$value['reward_credit']?></strong>房豆/单</td>
														<?php if($value['remark']){?>
                                                        <td class="td w300"><?=$value['remark']?></td>
                                                        <?php }else{?>
                                                        <td class="td w300">──</td>
                                                        <?php }?>
												</tr>                                                
												
                                            <?php }?>
                                            <?php }?>
                                                
									
										</table>
								</div>
						</div>
						
						<!----> 
				</div>
            </form>
		</div>
</div>
<script type="text/javascript" src="http://esf.s.house365.com/min/?f=zsb/js/v1.0/js2.js"></script>
<div class="dialog dialog2 dialogDk radius5" id="js_dialogDk">
		<div class="hd">
				<h3 class="h3">365贷款——<?=$type_name?></h3>
				<p title="关闭" class="close close-win">关闭 </p>
		</div>
		
		
		<div class="mod">
				<div class="forms">
                <dl class="list">
                    
                    
                    
                    <dd class="list_item clearfix">
                        <label class="label">贷款人姓名：</label>
                        <div class="fields nameInput">
                            <div class="fgInput jsNameInput jsFgInput">
                                <label class="labelPrev labelPrevN jslabelPrev" for="jsNameInput">请输入姓名</label>
                                <input type="text" id="jsNameInput" class="input_text w180 loan_name">
                            </div>
                        </div>
                    </dd>
                    <!---->

                    
                    <dd class="list_item clearfix">
                        <label class="label">贷款人电话：</label>
                        <div class="fields nameInput ">
                            <div class="fgInput jsNameInput jsFgInput">
                                <label class="labelPrev labelPrevN jslabelPrev" for="jsNameInputTel">请输入电话</label>
                                <input type="text" id="jsNameInputTel" class="input_text w180 loan_telno">
                            </div>
                        </div>
                    </dd>	
										
					<dd class="list_item clearfix">
                        <label class="label">贷款金额：</label>
                        <div class="fields nameInput ">
                            <div class="fgInput jsNameInput jsFgInput">
                                <label class="labelPrev labelPrevN jslabelPrev" for="jsNameInputPirce">请输入贷款金额</label>
                                <input type="text" id="jsNameInputPirce" class="input_text w180 loan_amount">
                            </div>
                        </div>
                    </dd>
										
										
										 <dd class="list_item clearfix">
                        <label class="label">贷款类型：</label>
                        <div class="fields nameInput ">
                            <div class="fgInput jsNameInput jsFgInput">
                              <p class="input_text_dk"><?=$type_name?></p>
                            </div>
                        </div>
                    </dd>
										
					<dd class="list_item clearfix">
                        <label class="label">经纪人账号：</label>
                        <div class="fields nameInput ">
                            <div class="fgInput jsNameInput jsFgInput">
                                  <p class="input_text_dk"><?=$username?></p>
                            </div>
                        </div>
                    </dd>
										
					<dd class="list_item clearfix" style="display:none;">
                       
                        
                          <div id="js_error_pop_d" style="color:red;padding-left:110px;"></div>
                      
                    </dd>

                    <dd class="list_item clearfix"> <a id="submitBtn" class="btnPopo btnCon radius5" href="javascript:void(0)" >提交</a>
					<!--<a class="btnPopo btnCon radius5" href="javascript:void(0)" style="background:#f9f9f9;" >提交</a>-->
					<a class="btnPopo btnPopo02 btnCon radius5 close-win" href="javascript:void(0)" >取消</a> </dd>
                </dl>
            </div>
		
		</div>

</div>
</body>
</html>
<script>
$(function(){
    $(".link_d").click(function(){       
        var pid = $(this).attr("id");
        $("#pid").val(pid);
        openWin('js_dialogDk');        
    })
    //贷款金额限制
     $(".loan_amount").on('keyup focusout',function(){        
           var v = $(this).val().replace(/\D/g,'');
           if(v.length>10){              
               v = v.substring(0,10);
           }
           //$(this).val(v);
           $(".loan_amount").val(v);
       })
      //电话限制
     $(".loan_telno").on('keyup focusout',function(){        
           var v = $(this).val().replace(/\D/g,'');
           if(v.length>20){              
               v = v.substring(0,20);
           }
           //$(this).val(v);
           $(".loan_telno").val(v);
       })
               
      //姓名限制//[\u4E00-\u9FA5]
     $(".loan_name").on('keyup focusout',function(){        
            var v = $(this).val().replace(/[^\u4E00-\u9FA5a-zA-Z]/g,'');          
           if(v.length>10){              
               v = v.substring(0,10);
           }
           //$(this).val(v);
           $(".loan_name").val(v);
       })           
 
       $("#submitBtn").click(function(){
		  
           var url = '/my_loan/addLoan/';
           var data = {};           
           data.loan_amount = parseInt($(".loan_amount").val());
           data.loan_telno = parseInt($(".loan_telno").val());
           data.loan_name = encodeURI($(".loan_name").val());
           data.pid = $("#pid").val();
           data.tid = $("#tid").val();
         // console.log(data);
           if(!data.loan_amount || !data.loan_telno || !data.loan_name ){
               //openWin("warning3");  
			   $("#js_error_pop_d").text("请填写正确的信息后提交！").parent().show();

               return false;
           } 
            $.post(url,data,function(result){                
                 if(result.result==1) {
					  //openWin("docation_loading");
					  $("#js_dialogDk").hide();
                    // alert('保存成功！');  
					 openWin("warning1");
                 } else {
                     //alert("保存失败,请重新输入！");
					 //openWin("warning2");
					  $("#js_error_pop_d").text("很遗憾，保存失败！").parent().show();
                 }
                 //$(".link_d").hide();
             },'json');
           
           
           return false;
       })
       
       
       
})


</script>


<div style="display:none;" class="dialog dialogW340 radius5"  id="warning1">
		<div class="hd">
				<h3 class="h3">提示</h3>
				<p class="close close-win" title="关闭">关闭 </p>
		</div>
		<div class="mod">
				<div class="textMod textMod003"><img alt="" src="http://esf.s.house365.com/zsb/images/v1.0/okBg.png"> 保存成功！</div>
				
		</div>
</div>
<!--
<div style="display:none;" class="dialog dialogW340 radius5"  id="warning1">
		<div class="hd">
				<h3 class="h3">提示</h3>
				<p class="close close-win" title="关闭">关闭 </p>
		</div>
		<div class="mod">
				<div class="textMod textMod003"><img alt="" src="http://esf.s.house365.com/zsb/images/v1.0/okBg.png"> 保存成功！</div>
				
		</div>
</div>

<div style="display:none;" class="dialog dialogW340 radius5"  id="warning2">
		<div class="hd">
				<h3 class="h3">提示</h3>
				<p class="close close-win" title="关闭">关闭 </p>
		</div>
		<div class="mod">
				<div class="textMod textMod003"><img alt="" src="http://esf.s.house365.com/zsb/images/v1.0/failureBg.png"> 很遗憾，保存失败！</div>
				
		</div>
</div>

<div style="display:none;" class="dialog dialogW340 radius5"  id="warning3">
		<div class="hd">
				<h3 class="h3">提示</h3>
				<p class="close close-win" title="关闭">关闭 </p>
		</div>
		<div class="mod">
				<div class="textMod textMod003"><img alt="" src="http://esf.s.house365.com/zsb/images/v1.0/failureBg.png"> 请填写正确的信息后提交！</div>
				
		</div>
</div>
-->


<!--页面处理中弹层-->
<div style="display:none; text-align: center;" id ='docation_loading'>
    <img src ="http://esf.s.house365.com/common/images/loading_6.gif">
    <p style="font-size: 16px; font-family:'微软雅黑'; line-height: 30px; color: #fff;">正在处理</p>
</div>