国产片侵犯亲女视频播放_亚洲精品二区_在线免费国产视频_欧美精品一区二区三区在线_少妇久久久_在线观看av不卡

服務器之家:專注于服務器技術及軟件下載分享
分類導航

PHP教程|ASP.NET教程|Java教程|ASP教程|編程技術|正則表達式|C/C++|IOS|C#|Swift|Android|VB|R語言|JavaScript|易語言|vb.net|

服務器之家 - 編程語言 - Java教程 - java編寫全年考勤日歷

java編寫全年考勤日歷

2021-06-18 13:48始于千里之外 Java教程

這篇文章主要為大家詳細介紹了java編寫全年考勤日歷,具有一定的參考價值,感興趣的小伙伴們可以參考一下

本文實例為大家分享了java編寫全年考勤日歷的具體代碼,供大家參考,具體內容如下

java代碼:

?
<sup id="ggecy"><tr id="ggecy"></tr></sup>
<th id="ggecy"><dfn id="ggecy"></dfn></th>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
package com.wp.action;
 
import java.text.simpledateformat;
import java.util.arraylist;
import java.util.calendar;
import java.util.hashmap;
 
public class calendaraction extends mainaction {
 
 private static final long serialversionuid = 1l;
 
 private int maxcols;
 private string html;
 private string clickdate;
 
 public string getclickdate() {
 return clickdate;
 }
 
 public void setclickdate(string clickdate) {
 this.clickdate = clickdate;
 }
 
 public string init() {
 calendar cal = calendar.getinstance();
 int month = cal.get(calendar.month) + 1;
 initmaxcols();
 html = createtbl();
 
 return success;
 }
 
 private void initmaxcols() {
 // 每行開頭灰色的格數
 int headdisableddays;
 // 當月的天數
 int onemonthdays;
 calendar cal = calendar.getinstance();
 cal.set(calendar.day_of_month, 1);
 
 for (int i = 0; i < 12; i++) {
 
  if (cal.get(calendar.day_of_week) == calendar.sunday) {
  // 周日空六格
  headdisableddays = 6;
  } else {
  headdisableddays = cal.get(calendar.day_of_week)
   - calendar.monday;
  }
 
  onemonthdays = cal.getactualmaximum(calendar.day_of_month);
  if (headdisableddays + onemonthdays > maxcols) {
  maxcols = headdisableddays + onemonthdays;
  }
  cal.add(calendar.month, 1);
 }
 
 }
 
