eventmod.php
6.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
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
<?php
//*****************************************************************************
//*
//* プログラム名:e-イベント
//* プログラムID:eventmod.php
//* 機能 :イベント編集画面
//* 作成者 :
//*
//*****************************************************************************
ob_start();
//各月の曜日変換処理の読み込み
require('./include/month_Eng.php');
//ソート手順の読み込み
require('function/sortrog.inc');
//ゼロ操作の読み込み
require('function/operatezero.inc');
require('function/tblctl.inc');
require('function/tblmake.inc');
fun_backhome($file_month);
$home="kannrimenu.php";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META name="GENERATOR" content="IBM WebSphere Homepage Builder V6.0.1 for Windows">
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<META http-equiv="Content-Style-Type" content="text/css">
<TITLE>event registration edit</TITLE>
<SCRIPT type="text/javascript" src="function/checkdata.js"></SCRIPT>
<link href="css/style.css" rel="stylesheet" type="text/css">
<SCRIPT Language="JavaScript">
<!--
function Move_Menu(){
document.event_cal.action = "main_menu.php";
document.event_cal.method = "POST";
document.event_cal.submit();
return;
}
function Move_LogOut(){
document.event_cal.action = "login.php";
document.event_cal.method = "POST";
document.event_cal.submit();
return;
}
//半角・全角を区別する
function charcount(str) {
len = 0;
str = escape(str);
for (i=0; i<str.length; i++, len++) {
if (str.charAt(i) == "%") {
if (str.charAt(++i) == "u") {
i += 3;
len++;
}
i++;
}
}
return len;
}
function Move_UpDate(){
var fyear = document.event_cal.fyear.value;
var fmon = document.event_cal.fmon.value;
var fday = document.event_cal.fday.value;
var name = document.event_cal.eventname.value;
var hpadrs = document.event_cal.hpadrs.value;
var tipword = document.event_cal.tipword.value;
//イベント名称の入力チェック
name = chrlengs(name)
if (charcount(name) == 0){
alert("Please input the event name.");
return false
}
if (charcount(name) > 200){
alert("Please input the event name within 100 character ems.");
return false
}
//不要なスペースの除去
fyear = chrlengs(fyear);
fmon = chrlengs(fmon);
fday = chrlengs(fday);
//一桁月日を二桁にする。
fmon = addzero(fmon);
fday = addzero(fday);
//ホームページアドレスに全角が入力された場合エラーを出す
if(hpadrs.match(/[^\x01-\x7E]/) ) {
alert("Please input the home page address by a one-byte alphanumeric.");
return false
}
//ホームページアドレスの文字数チェック
if (charcount(hpadrs) > 500){
alert("Please input the home page address within the one-byte 500 character.");
return false
}
//メッセージの文字数チェック
if (charcount(tipword) > 6000){
alert("Please input a message within 3000 character ems.");
return false
}
//登録チェック
if(confirm ("Is it registered?")){
document.event_cal.action = "eventreg.php";
document.event_cal.method = "POST";
document.event_cal.submit();
return;
}
}
-->
</SCRIPT>
</HEAD>
<BODY background="../../eventcalender/image/u009bcg.gif">
<FORM method="POST" name="event_cal">
<TABLE width="100%" border="0" align="center" cellPadding=0 cellSpacing=0 class="header">
<TBODY>
<TR>
<TD align="left"><img src="image/titilemini.gif" alt="e-event" width="117" height="40"></TD>
<TD align="right" width="300">
<INPUT type="button" value="Back" onclick="return Move_Menu()">
<INPUT type="button" value="Log out" onclick="return Move_LogOut()">
</TD>
</TR>
</TBODY>
</TABLE>
<br/>
<?php
list($event_ymd, $event_idx) = split(",", $touroku);
$eventy = substr($event_ymd, 0, 4);
$eventm = substr($event_ymd, 4, 2);
$eventd = substr($event_ymd, 6, 2);
//定数の設定
$ddir ="data/event/";
$logfile ="eventmst".fun_addzero($file_month).".csv";
$logfile = $ddir.$logfile;
$fp = @fopen($logfile, "r");
$found = 0;
while (($buf = fgetcsv($fp, 4096))){
//読み込んだメッセージを「,」で切り分けて変数に代入する
list($ev_date, $ev_idx, $evtname, $fnen, $fmont, $fdate, $tnen, $tmont, $tdate, $tplace, $hpadr, $popmsg) = $buf;
if (($ev_date == $event_ymd) && ($ev_idx == $event_idx)){
$evname = $evtname;
$key_date = $ev_date;
$ty = $tnen;
$tm = $tmont;
$td = $tdate;
$basyo = chgbr($tplace);
$hpd = chgbr($hpadr);
$msg = chgbr($popmsg);
$found = 1;
if (($eventd != 33) && ($eventd != 55) && ($eventd != 99)){
$fy = $fnen;
$fm = $fmont;
$fd = $fdate;
}else{
$jy = $eventy;
$jm = $eventm;
}
}
}
if ($found == 0){
echo "A designated record didn't exist.";
echo '<A href="main_menu.php"><IMG src="../../eventcalender/image/return.gif" width="58" height="36" border="0" align="right" alt="admin menu"></A>';
fun_maketbl(2, 0);
fclose($fp);
echo "</FORM></BODY></HOME>";
exit;
}
fclose($fp);
?>
<?php fun_maketbl(1,"Event Edit"); ?>
<?php fun_makeline(1, 0, 0); ?>
<FONT size="-1">Event Name:<FONT color="#ff0000" size="-1">(*Required)</FONT>
<INPUT size="100" type="text" name=eventname value="<?php echo $evname; ?>"><BR><BR>
<?php fun_makeline(2, 0, 0); ?>
<BR>
<?php fun_makeline(1, 0, 0); ?>
<FONT size="-1">Period:</FONT><BR>
<SELECT name="fyear">
<?php
//コンボボックスに変更
for ($intCnt = $fy-1; $intCnt <= $fy+1; $intCnt++) {
echo "<option value=".$intCnt;
if ($eventy == $intCnt){
echo " selected";
}
echo ">".$intCnt."</option>";
}
?>
</SELECT>
<SELECT name="fmon">
<?php
for ($intCnt = 1; $intCnt <= 12; $intCnt++) {
if (strlen($intCnt) == 1){
echo "<option value=0".$intCnt;
}else{
echo "<option value=".$intCnt;
}
if ($eventm == $intCnt){
echo " selected";
}
echo ">".month_Eng($intCnt)."</option>";
}
?>
</SELECT>
<SELECT name="fday">
<?php
for ($intCnt = 1; $intCnt <= 31; $intCnt++) {
if (strlen($intCnt) == 1){
echo "<option value=0".$intCnt;
}else{
echo "<option value=".$intCnt;
}
if ($eventd == $intCnt){
echo " selected";
}
echo ">".$intCnt."</option>";
}
?>
</SELECT>
<br><BR>
<FONT size="-1">Home Page Address:</FONT><BR>
<INPUT size="100" type="text" name="hpadrs" value = <?php echo $hpd; ?>>
<BR><BR>
<FONT size="-1">Message:</FONT><BR>
<TEXTAREA rows="9" cols="71" name="tipword"><?php echo $msg; ?></TEXTAREA><BR>
<?php fun_makeline(2,0,0); ?>
<INPUT type="hidden" name="kikan" value=<?php echo $touroku; ?>>
<INPUT type="hidden" name="file_month" value=<?php echo $file_month; ?>>
<INPUT type="hidden" name="filetyp" value=<?php echo $filetyp; ?>>
<INPUT type="hidden" name="main_year" value ="<?php echo $main_year; ?>">
<INPUT type="hidden" name="main_mon" value ="<?php echo $main_mon; ?>">
<INPUT type="hidden" name="syori" value ="<?php echo $syori; ?>">
<BR>
<INPUT type="button" value=" Entry " onclick="return Move_UpDate()">
</FORM>
</BODY>
</HTML>