<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"><!----20120110 ting---->
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ page import="net.sz600.tool.SzConvert" %>
<%@ page import="net.sz600.database.SzConn" %>
<%@ page import="net.sz600.system.SzPageHelp" %>
<%@ page import="net.sz600.organize.SzCompany" %>
<%@ page import="net.sz600.organize.SzCompanyInfo" %>
<%@ page import="net.sz600.system.SzProperties" %>
<%
		//default skin path
		String strSkin_SESSION = SzProperties.getSkin();

    //判断是否正在还原数据库
    if (SzConn.getRestore()) {
            out.println("管理员正在还原系统数据库，稍后再重新登陆！");
       return; //这里必须要加return，否则以下的程序仍然会执行。
    }

    String COMPANY = SzConvert.toSpaceStr(request.getParameter("COMPANY")); //分公司信息
    //取得公司的图片
    SzCompany szCompany = new SzCompany();
    SzCompanyInfo companyInfo = (SzCompanyInfo)szCompany.getInfoByKey(SzConvert.toInt(SzCompany.decryptCOMPANY(COMPANY)));
		String sTitle = "";
		int companyPepedom = 0;
		if (companyInfo != null) {
			sTitle = companyInfo.getGSMC();
			companyPepedom = companyInfo.getGSQZ();
		}
		if (sTitle.equals("")) {
			sTitle = "数飞协同网络办公系统";
		}
	
		String c = SzConvert.toSpaceStr(request.getParameter("c")); //助手参数
    if (c.equals("swc")) {
    	session.setAttribute("SzHelp", "swc");	
    } else {
    	session.setAttribute("SzHelp", "");
    }
    session.setAttribute("SzDLID", "");
    session.setAttribute("SzDLZH", "");
    session.setAttribute("SzLoginInfo", null);
    session.setAttribute("SzNavigator", "");
    
    //System.out.println("index============" + session.getAttribute("SzHelp"));

    String sIp = SzConvert.toSpaceStr( request.getRemoteHost() );
    //out.println("=" + sIp);

    //cookie
    Cookie[] cks =request.getCookies();
    String temp_cookie = null;
    String loginName = SzConvert.toSpaceStr(request.getParameter("LoginName")); // 
    String loginPassword = SzConvert.toSpaceStr(request.getParameter("LoginPassword"));

    if(cks!=null && loginName.equals("")) {
	    for(int   i=0;i<cks.length;i++)   {
              temp_cookie = cks[i].getName();
              //查找用户名
              if(temp_cookie.equals("SzLoginCookie")) {
            	  //SzConvert.strWriteData(cks[i].getValue());
                  loginName =  java.net.URLDecoder.decode(cks[i].getValue(),"GBK"); 
              }
        }
   }  
   if (loginName.equals("")) {
      loginName = "admin";
   }  
    
    //将在线SzOnlineCookie设置为空，保证助手知道还没有登陆。
    Cookie szOnlineCookie = new Cookie("SzOnlineCookie", "");
    szOnlineCookie.setMaxAge(0);
    szOnlineCookie.setPath("/");       
    response.addCookie(szOnlineCookie);	     
    //System.out.println(szCompany.getLoginPicture2(COMPANY));

    //System.out.println(net.sz600.check.SzHasp.getInstance().hasDog());

    String sServer_SESSION  = request.getServerName();
    String sPort_SESSION    = Integer.toString( request.getServerPort() );
    String sContext_SESSION = request.getContextPath();
%>
<html>
<head>
<%@ include file="/share/oa_title.jsp"%>
<meta name="keywords" content="数飞OA 2012" />
<meta name="description" content="数飞OA 2012" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link href="<%=strSkin_SESSION%>/css2007login.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="share/js/jquery-1.11.3.min.js"></script>
<script type="text/javascript" src="share/js/alertWin2.js"></script> 
<style type="text/css"></style>
<script language="javascript">
  function OpenDiv(v) {
  	var vCount = 5;
  	var vIndex = parseInt(v);
  	
  	var obj = null;
  	for (var i=0; i<vCount; i++) {
  		obj = document.getElementById("div" + i);
  		if (obj != null) {
  			obj.style.display = "none";
  		}
  	}  
  	obj = document.getElementById("div" + vIndex);
  	obj.style.display = "block";
  }
  function CloseDiv(v) {
  	var obj = null;  
  	obj = document.getElementById("div" + v);
  	obj.style.display = "none";
  }

  function SwapImg(objId, img) {
    document.getElementById(objId).src=img;
  }

  //2012-01-12增加
  function addBookmark() {
    try {
      title = "数飞OA";
      url = "http://<%=sServer_SESSION%>:<%=sPort_SESSION%>/<%=sContext_SESSION%>";
      window.external.AddFavorite(url, title);
    } catch(e) {
			alert("sorry,您电脑的浏览器不支持!");
    }
  }

  //可以成功
  function toDesktop(){
    try { 
      sName = "访问数飞OA";
      sUrl = "http://<%=sServer_SESSION%>:<%=sPort_SESSION%>/<%=sContext_SESSION%>";
      var WshShell = new ActiveXObject("WScript.Shell"); 
      var oUrlLink = WshShell.CreateShortcut(WshShell.SpecialFolders("Desktop") + "\\" + sName + ".url"); 
      oUrlLink.TargetPath = sUrl; 
      oUrlLink.Save(); 
      alert("创建快捷方式成功");
    } catch(e) {   
			alert(e + "当前IE安全级别不允许操作！");   
    }
  } 
 
  //下载登陆助手
  function downloadSwc() {
    if (confirm("登陆助手可最小化到托盘，可开机自动访问OA，确定要下载？")) {
	return true;
    }
    return false;
  }
  



