DUT001.inc
10.2 KB
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
<script type="text/javascript" src="xmlhttp.js"></script>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
var SFlg = false; //サブミットフラグを定義
function DoubleSubmit(){ //ダブルサブミットチェック関数
if (SFlg){ //ダブルサブミットの場合
alert("応答中です"); //メッセージを出力
return false;
}
SFlg = true; //サブミットフラグを設定
return true; //戻り値を設定
}
function dut_info(strDate){
cal1 = new JKL.Calendar("calid","e_gru","colname");
cal2 = new JKL.Calendar("calid2","e_gru","colname2");
cal3 = new JKL.Calendar("calid3","e_gru","colname3");
if(document.getElementById("dutinp").innerHTML !=""){
document.getElementById("dutinp").innerHTML = "";
}
loadHTMLFile_SUB_info("DUT001-1.php?strwkdate="+strDate);
}
function loadHTMLFile_SUB_info(fName){
httpObj2 = createXMLHttpRequest(displayData_info);
if (httpObj2)
{
httpObj2.open(Get_BName(),fName,true);
httpObj2.send(null);
}
}
function displayData_info(){
if ((httpObj2.readyState == 4) && (httpObj2.status == 200)){
document.getElementById("dutdata").innerHTML = httpObj2.responseText;
}else{
document.getElementById("dutdata").innerHTML = "<b>Loading...</b>";
}
}
function dut_inp(strDate,intTouban,intsts){
cal1 = new JKL.Calendar("calid","e_gru","colname");
cal2 = new JKL.Calendar("calid2","e_gru","colname2");
cal3 = new JKL.Calendar("calid3","e_gru","colname3");
//if(document.getElementById("dutinp").innerHTML !=""){
document.getElementById("dutinp").innerHTML = "";
//}else{
loadHTMLFile_SUB("DUT002.php?strwkdate="+strDate+"&intTouban="+intTouban+"&intsts="+intsts);
//}
}
function disp_off(){
if(document.getElementById("dutinp").innerHTML !=""){
document.getElementById("dutinp").innerHTML = "";
}
}
function getDate(){
document.e_gru.strwkdate.value=document.e_gru.main_year.value+document.e_gru.main_mon.value+"01";
dut_info(document.e_gru.strwkdate.value) ;
}
function add(intTouban,intsts,intaddsts){
var strsel;
var stradd;
var inti;
var intchk;
var intPt;
var strArray = new Array();
var intflg=0;
document.e_gru.intTouban.value=intTouban;
document.e_gru.intsts.value=intsts;
document.e_gru.intaddsts.value=intaddsts;
//社員追加
if (intaddsts==1){
inti=document.e_gru.syain_add.length-1;
for(i=0;i<document.e_gru.syain_list.length;i++){
if(document.e_gru.syain_list.options[i].selected){
//データ存在チェック
for(intchk=0;intchk<document.e_gru.syain_add.length;intchk++){
if (document.e_gru.syain_list.options[i].value==document.e_gru.syain_add.options[intchk].value){
intflg=1;
break;
}
}
//配信リスト設定
if (intflg==0){
document.e_gru.syain_add.options[inti]=new Option(document.e_gru.syain_list.options[i].text,document.e_gru.syain_list.options[i].value);
inti=inti+1;
}
intflg=0;
}
}
//最終行空文字
document.e_gru.syain_add.options[inti]=new Option(" ","");
}else{
//社員削除
inti=0;
for(i=0;i<document.e_gru.syain_add.length;i++){
if(document.e_gru.syain_add.options[i].selected){
strArray[inti]=document.e_gru.syain_add.options[i].value;
inti=inti+1;
}
}
for(i=0;i<strArray.length;i++){
for(intchk=0;intchk<document.e_gru.syain_add.length;intchk++){
if (strArray[i]==document.e_gru.syain_add.options[intchk].value){
if (document.e_gru.syain_add.options[intchk].value!=""){
document.e_gru.syain_add.options[intchk]=null;
break;
}
}
}
}
}
}
function submit_inp(intsts,intTouban){
var stradd;
if (date_chk(document.e_gru.st_year.value,document.e_gru.st_mon.value,document.e_gru.st_day.value)==false) {
document.e_gru.st_year.focus();
return false;
}
if (date_chk(document.e_gru.ed_year.value,document.e_gru.ed_mon.value,document.e_gru.ed_day.value)==false) {
document.e_gru.ed_year.focus();
return false;
}
st_date=document.e_gru.st_year.value+document.e_gru.st_mon.value+document.e_gru.st_day.value;
ed_date=document.e_gru.ed_year.value+document.e_gru.ed_mon.value+document.e_gru.ed_day.value;
if (st_date >ed_date){
alert("日付を正しく選択してください");
document.e_gru.st_year.focus();
return false;
}
if ((document.e_gru.st_hour.value=="") && (document.e_gru.st_minute.value!="")) {
alert("時間を正しく選択してください");
document.e_gru.st_hour.focus();
return false;
}
if ((document.e_gru.ed_hour.value=="") && (document.e_gru.ed_minute.value!="")) {
alert("時間を正しく選択してください");
document.e_gru.ed_hour.focus();
return false;
}
if ((document.e_gru.st_hour.value=="") && (document.e_gru.ed_hour.value!="")){
alert("時間を正しく選択してください");
document.e_gru.st_hour.focus();
return false;
}
if ((document.e_gru.ed_hour.value!="") && (document.e_gru.ed_hour.value!="")){
if(document.e_gru.st_hour.value+document.e_gru.st_minute.value > document.e_gru.ed_hour.value+document.e_gru.ed_minute.value){
alert("時間を正しく選択してください");
document.e_gru.st_hour.focus();
return false;
}
}
if (script_chk("担当内容",document.e_gru.contents.value)==false) {
document.e_gru.contents.focus();
return false;
}
stradd="";
for (i=0; i<document.e_gru.syain_add.options.length; i++){
stradd = stradd+document.e_gru.syain_add.options[i].value+"/";
}
if (stradd == "/"){
alert("担当者を1人以上選択してください");
return false;
}
// if (DoubleSubmit()) {
// document.e_gru.intsts.value=intsts;
// document.e_gru.intTouban.value=intTouban;
// document.e_gru.strsel.value=stradd;
// document.e_gru.intsyorists.value=1;
// document.e_gru.action="DUT004.php";
// document.e_gru.method="POST";
// document.e_gru.submit();
// return false;
// }
//20081006 GET→POST修正
prm = "intsts="+intsts+"&intTouban="+intTouban+"&strsel=" + stradd + "&intsyorists=1";
prm += "&st_year="+document.e_gru.st_year.value;
prm += "&st_mon="+document.e_gru.st_mon.value;
prm += "&st_day="+document.e_gru.st_day.value;
prm += "&ed_year="+document.e_gru.ed_year.value;
prm += "&ed_mon="+document.e_gru.ed_mon.value;
prm += "&ed_day="+document.e_gru.ed_day.value;
prm += "&st_hour="+document.e_gru.st_hour.value;
prm += "&st_minute="+document.e_gru.st_minute.value;
prm += "&ed_hour="+document.e_gru.ed_hour.value;
prm += "&ed_minute="+document.e_gru.ed_minute.value;
prm += "&contents="+encodeURIComponent(document.e_gru.contents.value)+" ";
prm += "&syain_add="+document.e_gru.syain_add.value;
prm += "&syain_list="+document.e_gru.syain_list.value;
// prm += "&="+document.e_gru..value
// prm += "&="+document.e_gru..value
// prm += "&="+document.e_gru..value
// prm += "&="+document.e_gru..value
// prm += "&="+document.e_gru..value
// prm += "&="+document.e_gru..value
// loadHTMLFile("DUT004.php?intsts="+intsts+"&intTouban="+intTouban+"&strsel="+stradd+"&intsyorists=1"+prm);
loadHTMLFile_Data("DUT004.php",prm);
// function loadHTMLFile(fName){
function loadHTMLFile_Data(fName,prm){
httpObj = createXMLHttpRequest(displayData);
if (httpObj){
//httpObj.open(Get_BName(),fName,true);
//httpObj.send(null);
httpObj.open("POST",fName,true);
httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
httpObj.send(prm);
}
}
function displayData()
{
if ((httpObj.readyState == 4) && (httpObj.status == 200))
{
dut_info(document.e_gru.strwkdate.value);
}else{
document.getElementById("dutinp").innerHTML = "<b>Loading...</b>";
}
}
}
function submit_del(intsts){
loadHTMLFile_SUB("DUT003.php?intsts="+intsts);
}
function loadHTMLFile_SUB(fName){
httpObj2 = createXMLHttpRequest(displayData2);
if (httpObj2)
{
httpObj2.open(Get_BName(),fName,true);
httpObj2.send(null);
}
}
function displayData2(){
if ((httpObj2.readyState == 4) && (httpObj2.status == 200)){
document.getElementById("dutinp").innerHTML = httpObj2.responseText;
}else{
document.getElementById("dutinp").innerHTML = "<b>Loading...</b>";
}
}
function del(intsts){
prm = "intsts="+intsts+"&intsyorists=2";
//loadHTMLFile("DUT004.php?intsts="+intsts+"&intsyorists=2");
loadHTMLFile_Data("DUT004.php",prm);
//function loadHTMLFile(fName){
function loadHTMLFile_Data(fName,prm){
httpObj = createXMLHttpRequest(displayData);
if (httpObj){
//httpObj.open(Get_BName(),fName,true);
//httpObj.send(null);
httpObj.open("POST",fName,true);
httpObj.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
httpObj.send(prm);
}
}
function displayData(){
if ((httpObj.readyState == 4) && (httpObj.status == 200)){
dut_info(document.e_gru.strwkdate.value);
}else{
document.getElementById("dutinp").innerHTML = "<b>Loading...</b>";
}
}
}
function cal_get(strDate, divid){
arrYMD = strDate.split("/");
if(divid == "calid"){
objY = document.e_gru.main_year;
objM = document.e_gru.main_mon;
}else if(divid == "calid2"){
objY = document.e_gru.st_year;
objM = document.e_gru.st_mon;
objD = document.e_gru.st_day;
}else if(divid == "calid3"){
objY = document.e_gru.ed_year;
objM = document.e_gru.ed_mon;
objD = document.e_gru.ed_day;
}
//年
for(i=0;i<objY.options.length;i++){
if(objY.options[i].value == arrYMD[0]){
objY.selectedIndex = i;
break;
}
}
//月
for(i=0;i<objM.options.length;i++){
if(objM.options[i].value == arrYMD[1]){
objM.selectedIndex = i;
break;
}
}
if(divid == "calid"){
//document.e_gru.strkijyunDate.value = arrYMD[0]+arrYMD[1]+arrYMD[2];
loadHTMLFile_SUB_info("DUT001-1.php?strwkdate="+arrYMD[0]+arrYMD[1]+arrYMD[2]);
}else{
//日
for(i=0;i<objD.options.length;i++){
if(objD.options[i].value == arrYMD[2]){
objD.selectedIndex = i;
break;
}
}
}
cal1 = new JKL.Calendar("calid","e_gru","colname");
cal2 = new JKL.Calendar("calid2","e_gru","colname2");
cal3 = new JKL.Calendar("calid3","e_gru","colname3");
}
-->
</SCRIPT>
<script>
var cal1 = new JKL.Calendar("calid","e_gru","colname");
var cal2 = new JKL.Calendar("calid2","e_gru","colname2");
var cal3 = new JKL.Calendar("calid3","e_gru","colname3");
</script>