adminimenu.php
4.43 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
<?
//*****************************************************************************
//*
//* プログラム名:
//* プログラムID:
//* 機能 :
//* 作成者 :
//*
//*****************************************************************************
header("Content-type: text/html; charset=shift-jis");
include('./include/smarty.conf');
//セッション開始
require_once("./include/session_start.inc");
include("./ini.php");
$o_smarty->assign('_USR_ROOT_URL_', $_USR_ROOT_URL_."/".$_SESSION["PHP_CAL_FOLDER"]."/calendar.php");
require('function/operatezero.inc');
//ファイル名称取得
$filename = "eventmst".fun_addzero($main_mon).".csv";
//定数ファイル名称####
$ddir = "./calendar/".$_SESSION["PHP_CAL_FOLDER"]."/data/event/";
$filename = $ddir.$filename;
//ボタンの設定
switch($syori){
case 2:
$strname= '<INPUT type="button" value=" 変 更 " onclick="return Move_Update()">';
break;
case 3:
$strname= '<INPUT type="button" value=" 削 除 " onclick="return Move_Delete()">';
break;
}
//見出しの設定
$midashi = array(" ","イベント日付","イベント名","開始年月日","終了年月日"," ","ホームページアドレス","吹き出し文言");
$midashi_w = array("30","95","250","80","80","15","300","230");
$Num_cnst = 8;
switch($syori){
case 2:
$midashi[0] = "変更";
break;
case 3:
$midashi[0] = "削除";
break;
}
$strtitle = $main_year."年".$main_mon."月のデータ";
//タイトル作成
for ($m=0;$m<$Num_cnst;$m++){
$strtitle2 ="<TD width='".$midashi_w[$m]."' ><FONT size=2>".$midashi[$m]."</FONT></TD>";
}
//CSVファイル読み取り
$fp=@fopen("$filename","r");
if ($fp == False){
print("ファイルを開くのに失敗しました。<BR>");
exit;
}
if (($syori == "1") || ($syori == "3" )){
$strbtn ="checkbox";
$strName1 ="touroku[]";
}else{
$strbtn ="radio";
$strName1 ="touroku";
}
$rec_cnt = 0;
while($buf=fgetcsv_reg($fp,4096)){
$num = count($buf);
list($event_ymd,$event_idx,$eventname,$fyear,$fmon,$fday,$tyear,$tmon,$tday,$t_place,$hpadr,$msg)=$buf;
if(substr($event_ymd,0,4)==$main_year){
$exp_key[$rec_cnt] = $event_ymd.",".$event_idx;
$eventy=substr($event_ymd,0,4);
$eventm=substr($event_ymd,4,2);
$eventd=substr($event_ymd,6,2);
$jun_tbl =array("33"=>"上旬","55"=>"中旬","99"=>"下旬");
if (($eventd == 33) ||($eventd == 55) || ($eventd == 99)){
$strEventDay[$rec_cnt] = $eventy."/".$eventm."/".$jun_tbl[$eventd];
}else{
$strEventDay[$rec_cnt] = $eventy."/".$eventm."/".$eventd;
}
//ここから下はイベント登録ファイルの出力
if ($buf[2] != ""){
$eventname1[$rec_cnt] =$buf[2];
}else{
$eventname1[$rec_cnt] =" ";
}
if (($fyear != "") && ($fmon != "") && ($fday != "")){
$fdate[$rec_cnt] = $fyear."/".$fmon."/".$fday;
}else{
$fdate[$rec_cnt] = " ";
}
if (($tyear != "") && ($tmon != "") && ($tday != "")){
$tdate[$rec_cnt] = $tyear."/".$tmon."/".$tday;
}else{
$tdate[$rec_cnt] = " ";
}
if ($hpadr != ""){
$hpadr1[$rec_cnt] = $hpadr;
}else{
$hpadr1[$rec_cnt] = " ";
}
for($i=9;$i<12;$i++){
$s = $i-4;
if ($buf[$i] != ""){
$midashi2_w[$rec_cnt] = $midashi_w[$s];
$bufa[$rec_cnt] = $buf[$i];
}else{
$midashi2_w[$rec_cnt] = $midashi_w[$s];
$bufa[$rec_cnt] = " ";
}
}
$rec_cnt++;
}
}
switch($syori){
case 2:
$o_smarty->assign('PHP_manual_NM',"<a href='../e-manual/henko/' target='_blank'>");
break;
case 3:
$o_smarty->assign('PHP_manual_NM',"<a href='../e-manual/del/' target='_blank'>");
break;
}
fclose($fp);
$o_smarty->assign('main_year' ,$main_year);
$o_smarty->assign('main_mon' ,$main_mon);
$o_smarty->assign('syori' ,$syori);
$o_smarty->assign('strname' ,$strname);
$o_smarty->assign('strtitle' ,$strtitle);
$o_smarty->assign('midashi' ,$midashi);
$o_smarty->assign('midashi_w' ,$midashi_w);
$o_smarty->assign('strbtn' ,$strbtn);
$o_smarty->assign('strName1' ,$strName1);
$o_smarty->assign('exp_key' ,$exp_key);
$o_smarty->assign('strEventDay' ,$strEventDay);
$o_smarty->assign('eventname1' ,$eventname1);
$o_smarty->assign('fdate' ,$fdate);
$o_smarty->assign('tdate' ,$tdate);
$o_smarty->assign('midashi2_w' ,$midashi2_w);
$o_smarty->assign('hpadr1' ,$hpadr1);
$o_smarty->assign('bufa' ,$bufa);
$o_smarty->assign('PHP_CAL_NAME',$_SESSION["PHP_CAL_NAME"]);
$o_smarty->assign('rec_cnt' ,$rec_cnt);
$o_smarty->display('adminimenu_t.tpl');
$o_smarty->display('header.tpl');
$o_smarty->display('adminimenu_f.tpl');
?>