TOP021_m.php
5.65 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
<?php
//*****************************************************************************
//*
//* プログラム名:簡易在席一覧
//* プログラムID:TOP021.php
//* 機能 :
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=Shift_JIS");
//*** 広告 ***//
include("include_m/Advertisement.inc");
//*** 共通処理 ***//
include("include_m/CommonProcess.inc");
$strSQL="SELECT syain_cd,name_kj_sei,name_kj_mei FROM syain_tbl Where del_flg=true Order by disp_rank";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$absArr = array("","","","");
for ($intCnt = 0; $intCnt < pg_numrows($objRec) ; $intCnt++){
$objData = pg_fetch_object($objRec, $intCnt);
$strSyain[$intCnt][0] = mb_convert_encoding($objData->name_kj_sei, "SJIS", "EUC-JP")." ".mb_convert_encoding($objData->name_kj_mei, "SJIS", "EUC-JP");
$strSyain[$intCnt][1]="未設定";
$strSQL = "SELECT * FROM kojin_data_tbl WHERE seq = 16 AND syain_cd ='".$objData->syain_cd."'";
$objState = pg_exec($strSQL);
if($objState == false){
echo("SQL実行に失敗しました(SELECR)");
exit;
}
/*
if(pg_numrows($objState) > 0){
$objStateData = pg_fetch_object($objState,0);
switch ($objStateData->memo) {
case "0":
$strSyain[$intCnt][1]="未設定";
break;
case "1":
$strSyain[$intCnt][1]="<font color='#ff0000'>不在</font>";
break;
case "2":
$strSyain[$intCnt][1]="<font color='#0000ff'>在席</font>";
break;
case "3":
$strSyain[$intCnt][1]="<font color='#00ff00'>一時退席</font>";
break;
}
if($objData->syain_cd == $PHP_SYAIN_CD){
$absArr[(int)$objStateData->memo] = "selected";
}
}
$strSyain[$intCnt][2]="";
$strSQL = "SELECT * FROM kojin_data_tbl WHERE seq = 17 AND syain_cd ='".$objData->syain_cd."'";
$objState = pg_exec($strSQL);
if($objState == false){
echo("SQL実行に失敗しました(SELECR)");
exit;
}
if(pg_numrows($objState) > 0){
$objStateData = pg_fetch_object($objState,0);
$strSyain[$intCnt][2]=" (".mb_convert_encoding(substr($objStateData->memo,5), "SJIS", "EUC-JP").")";
}
*/
//20100427
if(pg_numrows($objState) > 0){
$objStateData = pg_fetch_object($objState,0);
$inttemp = (int)$objStateData->memo;
$strCHK = "";
$strSQL2 = "SELECT * FROM mst_common_word Where seq = $inttemp And type = 1 order by seq";
$rsRecset2 = pg_exec($pg_con,$strSQL2);
if($rsRecset2==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
if(pg_numrows($rsRecset2) > 0){
$zaiseki_name=pg_result($rsRecset2,0,"memo1");
$collar=(int)pg_result($rsRecset2,0,"memo2");
$strSQL3 = "SELECT * FROM mst_common_word Where seq = $collar And type = 2 order by seq";
$rsRecset3 = pg_exec($pg_con,$strSQL3);
if($rsRecset3==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$zaiseki_collar=pg_result($rsRecset3,0,"memo1");
$strSyain[$intCnt][1]= "<font color='".$zaiseki_collar."'><b>".mb_convert_encoding($zaiseki_name, "SJIS", "EUC-JP")."</b></font>";
//$strSyain[$intCnt][1]= "<font color='".$zaiseki_collar."'><b>".$zaiseki_name."</b></font>";
//更新日時
$strSyain[$intCnt][2]="";
$strSQL = "SELECT * FROM kojin_data_tbl WHERE seq = 17 AND syain_cd ='".$objData->syain_cd."'";
$objState = pg_exec($strSQL);
if($objState == false){
echo("SQL実行に失敗しました(SELECR)");
exit;
}
if(pg_numrows($objState) > 0){
$objStateData = pg_fetch_object($objState,0);
$strSyain[$intCnt][2]=" (".mb_convert_encoding(substr($objStateData->memo,5), "SJIS", "EUC-JP").")";
}
}
}
}
//20100427 追加 リスト作成
$strSQL = "SELECT * FROM kojin_data_tbl WHERE seq = 16 AND syain_cd ='".$PHP_SYAIN_CD."'";
$objState = pg_exec($strSQL);
if($objState == false){
echo("SQL実行に失敗しました(SELECR)");
exit;
}
if(pg_numrows($objState) > 0){
$objStateData = pg_fetch_object($objState,0);
$inttemp2 = (int)$objStateData->memo;
}
$strCHK = "";
$strSQL2 = "SELECT * FROM mst_common_word Where type = 1 order by seq";
$rsRecset2 = pg_exec($pg_con,$strSQL2);
if($rsRecset2==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
$intRsCnt = pg_numrows($rsRecset2);
$strAbs = "<select name='abs' >";
$strAbs .= "<option value='0'>--------</option>";
for ($i = 0 ; $i <= $intRsCnt-1 ; $i++) {
$zaiseki_name=pg_result($rsRecset2,$i,"memo1");
if ($inttemp2 == pg_result($rsRecset2,$i,"seq")){
$strAbs .= "<option value='".pg_result($rsRecset2,$i,"seq")."' selected>".mb_convert_encoding($zaiseki_name, "SJIS", "EUC-JP")."</option>";
}else{
$strAbs .= "<option value='".pg_result($rsRecset2,$i,"seq")."' >".mb_convert_encoding($zaiseki_name, "SJIS", "EUC-JP")."</option>";
}
}
$strAbs .= "</select>";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE>簡易在席確認</TITLE>
</head>
<body>
<form method="GET" action="TOP022_m.php">
<center>
簡易在席確認<br>
<?php echo $strName; ?>
<HR width="100%">
</center>
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
?>
<HR width="100%">
<?php echo Date("Y/m/d H:i"); ?>現在
<br>
<?php
echo $strAbs;
?>
<INPUT TYPE = "submit" name = "type" VALUE = "更新する">
<hr>
<?php
for ($intCnt = 0; $intCnt < count($strSyain); $intCnt++) {
echo "・".$strSyain[$intCnt][0];
echo "<br> ".$strSyain[$intCnt][1].$strSyain[$intCnt][2]."<br>";
}
?>
<hr>
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
//*** 共通変数取得 ***//
include("include_m/CommonHidden.inc");
?>
</form>
</body>
</html>