</script>
</head>


<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table width="100%"  border="0" cellpadding="0" cellspacing="0" align="center"  background="<%=strSkin_SESSION%>/login/top_background.gif" >
  <tr >
    <td width="6%" height="85">&nbsp;</td>
    <td align="left"><a href="http://www.soarwell.com/" target="_blank" onfocus="javascript:blur();"><img src="<%=strSkin_SESSION%>/login/logo.png" id="logo" width="436" height="57" border="0" OnMouseOver="javascript:SwapImg('logo','<%=strSkin_SESSION%>/login/logo_02.png');" OnMouseOut="javascript:SwapImg('logo','<%=strSkin_SESSION%>/login/logo.png');"></a><% out.println(SzProperties.printSystemValidInfo()); %></td>

    <td width="4%" title="数飞OA产品介绍"><br></b><p><a href="javascript:OpenDiv(0);" onfocus="javascript:blur();"><img src="<%=strSkin_SESSION%>/login/web_button.gif" width="44" height="43" border="0" id="product" OnMouseOver="javascript:SwapImg('product','<%=strSkin_SESSION%>/login/web_button2.gif');" OnMouseOut="javascript:SwapImg('product','<%=strSkin_SESSION%>/login/web_button.gif');"></a></p><!---20120111 ting-->
    <td width="1"></td>

    <td width="4%" title="下载数飞尔登陆助手，可最小化到托盘，可开机自动访问OA"><br><p><a href="http://www.saas88.com/download/swc.rar" target="_blank" OnClick="return downloadSwc();" onfocus="javascript:blur();"><img src="<%=strSkin_SESSION%>/login/Download_button.gif" width="44" height="43" border="0" id="custom" OnMouseOver="javascript:SwapImg('custom','<%=strSkin_SESSION%>/login/Download_button2.gif');" OnMouseOut="javascript:SwapImg('custom','<%=strSkin_SESSION%>/login/Download_button.gif');"></a></p><!---20120111 ting-->
    <td width="1"></td>


  </tr>
</table>
<table width="100%"  border="0" cellpadding="0" cellspacing="0" align="center"  >
<form name="formUpdate" id="formUpdate" method="post">
  <input type="hidden" name="skinType" value="1">
  <input type="hidden" name="COMPANY" value="<%=COMPANY%>">
  <input type="hidden" name="navigator" value="MSIE">
  <tr height="442" valign="middle" >
    <td height="442" width="648" colspan="7"  background="<%=strSkin_SESSION%>/login/denglvbeijingse_jianbian.gif">
    <img src="<%=strSkin_SESSION%>/login/datu_fangzi.jpg" width="648" height="442"></td>

  </tr>
  <tr class="btColor1" height="28">
    <td width="20%" colspan="2">&nbsp;</td>
    <td valign="top" colspan="4" align="right"><span class="font1">用户名：</span>  
      <input type="text" name="txtLoginName" id="txtLoginName" value="<%=loginName %>" class="txtClass1" OnMouseOver="javascript:this.select();">
      <span class="font1">密码：</span>
	   <input type="password" name="txtLoginPassword"  value=""  class="txtClass1"  OnMouseOver="javascript:this.select();">
      <% if (SzProperties.needVerificationCode(request.getRemoteHost())) { %>
      <span class="font1">验证码：</span>
	    <input type="text" name="txtVerificationCode"  value=""  class="txtClass1"  OnMouseOver="javascript:this.select();">
	    <img alt="看不清楚，换一张"  src="organize/verificationImage.jsp" id="imgVerificationCode" class="txtClass1-2" onclick="javascript:VerificationCode();" style="width:70px;height: 25px"/>
      <% } %>	   	   
	   <input name="btnSave"  type="button" id="btnSave" class="img" style="cursor:hand;"  width="58" height="24"border="0"    OnClick="javascript:FormSave(formUpdate, 'loginCheck.jsp');">
   	</td>
    <td width="3%">&nbsp;</td>
  </tr>
  <tr height="5">
    <td height="10">&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  <tr height="5" class="btColor2">
    <td>&nbsp;</td>
    <td colspan="4"><p class="style1">

        <a href="http://www.soarwell.com/FAQ/oa_user_guide.shtml" target="_blank">安装使用常见问题及培训PPT</a>
	<a href="http://www.soarwell.com/download.shtml" target="_blank">最新试用版本下载</a>
	<a href="http://tieba.baidu.com/f?kw=%E6%95%B0%E9%A3%9EOA&ie=utf-8&fr=wwwt" target="_blank">到百度贴吧提问题</a>

	<a target="_blank" href="http://wpa.qq.com/msgrd?v=3&uin=294924968&site=qq&menu=yes"><img border="0" src="http://wpa.qq.com/pa?p=2:294924968:47" alt="数飞OA咨询，陈经理,电话0755-25580288" title="数飞OA咨询，陈经理,电话0755-25580288"></a>
	<br>
	<a href="http://www.soarwell.com" target="_blank">深圳市数飞尔科技有限公司</a>
        联系电话：0755-25580288，25562782 咨询QQ：294924968 

        </p>    
    </td>
    <td>&nbsp;</td>
    <td>&nbsp;</td>
  </tr>
  </form>
