calender.php
9.22 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
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
<?php
//*****************************************************************************
//*
//* プログラム名:e-イベント
//* プログラムID:calender.php
//* 機能 :イベント表示画面
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=shift-jis");
require('../_common/holiday_Eng.inc' );
require('./include/const.php' );
require('./include/month_Eng.php');
// ユーザー定義関数を取り込む
require('function/calender.inc' );
require('function/operatezero.inc');
//CSVファイルのパス
$ddir = "data/event/";
//カレンダー 色の配列
$clender = array("#EC534F", "#7CB60D", "#7CB60D", "#7CB60D", "#7CB60D", "#7CB60D", "#07A3DD");
$schedule = array("#EC534F", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#FFFFFF", "#07A3DD");
//ランダム広告
$affiliateNo1 = rand(1, 31);
$affiliateNo2 = rand(1, 31);
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="Microsoft FrontPage 4.0">
<META http-equiv="Content-Type" content="text/html; charset=shift_jis">
<META http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="css/style.css">
<TITLE><?php include("./include/title.inc"); ?>/e-event</TITLE>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
<!--
function GmDisp(){
document.cldr.action = "calender.php";
document.cldr.method = "POST";
document.cldr.submit();
return;
}
function reload(strDate){
document.cldr.strMainDate.value = strDate;
document.cldr.action = "calender.php";
document.cldr.method = "POST";
document.cldr.submit();
return;
}
function event_input(strDate){
document.cldr.hiduke.value = strDate;
document.cldr.action = "evententry.php";
document.cldr.method = "POST";
document.cldr.submit();
return;
}
function group_send(strDate){
document.cldr.strMainDate.value = strDate;
document.cldr.action = "../group_tran/group_Tran.php";
document.cldr.method = "POST";
document.cldr.submit();
return;
}
//-->
</script>
<?php
include("./function/focus.inc");
?>
</HEAD>
<BODY>
<div align="center">
<FORM METHOD="POST" name="cldr">
<!-- カレンダー表示 -->
<?php
//基準日取得
if($main_year == "" && $main_mon=="" && $strMainDate==""){
$main_year = date("Y");
$main_mon = date("n");
}else{
if ($strMainDate != ""){
$main_year = substr($strMainDate, 0, 4);
$main_mon = substr($strMainDate, 4, 2);
}
}
$strDispDate[0] = date("Ymd", mktime (0, 0, 0, $main_mon-1, "01", $main_year));
$strDispDate[1] = date("Y").date("m")."01";
$strDispDate[2] = date("Ymd", mktime (0, 0, 0, $main_mon+1, "01", $main_year));
?>
<span="TinnyFont"><br /></span>
<div class="title_head">
<!--アンテナショップ名称表示-->
<div class="shop_name"><?php echo $CONST_SHOP_NAME; ?></div>
<!--社名表示-->
<div class="com_name"><?php echo $CONST_COMPANY_NAME; ?></div>
<!--div class="logout"><INPUT type="button" class="logout_btn" value="ログアウト"></div-->
</div>
<TABLE width=100% border="0" align="center" cellPadding=0 cellSpacing=0 class="header">
<TBODY>
<TR>
<TD align="left" width="350">
</TD>
<TD align="center">
<SELECT name="main_year" onChange="GmDisp()" class="years">
<?php
for ($intCnt = $main_year-1; $intCnt <= $main_year+1; $intCnt++) {
echo "<option value = ".$intCnt;
if ($main_year == $intCnt){
echo " selected";
}
echo ">".$intCnt."</option>";
}
?>
</SELECT>
<SELECT name="main_mon" onChange="GmDisp()" class="years">
<?php
for ($intCnt = 1; $intCnt <= 12; $intCnt++) {
if (strlen($intCnt) == 1){
echo "<option value = 0".$intCnt;
}else{
echo "<option value = ".$intCnt;
}
if ($main_mon == $intCnt){
echo " selected";
}
echo ">".month_Eng($intCnt)."</option>";
}
?>
</SELECT>
</TD>
<TD align="right" width="350">
<INPUT type="button" class="n_btn" value="<< Last Mon" onclick="return reload(<?php echo $strDispDate[0]; ?>)">
<INPUT type="submit" class="n_btn" value=" This Mon " onclick="return reload(<?php echo $strDispDate[1]; ?>)">
<INPUT type="submit" class="n_btn" value="Next Mon >>" onclick="return reload(<?php echo $strDispDate[2]; ?>)">
</TD>
</TR>
</TBODY>
</TABLE>
<TABLE width="100%" class="mainTbr">
<TR align="center">
<TD width="15%" bgcolor="#EC534F" style="color:#FFFFFF; font-size:20px">Sun</TD>
<TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px">Mon</TD>
<TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px">Tues</TD>
<TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px">Wed</TD>
<TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px">Thurs</TD>
<TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px">Fri</TD>
<TD width="15%" bgcolor="#07A3DD" style="color:#FFFFFF; font-size:20px">Sat</TD>
</TR>
<?php
//MAX日付取得
$main_day = "01";
$dateMax = date("j", mktime (0, 0, 0, $main_mon+1, $main_day-1, $main_year));
//カレンダー空白数(前)
$intbefor = date("w", mktime (0, 0, 0, $main_mon, $main_day, $main_year));
//カレンダー空白数(後)
$intafter = date("w", mktime (0, 0, 0, $main_mon, $dateMax, $main_year));
$intafter = 6-$intafter;
//ループ基準日取得
$strWkDate = date("Y/m/d", mktime (0, 0, 0, $main_mon, $main_day-$intbefor, $main_year));
list($chk_year, $chk_mon, $chk_day)=split("/", $strWkDate);
for($intCnt = 0; $intCnt < $intbefor + $dateMax + $intafter; $intCnt++) {
$strWkDate = date("Y/m/d", mktime (0, 0, 0, $chk_mon, $chk_day+$intCnt, $chk_year));
$strcalender[$intCnt] = $strWkDate;
}
$idnames = "";
//テーブル作成
$intKaigyo = 6;
for($intCnt = 0; $intCnt < count($strcalender); $intCnt++) {
list($chk_year, $chk_mon, $chk_day) = split("/", $strcalender[$intCnt]);
$intYoubi = date("w", mktime (0, 0, 0, $chk_mon, $chk_day, $chk_year));
//テーブル開始
if ($intCnt % 7 == 0){
echo "<TR>";
}
//日付表示
if ($chk_mon == $main_mon){
//日付編集
if (substr($chk_mon, 0, 1) == 0){
$input_mon = substr($chk_mon, 1, 1);
}else{
$input_mon = $chk_mon;
}
if (substr($chk_day, 0, 1) == 0){
$input_day = substr($chk_day, 1, 1);
}else{
$input_day = $chk_day;
}
if (array_key_exists($chk_year.$chk_mon.$chk_day, $holiday)) {
$schedule_color = $schedule["0"];
$holiday_name = $holiday[$chk_year.$chk_mon.$chk_day];
}else{
$schedule_color = $schedule[$intYoubi];
$holiday_name = "";
}
echo '<TD width="14%" height="50" bgColor="'.$schedule_color.'">'.$chk_day;
if ($holiday_name != ""){
echo '<br><div class = "holiday">'.$holiday_name.'</div>';
}
echo "<ul>";
//データの取得
$file_name = $ddir."eventmst".fun_addzero($main_mon).".csv";
//読み込んだテーブルのレコード数を格納する変数
$tbl_cnt = 0;
$month_dat = fun_csvread($month_dat, $file_name);
//データ出力
for ($intdataCnt = 0; $intdataCnt < count($month_dat)+1; $intdataCnt++){
if (trim($month_dat[$intdataCnt][0]) == $chk_year.$chk_mon.$chk_day){
$month_dat[$intdataCnt][2] = str_replace("<", "<", $month_dat[$intdataCnt][2]);
$month_dat[$intdataCnt][2] = str_replace(">", ">", $month_dat[$intdataCnt][2]);
$idnames[] = "#open".$intdataCnt."";
echo '<p><a href="#open'.$intdataCnt.'">'.$month_dat[$intdataCnt][2].'</a></p>';
}
}
echo "</ul>\n\n";
echo "</TD>";
}else{
if (array_key_exists($chk_year.$chk_mon.$chk_day, $holiday)) {
$schedule_color = $schedule["0"];
$holiday_name = $holiday[$chk_year.$chk_mon.$chk_day];
}else{
$schedule_color = $schedule[$intYoubi];
$holiday_name = "";
}
echo "<TD Align=top width=115 bgColor='#DBDBDB' height=30>";
}
//テーブル終了
if ($intKaigyo == $intCnt){
echo "</tr>";
$intKaigyo = $intKaigyo+7;
}
}
?>
</TABLE>
<!--イベント詳細表示-->
<?php
echo "\n".'<div id="modal">'."\n";
for ($i = 0; $i<count($month_dat)+1; $i++){
if(trim($month_dat[$i][0]) != "" && substr($month_dat[$i][0], 0, 4) == $main_year){
echo '<div id="open'.$i.'">'."\n";
echo '<a href="#" class="close_overlay">×</a>'."\n";
echo '<span class="modal_window">'."\n";
echo '<h2>event information</h2>'."\n";
echo '<p><b>Event:<br></b>'.$month_dat[$i][2].'</p>'."\n";
if($month_dat[$i][10] != ""){
echo '<div class="url_return"><p><b>HomePage:<br></b><a href="'.$month_dat[$i][10].'" target="_brank">'.$month_dat[$i][10].'</a></p></div>';
}
echo '<p><b>Contents:</b><br>'.$month_dat[$i][11].'</p>'."\n";
echo '<a href="#">CLOSE 【×】</a>'."\n";
echo '</span>'."\n";
echo '</div>'."\n";
}
}
echo '</div>'."\n";
?>
<INPUT type="hidden" name="disp_nm" value="<?php echo $stDisp_Name ?>">
<INPUT type="hidden" name="sYear" value="">
<INPUT type="hidden" name="sMonth" value="">
<INPUT type="hidden" name="strMainDate" value="">
<INPUT type="hidden" name="hiduke" value="">
<INPUT type="hidden" name="usr_name" value="guest">
<INPUT type="hidden" name="usr_pword" value="guest">
<INPUT type="hidden" name="pageName" value="<?php include("./include/title.inc"); ?>">
<INPUT type="hidden" name="file_sel" value="event">
</SCRIPT>
<style type="text/css">
<?php
echo implode(",", $idnames);
?>
{
top: 0;
left: 0;
width: 100%;
height: 100%;
display: none;
position: absolute;
}
</style>
</FORM>
</div>
</BODY>
</HTML>