CON008.php
9.98 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
<?php
//*****************************************************************************
//*
//* プログラム名:社員情報画面
//* プログラムID:CON008
//* 機能 :社員情報画面を表示する
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=EUC-JP");
//***************************
//*インクルードファイル
//***************************
include("./include/session_start.inc"); //セッション開始
include("./include/SessionChk.inc"); //セッションチェック
include("./include/dbcon_group.inc"); //DB接続
//制限数の取得
$strSQL = "SELECT * FROM maxuser_tbl Where group_id='$PHP_FOLDER_NAME'";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$objData = pg_fetch_object($objRec, 0);
$Max_Count=$objData->max_count;
//***************************
//*画面制御
//***************************
include("./inc/header.inc"); //
include("./inc/CON008.inc"); //
include("menu_opacity.php"); //メニュー
//***************************
//*インクルードファイル
//***************************
include("./include/dbcon.inc"); //DB接続
$strSQL = "SELECT count(*) as UserCnt FROM syain_tbl Where del_flg =true";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$objData = pg_fetch_object($objRec, 0);
$User_Count=$objData->usercnt;
if ($Max_Count<=$User_Count){
$UserFlg=1;
}else{
$UserFlg=0;
}
//社員情報
$strSql = "SELECT * FROM syain_tbl WHERE del_flg =true";
if($strSyuugyou_type != ""){
$strSql = $strSql." AND syugyo_type =".$strSyuugyou_type;
}
$strSyain_cd = "";
if($strSyozoku_cd != ""){
$strSQLBumon="SELECT syain_cd FROM syozoku_tbl Where syozoku_cd=".$strSyozoku_cd ;
$objRecBumon = pg_exec($pg_con,$strSQLBumon);
if($objRecBumon==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$strSyain_cd =" AND (";
for ($intCnt = 0; $intCnt < pg_numrows($objRecBumon) ; $intCnt++) {
if($intCnt == 0){
$strSyain_cd = $strSyain_cd." syain_cd = '".trim(pg_result($objRecBumon,$intCnt,"syain_cd"))."'";
}else{
$strSyain_cd = $strSyain_cd." OR syain_cd = '".trim(pg_result($objRecBumon,$intCnt,"syain_cd"))."'";
}
}
$strSyain_cd = $strSyain_cd." ) ";
}
$strSql = $strSql.$strSyain_cd." ORDER BY disp_rank";
$rsRecset = pg_exec($pg_con,$strSql);
$intRsCnt = pg_numrows($rsRecset);
//就業形態リスト
$strSql = "SELECT syuugyou_type,type_name FROM mst_syuugyou_type ORDER BY disp_rank";
$rsSyuugyouRecset = pg_exec($pg_con,$strSql);
$intSyuugyouRsCnt = pg_numrows($rsSyuugyouRecset);
//部門リスト
$strSql = "SELECT syozoku_cd,bumon_name FROM mst_bumon Where del_flg = 0 ORDER BY disp_rank";
$rsBumonRecset = pg_exec($pg_con,$strSql);
$intBumonRsCnt = pg_numrows($rsBumonRecset);
?>
<form name="e_gru">
<?php if ($PHP_BIT[0]==1){ ?>
<table width="100%" border="0" cellspacing="0">
<tr>
<td class="midashi">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<th width="50%" scope="col"><div align="left"><img src="image/t_kanri.gif" border="0"> 社員情報設定</div></th>
<th width="50%" scope="col"><div align="right"><a href='javascript:Disp_Help("CON008HLP.htm")'><img src="image/help.gif" border="0"></a><a href='javascript:Disp_Help("CON008HLP.htm")'>ヘルプ</a></div></th>
</tr>
</table>
<div align="right"></div>
</td>
</tr>
</table>
<br>
<table width="100%" border="0">
<tr>
<td><input type="button" onclick="sinki();" value="社員新規作成" <?php if ($UserFlg==1){ echo "disabled"; } ?>></td>
<td align="right"><input type="button" onclick="return back();" value=" 戻 る " name="modoru"></td>
<tr>
</table>
<table width="402" border="0" cellspacing="1" cellpadding="1" bgcolor="#9999ff">
<tr>
<td>
<table width="400" cellSpacing="1" cellPadding="1" border="0">
<tr>
<td align="center" bgColor="#ccccff"><span class="Normalfont">現在ご登録人数</span></td>
<td align="center" bgColor="#ffffff">
<?php if ($UserFlg==1){ ?>
<span class="Chufont"><?php echo $User_Count; ?>人</span>
<?php }else{ ?>
<span class="Normalfont"><?php echo $User_Count; ?>人</span>
<?php } ?>
</td>
<td align="center" bgColor="#ccccff"><span class="Normalfont">ご利用可能人数</span></td>
<td align="center" bgColor="#ffffff"><span class="Normalfont"><?php echo $Max_Count; ?>人</span></td>
</tr>
<?php if ($UserFlg==1){ ?>
<tr>
<td align="center" colspan="4" bgColor="#ffffff"><span class="Chufont">登録人数が制限いっぱいです。</span></td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<table width="100%" border="0">
<tr>
<td align="right">
<span class="Normalfont">就業形態:</span>
<select name="syugyo" onchange="disp_syugyo();">
<option value="" >すべて</option>
<?php
for ($i = 0 ; $i < $intSyuugyouRsCnt ; $i++) {
if ($strSyuugyou_type == pg_result($rsSyuugyouRecset,$i,"syuugyou_type")) {
echo "<option value=\"".pg_result($rsSyuugyouRecset,$i,"syuugyou_type")."\" selected>".pg_result($rsSyuugyouRecset,$i,"type_name")."</option>";
}else{
echo "<option value=\"".pg_result($rsSyuugyouRecset,$i,"syuugyou_type")."\">".pg_result($rsSyuugyouRecset,$i,"type_name")."</option>";
}
}
?>
<option value="0" <?php if ($strSyuugyou_type == "0") { ?> selected <?php } ?>>未設定</option>
</select>
<span class="Normalfont">所属部門:</span>
<select name="bumon" onchange="disp_bumon();">
<option value="">すべて</option>
<?php
for ($i = 0 ; $i < $intBumonRsCnt ; $i++) {
if ($strSyozoku_cd == pg_result($rsBumonRecset,$i,"syozoku_cd")) {
echo "<option value=\"".pg_result($rsBumonRecset,$i,"syozoku_cd")."\" selected>".pg_result($rsBumonRecset,$i,"bumon_name")."</option>";
}else{
echo "<option value=\"".pg_result($rsBumonRecset,$i,"syozoku_cd")."\">".pg_result($rsBumonRecset,$i,"bumon_name")."</option>";
}
}
?>
</select>
</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="1" cellpadding="1" bgColor="#9999ff">
<tr>
<td>
<table width="100%" cellspacing="1" cellpadding="1" border="0">
<tr bgcolor="#ccccff" align="center">
<td height="30" width="5%"><span class="Normalfont">表示移動</span></td>
<td height="30" width="10%"><span class="Normalfont">社員番号</span></td>
<td height="30" ><span class="Normalfont">社員名</span></td>
<td height="30" ><span class="Normalfont">就業形態</span></td>
<td height="30" ><span class="Normalfont">所属部門</span></td>
</tr>
<?php for ($i = 0 ; $i < $intRsCnt ; $i++) {?>
<tr bgcolor="#ffffff">
<td align="center">
<span class="Normalfont">
<?php if ($strSyuugyou_type == "" && $strSyozoku_cd == ""){ ?>
<?php if($i != 0) { ?>
<input type="button" onclick="return up('<?php echo pg_result($rsRecset,$i,"syain_cd") ?>');" value="↑">
<?php } ?>
<?php if($i != $intRsCnt-1) {?>
<input type="button" onclick="return down('<?php echo pg_result($rsRecset,$i,"syain_cd") ?>');" value="↓">
<?php } ?>
<?php }else{ ?>
---
<?php } ?>
</span>
</td>
<td height="30">
<span class="Normalfont"><?php echo pg_result($rsRecset,$i,"syain_id") ?></span>
</td>
<td height="30">
<span noWrap class="Normalfont">
<a href="javascript:edit('<?php echo pg_result($rsRecset,$i,"syain_cd") ?>')"><?php echo htmlspecialchars(pg_result($rsRecset,$i,"name_kj_sei").pg_result($rsRecset,$i,"name_kj_mei")) ?></a>
</span>
</td>
<?php
//就業タイプ取得
$strSQLtype="SELECT type_name FROM mst_syuugyou_type Where syuugyou_type= ". pg_result($rsRecset,$i,"syugyo_type");
$objRectype = pg_exec($strSQLtype);
if($objRectype==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if (pg_numrows($objRectype) > 0){
$objSyugyo = pg_fetch_object($objRectype,0);
$strSyugyo_Name=$objSyugyo->type_name;
}else{
$strSyugyo_Name="";
}
?>
<td height="30">
<span class="Normalfont"><?php echo $strSyugyo_Name; ?></span>
</td>
<?php
//所属取得
$strSQLSyozoku="SELECT syozoku_cd FROM syozoku_tbl Where syain_cd= '".pg_result($rsRecset,$i,"syain_cd")."'";
$objRecSyozoku = pg_exec($strSQLSyozoku);
if($objRecSyozoku==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$objSyozoku = pg_fetch_object($objRecSyozoku,0);
$strBumon_Name ="";
for ($intCnt = 0; $intCnt < pg_numrows($objRecSyozoku) ; $intCnt++) {
$objSyozoku = pg_fetch_object($objRecSyozoku, $intCnt);
//部門名取得
$strSQLbumon="SELECT bumon_name FROM mst_bumon Where syozoku_cd=$objSyozoku->syozoku_cd ";
$objRecbumon = pg_exec($strSQLbumon);
if($objRecbumon==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$objBumon = pg_fetch_object($objRecbumon,0);
$strBumon_Name = $strBumon_Name.$objBumon->bumon_name ."<BR>";
}
?>
<td height="30">
<span class="Normalfont"><?php echo $strBumon_Name; ?></span>
</td>
</tr>
<?php } ?>
</table>
</td>
</tr>
</table>
<br>
<table width="100%" border="0" >
<tr height="40">
<td align="right"><input type="button" onclick="return back();" value=" 戻 る " name="modoru"></td>
</tr>
</table>
<input type="hidden" name="sinki_edit_flg" value="">
<input type="hidden" name="up_down_flg" value="">
<input type="hidden" name="syain_cd" value="">
<input type="hidden" name="strSyuugyou_type" value="">
<input type="hidden" name="strSyozoku_cd" value="">
<?php }else{?>
<a href="TOP000.php"><span class="Normalfont">マスタ変更権限がありません</span></a>
<?php } ?>
</form>
<?php
//コピーライト
include("include/copyright.inc");
?>