ADM0030.js
3.03 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
//文字コードはEUCで保存すること
function syain_chk(){
if ( (document.frm.lstBumon.selectedIndex == -1) || (document.frm.lstBumon.value == "") ) {
return false;
}
}
var SFlg = false; //サブミットフラグを定義
function DoubleSubmit(){ //ダブルサブミットチェック関数
if (SFlg){ //ダブルサブミットの場合
alert("応答中です"); //メッセージを出力
return false;
}
SFlg = true; //サブミットフラグを設定
return true; //戻り値を設定
}
function sinki(){
if (DoubleSubmit()) {
document.frm.mode.value="add";
document.frm.action = "ADM0031.php";
document.frm.method = "POST";
document.frm.submit();
}
}
function edit(){
var selno = 0;
if (syain_chk() == false) {
document.frm.lstBumon.focus();
return false;
}
if (DoubleSubmit()) {
//seq取得
document.frm.bseq.value = document.frm.lstBumon.value;
//名前取得
selno = document.frm.lstBumon.options.selectedIndex;
document.frm.bname.value = document.frm.lstBumon.options[selno].text;
document.frm.mode.value="edt";
document.frm.action = "ADM0031.php";
document.frm.method="POST";
document.frm.submit();
}
}
function del_chk(){
var selno = 0;
//ユーザの選択チェック
if (syain_chk() == false) {
document.frm.lstBumon.focus();
return false;
}
//seq取得
document.frm.bseq.value = document.frm.lstBumon.value;
//名前取得
selno = document.frm.lstBumon.options.selectedIndex;
document.frm.bname.value = document.frm.lstBumon.options[selno].text;
//ユーザの削除確認
if(confirm(document.frm.bname.value+'を削除します')){
document.frm.mode.value="del";
document.frm.action = "ADM0032.php";
document.frm.method = "POST";
document.frm.submit();
}else{
return false;
}
}
function up(){
var selno = 0;
if (document.frm.lstBumon.options.selectedIndex != 0){
if (syain_chk() == false) {
document.frm.lstBumon.focus();
return false;
}
if (DoubleSubmit()) {
document.frm.bseq.value = document.frm.lstBumon.value;
selno = document.frm.lstBumon.options.selectedIndex;
document.frm.bname.value = document.frm.lstBumon.options[selno].text;
document.frm.mode.value="up";
document.frm.idx.value = eval(document.frm.idx.value) -1;
document.frm.action = "ADM0032.php";
document.frm.method = "POST";
document.frm.submit();
}
}
}
function down(){
var selno = 0;
if ( document.frm.lstBumon.options.length-1
> document.frm.lstBumon.options.selectedIndex){
if (syain_chk() == false) {
document.frm.lstBumon.focus();
return false;
}
if (DoubleSubmit()) {
document.frm.bseq.value = document.frm.lstBumon.value;
selno = document.frm.lstBumon.options.selectedIndex;
document.frm.bname.value = document.frm.lstBumon.options[selno].text;
document.frm.mode.value = "down";
document.frm.idx.value = eval(document.frm.idx.value) +1;
document.frm.action = "ADM0032.php";
document.frm.method = "POST";
document.frm.submit();
}
}
}
function backmenu(){
location.href = "SIM0100.php";
}
function getindex(){
document.frm.idx.value = document.frm.lstBumon.options.selectedIndex;
}