RES002_m.php
6.72 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
<?php
//*****************************************************************************
//*
//* プログラム名:施設予約(携帯電話)
//* プログラムID:TOP002_m.php
//* 機能 :日別施設予約画面
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=Shift_JIS");
//*** 広告 ***//
include("include_m/Advertisement.inc");
//*** 共通処理 ***//
include("include_m/CommonProcess.inc");
//*** 施設予約***
$strMenuSQL = "SELECT name FROM sub_menu_TBL WHERE url = 'RES001.php'";
$rsRecset = pg_exec($strMenuSQL);
$PHP_TITLE_NAME=mb_convert_encoding(pg_result($rsRecset,0,"name"), "SJIS", "EUC-JP");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE>E-グルPro(<?php echo $PHP_TITLE_NAME; ?>)</TITLE>
</HEAD>
<BODY>
<form method="Get" action="RES002_m.php">
<center><?php echo $PHP_TITLE_NAME; ?><br>
<?php echo $strName; ?>
<HR width="100%">
<?php echo $koukokuTEL; ?>
</center>
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
?>
<HR width="100%">
<A href="RES001_m.php?sisetu_id=<?php echo $sisetu_id ?>&year=<?php echo $year ?>&mon=<?php echo $mon ?>&<?php echo $PHP_Argument ?>"accesskey="1"><?php echo Get_Num("1"); ?><?php echo substr($year,2,2); ?>年<?php echo intval($mon); ?>月カレンダーへ</A>
<br><br>
<?php
//*** 施設情報 ***//
$strSQL="Select seq,sisetu_name,disp_rank From mst_sisetu Order By disp_rank";
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
//初期値設定
if (pg_numrows($objRecSet)>0){
if ($sisetu_id==""){
$objRecDat = pg_fetch_object($objRecSet, $intCnt);
$sisetu_id= $objRecDat->seq;
}
}else{
$sisetu_id==0;
}
//*** 日付編集 ***//
if($year == "" && $mon=="" && $day==""){
$year=date("Y");
$mon=date("n");
$day=date("j");
}
//*** 施設情報 ***//
echo "<SELECT name=sisetu_id>";
for ($intCnt = 0; $intCnt < pg_numrows($objRecSet); $intCnt++) {
$objRecDat = pg_fetch_object($objRecSet, $intCnt);
echo '<OPTION value="'.$objRecDat->seq.'" ';
if ($sisetu_id==$objRecDat->seq){
echo "selected";
}
echo ">";
echo mb_convert_encoding($objRecDat->sisetu_name, "SJIS", "EUC-JP" );
echo "</OPTION>";
}
echo "</SELECT><br>";
//*** 予定開始年 ***//
echo "<SELECT name=year>";
for ($i = $year-1 ; $i <= $year+1 ; $i++) {
if ($year == $i) {
echo "<option value=\"".$i."\" selected>".$i."年\n";
}else{
echo "<option value=\"".$i."\">".$i."年\n";
}
}
echo "</SELECT>";
//*** 予定開始月 ***//
echo "<SELECT name=mon>";
for ($i = 1 ; $i <= 12 ; $i++) {
if ($mon == $i) {
if (strlen($i)==1){
echo "<option value=\""."0".$i."\" selected>".$i."月\n";
}
else{
echo "<option value=\"".$i."\" selected>".$i."月\n";
}
}
else{
if (strlen($i)==1){
echo "<option value=\""."0".$i."\">".$i."月\n";
}
else{
echo "<option value=\"".$i."\">".$i."月\n";
}
}
}
echo "</SELECT>";
//*** 予定開始日 ***//
echo "<SELECT name=day>";
for ($i = 1 ; $i <= 31 ; $i++) {
if ($day == $i) {
if (strlen($i)==1){
echo "<option value=\""."0".$i."\" selected>".$i."日\n";
}
else{
echo "<option value=$i selected>".$i."日\n";
}
}else{
if (strlen($i)==1){
echo "<option value=\""."0".$i."\">".$i."日\n";
}
else{
echo "<option value=$i>".$i."日\n";
}
}
}
echo "</SELECT><br>";
echo '<input type="submit" value="表示"><br>';
//*****日付編集*****//
if (strlen($mon)==1){
$mon="0".$mon;
}
if (strlen($day)==1){
$day="0".$day;
}
$strDate=$year."/".$mon."/".$day;
//*****スケジュール情報取得*****//
$strSQL = "SELECT seq,rsv_no,syain_cd,rsv_st_date,rsv_ed_date,rsv_st_time,rsv_ed_time,".
"reg_date,reg_time,contact,purpose,resume,link_cd,rev_type,rev_code,del_date ".
"FROM sisetu_tbl ".
"WHERE rsv_no=$sisetu_id and rsv_st_date<='".$strDate."' and ".
"rsv_ed_date>='".$strDate."' and ".
"(del_date not like '%".$strDate."%' or del_date IS Null) ";
$objRecDat = pg_exec($strSQL);
if($objRecDat==false){
echo("SQL実行に失敗しました(SELECT)");
exit;
}
//スケジュール表示
for ($intCnt = 0; $intCnt < pg_numrows($objRecDat); $intCnt++) {
$objRecSet = pg_fetch_object($objRecDat, $intCnt);
//変数クリア
$strTime=""; //時間
$strScdl_kbn=""; //予定種別
//時間表示
if ($objRecSet->rsv_st_time != ""){
list($st_hour,$st_mini)=split(":", mb_convert_encoding($objRecSet->rsv_st_time, "SJIS", "EUC-JP" ));
$strTime=$st_hour.":".$st_mini;
}
if ($objRecSet->rsv_ed_time != ""){
list($ed_hour,$ed_mini)=split(":", mb_convert_encoding($objRecSet->rsv_ed_time, "SJIS", "EUC-JP" ));
$strTime=$strTime."-".$ed_hour.":".$ed_mini;
}
//普通のスケジュールの場合
if ($objRecSet->rev_type==0){
$strScdl=$strScdl_kbn.mb_convert_encoding($objRecSet->purpose, "SJIS", "EUC-JP" );
echo "<A href=RES003_m.php?$PHP_Argument&seq=$objRecSet->seq&sisetu_id=$sisetu_id&setDate=$year$mon$day>".$strTime.$strScdl."</A><BR>";
}elseif($objRecSet->rev_type==1){
//週間スケジュールの場合
$strYoubi=date("w", mktime (0,0,0,$mon,$day,$year));
if ($strYoubi==$objRecSet->rev_code){
$strTime=mb_convert_encoding($strTime, "SJIS", "EUC-JP" );
$strScdl=$strScdl_kbn.mb_convert_encoding($objRecSet->purpose, "SJIS", "EUC-JP" );
$strScdl=$strScdl."(週間)";
echo "<A href=RES003_m.php?$PHP_Argument&seq=$objRecSet->seq&sisetu_id=$sisetu_id&setDate=$year$mon$day>".$strTime.$strScdl."</A><BR>";
}
}elseif($objRecSet->rev_type==2){
//20090818 月末対応
if ($objRecSet->rev_code == 32){
$str_rev_code = date("t", mktime (0,0,0,$mon,$day,$year));
}else{
$str_rev_code = $objRecSet->rev_code;
}
//月間スケジュールの場合
//if ($objRecSet->rev_code==intval($day)){
if ($str_rev_code==intval($day)){
$strTime=mb_convert_encoding($strTime, "SJIS", "EUC-JP" );
$strScdl=$strScdl_kbn.mb_convert_encoding($objRecSet->purpose, "SJIS", "EUC-JP" );
$strScdl=$strScdl."(月間)";
echo "<A href=RES003_m.php?$PHP_Argument&seq=$objRecSet->seq&sisetu_id=$sisetu_id&setDate=$year$mon$day>".$strTime.$strScdl."</A><BR>";
}
}
}
echo "<A href=RES003_m.php?$PHP_Argument&setDate=$year$mon$day&sisetu_id=$sisetu_id>施設予約</A>";
?>
<br><br><A href="RES001_m.php?sisetu_id=<?php echo $sisetu_id ?>&year=<?php echo $year ?>&mon=<?php echo $mon ?>&<?php echo $PHP_Argument ?>"accesskey="1"><?php echo Get_Num("1"); ?><?php echo substr($year,2,2); ?>年<?php echo intval($mon); ?>月カレンダーへ</A>
<HR width="100%">
<?php
//メニュー表示
include("include_m/CommonMenuReturn.inc");
//*** 共通変数取得 ***//
include("include_m/CommonHidden.inc");
?>
</form>
</BODY>
</HTML>