TOP900.php
7.64 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
<?php
//*****************************************************************************
//*
//* プログラム名:スケジュール
//* プログラムID:TOP900.php
//* 機能 :CSV出力
//* 作成者 :K.Yoshimrua
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
include('include/smarty.conf');
$strDBinc="include/dbcon.inc";
include($strDBinc);
//社員情報取得
$strSQL="SELECT syain_cd,name_kj_sei,name_kj_mei".
" FROM syain_tbl Where del_flg=true Order By Disp_rank";
$objData = pg_exec($strSQL);
for($intCnt = 0; $intCnt < pg_numrows($objData) ; $intCnt++) {
$objRecData = pg_fetch_object($objData, $intCnt);
$strSyain[$intCnt][0]=$objRecData->syain_cd;
$strSyain[$intCnt][1]=$objRecData->name_kj_sei.$objRecData->name_kj_mei;
$strSyain[$intCnt][2]="";
$strSQL = "SELECT * From syozoku_tbl Where syain_cd='".$strSyain[$intCnt][0]."' ";
$objBumon = pg_exec($strSQL);
for($i = 0; $i < pg_numrows($objBumon) ; $i++) {
$objRecBumon = pg_fetch_object($objBumon, $i);
$strSyain[$intCnt][2].=$objRecBumon->syozoku_cd."/";
}
}
//全部門
$strSQL = "SELECT syozoku_cd,bumon_name,disp_rank From mst_bumon Where del_flg=0 Order By disp_rank";
$objBumon = pg_exec($strSQL);
for($intCnt = 0; $intCnt < pg_numrows($objBumon) ; $intCnt++) {
$objRecBumon = pg_fetch_object($objBumon, $intCnt);
$strBumon[$intCnt][0]=$objRecBumon->syozoku_cd;
$strBumon[$intCnt][1]=$objRecBumon->bumon_name;
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
<META http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="basefont.css">
<TITLE>E-グルPro</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
//--------------------------
// オールチェック
//--------------------------
function All_chk(intSts){
if (document.e_gru.syain_chk.length){
if (intSts==1){
for(i = 0 ; i <= document.e_gru.syain_chk.length-1; i++ ){
document.e_gru.syain_chk[i].checked=false;
}
}else{
for(i = 0 ; i <= document.e_gru.syain_chk.length-1; i++ ){
document.e_gru.syain_chk[i].checked=true;
}
}
}else{
if (intSts==1){
document.e_gru.syain_chk.checked=false;
}else{
document.e_gru.syain_chk.checked=true;
}
}
}
//--------------------------
// 部門チェック
//--------------------------
function All_chk2(){
if (document.e_gru.syain_chk.length){
for(i = 0 ; i <= document.e_gru.syain_chk.length-1; i++ ){
arr = (document.e_gru.syain_hid[i].value).split("/");
for(j=0;j<arr.length;j++){
if (document.e_gru.bumon.value==arr[j]){
document.e_gru.syain_chk[i].checked=true;
break;
}
}
}
}else{
arr = (document.e_gru.syain_hid.value).split("/");
for(j=0;j<arr.length;j++){
if (document.e_gru.bumon.value==arr[j]){
document.e_gru.syain_chk.checked=true;
break;
}
}
}
}
//--------------------------
// CSVダウンロード
//--------------------------
function CSVDownLoad(){
prm = "";
prm_list="";
if (document.e_gru.syain_chk.length){
for(i = 0 ; i <= document.e_gru.syain_chk.length-1; i++ ){
if (document.e_gru.syain_chk[i].checked==true){
prm_list+=document.e_gru.syain_chk[i].value+",";
}
}
}else{
prm_list+=document.e_gru.syain_chk.value+",";
}
if (prm_list==""){
alert("社員を最低一人を選択してください。");
return false;
}
prm = "lst_data="+prm_list;
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;
document.e_gru.action = "TOP901.php?"+prm;
location.href = document.e_gru.action;
}
-->
</SCRIPT>
</HEAD>
<BODY>
<form name="e_gru">
<?php
$intLoop=date("Y")-2004+3;
?>
<br>
<TABLE width="580">
<TR>
<TD>
<TABLE cellspacing="1" cellpadding="1" width="100%" align="center" class="mainColor" border="0">
<TR>
<TD width=95 height=25 class="toneDown"><span class=Normalfont>出力期間</span></TD>
<TD height=25 bgcolor="#ffffff">
<SELECT name=st_year>
<option value="" selected>----</option>;
<?php
for ($i = 0 ; $i <= $intLoop ; $i++) {
$intSetValue=2004+$i;
echo '<option value='.$intSetValue.'>'.$intSetValue.'</option>';
}
?>
</SELECT>年
<SELECT name=st_mon>
<option value="" selected>---</option>;
<?php
for ($i = 1 ; $i <= 12 ; $i++) {
echo '<option value="'.sprintf('%02d',$i).'">'.$i.'</option>';
}
?>
</SELECT>月
<SELECT name=st_day>
<option value="" selected>---</option>;
<?php
for ($i = 1 ; $i <= 31 ; $i++) {
echo '<option value="'.sprintf('%02d',$i).'">'.$i.'</option>';
}
?>
</SELECT>日
<span class=Normalfont>〜</span>
<SELECT name=ed_year>
<option value="">----</option>;
<?php
for ($i = 0 ; $i <= $intLoop ; $i++) {
$intSetValue=2004+$i;
echo '<option value="'.$intSetValue.'" ';
if (date("Y") == $intSetValue) {
echo 'selected';
}
echo '>'.$intSetValue.'</option>';
}
?>
</SELECT>年
<SELECT name=ed_mon>
<option value="">---</option>;
<?php
for ($i = 1 ; $i <= 12 ; $i++) {
echo '<option value="'.sprintf('%02d',$i).'" ';
if (date("n") == $i) {
echo 'selected';
}
echo '>'.$i.'</option>';
}
?>
</SELECT>月
<SELECT name=ed_day>
<option value="">---</option>;
<?php
for ($i = 1 ; $i <= 31 ; $i++) {
echo '<option value="'.sprintf('%02d',$i).'" ';
if (date("j") == $i) {
echo 'selected';
}
echo '>'.$i.'</option>';
}
?>
</SELECT>日
<span class=Normalfont> </span>
</TD>
</TR>
<TR>
<TD width=95 height=25 class="toneDown"><span class=Normalfont>出力部門</span></TD>
<TD height=25 bgcolor="#ffffff">
<INPUT type="button" onclick="All_chk(0);" value="全選択">
<INPUT type="button" onclick="All_chk(1);" value="全解除"><BR>
<select name="bumon">
<?php
for($intCnt = 0; $intCnt < count($strBumon) ; $intCnt++) {
echo '<option value="'.$strBumon[$intCnt][0].'">'.$strBumon[$intCnt][1].'</option>';
}
?>
</select>
<INPUT type="button" onclick="All_chk2();" value="選択">
</TD>
</TR>
<TR>
<TD width=95 height=25 class="toneDown"><span class=Normalfont>出力社員</span></TD>
<TD height=25 bgcolor="#ffffff">
<?php
for($intCnt = 0; $intCnt < count($strSyain) ; $intCnt++) {
echo '<input type="checkbox" name="syain_chk" id="'.$strSyain[$intCnt][0].'" value="'.$strSyain[$intCnt][0].'">';
echo '<label for="'.$strSyain[$intCnt][0].'">';
echo '<span class="Normalfont">'.$strSyain[$intCnt][1].'</span>';
echo '</label><BR>';
echo '<input type="hidden" name="syain_hid" value="'.$strSyain[$intCnt][2].'">';
}
?>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<input type="button" onClick="CSVDownLoad();" name = "btnCsv" value="ダウンロード"> <input type="button" onClick="javascript:window.close();" name = "btnCsv" value="閉じる">
</form>
</BODY>
</HTML>