TOP021.php
4.73 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
<?php
//*****************************************************************************
//*
//* プログラム名:簡易在席一覧
//* プログラムID:TOP021.php
//* 機能 :
//* 作成者 :
//*
//*****************************************************************************
include("include/session_start.inc");
include("include/SessionChk.inc");
include("include/STRING.inc");
$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";
$objRec = pg_exec($strSQL);
if($objRec==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
for ($intCnt = 0; $intCnt < pg_numrows($objRec) ; $intCnt++){
$objData = pg_fetch_object($objRec, $intCnt);
$strSyain[$intCnt][0] = $objData->name_kj_sei." ".$objData->name_kj_mei;
$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><b>不在</b></font>";
break;
case "2":
$strSyain[$intCnt][1]="<font color=#0000ff>在席</font>";
break;
case "3":
$strSyain[$intCnt][1]="<font color=#00ff00>一時退席</font>";
break;
}
}
*/
$strSyain[$intCnt][2]="";
if(pg_numrows($objState) > 0){
//20100427
$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>".$zaiseki_name."</b></font>";
//更新日時
$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]=$objStateData->memo;
}
}
}
}
?>
<!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>簡易在席一覧</TITLE>
<SCRIPT LANGUAGE="JAVASCRIPT">
<!--
// this page's own script
function printer(){
window.print();
}
-->
</SCRIPT>
</head>
<body>
<form name="zaiseki_lst">
<div align="center">
<span class="Normalfont"><b><?php echo Date("Y/m/d H:i"); ?> </b>現在の在席状況</span>
<TABLE class="mainColor" width="402" border="0" cellspacing="1" cellpadding="1">
<tr><td>
<TABLE width="400" border="0" cellspacing="1" cellpadding="1">
<TR class="toneDown">
<TD width="200" height="25" align="center"><span class="Flowfont">名前</span></TD>
<TD width="100" height="25" align="center"><span class="Flowfont">状態</span></TD>
<TD width="100" height="25" align="center"><span class="Flowfont">実施日時</span></TD>
</TR>
<?php for ($intCnt = 0; $intCnt < count($strSyain); $intCnt++) { ?>
<TR bgcolor ="#ffffff">
<TD width="200" height="25" align="left"><span class="Flowfont"><?php echo $strSyain[$intCnt][0]; ?></span></TD>
<TD width="100" height="25" align="center"><span class="Flowfont"><?php echo $strSyain[$intCnt][1]; ?></span></TD>
<TD width="100" height="25" align="center"><span class="Flowfont"><?php echo $strSyain[$intCnt][2]; ?></span></TD>
</TR>
<?php } ?>
</TABLE>
</td>
</TR>
</TABLE>
<BR>
<TABLE cellSpacing="0" cellPadding="0" width="400" border="0" class="needless">
<TR>
<TD align="center">
<INPUT TYPE="button" VALUE=" 印刷する " onClick="printer()">
<INPUT TYPE="button" VALUE=" 画面更新 " onClick="location.reload()">
<INPUT TYPE="button" VALUE=" 閉じる " onClick="window.close()">
</TD>
</TR>
</TABLE>
</div>
</form>
</body>
</html>