</table>
<!--
<div style="position:absolute;left:200;top:0;margin-top:150px;margin-left:300px;" id="divImg04">
  <img src="images/2011/img_04.gif">
</div>
-->
</div>
<div style="position:absolute;left:0;top:0;margin-top:100px;margin-left:200px;display:none;" id="div0">
      <table width="600"  border="0" cellpadding="0" cellspacing="0" >
        <tr>
          <td width="5"><img src="<%=strSkin_SESSION%>/login/homezhanshi/d01_01.gif"></td>
          <td width="98%" height="26" background="<%=strSkin_SESSION%>/login/homezhanshi/d01_02.gif"><span class="fonthome3">产品介绍</span></td>
          <td width="35" background="<%=strSkin_SESSION%>/login/homezhanshi/d01_02.gif" align="right">
          <a href="#" OnClick="javascript:CloseDiv(0);" >
          	<img src="<%=strSkin_SESSION%>/login/images/more_03.gif" width="29" height="12" border="0">
          </a>
          </td>
          <td width="5"><img src="<%=strSkin_SESSION%>/login/homezhanshi/d01_03.gif"></td>
        </tr>
        <tr bgcolor="#f4f4f4">
          <td background="<%=strSkin_SESSION%>/login/homezhanshi/d02_01.gif"></td>
          <td height="180" colspan="2"><div class="fonthome4"> 
<% if (!net.sz600.check.SzHasp.getInstance().hasDog()) {%>
<b>版 本 名：数飞协同网络办公系统</b><br>
<b>版 本 号：</b>V6.6<br>
<b>版本性质：</b>试用版，试用期限60天<br>
<% } else { %>
<b>版 本 名：数飞协同网络办公系统</b><br>
<b>版 本 号：</b><%=net.sz600.check.SzHasp.getInstance().getVersion()%><br>
<b>版本性质：</b><%=net.sz600.check.SzHasp.getInstance().getProductLimitInfo()%><br>
<% } %>   
<b>开 发 商：</b><font class="fonthome3">深圳市数飞尔科技有限公司</font><br>
<b>公司网站：</b><a href="http://www.soarwell.com" target="_blank">www.soarwell.com</a> <a href="http://www.soarwell.com" target="_blank">www.saas88.com</a><br>
<b>功能说明：</b>数飞OA V6.6发布于2015年1月份，实现手机OA，微信OA，手机审批，微信审批。支持手机浏览器访问，支持邮件提醒；可通过微信访问、可支持微信提醒。主要实现表单自定义、流程自定义、公告文档管理、常用流程审批、资源管理、电子邮件收发、公文审批；可实现Office在线编辑、电子印章。<br>
<a href="http://www.soarwell.com/download.shtml" target="_blank">数飞官方下载地址</a><br>

          </div></td>
          <td background="<%=strSkin_SESSION%>/login/homezhanshi/d02_02.gif"></td>
        </tr>
        <tr >
          <td width="5"><img src="<%=strSkin_SESSION%>/login/homezhanshi/d03_01.gif"></td>
          <td height="5" colspan="2" background="<%=strSkin_SESSION%>/login/homezhanshi/d03_02.gif"></td>
          <td width="5"><img src="<%=strSkin_SESSION%>/login/homezhanshi/d03_03.gif"></td>
        </tr>
      </table>  		
