<html>
<head>
<meta charset="utf-8">
<title>恩格会计软件</title>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="mycss.css" type="text/css" />
<script type="text/javascript" language="javascript">
<!--
function checkForm(){
	if (form1.user.value==""){
	    alert("用户不能为空！");
		form1.user.focus();
		return false;
	}
	
	if (form1.pwd.value==""){
	    alert("密码不能为空！");
		form1.pwd.focus();
		return false;
	}
	
	form1.submit();
}
//-->
</script>
</head>

<body>
<form name="form1" action="loginCheck.php" method="post">
<div style="position:absolute;left:35%; top:30%; ">
<table width="370" border="0" cellspacing="0" bgcolor="#CCCCCC">
  <tr>
    <td height="40" colspan="2" style="border-bottom-style:inset" >
    &nbsp;&nbsp;<font color="black"><strong>系统登录</strong></font>
    （<a href="http://www.accsoft2008.com/" target="_blank">在线帮助</a>）
    </td>
  </tr>
  <tr>
    <td height="20" colspan="2"></td>
  </tr>
  <tr>
    <td width="126" height="50">&nbsp;&nbsp;<font color="black">用&nbsp;&nbsp;户:</font></td>
    <td width="232" height="50"><input name="user" type="text" style="width:200px; height:30px"/></td>
  </tr>
  <tr>
    <td width="126" height="50">&nbsp;&nbsp;<font color="black">密&nbsp;&nbsp;码:</font></td>
    <td width="232" height="50"><input name="pwd" type="password" style="width:200px; height:30px"/></td>
  </tr>
  <tr>
    <td height="50" colspan="2" align="center" ><input name="ok" type="button" value="提交" onClick="checkForm()" /></td>
  </tr>
  <tr>
    <td height="30" colspan="2" align="center"><a href="http://jq.qq.com/?_wv=1027&k=2EqjQHq" target="_blank">点击链接加入讨论群</a></td>
  </tr>
</table>
</font>
</div>
</form>
<?php
//检测上次登录合法的用户是否存在，如存在直接给用户赋值，简化用户输入；
if(isset($_COOKIE["myuserid"])){
	echo '<script type="text/javascript" language="javascript">
	      <!--
	      form1.user.value='.$_COOKIE["myuserid"].'
	      form1.pwd.focus()
		  //-->
	      </script>';
}else{
	echo '<script>form1.user.focus();</script>';
}

//打印所有账套名称及链接路径；
$handle=opendir('../');
$arr=array();
while($file=readdir($handle)){
 $newpath="../".$file;
 if(is_dir($newpath)) $arr[] = $newpath ;
} 

for($i=2;$i<count($arr);$i++){
	echo '<a href="'.$arr[$i].'/login.php">'.substr($arr[$i],3).'</a>|';
	}
	
//print_r($arr); 
?>
</body>
</html>