<?php widget("fhead");include($path_cache.DS."mod_agent_Shared_fhead.php"); ?>
<body class="mainbg">
	<div id="mainhearder"><span>您的位置：<a href="<?php echo $vd['root']; ?>index.php?m=mod_b2b&a=Home">直销商管理系统</a> >> 销售记录 >> 员工结帐管理</span></div>
	<div id="tabs5">
		<ul class="menu5" id="menu5">
		<li onclick="location.href='index.php?m=mod_agent&c=Loan&a=Create';" class="hover"><span class="xg">借款申请</span></li>
		<li onclick="location.href='index.php?m=mod_agent&c=Loan';"><span class="jl">全部记录</span></li>
	</ul>
	</div>
	<div class="main5" id="main5">
	<form name="checkout" method="post" action="index.php?m=mod_agent&c=Loan&a=Save">
	<table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
	<tr>
	<td class="tableleft">
		<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="table1">
		<?php $item=$vd['item']; ?>
    <tr>
      <td width="20%" align="right" class="tableleft1">公司名：</td>
      <td width="80%" class="tableright1"><?php echo $item['company']; ?>(<?php (displayCode($item['aid'])); ?>)</td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1">帐户可用余额：</td>
      <td width="80%" class="tableright1" style="color:#ff0000">&nbsp;<b><?php echo $item['aremain']; ?></b> <?php echo $vd['lang']['moneyunit']; ?></td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1">目前欠款：</td>
      <td width="80%" class="tableright1" style="color:#ff0000">&nbsp;<b><?php echo $item['arrears']; ?></b> <?php echo $vd['lang']['moneyunit']; ?></td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1">信用额度：</td>
      <td width="80%" class="tableright1" style="color:#ff0000">&nbsp;<b><?php echo $item['credit']; ?></b> <?php echo $vd['lang']['moneyunit']; ?> (如果您欠款数目小于这个数值且正在跟系统借款，您的申请会自动完成)</td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1"><span id="loanlable">向别人借钱</span>：</td>
      <td width="80%" class="tableright1"><input type="text" class="input" style="font-weight:normal" name="dollars" size="24"/> <?php echo $vd['lang']['moneyunit']; ?></td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1">操作类型：</td>
      <td width="80%" class="tableright1"><input type="radio" name="thisaction" value="21"  onclick="set(1)"/>借钱给别人 <input type="radio" name="thisaction" value="22" checked onclick="set(0)"/>向别人借钱</td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1"><span id="sidelable">对方</span>编号：</td>
      <td width="80%" class="tableright1"><input type="text" class="input" style="font-weight:normal" name="otherside" id="otherside" size="24"/> <span id="spansys"><input type="checkbox" name="issys" id="issys" value="1" onclick="setotherside(this)"/>系统</span></td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1">约定还款：</td>
      <td width="80%" class="tableright1"><input type="text" class="input" style="font-weight:normal" name="deadline" id="deadline" size="24" value="<?php echo date("Y-m-d H:i:s" , strtotime("30 days")); ?>" style="vertical-align:middle"/></td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1">超级密码：</td>
      <td width="80%" class="tableright1"><input type="password" class="input" style="font-weight:normal" name="superpwd" size="24"/></td>
    </tr>
    <tr>
      <td width="20%" align="right" class="tableleft1">操作原因：</td>
      <td width="80%" class="tableright1">
      	<textarea name="reason" cols="50" rows="5" scrolling="yes" style="padding:5px"></textarea>
      </td>
    </tr>
		<tr>
		<td align="right" class="tableleft1">&nbsp;</td>
		<td class="tableright1"><input type="hidden" name="Login_my" value="37126884"><input type="submit" name="submit" value="确认提交" class="button" tabindex="16"> <input type="reset" name="reset" value="重新填写" class="button" tabindex="17"></td>
		</tr>
		</table>
	</td>
	</tr>
	</table>
	</form>
<script type="text/javascript">
	var $ = function(id) {
		return document.getElementById(id);
	}
	function set(flag)
	{
		//loanTable.rows[7].style.display = flag ? "" : "none";
		$("loanlable").innerHTML = flag ? "借钱给别人" : "向别人借钱";
		
		    
    $("issys").checked = false;
    $("otherside").style.background = "#fff";
    $("otherside").disabled = false;
    
    $("spansys").style.display = flag ? "none" : "";

	}
	
	function setotherside(obj)
	{
		if(obj.checked)
		{
			$("otherside").value = "";
			$("otherside").style.background = "#f0f0f0";
			$("otherside").disabled = true;
		}
	  else
		{
			$("otherside").style.background = "#fff";
			$("otherside").disabled = false;
		}
	}
</script>	
</body>
</html>