</div>

<!--二唯码-->
<div style="position:absolute;right:0;top:0;margin-top:100px;margin-right:16px;" id="divQrcode">
  <img src="images/qrcode_soarwell_430.jpg" width="129"><br>
  <div style="background:#FFFFFF" align="center" class="style1">扫一扫，体验微信OA</div>
</div>


</body>
</html>
<script language="javascript">
  function myFunction() {
    //document.getElementById("btnSave").click();
    FormSave(formUpdate, 'loginCheck.jsp');
  }
  //2013-06-07增加
  function VerificationCode() {
    var oVerificationCode = document.getElementById("imgVerificationCode");
    if (oVerificationCode != null) {
      //oVerificationCode.src= "organize/verificationImage.jsp";
      oVerificationCode.setAttribute("src","organize/verificationImage.jsp?"+ Math.random());
    }
  }
  
  function SelectSkinType(vType) {
  	if (vType == "1") {
	  document.location.href="index.jsp?COMPANY=<%=COMPANY%>";	
  	} else if (vType == "2") {
	  document.location.href="index2.jsp?COMPANY=<%=COMPANY%>"; 	
  	} else if (vType == "3") {
      document.location.href="3index.jsp?COMPANY=<%=COMPANY%>";
  	}
  }
  


  
  function FormSave(formName, url) {

    if (formName.txtLoginName.value == "") {
      formName.txtLoginName.focus();
      //alert("登陆名称不能为空");
      alertWin2simple("登陆名称不能为空", "txtLoginName", 50);
      return false;
    }
    
    //$.get(url,data,callback,type)
		$.post("loginCheckAjax.jsp", 
				$("#formUpdate").serialize(),
   			function(data){
   				data = data.replace(/(\n)+|(\r\n)+/g, "");
   				
     			if (data == "") {
     				document.location.href="main/index.jsp";
     			} else {
     				//alertTips2(data, 50, 3);
						alertWin2simple(data, "txtLoginName", 50);
     			} 
     			
   			}, 
   			"text");        
    //提交
    //
    //formName.submit();
  }

  function FormReset() {
    formUpdate.txtLoginName.value = "";
    formUpdate.txtLoginPassword.value = "";
    formUpdate.txtLoginName.focus();
  }

  function keyDown(e) {
    //修改2011-11-03：支持safari,ff
    var et = e || window.event;
    if (et.keyCode) {
			if (et.keyCode == 13) {
     		 FormSave(formUpdate, 'loginCheckApp.jsp');
			}
    } else  if (et.which  == 13) {
      		//回车就是提交，调用保存
      		//document.formUpdate.btnSave.click();
      		
     		 FormSave(formUpdate, 'loginCheckApp.jsp');
    }
  }
  document.onkeydown = keyDown;
  //如果已经有了用户名，则光标在密码处。否则在用户处
  if (formUpdate.txtLoginName.value == "") {
  	formUpdate.txtLoginName.focus();
  } else {
  	formUpdate.txtLoginPassword.focus();
  }
  
  var vScreenWidth = screen.width;


  var oDiv = document.getElementById("divImg04");
  if (oDiv != null) {
     if (vScreenWidth >1024) {
  	oDiv.style.left = vScreenWidth - 420;
     } else {
  	oDiv.style.left = vScreenWidth - 180;
     }
  }

  //var codeName=navigator.appCodeName;
  //alert(codeName);

  //2014-06增加浏览器类型
  var sNavigator = "MSIE";

  if(navigator.userAgent.indexOf("MSIE")>0) {   
      sNavigator = "MSIE";  
  } else if(navigator.userAgent.indexOf("Chrome")>0) { 
      sNavigator = "CHROME";  
  } else if(navigator.userAgent.indexOf("Firefox")>0) {   
      sNavigator = "FIREFOX"; 
  } else if(navigator.userAgent.indexOf("MQQBrowser")>0) {   
      sNavigator = "MQQBROWSER";   
  } else if(navigator.userAgent.indexOf("AppleWebKit")>0) {   
      sNavigator = "APPLEWEBKIT";           
  } else {
      sNavigator = "OTHER"; 
  }
  formUpdate.navigator.value = sNavigator;

  //alert(window.screen.width);
  //alert(navigator.platform);
  if (window.screen.width < 800) {
    document.location.href="indexApp.jsp";
  } else if(navigator.platform.indexOf('Win32')!=-1){ 
  } else if(navigator.platform.indexOf('Win64')!=-1){ 
  } else {
    document.location.href="indexApp.jsp";
  }
  //2014-07增加判断：屏幕大小，转换
</script>


