<?php 
//****************************************请求权限*****************************************
require("locked.php");                                                                 //*
setlocked(0,会计科目—恩格会计管理系统);                                                    //*
//****************************************************************************************
?>
<html>
<head>
<meta charset="utf-8">
<title>新增会计科目</title>
<script language="javascript" type="text/javascript" src="myJs.js"></script>
<link rel="stylesheet" href="myCss.css" type="text/css" />
<script language="javascript" type="text/javascript">
<!--
function checkForm(){
	if (form1.id.value==""){
	    alert("ID不能为空！");
		form1.id.focus();
		return false;
	}
	
	if (isNaN(form1.id.value)){
	    alert("ID必须为数字！");
		form1.id.focus();
		return false;
	}else{
		switch(form1.id.value.length){
			//限定会计科目长度，五级，42222类型；
			case 4:
				break;
			case 6:
				break;
			case 8:
				break;
			case 10:
				break;
			case 12:
				break;
			default:
				alert("ID位数不正确！");
				form1.id.focus();
				return false;
		}
	}
	
	if((form1.id.value).substring(0,1)==0){
		alert("ID起始不能为零！");
		form1.id.focus();
		return false;
	}
	
	if(form1.name.value==""){
	    alert("名称不能为空！");
		form1.name.focus();
		return false;
	}
	
	//会计科目，基础资料名称文字禁止出现的数据 arrban 列举的字符；
	for(var i=0;i<arrban.length;i++){
		if((form1.name.value).indexOf(arrban[i])!=-1){
			alert("名称字符不能出现："+arrban[i]);
			form1.name.focus();
			return false;
		}
	}
	
	form1.submit();
}
//-->
</script>
</head>

<body>
<form action="account_InsertSubmit.php" method="post" name="form1">
<table>
<td colspan="2" align="center"><font size="+3">会计科目</font></td>
<tr>
<td>ID</td><td><input name="id" type="text" style="width:450px" /></td>
</tr>
<tr>
<td>名称</td><td><input name="name" type="text" style="width:450px" /></td>
</tr>
<tr>
<td>分类</td>
<td>
<select name="t" style="width:456px">
<option value="资产" selected="selected">资产</option>
<option value="负债">负债</option>
<option value="权益">权益</option>
<option value="成本">成本</option>
<option value="利润">利润</option>
</select>
</td>
</tr>
<tr>
<td>方向</td>
<td>
<select name="dc" style="width:456px">
<option value="借方" selected="selected">借方</option>
<option value="贷方">贷方</option>
</select>
</td>
</tr>
<tr>
<td>基<br /><br />础<br /><br />资<br /><br />料</td>
<td align="center">

<table>
<tr>
<td>
数量外币
</td>
<td>
<select name="slwb">
<option value="0" selected="selected">否</option>
<option value="-1">是</option>
</select>
</td>
<td width="100px"></td>
<td>
现金流量
</td>
<td>
<select name="xjll">
<option value="0" selected="selected">否</option>
<option value="-1">是</option>
</select>
</td>
<tr>
<td>
客户
</td>
<td>
<select name="kh">
<option value="0" selected="selected">否</option>
<option value="-1">是</option>
</select>
</td>
<td width="100px"></td>
<td>
个人
</td>
<td>
<select name="gr">
<option value="0" selected="selected">否</option>
<option value="-1">是</option>
</select>
</td>
</tr>
<tr>
<td>
存货
</td>
<td>
<select name="ch">
<option value="0" selected="selected">否</option>
<option value="-1">是</option>
</select>
</td>
<td width="100px"></td>
<td>
供应商
</td>
<td>
<select name="gys">
<option value="0" selected="selected">否</option>
<option value="-1">是</option>
</select>
</td>
</tr>
<tr>
<td>
部门
</td>
<td>
<select name="bm">
<option value="0" selected="selected">否</option>
<option value="-1">是</option>
</select>
</td>
<td width="100px"></td>
<td>
核算项目
</td>
<td>
<select name="xm">
<option value="0" selected="selected">否</option>
<option value="-1">是</option>
</select>
</td>
</tr>
</table>

</td>
</tr>
<tr>
<td colspan="2" align="center"><br /><br /><input name="insert" type="button" onClick="checkForm()" value="添加" /></td>
</tr>
</table>
</form>
</body>
</html>