 private string createtbl() {
 stringbuffer html = new stringbuffer();
 string[] weekdays = { "一", "二", "三", "四", "五", "六", "日" };
 simpledateformat formattd = new simpledateformat("yyyymmdd");
 simpledateformat formatheader = new simpledateformat("yyyy年mm月");
 simpledateformat formattitle = new simpledateformat("yyyy年mm月dd日");
 hashmap<string, string> map = getcalendardetail();
 
 // 每行開頭灰色的格數
 int headdisableddays;
 
 // html.append("<table id='caltbl'>\r\n");
 html.append("<tr>\r\n");
 html.append("<th></th>\r\n");
 for (int col = 0; col < maxcols; col++) {
  html.append("<th>");
  html.append(weekdays[col % weekdays.length]);
  html.append("</th>\r\n");
 }
 html.append("</tr>\r\n");
 calendar cal = calendar.getinstance();
 int month = cal.get(calendar.month);
 for (int months = 0; months < 12; months++) {
  html.append("<tr>\r\n");
  string s;
  s = formatheader.format(cal.gettime());
  html.append("<td class='rowheader'>" + s + "</td>\r\n");
  
  cal.set(calendar.day_of_month, 1);
  if (cal.get(calendar.day_of_week) == calendar.sunday) {
  // 周日空六格
  headdisableddays = 6;
  } else {
  headdisableddays = cal.get(calendar.day_of_week)
   - calendar.monday;
  }
  cal.add(calendar.day_of_month, -headdisableddays);
 
  for (int col = 0; col < maxcols; col++) {
 
  html.append("<td id='");
 
  string date = formattd.format(cal.gettime());
  html.append(date + "' ");
  // if (headdisableddays-- > 0) {
  // html.append("class='disabledtd'");
  // }else
  if (month != cal.get(calendar.month)) {
   html.append("class='disabledtd'");
  
  } else if (map.containskey(formattd.format(cal.gettime()))) {
   int type = integer.parseint(map.get(formattd.format(cal
    .gettime())));
   if(type == 1){
   //html.append("class='holidaytd'");
   }else if(type == 2){
   html.append("class='holidaytd'");
   }
  } else if (cal.get(calendar.day_of_week) == calendar.saturday
   || cal.get(calendar.day_of_week) == calendar.sunday) {
   html.append("class='weekendtd'");
  } else {
   html.append("class='generaltd'");
  }
  html.append(" java" id="highlighter_932381">
?
1
2
3
<action name="calendar" class="com.wp.action.calendaraction" method="init">
   <result name="success" type="json"></result>
</action>

html代碼:

?
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<!doctype html public "-//w3c//dtd html 4.01 transitional//en" "http://www.w3.org/tr/html4/loose.dtd">
<%@ page language="java" contenttype="text/html; charset=utf-8"
 pageencoding="utf-8"%>
<%
 string path = request.getcontextpath();
 string basepath = request.getscheme() + "://"
  + request.getservername() + ":" + request.getserverport()
  + path;
%>
<%@taglib prefix="s" uri="/struts-tags"%>
<html>
 <style type="text/css">
  .disabledtd{
  background-color:gray;
  }
  .weekendtd{
  background-color:yellow;
  }
  .holidaytd{
  background-color:green;
  }
  .generaltd{
  background-color:white;
  }
  #caltbl{
  font-family: verdana,arial,sans-serif;
  font-size:13px;
  color:#333333;
  border-width: 1px;
  border-color: #a9c6c9;
  border-collapse: collapse;
  }
  #caltbl th{
  border-width: 1px;
  padding: 4px;
  border-style: solid;
  border-color: #a9c6c9;
  background-color:olive;
  }
  #caltbl td {
  border-width: 1px;
  padding: 4px;
  border-style: solid;
  border-color: #a9c6c9;
  }
  .rowheader{
  background-color:olive;
  }
 </style>
 
 <head>
 
 <meta http-equiv="content-type" content="text/html; charset=utf-8" />
 <title>login page</title>
 <link rel="stylesheet" type="text/css" media="screen"
  href="<%=basepath%>/html/styles/styles.css" rel="external nofollow" />
 <script src="<%=basepath%>/html/scripts/common.js"
  type="text/javascript"></script>
 <script src="<%=basepath%>/html/scripts/jquery.js"
  type="text/javascript"></script>
 <script src="<%=basepath%>/html/scripts/jquery.json-2.2.min.js"
  type="text/javascript"></script>
 <script src="<%=basepath%>/html/scripts/jquery.ui.custom.js"
  type="text/javascript"></script>
 <script src="<%=basepath%>/html/scripts/script.js"
  type="text/javascript"></script>
  <script type="text/javascript">
  $(document).ready(function(){
  var checktype = 0;
  $.post('calendar',{},function(data,status)
  {
   if(data != null && data.html != null && data.html != ""){
   $("#caltbl").html( data.html);
   $("#caltbl td").click(tdclick);
   $("#checktype input").click(typecheck);
   }
  }).error(function(){
   
  });
 
  var tdclick = function(){
  
   if(this.classname == 'rowheader' || this.classname == 'disabledtd'){
   return;
   }
   if(checktype != null && checktype != "" && checktype != 0){
   if(checktype == 1){  
    this.style.backgroundcolor="white";
   }else if(checktype == 2){   
    this.style.backgroundcolor="yellow";
   }else if(checktype == 3){   
    this.style.backgroundcolor="green";
   }
   }
  };
  var typecheck = function(){
   checktype = this.value;
  };
  
  
  });
  
 </script>
 </head>
 <body>
 <div id="calendar">
  <table id="caltbl"></table> 
 </div>
 <div>
  <table id="checktype">
  <tr>
   <td style="background-color: white;"> <input type="radio" name="type" value="1"> </td>
   <td style="background-color: yellow;"><input type="radio" name="type" value="2"></td>
   <td style="background-color: green;"> <input type="radio" name="type" value="3"></td>
  </tr>
  </table>
 </div>
 </body>
</html>

效果如下

java編寫全年考勤日歷

以上就是本文的全部內容,希望對大家的學習有所幫助,也希望大家多多支持服務器之家。

原文鏈接:https://blog.csdn.net/u013816347/article/details/44259455

延伸 · 閱讀

精彩推薦
主站蜘蛛池模板: 免费成人在线观看视频 | 午夜在线观看视频 | 岛国av一区 | 日韩成人一区二区 | 国产黄色一级大片 | 久久精品免费一区二区三区 | 免费视频二区 | 久久久久久成人 | 91久久久久久久久久久久久 | 久草电影网 | 国产福利一区二区 | 在线观看视频91 | 在线色网站 | 日韩成人av在线 | 久久精品无码一区二区三区 | 国产精品日产欧美久久久久 | 久久伊99综合婷婷久久伊 | 91精品国产一区二区三区香蕉 | 久久久久国产精品 | 国内精品一区二区三区 | 亚洲视频在线观看网址 | 国产综合精品一区二区三区 | 亚洲一区精品在线 | 久久99精品国产99久久6尤 | 久久精品无码一区二区三区 | 亚洲成人av一区二区三区 | 亚洲欧美视屏 | 日本一区二区电影 | 精品久久久久一区二区国产 | 日本视频免费观看 | а天堂中文最新一区二区三区 | 欧美激情久久久久久 | 亚州av在线 | 日韩91 | 久久久久久久99 | 亚洲欧美日韩在线一区 | 精品国产精品三级精品av网址 | 欧美天堂一区二区三区 | 亚洲精品一区 | 欧美亚洲高清 | 精品久久久久久久久久 |