eventmod.php
3.08 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
<?php
header("Content-type: text/html; charset=shift-jis");
include('./include/smarty.conf');
include("./ini.php");
//セッション開始
require_once("./include/session_start.inc");
ob_start();
//ソート手順の読み込み
require('function/sortrog.inc');
//ゼロ操作の読み込み
require('function/operatezero.inc');
require('function/tblctl.inc');
require('function/tblmake.inc');
fun_backhome($file_month);
$home="kannrimenu.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 = "./calendar/".$_SESSION["PHP_CAL_FOLDER"]."/data/event/";
$logfile ="eventmst".fun_addzero($file_month).".csv";
$logfile = $ddir.$logfile;
$fp = @fopen($logfile, "r");
$found = 0;
while (($buf = fgetcsv_reg($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 "指定されたレコードが存在しませんでした";
echo '<A href="main_menu.php"><IMG src="../../eventcalender/image/return.gif" width="58" height="36" border="0" align="right" alt="管理者メニュー"></A>';
fun_maketbl(2,0);
fclose($fp);
echo "</FORM></BODY></HOME>";
exit;
}
fclose($fp);
//開始年
$kaisiNen = "";
for ($intI = $fy-1 ; $intI <= $fy+1 ; $intI++) {
$kaisiNen .= "<option value=".$intI;
if ($fy==$intI){
$kaisiNen .= " selected";
}
$kaisiNen .= ">".$intI."年</option>";
}
$kaisiTuki = "";
//開始月
$kaisiTuki = "";
for ($intI = 1 ; $intI <= 12 ; $intI++) {
$kaisiTuki .= "<option value=".sprintf('%02d', $intI);
if ($fm == $intI){
$kaisiTuki .= " selected";
}
$kaisiTuki .= ">".$intI."月</option>";
}
//開始日
$kaisiHi = "";
for ($intI = 1 ; $intI <= 31 ; $intI++) {
$kaisiHi .= "<option value=".sprintf('%02d', $intI);
if ($fd == $intI){
$kaisiHi .= " selected";
}
$kaisiHi .= ">".$intI."月</option>";
}
$o_smarty->assign('evname' ,$evname);
$o_smarty->assign('kaisiNen' ,$kaisiNen);
$o_smarty->assign('kaisiTuki' ,$kaisiTuki);
$o_smarty->assign('kaisiHi' ,$kaisiHi);
$o_smarty->assign('hpd' ,$hpd);
$o_smarty->assign('msg' ,$msg);
$o_smarty->assign('touroku' ,$touroku);
$o_smarty->assign('file_month' ,$file_month);
$o_smarty->assign('filetyp' ,$filetyp);
$o_smarty->assign('main_year' ,$main_year);
$o_smarty->assign('main_mon' ,$main_mon);
$o_smarty->assign('syori' ,$syori);
$o_smarty->assign('PHP_CAL_NAME',$_SESSION["PHP_CAL_NAME"]);
$o_smarty->display('eventmod_t.tpl');
$o_smarty->display('header.tpl');
$o_smarty->display('eventmod_f.tpl');
?>