Commit 1d2c573a53de354de04b2c64936ee429bada6cbd

Authored by 山上
0 parents

移行前e_event(LWS)

Showing 69 changed files with 4835 additions and 0 deletions

Too many changes to show.

To preserve performance only 69 of 69+ files are displayed.

  1 +php_flag register_globals On
  2 +php_flag display_errors On
  3 +php_value error_reporting 6135
  4 +php_value default_charset SJIS
  5 +php_value mbstring.internal_encoding SJIS
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:
  5 +//* プログラムID:
  6 +//* 機能 :
  7 +//* 作成者 :
  8 +//*
  9 +//*****************************************************************************
  10 +//セッション開始
  11 +require_once("./include/session_start.inc");
  12 +
  13 +require('function/operatezero.inc');
  14 +
  15 +//ファイル名称取得
  16 +$filename = "eventmst".fun_addzero($main_mon).".csv";
  17 +
  18 +//定数ファイル名称####
  19 +$ddir = "data/event/";
  20 +$filename = $ddir.$filename;
  21 +
  22 +?>
  23 +<HTML>
  24 +<HEAD>
  25 +<TITLE>E_イベント管理者用画面</TITLE>
  26 +<SCRIPT Language="JavaScript">
  27 +<!--
  28 +function incheck(){
  29 +}
  30 +
  31 +function Move_Menu(){
  32 + document.eventup.action = "main_menu.php";
  33 + document.eventup.method="POST";
  34 + document.eventup.submit();
  35 + return;
  36 +}
  37 +
  38 +function Move_LogOut(){
  39 + document.eventup.action = "login.php";
  40 + document.eventup.method="POST";
  41 + document.eventup.submit();
  42 + return;
  43 +}
  44 +
  45 +function Move_Update(){
  46 + if (document.eventup.rec.value==0){
  47 + alert("レコードが存在しませんでした");
  48 + return false;
  49 + }
  50 + var maxcnt,cnt;
  51 + maxcnt = document.eventup.elements.length;
  52 + cnt = 0;
  53 + for(i=2;i<maxcnt;i++){
  54 + if (document.eventup.elements[i].checked){
  55 + cnt++;
  56 + }
  57 + }
  58 + if (cnt == 0){
  59 + alert("処理対象が選択されていません");
  60 + return false;
  61 + }
  62 +
  63 + if(confirm ("変更しますか?")){
  64 + document.eventup.action = "eventmod.php";
  65 + document.eventup.method="POST";
  66 + document.eventup.submit();
  67 + return;
  68 + }
  69 +
  70 +}
  71 +
  72 +function Move_Delete(){
  73 + if (document.eventup.rec.value==0){
  74 + alert("レコードが存在しませんでした");
  75 + return false;
  76 + }
  77 + var maxcnt,cnt;
  78 + maxcnt = document.eventup.elements.length;
  79 + cnt = 0;
  80 + for(i=2;i<maxcnt;i++){
  81 + if (document.eventup.elements[i].checked){
  82 + cnt++;
  83 + }
  84 + }
  85 + if (cnt == 0){
  86 + alert("処理対象が選択されていません");
  87 + return false;
  88 + }
  89 +
  90 + if(confirm ("削除しますか?")){
  91 + document.eventup.action = "eventdel.php";
  92 + document.eventup.method="POST";
  93 + document.eventup.submit();
  94 + return;
  95 + }
  96 +
  97 + document.eventup.action = "main_menu.php";
  98 + document.eventup.method="POST";
  99 + document.eventup.submit();
  100 + return;
  101 +}
  102 +
  103 +-->
  104 +</SCRIPT>
  105 +<meta http-equiv="Content-Type" content="text/html; charset=shift_jis">
  106 +<link href="css/style.css" rel="stylesheet" type="text/css">
  107 +</HEAD>
  108 +<BODY>
  109 +<FORM method="POST" name="eventup">
  110 +<TABLE width="100%" border="0" align="center" cellPadding=0 cellSpacing=0 class="header">
  111 + <TBODY>
  112 + <TR>
  113 + <TD align="left"><img src="image/titilemini.gif" alt="e-イベント" width="117" height="40"></TD>
  114 + <TD align="right" width="150">
  115 + <a href="../manual/" target="_blank"><img src="image/icon_01.gif" alt="e-イベントマニュアル" width="144" hight="50" border="0"></a>
  116 + </TD>
  117 + <TD align="right" width="300">
  118 + <INPUT type="button" value="戻る" onclick="return Move_Menu()">
  119 + <INPUT type="button" value="ログアウト" onclick="return Move_LogOut()">
  120 + </TD>
  121 + </TR>
  122 + </TBODY>
  123 +</TABLE>
  124 +<?PHP
  125 +switch($syori){
  126 + case 2:
  127 + echo '<INPUT type="button" value="変更" onclick="return Move_Update()">';
  128 + break;
  129 + case 3:
  130 + echo '<INPUT type="button" value="削除" onclick="return Move_Delete()">';
  131 + break;
  132 +}
  133 +?>
  134 +<TABLE border="1" width="950" cellspacing="1" callpadding="2" bgcolor="#ffffff">
  135 + <TR bgcolor ="#FFFFCC">
  136 + <TD colspan="13">
  137 + <FONT size="-1">
  138 + <?PHP
  139 + //見出しの設定
  140 + $midashi = array(" ","イベント日付","イベント名","開始年月日","終了年月日","&nbsp;","ホームページアドレス","吹き出し文言");
  141 + $midashi_w = array("30","95","250","80","80","15","180","230");
  142 + $Num_cnst = 8;
  143 +
  144 + switch($syori){
  145 + case 2:
  146 + $midashi[0] = "変更";
  147 + break;
  148 + case 3:
  149 + $midashi[0] = "削除";
  150 + break;
  151 + }
  152 + echo $main_year."年".$main_mon."月のデータ";
  153 + ?>
  154 + </FONT>
  155 + </TD>
  156 + </TR>
  157 + <TR>
  158 + <?PHP
  159 + for ($m=0;$m<$Num_cnst;$m++){
  160 + echo '<TD width='.$midashi_w[$m].'><FONT size="-1">'.$midashi[$m].'</FONT></TD>';
  161 + }
  162 + ?>
  163 + </TR>
  164 +<?PHP
  165 +//!!PHPの処理
  166 +$fp=@fopen("$filename","r");
  167 +if ($fp == False){
  168 + print("ファイルを開くのに失敗しました。<BR>");
  169 + exit;
  170 +}
  171 +$rec_cnt = 0;
  172 +while($buf=fgetcsv($fp,4096)){
  173 + $num = count($buf);
  174 + list($event_ymd,$event_idx,$eventname,$fyear,$fmon,$fday,$tyear,$tmon,$tday,$t_place,$hpadr,$msg)=$buf;
  175 + $exp_key = $event_ymd.",".$event_idx;
  176 +
  177 + if(substr($event_ymd,0,4)==$main_year){
  178 + echo '<TR><TD width=30><FONT size="-1">';
  179 + if (($syori == "1") || ($syori == "3" )){
  180 + echo '<INPUT type="checkbox" name="touroku[]" value="'.$exp_key.'"></FONT></TD>';
  181 + }else{
  182 + echo '<INPUT type="radio" name="touroku" value="'.$exp_key.'"></FONT></TD>';
  183 + }
  184 +
  185 + $eventy=substr($event_ymd,0,4);
  186 + $eventm=substr($event_ymd,4,2);
  187 + $eventd=substr($event_ymd,6,2);
  188 +
  189 + $jun_tbl =array("33"=>"上旬","55"=>"中旬","99"=>"下旬");
  190 + if (($eventd == 33) ||($eventd == 55) || ($eventd == 99)){
  191 + echo '<TD width=95><FONT size="-1">'.$eventy.'/'.$eventm.'/'.$jun_tbl[$eventd].'</FONT></TD>';
  192 + }else{
  193 + echo '<TD width=95><FONT size="-1">'.$eventy.'/'.$eventm.'/'.$eventd.'</FONT></TD>';
  194 + }
  195 +
  196 + //ここから下はイベント登録ファイルの出力
  197 + if ($buf[2] != ""){
  198 + echo '<TD width=250><FONT size="-1">'.$buf[2].'</FONT></TD>';
  199 + }else{
  200 + echo '<TD width=250><FONT size="-1"><BR></FONT></TD>';
  201 + }
  202 + if (($fyear != "") && ($fmon != "") && ($fday != "")){
  203 + echo '<TD width=80><FONT size="-1">'.$fyear.'/'.$fmon.'/'.$fday.'</FONT></TD>';
  204 + }else{
  205 + echo '<TD width=80><FONT size="-1"><BR></FONT></TD>';
  206 + }
  207 +
  208 + if (($tyear != "") && ($tmon != "") && ($tday != "")){
  209 + echo '<TD width=80><FONT size="-1">'.$tyear.'/'.$tmon.'/'.$tday.'</FONT></TD>';
  210 + }else{
  211 + echo '<TD width=80><FONT size="-1"><BR></FONT></TD>';
  212 + }
  213 + for($i=9;$i<12;$i++){
  214 + $s = $i-4;
  215 + if ($buf[$i] != ""){
  216 + echo '<TD width='.$midashi_w[$s].'><FONT size="-1">';
  217 + echo $buf[$i].'</TD></FONT>';
  218 + }else{
  219 + echo '<TD width='.$midashi_w[$s].'><FONT size="-1">';
  220 + echo '<BR></TD></FONT>';
  221 + }
  222 + }
  223 + echo '</TR>';
  224 + $rec_cnt++;
  225 + }
  226 +}
  227 +
  228 +echo '</TABLE>';
  229 +fclose($fp);
  230 +
  231 +echo '登録件数は'.$rec_cnt;
  232 +echo '件でした<BR><BR>';
  233 +
  234 +?>
  235 +<INPUT type ="hidden" name="main_year" value ="<?PHP echo $main_year; ?>">
  236 +<INPUT type ="hidden" name="main_mon" value ="<?PHP echo $main_mon; ?>">
  237 +<INPUT type ="hidden" name="file_month" value ="<?PHP echo $main_mon; ?>">
  238 +<INPUT type ="hidden" name="filetyp" value ="<?PHP echo $filetyp; ?>">
  239 +<INPUT type ="hidden" name="rec" value ="<?PHP echo $rec_cnt; ?>">
  240 +<INPUT type ="hidden" name="syori" value ="<?PHP echo $syori; ?>">
  241 +</FORM>
  242 +</BODY>
  243 +</HTML>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:e-イベント
  5 +//* プログラムID:calender.php
  6 +//* 機能 :イベント表示画面
  7 +//* 作成者 :
  8 +//*
  9 +//*****************************************************************************
  10 +header("Content-type: text/html; charset=shift-jis");
  11 +
  12 +require('../_common/holiday.inc' );
  13 +
  14 +// ユーザー定義関数を取り込む
  15 +require('function/calender.inc' );
  16 +require('function/operatezero.inc');
  17 +
  18 +//CSVファイルのパス
  19 +$ddir = "data/event/";
  20 +
  21 +//カレンダー 色の配列
  22 +$clender=array("#FDDFFD","#ccffcc","#ccffcc","#ccffcc","#ccffcc","#ccffcc","#CCF8FB");
  23 +$schedule=array("#FDDFFD","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#CCF8FB");
  24 +
  25 +//ランダム広告
  26 +$affiliateNo1 = rand(1, 31);
  27 +$affiliateNo2 = rand(1, 31);
  28 +?>
  29 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  30 +<HTML>
  31 +<HEAD>
  32 +<META name="GENERATOR" content="Microsoft FrontPage 4.0">
  33 +<META http-equiv="Content-Type" content="text/html; charset=shift_jis">
  34 +<META http-equiv="Content-Style-Type" content="text/css">
  35 +<link rel="stylesheet" type="text/css" href="css/style.css">
  36 +<TITLE><?PHP include("./include/title.inc"); ?>/e-イベント</TITLE>
  37 +<script type="text/javascript" src="./js/jquery-2.1.1.min.js"></script>
  38 +<script type="text/javascript" src="./js/jquery.leanModal.js"></script>
  39 +<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
  40 +<!--
  41 + $(function() {
  42 + $('a[rel*=leanModal]').leanModal({ top : 200, closeButton: ".modal_close" });
  43 + });
  44 +
  45 +function GmDisp(){
  46 + document.cldr.action = "calender.php";
  47 + document.cldr.method="POST";
  48 + document.cldr.submit();
  49 + return;
  50 +
  51 +}
  52 +
  53 +function reload(strDate){
  54 + document.cldr.strMainDate.value=strDate;
  55 + document.cldr.action = "calender.php";
  56 + document.cldr.method="POST";
  57 + document.cldr.submit();
  58 + return;
  59 +
  60 +}
  61 +function event_input(strDate){
  62 + document.cldr.hiduke.value=strDate;
  63 + document.cldr.action = "evententry.php";
  64 + document.cldr.method="POST";
  65 + document.cldr.submit();
  66 + return;
  67 +
  68 +}
  69 +
  70 +function group_send(strDate){
  71 + document.cldr.strMainDate.value=strDate;
  72 + document.cldr.action = "../group_tran/group_Tran.php";
  73 + document.cldr.method="POST";
  74 + document.cldr.submit();
  75 + return;
  76 +
  77 +}
  78 +
  79 +var message = new Array();
  80 +
  81 +//-->
  82 +</SCRIPT>
  83 +
  84 +<?PHP
  85 +include("./function/focus.inc");
  86 +?>
  87 +</HEAD>
  88 +<BODY>
  89 +<div align="center">
  90 +<FORM METHOD="POST" name="cldr">
  91 +<!-- カレンダー表示 -->
  92 +<?PHP
  93 + //基準日取得
  94 + if($main_year == "" && $main_mon=="" && $strMainDate==""){
  95 + $main_year=date("Y");
  96 + $main_mon=date("n");
  97 + }else{
  98 + if ($strMainDate!=""){
  99 + $main_year=substr($strMainDate, 0, 4);
  100 + $main_mon=substr($strMainDate, 4, 2);
  101 + }
  102 + }
  103 +
  104 + $strDispDate[0]=date("Ymd", mktime (0,0,0,$main_mon-1,"01",$main_year));
  105 + $strDispDate[1]=date("Y").date("m")."01";
  106 + $strDispDate[2]=date("Ymd", mktime (0,0,0,$main_mon+1,"01",$main_year));
  107 +?>
  108 +
  109 +<span="TinnyFont"><br /></span>
  110 +<TABLE width=100% border="0" align="center" cellPadding=0 cellSpacing=0 class="header">
  111 + <TBODY>
  112 + <TR>
  113 + <TD align="left" width="350">
  114 +
  115 + </TD>
  116 + <TD align="center"> 
  117 + <SELECT name="main_year" onChange="GmDisp()">
  118 + <?PHP
  119 + for ($intCnt = $main_year-1 ; $intCnt <= $main_year+1 ; $intCnt++) {
  120 + echo "<option value=".$intCnt;
  121 + if ($main_year==$intCnt){
  122 + echo " selected";
  123 + }
  124 + echo ">".$intCnt."年</option>";
  125 + }
  126 + ?>
  127 + </SELECT>
  128 + <SELECT name="main_mon" onChange="GmDisp()">
  129 + <?PHP
  130 + for ($intCnt = 1 ; $intCnt <= 12 ; $intCnt++) {
  131 + if (strlen($intCnt)==1){
  132 + echo "<option value=0".$intCnt;
  133 + }else{
  134 + echo "<option value=".$intCnt;
  135 + }
  136 +
  137 + if ($main_mon == $intCnt){
  138 + echo " selected";
  139 + }
  140 + echo ">".$intCnt."月</option>";
  141 + }
  142 + ?>
  143 + </SELECT>
  144 + </TD>
  145 + <TD align="right" width="350"><INPUT type="button" value="<< 先月" onclick="return reload(<?PHP echo $strDispDate[0]; ?>)"><INPUT type="submit" value=" 今月 " onclick="return reload(<?PHP echo $strDispDate[1]; ?>)"><INPUT type="submit" value="来月 >>" onclick="return reload(<?PHP echo $strDispDate[2]; ?>)"> </TD>
  146 + </TR>
  147 + </TBODY>
  148 +</TABLE>
  149 +<TABLE width="100%" class="mainTbr">
  150 + <TR align="center">
  151 + <TD width="15%" bgcolor="#FDDFFD"></TD>
  152 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  153 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  154 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  155 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  156 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  157 + <TD width="15%" bgcolor="#CCF8FB"></TD>
  158 + </TR>
  159 + <?PHP
  160 + //MAX日付取得
  161 + $main_day="01";
  162 + $dateMax=date("j", mktime (0,0,0,$main_mon+1,$main_day-1,$main_year));
  163 +
  164 + //カレンダー空白数(前)
  165 + $intbefor=date("w", mktime (0,0,0,$main_mon,$main_day,$main_year));
  166 +
  167 + //カレンダー空白数(後)
  168 + $intafter=date("w", mktime (0,0,0,$main_mon,$dateMax,$main_year));
  169 + $intafter=6-$intafter;
  170 +
  171 + //ループ基準日取得
  172 + $strWkDate=date("Y/m/d", mktime (0,0,0,$main_mon,$main_day-$intbefor,$main_year));
  173 + list($chk_year,$chk_mon,$chk_day)=split("/", $strWkDate);
  174 +
  175 + for($intCnt = 0; $intCnt < $intbefor+$dateMax+$intafter ; $intCnt++) {
  176 + $strWkDate=date("Y/m/d", mktime (0,0,0,$chk_mon,$chk_day+$intCnt,$chk_year));
  177 + $strcalender[$intCnt]=$strWkDate;
  178 + }
  179 +
  180 + //テーブル作成
  181 + $intKaigyo=6;
  182 + for($intCnt = 0; $intCnt < count($strcalender) ; $intCnt++) {
  183 + list($chk_year,$chk_mon,$chk_day)=split("/", $strcalender[$intCnt]);
  184 + $intYoubi=date("w", mktime (0,0,0,$chk_mon,$chk_day,$chk_year));
  185 + //テーブル開始
  186 + if ($intCnt % 7 == 0){
  187 + echo "<TR>";
  188 + }
  189 +
  190 + //日付表示
  191 + if ($chk_mon==$main_mon){
  192 + //日付編集
  193 + if (substr($chk_mon,0,1) == 0){
  194 + $input_mon = substr($chk_mon,1,1);
  195 + }else{
  196 + $input_mon = $chk_mon;
  197 + }
  198 + if (substr($chk_day,0,1) == 0){
  199 + $input_day = substr($chk_day,1,1);
  200 + }else{
  201 + $input_day = $chk_day;
  202 + }
  203 +
  204 + if (array_key_exists($chk_year.$chk_mon.$chk_day, $holiday)) {
  205 + $schedule_color=$schedule["0"];
  206 + $holiday_name = $holiday[$chk_year.$chk_mon.$chk_day];
  207 + }else{
  208 + $schedule_color=$schedule[$intYoubi];
  209 + $holiday_name = "";
  210 + }
  211 +
  212 + echo '<TD width="14%" height="50" bgColor="'.$schedule_color.'">'.$chk_day;
  213 + if ($holiday_name!=""){
  214 + echo "<br />".$holiday_name;
  215 + }
  216 + echo "<ul>";
  217 +
  218 + //データの取得
  219 + $file_name = $ddir."eventmst".fun_addzero($main_mon).".csv";
  220 + //読み込んだテーブルのレコード数を格納する変数
  221 + $tbl_cnt=0;
  222 + $month_dat=fun_csvread($month_dat,$file_name);
  223 + //データ出力
  224 + for ($intdataCnt=0; $intdataCnt < count($month_dat)+1; $intdataCnt++){
  225 + if (trim($month_dat[$intdataCnt][0]) == $chk_year.$chk_mon.$chk_day){
  226 +?>
  227 + <script language="javascript" type="text/javascript">
  228 + <!--
  229 + message[<?PHP echo $intdataCnt ?>] = '<?PHP echo $month_dat[$intdataCnt][11] ?>';
  230 + -->
  231 + </script>
  232 +
  233 +<?PHP
  234 +/*
  235 + if($month_dat[$intdataCnt][10] == ""){
  236 +
  237 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  238 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  239 +
  240 + //ポップアップの内容が無い場合はJSをはずす
  241 + if($month_dat[$intdataCnt][11] == "") {
  242 + //<table>タグは、Wiondows IE6.0のバグ回避
  243 + echo '<li class="mainTxt">'.$month_dat[$intdataCnt][2].'</li>';
  244 + }else{
  245 + echo '<li><table><tr><td>';
  246 + echo '<span onMouseover="disp_mess('.$intdataCnt.')" onMouseout="del_mess('.$intdataCnt.')">'.$month_dat[$intdataCnt][2].'<span>';
  247 + echo '</td></tr></table></li>';
  248 + }
  249 + }else{
  250 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  251 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  252 +
  253 + echo '<li><table><tr><td>';
  254 + echo '<a href="'.$month_dat[$intdataCnt][10].'" target="_blank" onMouseover="disp_mess('.$intdataCnt.')"';
  255 + echo 'onMouseout="del_mess('.$intdataCnt.')">'.$month_dat[$intdataCnt][2].'</a>';
  256 + echo '</td></tr></table></li>';
  257 +
  258 +
  259 +
  260 + }
  261 +*/
  262 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  263 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  264 +
  265 + echo '<a id="go'.$intdataCnt.'" rel="leanModal" name="dt'.$intdataCnt.'" href="#dt'.$intdataCnt.'">'.$month_dat[$intdataCnt][2].'</a><br>';
  266 + echo '<div id="dt'.$intdataCnt.'" style="background-color:#FFFFFF;display:none;">';
  267 + echo '<br>';
  268 + echo '<p>イベント:'.$month_dat[$intdataCnt][2].'</p>';
  269 + if($month_dat[$intdataCnt][10] != ""){
  270 + echo 'ホームページ:<a href="'.$month_dat[$intdataCnt][10].'" target="_brank">'.$month_dat[$intdataCnt][2].'</a>';
  271 + }
  272 + echo '<p>内容:'.$month_dat[$intdataCnt][11].'</p>';
  273 + echo '</div>';
  274 +
  275 + // イベントが無い月はポップアップのJavaScriptは読み込まない
  276 + if (!($month_dat[$intdataCnt][2] == "")){
  277 + $popup_js = "yes";
  278 + }
  279 + }
  280 + }
  281 + echo "</ul>\n\n";
  282 + echo "</TD>";
  283 + }else{
  284 + if (array_key_exists($chk_year.$chk_mon.$chk_day, $holiday)) {
  285 + $schedule_color=$schedule["0"];
  286 + $holiday_name = $holiday[$chk_year.$chk_mon.$chk_day];
  287 + }else{
  288 + $schedule_color=$schedule[$intYoubi];
  289 + $holiday_name = "";
  290 + }
  291 + echo "<TD Align=top width=115 bgColor=$schedule_color height=30>".$chk_day;
  292 + if ($holiday_name!=""){
  293 + echo "<br />".$holiday_name;
  294 + }
  295 + }
  296 +
  297 + //テーブル終了
  298 + if ($intKaigyo==$intCnt){
  299 + echo "</tr>";
  300 + $intKaigyo=$intKaigyo+7;
  301 + }
  302 + }
  303 +
  304 + ?>
  305 +</TABLE>
  306 +<INPUT type="hidden" name="disp_nm" value="<?PHP echo $stDisp_Name ?>">
  307 +<INPUT type="hidden" name="sYear" value="">
  308 +<INPUT type="hidden" name="sMonth" value="">
  309 +<INPUT type="hidden" name="strMainDate" value="">
  310 +<INPUT type="hidden" name="hiduke" value="">
  311 +<INPUT type="hidden" name="usr_name" value="guest">
  312 +<INPUT type="hidden" name="usr_pword" value="guest">
  313 +<INPUT type="hidden" name="pageName" value="<?PHP include("./include/title.inc"); ?>">
  314 +</FORM>
  315 +</div>
  316 +<?PHP
  317 +if ($popup_js == "yes"){
  318 + echo "<script language=\"javascript\" type=\"text/javascript\" src=\"js/popup.js\"></script>";
  319 +}
  320 +?>
  321 +</BODY>
  322 +</HTML>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:e-イベント
  5 +//* プログラムID:calender.php
  6 +//* 機能 :イベント表示画面
  7 +//* 作成者 :
  8 +//*
  9 +//*****************************************************************************
  10 +header("Content-type: text/html; charset=shift-jis");
  11 +
  12 +require('../_common/holiday.inc' );
  13 +require('./include/const.php' );
  14 +
  15 +// ユーザー定義関数を取り込む
  16 +require('function/calender.inc' );
  17 +require('function/operatezero.inc');
  18 +
  19 +//CSVファイルのパス
  20 +$ddir = "data/event/";
  21 +
  22 +//カレンダー 色の配列
  23 +$clender=array("#EC534F","#7CB60D","#7CB60D","#7CB60D","#7CB60D","#7CB60D","#07A3DD");
  24 +$schedule=array("#EC534F","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#07A3DD");
  25 +
  26 +//ランダム広告
  27 +$affiliateNo1 = rand(1, 31);
  28 +$affiliateNo2 = rand(1, 31);
  29 +?>
  30 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  31 +<HTML>
  32 +<HEAD>
  33 +<META name="GENERATOR" content="Microsoft FrontPage 4.0">
  34 +<META http-equiv="Content-Type" content="text/html; charset=shift_jis">
  35 +<META http-equiv="Content-Style-Type" content="text/css">
  36 +<link rel="stylesheet" type="text/css" href="css/style.css">
  37 +<TITLE><?PHP include("./include/title.inc"); ?>/e-イベント</TITLE>
  38 +<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
  39 +<!--
  40 +function GmDisp(){
  41 + document.cldr.action = "calender.php";
  42 + document.cldr.method="POST";
  43 + document.cldr.submit();
  44 + return;
  45 +
  46 +}
  47 +
  48 +function reload(strDate){
  49 + document.cldr.strMainDate.value=strDate;
  50 + document.cldr.action = "calender.php";
  51 + document.cldr.method="POST";
  52 + document.cldr.submit();
  53 + return;
  54 +
  55 +}
  56 +function event_input(strDate){
  57 + document.cldr.hiduke.value=strDate;
  58 + document.cldr.action = "evententry.php";
  59 + document.cldr.method="POST";
  60 + document.cldr.submit();
  61 + return;
  62 +
  63 +}
  64 +
  65 +function group_send(strDate){
  66 + document.cldr.strMainDate.value=strDate;
  67 + document.cldr.action = "../group_tran/group_Tran.php";
  68 + document.cldr.method="POST";
  69 + document.cldr.submit();
  70 + return;
  71 +
  72 +}
  73 +
  74 +//-->
  75 +</script>
  76 +<?PHP
  77 +include("./function/focus.inc");
  78 +?>
  79 +</HEAD>
  80 +<BODY>
  81 +<div align="center">
  82 +<FORM METHOD="POST" name="cldr">
  83 +<!-- カレンダー表示 -->
  84 +<?PHP
  85 + //基準日取得
  86 + if($main_year == "" && $main_mon=="" && $strMainDate==""){
  87 + $main_year=date("Y");
  88 + $main_mon=date("n");
  89 + }else{
  90 + if ($strMainDate!=""){
  91 + $main_year=substr($strMainDate, 0, 4);
  92 + $main_mon=substr($strMainDate, 4, 2);
  93 + }
  94 + }
  95 +
  96 + $strDispDate[0]=date("Ymd", mktime (0,0,0,$main_mon-1,"01",$main_year));
  97 + $strDispDate[1]=date("Y").date("m")."01";
  98 + $strDispDate[2]=date("Ymd", mktime (0,0,0,$main_mon+1,"01",$main_year));
  99 +?>
  100 +
  101 +<span="TinnyFont"><br /></span>
  102 +<div class="title_head">
  103 +<div class="com_name"><?PHP echo $CONST_GROUP_NAME ?></div>
  104 +<!--div class="logout"><INPUT type="button" class="logout_btn" value="ログアウト"></div-->
  105 +</div>
  106 +
  107 +
  108 +<TABLE width=100% border="0" align="center" cellPadding=0 cellSpacing=0 class="header">
  109 + <TBODY>
  110 + <TR>
  111 + <TD align="left" width="350">
  112 +
  113 + </TD>
  114 + <TD align="center"> 
  115 + <SELECT name="main_year" onChange="GmDisp()" class="years">
  116 + <?PHP
  117 + for ($intCnt = $main_year-1 ; $intCnt <= $main_year+1 ; $intCnt++) {
  118 + echo "<option value=".$intCnt;
  119 + if ($main_year==$intCnt){
  120 + echo " selected";
  121 + }
  122 + echo ">".$intCnt."年</option>";
  123 + }
  124 + ?>
  125 + </SELECT>
  126 + <SELECT name="main_mon" onChange="GmDisp()" class="years">
  127 + <?PHP
  128 + for ($intCnt = 1 ; $intCnt <= 12 ; $intCnt++) {
  129 + if (strlen($intCnt)==1){
  130 + echo "<option value=0".$intCnt;
  131 + }else{
  132 + echo "<option value=".$intCnt;
  133 + }
  134 +
  135 + if ($main_mon == $intCnt){
  136 + echo " selected";
  137 + }
  138 + echo ">".$intCnt."月</option>";
  139 + }
  140 + ?>
  141 + </SELECT>
  142 + </TD>
  143 + <TD align="right" width="350"><INPUT type="button" class="n_btn" value="<< 先月" onclick="return reload(<?PHP echo $strDispDate[0]; ?>)"><INPUT type="submit" class="n_btn" value=" 今月 " onclick="return reload(<?PHP echo $strDispDate[1]; ?>)"><INPUT type="submit" class="n_btn" value="来月 >>" onclick="return reload(<?PHP echo $strDispDate[2]; ?>)"> </TD>
  144 + </TR>
  145 + </TBODY>
  146 +</TABLE>
  147 +<TABLE width="100%" class="mainTbr">
  148 + <TR align="center">
  149 + <TD width="15%" bgcolor="#EC534F" style="color:#FFFFFF; font-size:20px"></TD>
  150 + <TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px"></TD>
  151 + <TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px"></TD>
  152 + <TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px"></TD>
  153 + <TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px"></TD>
  154 + <TD width="14%" bgcolor="#7CB60D" style="color:#FFFFFF; font-size:20px"></TD>
  155 + <TD width="15%" bgcolor="#07A3DD" style="color:#FFFFFF; font-size:20px"></TD>
  156 + </TR>
  157 + <?PHP
  158 + //MAX日付取得
  159 + $main_day="01";
  160 + $dateMax=date("j", mktime (0,0,0,$main_mon+1,$main_day-1,$main_year));
  161 +
  162 + //カレンダー空白数(前)
  163 + $intbefor=date("w", mktime (0,0,0,$main_mon,$main_day,$main_year));
  164 +
  165 + //カレンダー空白数(後)
  166 + $intafter=date("w", mktime (0,0,0,$main_mon,$dateMax,$main_year));
  167 + $intafter=6-$intafter;
  168 +
  169 + //ループ基準日取得
  170 + $strWkDate=date("Y/m/d", mktime (0,0,0,$main_mon,$main_day-$intbefor,$main_year));
  171 + list($chk_year,$chk_mon,$chk_day)=split("/", $strWkDate);
  172 +
  173 + for($intCnt = 0; $intCnt < $intbefor+$dateMax+$intafter ; $intCnt++) {
  174 + $strWkDate=date("Y/m/d", mktime (0,0,0,$chk_mon,$chk_day+$intCnt,$chk_year));
  175 + $strcalender[$intCnt]=$strWkDate;
  176 + }
  177 +$idnames = "";
  178 +
  179 + //テーブル作成
  180 + $intKaigyo=6;
  181 + for($intCnt = 0; $intCnt < count($strcalender) ; $intCnt++) {
  182 + list($chk_year,$chk_mon,$chk_day)=split("/", $strcalender[$intCnt]);
  183 + $intYoubi=date("w", mktime (0,0,0,$chk_mon,$chk_day,$chk_year));
  184 + //テーブル開始
  185 + if ($intCnt % 7 == 0){
  186 + echo "<TR>";
  187 + }
  188 +
  189 + //日付表示
  190 + if ($chk_mon==$main_mon){
  191 + //日付編集
  192 + if (substr($chk_mon,0,1) == 0){
  193 + $input_mon = substr($chk_mon,1,1);
  194 + }else{
  195 + $input_mon = $chk_mon;
  196 + }
  197 + if (substr($chk_day,0,1) == 0){
  198 + $input_day = substr($chk_day,1,1);
  199 + }else{
  200 + $input_day = $chk_day;
  201 + }
  202 +
  203 + if (array_key_exists($chk_year.$chk_mon.$chk_day, $holiday)) {
  204 + $schedule_color=$schedule["0"];
  205 + $holiday_name = $holiday[$chk_year.$chk_mon.$chk_day];
  206 + }else{
  207 + $schedule_color=$schedule[$intYoubi];
  208 + $holiday_name = "";
  209 + }
  210 +
  211 + echo '<TD width="14%" height="50" bgColor="'.$schedule_color.'">'.$chk_day;
  212 + if ($holiday_name!=""){
  213 + echo " ".$holiday_name;
  214 + }
  215 + echo "<ul>";
  216 +
  217 + //データの取得
  218 + $file_name = $ddir."eventmst".fun_addzero($main_mon).".csv";
  219 + //読み込んだテーブルのレコード数を格納する変数
  220 + $tbl_cnt=0;
  221 + $month_dat=fun_csvread($month_dat,$file_name);
  222 + //データ出力
  223 + for ($intdataCnt=0; $intdataCnt < count($month_dat)+1; $intdataCnt++){
  224 +
  225 + if (trim($month_dat[$intdataCnt][0]) == $chk_year.$chk_mon.$chk_day){
  226 +/*
  227 + if($month_dat[$intdataCnt][10] == ""){
  228 +
  229 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  230 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  231 +
  232 + //ポップアップの内容が無い場合はJSをはずす
  233 + if($month_dat[$intdataCnt][11] == "") {
  234 + //<table>タグは、Wiondows IE6.0のバグ回避
  235 + echo '<li class="mainTxt">'.$month_dat[$intdataCnt][2].'</li>';
  236 + }else{
  237 + echo '<li><table><tr><td>';
  238 + echo '<span onMouseover="disp_mess('.$intdataCnt.')" onMouseout="del_mess('.$intdataCnt.')">'.$month_dat[$intdataCnt][2].'<span>';
  239 + echo '</td></tr></table></li>';
  240 + }
  241 + }else{
  242 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  243 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  244 +
  245 + echo '<li><table><tr><td>';
  246 + echo '<a href="'.$month_dat[$intdataCnt][10].'" target="_blank" onMouseover="disp_mess('.$intdataCnt.')"';
  247 + echo 'onMouseout="del_mess('.$intdataCnt.')">'.$month_dat[$intdataCnt][2].'</a>';
  248 + echo '</td></tr></table></li>';
  249 +
  250 +
  251 +
  252 + }
  253 +*/
  254 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  255 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  256 +
  257 + $idnames[] = "#open".$intdataCnt."";
  258 + echo '<p><a href="#open'.$intdataCnt.'">'.$month_dat[$intdataCnt][2].'</a></p>';
  259 +
  260 +
  261 + // イベントが無い月はポップアップのJavaScriptは読み込まない
  262 + /*
  263 + if (!($month_dat[$intdataCnt][2] == "")){
  264 + $popup_js = "yes";
  265 + }
  266 + */
  267 + }
  268 + }
  269 + echo "</ul>\n\n";
  270 + echo "</TD>";
  271 + }else{
  272 + if (array_key_exists($chk_year.$chk_mon.$chk_day, $holiday)) {
  273 + $schedule_color=$schedule["0"];
  274 + $holiday_name = $holiday[$chk_year.$chk_mon.$chk_day];
  275 + }else{
  276 + $schedule_color=$schedule[$intYoubi];
  277 + $holiday_name = "";
  278 + }
  279 + echo "<TD Align=top width=115 bgColor='#DBDBDB' height=30>";
  280 +/*
  281 + echo "<TD Align=top width=115 bgColor=$schedule_color height=30>".$chk_day;
  282 + if ($holiday_name!=""){
  283 + echo "<br />".$holiday_name;
  284 + }
  285 +*/
  286 + }
  287 +
  288 + //テーブル終了
  289 + if ($intKaigyo==$intCnt){
  290 + echo "</tr>";
  291 + $intKaigyo=$intKaigyo+7;
  292 + }
  293 + }
  294 +
  295 +
  296 + ?>
  297 +</TABLE>
  298 +
  299 +<!-- イベント詳細表示 -->
  300 +<?PHP
  301 +echo "\n".'<div id="modal">'."\n";
  302 +for ($i=0;$i<count($month_dat);$i++){
  303 + if(trim($month_dat[$i][0]) != "" && substr($month_dat[$i][0],0,4) == $main_year){
  304 + echo '<div id="open'.$i.'">'."\n";
  305 + echo '<a href="#" class="close_overlay">×</a>'."\n";
  306 + echo '<span class="modal_window">'."\n";
  307 + echo '<h2>イベントの詳細</h2>'."\n";
  308 + echo '<p><b>イベント:</b>'.$month_dat[$i][2].'</p>'."\n";
  309 + if($month_dat[$i][10] != ""){
  310 + echo '<p><b>ホームページ:</b><a href="'.$month_dat[$i][10].'" target="_brank">'.$month_dat[$i][10].'</a></p>';
  311 + }
  312 + echo '<p><b>内容:</b><br>'.$month_dat[$i][11].'</p>'."\n";
  313 + echo '<a href="#">【×】CLOSE</a>'."\n";
  314 + echo '</span>'."\n";
  315 + echo '</div>'."\n";
  316 + }
  317 +}
  318 +echo '</div>'."\n";
  319 +
  320 +?>
  321 +<INPUT type="hidden" name="disp_nm" value="<?PHP echo $stDisp_Name ?>">
  322 +<INPUT type="hidden" name="sYear" value="">
  323 +<INPUT type="hidden" name="sMonth" value="">
  324 +<INPUT type="hidden" name="strMainDate" value="">
  325 +<INPUT type="hidden" name="hiduke" value="">
  326 +<INPUT type="hidden" name="usr_name" value="guest">
  327 +<INPUT type="hidden" name="usr_pword" value="guest">
  328 +<INPUT type="hidden" name="pageName" value="<?PHP include("./include/title.inc"); ?>">
  329 +</SCRIPT>
  330 +
  331 +<style type="text/css">
  332 +<!--
  333 +<?PHP
  334 +echo implode(",", $idnames);
  335 +?>
  336 +{
  337 + top: 0;
  338 + left: 0;
  339 + width: 100%;
  340 + height: 100%;
  341 + display: none;
  342 + position: absolute;
  343 +}
  344 +
  345 +.close_overlay {
  346 + top: 0;
  347 + left: 0;
  348 + width: 100%;
  349 + height: 100%;
  350 + display: block;
  351 + text-indent: -9999px;
  352 + position: absolute;
  353 + background: #000;
  354 + opacity: 0.5;
  355 + z-index: 5;
  356 +
  357 +}
  358 +
  359 +.modal_window {
  360 + top: 40%;
  361 + left: 50%;
  362 + margin: -150px 0 0 -200px;
  363 + width: 400px;
  364 + height: auto;
  365 + text-align: center;
  366 + display: block;
  367 + background: #fff;
  368 + position: absolute;
  369 + z-index: 10;
  370 + -webkit-border-radius: 6px;
  371 + -moz-border-radius: 6px;
  372 + -o-border-radius: 6px;
  373 + border-radius: 6px;
  374 + box-shadow: 0 1px 3px #CCC;
  375 +}
  376 +
  377 +.modal_window h2 {
  378 + margin-bottom: 20px;
  379 + width: 400px;
  380 + height: 30px;
  381 + line-height: 30px;
  382 + color: #fff;
  383 + font-size: 12px;
  384 + font-weight: bold;
  385 + text-align: left;
  386 + text-indent: 15px;
  387 + background: #0066FF;
  388 +}
  389 +.modal_window p {
  390 + padding: 0 15px 15px 15px;
  391 + font-size: 12px;
  392 + line-height: 160%;
  393 + text-align: left;
  394 +}
  395 +
  396 +.close_pop a{
  397 + font-size:12px;
  398 + font-weight:800;
  399 + color:#0066FF;
  400 + margin:15px 90px;
  401 + text-align:center;
  402 + bottom:0px;
  403 + }
  404 +
  405 +
  406 +/* CSS3 ModalWindow SET
  407 +-------------------------- */
  408 +@-webkit-keyframes modalFadeIn {
  409 + 0% {opacity:0;display:block;}
  410 + 100% {opacity:1;}
  411 +}
  412 +div#modal div:target {
  413 + -webkit-animation-name: modalFadeIn;
  414 + -webkit-animation-duration: 1s;
  415 + -webkit-animation-iteration-count: 1;
  416 + opacity: 1;
  417 + display:block;
  418 +}
  419 +-->
  420 +</style>
  421 +
  422 +</FORM>
  423 +</div>
  424 +<?PHP
  425 +/*
  426 +if ($popup_js == "yes"){
  427 + echo "<script language=\"javascript\" type=\"text/javascript\" src=\"js/popup.js\"></script>";
  428 +}
  429 +*/
  430 +?>
  431 +
  432 +</BODY>
  433 +</HTML>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +//*****************************************************************************
  3 +//*
  4 +//* プログラム名:e-イベント
  5 +//* プログラムID:calender.php
  6 +//* 機能 :イベント表示画面
  7 +//* 作成者 :
  8 +//*
  9 +//*****************************************************************************
  10 +header("Content-type: text/html; charset=shift-jis");
  11 +
  12 +require('../_common/holiday.inc' );
  13 +
  14 +// ユーザー定義関数を取り込む
  15 +require('function/calender.inc' );
  16 +require('function/operatezero.inc');
  17 +
  18 +//CSVファイルのパス
  19 +$ddir = "data/event/";
  20 +
  21 +//カレンダー 色の配列
  22 +$clender=array("#FDDFFD","#ccffcc","#ccffcc","#ccffcc","#ccffcc","#ccffcc","#CCF8FB");
  23 +$schedule=array("#FDDFFD","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#CCF8FB");
  24 +
  25 +//ランダム広告
  26 +$affiliateNo1 = rand(1, 31);
  27 +$affiliateNo2 = rand(1, 31);
  28 +?>
  29 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  30 +<HTML>
  31 +<HEAD>
  32 +<META name="GENERATOR" content="Microsoft FrontPage 4.0">
  33 +<META http-equiv="Content-Type" content="text/html; charset=shift_jis">
  34 +<META http-equiv="Content-Style-Type" content="text/css">
  35 +<meta name="viewport" content="width=device-width,initial-scale=1.0">
  36 +<link rel="stylesheet" type="text/css" href="css/style.css">
  37 +<TITLE><?PHP include("./include/title.inc"); ?>/e-イベント</TITLE>
  38 +<script type="text/javascript" src="./js/jquery-2.1.1.min.js"></script>
  39 +<script type="text/javascript" src="./js/jquery.leanModal.js"></script>
  40 +<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
  41 +<!--
  42 + $(function() {
  43 + $('a[rel*=leanModal]').leanModal({ top : 200, closeButton: ".modal_close" });
  44 + });
  45 +
  46 +function GmDisp(){
  47 + document.cldr.action = "calender.php";
  48 + document.cldr.method="POST";
  49 + document.cldr.submit();
  50 + return;
  51 +
  52 +}
  53 +
  54 +function reload(strDate){
  55 + document.cldr.strMainDate.value=strDate;
  56 + document.cldr.action = "calender.php";
  57 + document.cldr.method="POST";
  58 + document.cldr.submit();
  59 + return;
  60 +
  61 +}
  62 +function event_input(strDate){
  63 + document.cldr.hiduke.value=strDate;
  64 + document.cldr.action = "evententry.php";
  65 + document.cldr.method="POST";
  66 + document.cldr.submit();
  67 + return;
  68 +
  69 +}
  70 +
  71 +function group_send(strDate){
  72 + document.cldr.strMainDate.value=strDate;
  73 + document.cldr.action = "../group_tran/group_Tran.php";
  74 + document.cldr.method="POST";
  75 + document.cldr.submit();
  76 + return;
  77 +
  78 +}
  79 +
  80 +var message = new Array();
  81 +
  82 +//-->
  83 +</SCRIPT>
  84 +
  85 +<?PHP
  86 +include("./function/focus.inc");
  87 +?>
  88 +</HEAD>
  89 +<BODY>
  90 +<div align="center">
  91 +<FORM METHOD="POST" name="cldr">
  92 +<!-- カレンダー表示 -->
  93 +<?PHP
  94 + //基準日取得
  95 + if($main_year == "" && $main_mon=="" && $strMainDate==""){
  96 + $main_year=date("Y");
  97 + $main_mon=date("n");
  98 + }else{
  99 + if ($strMainDate!=""){
  100 + $main_year=substr($strMainDate, 0, 4);
  101 + $main_mon=substr($strMainDate, 4, 2);
  102 + }
  103 + }
  104 +
  105 + $strDispDate[0]=date("Ymd", mktime (0,0,0,$main_mon-1,"01",$main_year));
  106 + $strDispDate[1]=date("Y").date("m")."01";
  107 + $strDispDate[2]=date("Ymd", mktime (0,0,0,$main_mon+1,"01",$main_year));
  108 +?>
  109 +
  110 +<span="TinnyFont"><br /></span>
  111 +<div class="title_head">
  112 +<div class="com_name">企業・団体名</div>
  113 +<!--div class="logout"><INPUT type="button" class="logout_btn" value="ログアウト"></div-->
  114 +</div>
  115 +
  116 +
  117 +<TABLE width=100% border="0" align="center" cellPadding=0 cellSpacing=0 class="header">
  118 + <TBODY>
  119 + <TR>
  120 + <TD align="left" width="350">
  121 +
  122 + </TD>
  123 + <TD align="center"> 
  124 + <SELECT name="main_year" onChange="GmDisp()" class="years">
  125 + <?PHP
  126 + for ($intCnt = $main_year-1 ; $intCnt <= $main_year+1 ; $intCnt++) {
  127 + echo "<option value=".$intCnt;
  128 + if ($main_year==$intCnt){
  129 + echo " selected";
  130 + }
  131 + echo ">".$intCnt."年</option>";
  132 + }
  133 + ?>
  134 + </SELECT>
  135 + <SELECT name="main_mon" onChange="GmDisp()" class="years">
  136 + <?PHP
  137 + for ($intCnt = 1 ; $intCnt <= 12 ; $intCnt++) {
  138 + if (strlen($intCnt)==1){
  139 + echo "<option value=0".$intCnt;
  140 + }else{
  141 + echo "<option value=".$intCnt;
  142 + }
  143 +
  144 + if ($main_mon == $intCnt){
  145 + echo " selected";
  146 + }
  147 + echo ">".$intCnt."月</option>";
  148 + }
  149 + ?>
  150 + </SELECT>
  151 + </TD>
  152 + <TD align="right" width="350"><INPUT type="button" class="n_btn" value="<< 先月" onclick="return reload(<?PHP echo $strDispDate[0]; ?>)"><INPUT type="submit" class="n_btn" value=" 今月 " onclick="return reload(<?PHP echo $strDispDate[1]; ?>)"><INPUT type="submit" class="n_btn" value="来月 >>" onclick="return reload(<?PHP echo $strDispDate[2]; ?>)"> </TD>
  153 + </TR>
  154 + </TBODY>
  155 +</TABLE>
  156 +<TABLE width="100%" class="mainTbr">
  157 + <TR align="center">
  158 + <TD width="15%" bgcolor="#FDDFFD"></TD>
  159 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  160 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  161 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  162 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  163 + <TD width="14%" bgcolor="#EAFDEA"></TD>
  164 + <TD width="15%" bgcolor="#CCF8FB"></TD>
  165 + </TR>
  166 + <?PHP
  167 + //MAX日付取得
  168 + $main_day="01";
  169 + $dateMax=date("j", mktime (0,0,0,$main_mon+1,$main_day-1,$main_year));
  170 +
  171 + //カレンダー空白数(前)
  172 + $intbefor=date("w", mktime (0,0,0,$main_mon,$main_day,$main_year));
  173 +
  174 + //カレンダー空白数(後)
  175 + $intafter=date("w", mktime (0,0,0,$main_mon,$dateMax,$main_year));
  176 + $intafter=6-$intafter;
  177 +
  178 + //ループ基準日取得
  179 + $strWkDate=date("Y/m/d", mktime (0,0,0,$main_mon,$main_day-$intbefor,$main_year));
  180 + list($chk_year,$chk_mon,$chk_day)=split("/", $strWkDate);
  181 +
  182 + for($intCnt = 0; $intCnt < $intbefor+$dateMax+$intafter ; $intCnt++) {
  183 + $strWkDate=date("Y/m/d", mktime (0,0,0,$chk_mon,$chk_day+$intCnt,$chk_year));
  184 + $strcalender[$intCnt]=$strWkDate;
  185 + }
  186 +
  187 + //テーブル作成
  188 + $intKaigyo=6;
  189 + for($intCnt = 0; $intCnt < count($strcalender) ; $intCnt++) {
  190 + list($chk_year,$chk_mon,$chk_day)=split("/", $strcalender[$intCnt]);
  191 + $intYoubi=date("w", mktime (0,0,0,$chk_mon,$chk_day,$chk_year));
  192 + //テーブル開始
  193 + if ($intCnt % 7 == 0){
  194 + echo "<TR>";
  195 + }
  196 +
  197 + //日付表示
  198 + if ($chk_mon==$main_mon){
  199 + //日付編集
  200 + if (substr($chk_mon,0,1) == 0){
  201 + $input_mon = substr($chk_mon,1,1);
  202 + }else{
  203 + $input_mon = $chk_mon;
  204 + }
  205 + if (substr($chk_day,0,1) == 0){
  206 + $input_day = substr($chk_day,1,1);
  207 + }else{
  208 + $input_day = $chk_day;
  209 + }
  210 +
  211 + if (array_key_exists($chk_year.$chk_mon.$chk_day, $holiday)) {
  212 + $schedule_color=$schedule["0"];
  213 + $holiday_name = $holiday[$chk_year.$chk_mon.$chk_day];
  214 + }else{
  215 + $schedule_color=$schedule[$intYoubi];
  216 + $holiday_name = "";
  217 + }
  218 +
  219 + echo '<TD width="14%" height="50" bgColor="'.$schedule_color.'">'.$chk_day;
  220 + if ($holiday_name!=""){
  221 + echo " ".$holiday_name;
  222 + }
  223 + echo "<ul>";
  224 +
  225 + //データの取得
  226 + $file_name = $ddir."eventmst".fun_addzero($main_mon).".csv";
  227 + //読み込んだテーブルのレコード数を格納する変数
  228 + $tbl_cnt=0;
  229 + $month_dat=fun_csvread($month_dat,$file_name);
  230 + //データ出力
  231 + for ($intdataCnt=0; $intdataCnt < count($month_dat)+1; $intdataCnt++){
  232 +
  233 + if (trim($month_dat[$intdataCnt][0]) == $chk_year.$chk_mon.$chk_day){
  234 +?>
  235 + <script language="javascript" type="text/javascript">
  236 + <!--
  237 + message[<?PHP echo $intdataCnt ?>] = '<?PHP echo $month_dat[$intdataCnt][11] ?>';
  238 + -->
  239 + </script>
  240 +
  241 +<?PHP
  242 +/*
  243 + if($month_dat[$intdataCnt][10] == ""){
  244 +
  245 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  246 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  247 +
  248 + //ポップアップの内容が無い場合はJSをはずす
  249 + if($month_dat[$intdataCnt][11] == "") {
  250 + //<table>タグは、Wiondows IE6.0のバグ回避
  251 + echo '<li class="mainTxt">'.$month_dat[$intdataCnt][2].'</li>';
  252 + }else{
  253 + echo '<li><table><tr><td>';
  254 + echo '<span onMouseover="disp_mess('.$intdataCnt.')" onMouseout="del_mess('.$intdataCnt.')">'.$month_dat[$intdataCnt][2].'<span>';
  255 + echo '</td></tr></table></li>';
  256 + }
  257 + }else{
  258 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  259 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  260 +
  261 + echo '<li><table><tr><td>';
  262 + echo '<a href="'.$month_dat[$intdataCnt][10].'" target="_blank" onMouseover="disp_mess('.$intdataCnt.')"';
  263 + echo 'onMouseout="del_mess('.$intdataCnt.')">'.$month_dat[$intdataCnt][2].'</a>';
  264 + echo '</td></tr></table></li>';
  265 +
  266 +
  267 +
  268 + }
  269 +*/
  270 + $month_dat[$intdataCnt][2] = str_replace("&lt;","<",$month_dat[$intdataCnt][2]);
  271 + $month_dat[$intdataCnt][2] = str_replace("&gt;",">",$month_dat[$intdataCnt][2]);
  272 +
  273 + echo '<a id="go'.$intdataCnt.'" rel="leanModal" name="dt'.$intdataCnt.'" href="#dt'.$intdataCnt.'">'.$month_dat[$intdataCnt][2].'</a><br>';
  274 + echo '<div id="dt'.$intdataCnt.'" style="background-color:#FFFFFF;display:none;" class="pop_detail">';
  275 + echo '<h2>イベントの詳細</h2>';
  276 + echo '<p>イベント:'.$month_dat[$intdataCnt][2].'</p>';
  277 + if($month_dat[$intdataCnt][10] != ""){
  278 + echo '<p>ホームページ:<a href="'.$month_dat[$intdataCnt][10].'" target="_brank">'.$month_dat[$intdataCnt][10].'</a></p>';
  279 + }
  280 + echo '<p>内容:'.$month_dat[$intdataCnt][11].'</p>';
  281 + echo '<div class="close_pop"><a href="JavaScript:void(0);" class="modal_close">【×】CLOSE</a></div>';
  282 + echo '</div>';
  283 +
  284 +
  285 + // イベントが無い月はポップアップのJavaScriptは読み込まない
  286 + if (!($month_dat[$intdataCnt][2] == "")){
  287 + $popup_js = "yes";
  288 + }
  289 + }
  290 + }
  291 + echo "</ul>\n\n";
  292 + echo "</TD>";
  293 + }else{
  294 + if (array_key_exists($chk_year.$chk_mon.$chk_day, $holiday)) {
  295 + $schedule_color=$schedule["0"];
  296 + $holiday_name = $holiday[$chk_year.$chk_mon.$chk_day];
  297 + }else{
  298 + $schedule_color=$schedule[$intYoubi];
  299 + $holiday_name = "";
  300 + }
  301 + echo "<TD Align=top width=115 bgColor=$schedule_color height=30>".$chk_day;
  302 + if ($holiday_name!=""){
  303 + echo "<br />".$holiday_name;
  304 + }
  305 + }
  306 +
  307 + //テーブル終了
  308 + if ($intKaigyo==$intCnt){
  309 + echo "</tr>";
  310 + $intKaigyo=$intKaigyo+7;
  311 + }
  312 + }
  313 +
  314 + ?>
  315 +</TABLE>
  316 +<INPUT type="hidden" name="disp_nm" value="<?PHP echo $stDisp_Name ?>">
  317 +<INPUT type="hidden" name="sYear" value="">
  318 +<INPUT type="hidden" name="sMonth" value="">
  319 +<INPUT type="hidden" name="strMainDate" value="">
  320 +<INPUT type="hidden" name="hiduke" value="">
  321 +<INPUT type="hidden" name="usr_name" value="guest">
  322 +<INPUT type="hidden" name="usr_pword" value="guest">
  323 +<INPUT type="hidden" name="pageName" value="<?PHP include("./include/title.inc"); ?>">
  324 +</FORM>
  325 +</div>
  326 +<?PHP
  327 +if ($popup_js == "yes"){
  328 + echo "<script language=\"javascript\" type=\"text/javascript\" src=\"js/popup.js\"></script>";
  329 +}
  330 +?>
  331 +</BODY>
  332 +</HTML>
\ No newline at end of file
... ...
  1 +#lean_overlay {
  2 + position: fixed;
  3 + z-index:100;
  4 + top: 0px;
  5 + left: 0px;
  6 + height:100%;
  7 + width:100%;
  8 + background: #000;
  9 + display: none;
  10 +}
  11 +
  12 +body {
  13 + padding: 10px;
  14 + margin: 10px;
  15 + background-repeat: repeat;
  16 +}
  17 +
  18 +h1 {
  19 + color: #fff;
  20 + font-size: 110%;
  21 + text-align: center;
  22 +}
  23 +
  24 +a:link, a:visited, a:hover {
  25 + color: #006600;
  26 + text-decoration: underline;
  27 + padding:4px 6px;
  28 + background-color:#FFFFFF
  29 +}
  30 +
  31 +a:hover {
  32 + text-decoration: none;
  33 + color: #006600;
  34 + font-size:19px;
  35 + font-weight:bold;
  36 +}
  37 +
  38 +ul, li {
  39 + padding: 0px;
  40 + margin: 0px;
  41 +}
  42 +
  43 +li {
  44 + margin: 0px 0px 0px 0px;
  45 + padding: 0px 0px 0px 16px;
  46 + background-image: url(../image/yajirusi.gif);
  47 + background-position: left 4px;
  48 + background-repeat: no-repeat;
  49 + list-style-type: none;
  50 +}
  51 +
  52 +#google {
  53 + background: #fff;
  54 + border: 1px solid #069;
  55 +}
  56 +
  57 +.title_head{
  58 + width:100%;
  59 + margin:0px 0px 20px 0px;
  60 + overflow:hidden;}
  61 +
  62 +.com_name{
  63 + width:50%;
  64 + float:left;
  65 + text-align:left;
  66 + font-size:16px;
  67 + font-weight:600;
  68 + color:#333333;}
  69 +
  70 +.logout{
  71 + float:right;
  72 + width:50%;
  73 + text-align:right;}
  74 +
  75 +
  76 +.logout_btn{
  77 + padding: 5px 20px;
  78 + font-size: 0.8em;
  79 + background-color: #C33;
  80 + color: #FFF;
  81 + border-style: none;
  82 + font-weight:400;
  83 + -webkit-border-radius: 5px;
  84 + -moz-border-radius: 5px;
  85 + -o-border-radius: 5px;
  86 + border-radius: 5px;
  87 +
  88 +}
  89 +
  90 +.header input {
  91 + padding: 2px 16px 2px 16px;
  92 +}
  93 +
  94 +table.mainTbr {
  95 + border-collapse: collapse;
  96 + text-align: left;
  97 + vertical-align: top;
  98 + border-spacing: 5px;
  99 + border-collapse: separate;
  100 +
  101 +}
  102 +
  103 +.mainTbr th {
  104 + border: 0px #666 none;
  105 + padding: 6px;
  106 + font-weight: normal;
  107 + background-color: #f6f6f6;
  108 +
  109 +}
  110 +
  111 +.mainTbr td {
  112 + border: 1px #333 solid;
  113 + vertical-align: top;
  114 + padding: 6px;
  115 + color:#333;
  116 + font-size:16px;
  117 +
  118 +}
  119 +
  120 +.mainTbr td td {
  121 + font-size: 80%;
  122 + border: none;
  123 + padding: 0px;
  124 +
  125 +}
  126 +
  127 +.mainTxt {
  128 + font-size: 80%;
  129 +}
  130 +
  131 +address {
  132 + background-color: #AD0046;
  133 + font-size: 80%;
  134 + font-style: normal;
  135 + padding: 4px;
  136 +}
  137 +
  138 +.header {
  139 + background-color: #FFFFFF;
  140 + border: 0px #CCCCCC solid;
  141 + padding: 4px 10px 4px 10px;
  142 +}
  143 +
  144 +/*ポップアップ用*/
  145 +.tips{
  146 + color: #006600;
  147 + font-size: 80%;
  148 + position:absolute;
  149 + visibility:hidden;
  150 + border:1px solid #006600;
  151 + padding:5;
  152 + background-color:#CCFF99;
  153 + layer-background-color:#CCFF99;
  154 +}
  155 +
  156 +/* フローティングメッセージのスタイル (ここで表示されるスタイルを指定)*/
  157 +.spanstyle {
  158 + position:absolute;
  159 + visibility:hidden;
  160 + color:#006600; /* フォント色 */
  161 + font-size:10pt; /* フォントサイズ */
  162 +/* font-weight:bold; 太字の場合コメントを外す */
  163 + border:1px gray solid; /* 枠線の太さ、色、形状 */
  164 + padding:5px;
  165 + background-color:#CCFF99; /* 背景色 */
  166 + z-index:100;
  167 +/* センタリングはネスケで表示位置が大幅にずれるので使用しないで下さい */
  168 +}
  169 +/* フローティングメッセージの影のスタイル (コメントが有る部分以外はspanstyleに合わせる)*/
  170 +.syadowstyle {
  171 + position:absolute;
  172 + visibility:hidden;
  173 + color:gray; /* フォント色 (背景色に合わせる */
  174 + font-size:10pt;
  175 + border:1px gray solid; /* 枠線の太さ、色、形状 */
  176 + padding:5px;
  177 + background-color:gray; /* 背景色 */
  178 + z-index:90;
  179 +/* z-indexはspanstyleより必ず小さく */
  180 +}
  181 +.temp_style {
  182 + color:#666666;
  183 + font-weight:bold;
  184 + background-color:#ffff00;
  185 + text-decoration:none;
  186 +}
  187 +
  188 +/*====================================================
  189 +テキスト
  190 +====================================================*/
  191 +
  192 +.Normalfont, .Typewriter {
  193 + font-size:14px;
  194 + line-height: 150%;
  195 +}
  196 +
  197 +.Typewriter {
  198 + font-family: "MS ゴシック", "Osaka−等幅", monospace;
  199 +}
  200 +
  201 +.Largefont {
  202 + font-size:18px;
  203 +}
  204 +
  205 +.Titlefont {
  206 + font-size:22px;
  207 + font-weight:bold;
  208 + text-decoration:underline;
  209 +}
  210 +
  211 +.Userfont {
  212 + font-size:16px;
  213 + font-weight:bold;
  214 +}
  215 +
  216 +.Chufont {
  217 + font-size:14px;
  218 + font-weight:bold;
  219 + color:red;
  220 +}
  221 +
  222 +.Flowfont {
  223 + font-size: 12px;
  224 +}
  225 +
  226 +.LargeBold {
  227 + font-size: 18px;
  228 + font-weight: bold;
  229 +}
  230 +
  231 +.Middlefont {
  232 + font-size: 16px;
  233 +}
  234 +
  235 +.MiddleBold {
  236 + font-size: 16px;
  237 + font-weight: bold;
  238 +}
  239 +
  240 +.SmallFont {
  241 + font-size: 14px;
  242 +}
  243 +
  244 +.SmallBold {
  245 + font-size: 14px;
  246 + font-weight: bold;
  247 +}
  248 +
  249 +.TinnyFont {
  250 + font-size: 9px;
  251 +}
  252 +
  253 +.TinnyBold {
  254 + font-size: 9px;
  255 + font-weight: bold;
  256 +}
  257 +
  258 +.pop_detail{
  259 + width:270px;
  260 + top: 40%;
  261 + vertical-align:top;
  262 + background-color: #FFF;
  263 + padding: 20px 25px;
  264 + -webkit-border-radius: 6px;
  265 + -moz-border-radius: 6px;
  266 + -o-border-radius: 6px;
  267 + border-radius: 6px;
  268 + box-shadow: 0 1px 3px #CCC;
  269 + font-size:12px;
  270 + font-weight:400;
  271 + color:#333;
  272 + padding:20px 20px;
  273 + }
  274 +.pop_detail p{
  275 + font-size:12px;
  276 + font-weight:400;
  277 + color:#333;
  278 + padding:5px 7px;
  279 + }
  280 +
  281 +.pop_detail h2 {
  282 + margin-bottom: 20px;
  283 + width: 260px;
  284 + height: 30px;
  285 + line-height: 30px;
  286 + color: #fff;
  287 + font-size: 12px;
  288 + font-weight: bold;
  289 + text-align: left;
  290 + text-indent: 15px;
  291 + background: #0066FF;
  292 + margin:0px 0px 0px 5px;
  293 +}
  294 +
  295 +.close_pop a{
  296 + font-size:12px;
  297 + font-weight:800;
  298 + color:#0066FF;
  299 + margin:15px 90px;
  300 + text-align:center;
  301 + bottom:0px;
  302 + }
  303 +
  304 +/*submit css*/
  305 +
  306 +.years{
  307 + padding: 15px 40px;
  308 + font-size: 0.9em;
  309 + background-color: #DDDDDD;
  310 + color: #333;
  311 + border-style: none;
  312 + font-weight:400;
  313 +}
  314 +
  315 +
  316 +.n_btn{
  317 + padding: 10px 20px;
  318 + font-size: 0.9em;
  319 + background-color: #DDDDDD;
  320 + color: #333;
  321 + border-style: none;
  322 + font-weight:400;
  323 + -webkit-border-radius: 5px;
  324 + -moz-border-radius: 5px;
  325 + -o-border-radius: 5px;
  326 + border-radius: 5px;
  327 +
  328 +}
... ...
  1 +20160406,1,"山陽新聞の連載「彩(いろどり)おかやま」 連載開始10年目",2016,04,06,2016,04,10,,"http://www.torioka.com/event_list/%e5%b1%b1%e9%99%bd%e6%96%b0%e8%81%9e%ef%bc%88%e5%b2%a1%e5%b1%b1%e7%9c%8c%ef%bc%89/","岡山県の風景・風物詩・生活など写真で阜サする「彩おかやま」新聞連載10周年を記念して、厳選24作品を展示します。<BR>岡山の厳選観光スポットを写真と画像で体感下さい。<BR><BR>場所:とっとり・おかやま新橋館 2F催物スペース<BR>日時:4月6日(水)〜4月10日(日)10:00〜18:00 (4月6日は14:00〜18:00)<BR>"
  2 +20160407,1,"山陽新聞の連載「彩(いろどり)おかやま」 連載開始10年目",2016,04,06,2016,04,10,,"http://www.torioka.com/event_list/%e5%b1%b1%e9%99%bd%e6%96%b0%e8%81%9e%ef%bc%88%e5%b2%a1%e5%b1%b1%e7%9c%8c%ef%bc%89/","岡山県の風景・風物詩・生活など写真で阜サする「彩おかやま」新聞連載10周年を記念して、厳選24作品を展示します。<BR>岡山の厳選観光スポットを写真と画像で体感下さい。<BR><BR>場所:とっとり・おかやま新橋館 2F催物スペース<BR>日時:4月6日(水)〜4月10日(日)10:00〜18:00 (4月6日は14:00〜18:00)<BR>"
  3 +20160408,1,"山陽新聞の連載「彩(いろどり)おかやま」 連載開始10年目",2016,04,06,2016,04,10,,"http://www.torioka.com/event_list/%e5%b1%b1%e9%99%bd%e6%96%b0%e8%81%9e%ef%bc%88%e5%b2%a1%e5%b1%b1%e7%9c%8c%ef%bc%89/","岡山県の風景・風物詩・生活など写真で阜サする「彩おかやま」新聞連載10周年を記念して、厳選24作品を展示します。<BR>岡山の厳選観光スポットを写真と画像で体感下さい。<BR><BR>場所:とっとり・おかやま新橋館 2F催物スペース<BR>日時:4月6日(水)〜4月10日(日)10:00〜18:00 (4月6日は14:00〜18:00)<BR>"
  4 +20160409,1,"山陽新聞の連載「彩(いろどり)おかやま」 連載開始10年目",2016,04,06,2016,04,10,,"http://www.torioka.com/event_list/%e5%b1%b1%e9%99%bd%e6%96%b0%e8%81%9e%ef%bc%88%e5%b2%a1%e5%b1%b1%e7%9c%8c%ef%bc%89/","岡山県の風景・風物詩・生活など写真で阜サする「彩おかやま」新聞連載10周年を記念して、厳選24作品を展示します。<BR>岡山の厳選観光スポットを写真と画像で体感下さい。<BR><BR>場所:とっとり・おかやま新橋館 2F催物スペース<BR>日時:4月6日(水)〜4月10日(日)10:00〜18:00 (4月6日は14:00〜18:00)<BR>"
  5 +20160410,1,"山陽新聞の連載「彩(いろどり)おかやま」 連載開始10年目",2016,04,06,2016,04,10,,"http://www.torioka.com/event_list/%e5%b1%b1%e9%99%bd%e6%96%b0%e8%81%9e%ef%bc%88%e5%b2%a1%e5%b1%b1%e7%9c%8c%ef%bc%89/","岡山県の風景・風物詩・生活など写真で阜サする「彩おかやま」新聞連載10周年を記念して、厳選24作品を展示します。<BR>岡山の厳選観光スポットを写真と画像で体感下さい。<BR><BR>場所:とっとり・おかやま新橋館 2F催物スペース<BR>日時:4月6日(水)〜4月10日(日)10:00〜18:00 (4月6日は14:00〜18:00)<BR>"
... ...
  1 +<?PHP
  2 +ob_start();
  3 +
  4 +//セッション開始
  5 +require_once("./include/session_start.inc");
  6 +
  7 +require('function/operatezero.inc');
  8 +require('function/sortrog.inc');
  9 +require('function/tblctl.inc');
  10 +fun_backhome($file_month);
  11 +
  12 +//受け取った削除情報配列の項目数を数える
  13 +$num = count($touroku);
  14 +if ($num != 0){
  15 + //マスタファイルのオープン
  16 + $ddir = "data/event/";
  17 + $filename = $ddir."eventmst".fun_addzero($file_month).".csv";
  18 + $fp=@fopen("$filename","r+");
  19 + if ($fp == False){
  20 + print("ファイルを開くのに失敗しました。<BR>\n");
  21 + exit;
  22 + }
  23 +
  24 + //書き込みファイルをロックする
  25 + set_file_buffer($fp, 0);
  26 + flock($fp, 2);
  27 +
  28 + //ファイルポインタを先頭に戻す
  29 + rewind($fp);
  30 +
  31 + //各変数の初期化
  32 + $mstcnt = 0;
  33 +
  34 + //マスタファイルを読み込み、レコード件数を数える
  35 + while($mst_read=fgetcsv($fp,4096)){
  36 + $mstbuf[$mstcnt] = $mst_read;
  37 + //$mstbuf[$mstcnt][0] = '"'.$mstbuf[$mstcnt][0].'"';
  38 + //$mstbuf[$mstcnt][1] = '"'.$mstbuf[$mstcnt][1].'"';
  39 + $mstbuf[$mstcnt][2] = '"'.$mstbuf[$mstcnt][2].'"';
  40 + $mstbuf[$mstcnt][3] = $mstbuf[$mstcnt][3];
  41 + $mstbuf[$mstcnt][4] = $mstbuf[$mstcnt][4];
  42 + $mstbuf[$mstcnt][5] = $mstbuf[$mstcnt][5];
  43 + $mstbuf[$mstcnt][6] = $mstbuf[$mstcnt][6];
  44 + $mstbuf[$mstcnt][7] = $mstbuf[$mstcnt][7];
  45 + $mstbuf[$mstcnt][8] = $mstbuf[$mstcnt][8];
  46 + $mstbuf[$mstcnt][9] = $mstbuf[$mstcnt][9];
  47 + $mstbuf[$mstcnt][10] = '"'.$mstbuf[$mstcnt][10].'"';
  48 + $mstbuf[$mstcnt][11] = '"'.$mstbuf[$mstcnt][11].'"';
  49 + $mstcnt++;
  50 + }
  51 +
  52 + //渡されたKEYを元に一時ファイルから書き込むレコードを抽出
  53 + for ($i=0 ; $i<$num ; $i++){
  54 + //KEYを項目に展開
  55 + $m_idx = 0;
  56 + $found = 0;
  57 + list($touroku_ymd,$touroku_idx) = split(",",$touroku[$i]);
  58 +
  59 + //KEYと合致する情報または、テーブルの最後まで
  60 + while(($m_idx < $mstcnt) && ($found == 0)){
  61 + list($key_ymd,$ev_idx,$eventname,$fnen,$fmon,$fday,$tnen,$tmon,$tday,$place,$hpadrs,$mongon)=$mstbuf[$m_idx];
  62 + if (($key_ymd==$touroku_ymd) && ($ev_idx==$touroku_idx)){
  63 + $found = 1;
  64 + }
  65 + $m_idx++;
  66 + }
  67 +
  68 + //指定されたレコードが見つかった場合全項目クリア
  69 + if ($found != 0){
  70 + $mstbuf[$m_idx - 1]="";
  71 + }
  72 + }
  73 +
  74 + //データのソート
  75 + usort($mstbuf,idxsort);
  76 + usort($mstbuf,mycmp);
  77 +
  78 + fun_writetbl($mstbuf,$mstcnt,$fp);
  79 +
  80 + // ファイルのロックを解除して、ファイルを閉じる
  81 + flock($fp, 3);
  82 + fclose($fp);
  83 +}
  84 +
  85 +?>
  86 +<HTML>
  87 +<HEAD>
  88 +<META http-equiv="Content-Type" content="text/html; charset=shift_jis">
  89 +<META http-equiv="Content-Style-Type" content="text/css">
  90 +<TITLE>E_イベント管理者用画面</TITLE>
  91 +<SCRIPT LANGUAGE="JAVASCRIPT">
  92 +<!--
  93 +function load_screen(){
  94 + document.event_cal.action = "adminimenu.php";
  95 + document.event_cal.method="POST";
  96 + document.event_cal.submit();
  97 +}
  98 +-->
  99 +</SCRIPT>
  100 +</HEAD>
  101 +<BODY onLoad="return load_screen();">
  102 +<form name="event_cal">
  103 +<INPUT type ="hidden" name="main_year" value ="<?PHP echo $main_year; ?>">
  104 +<INPUT type ="hidden" name="main_mon" value ="<?PHP echo $main_mon; ?>">
  105 +<INPUT type ="hidden" name="syori" value ="<?PHP echo $syori; ?>">
  106 +</form>
  107 +</BODY>
  108 +</HTML>
... ...
  1 +<?PHP
  2 +ob_start();
  3 +
  4 +$home ="main_menu.php";
  5 +require('function/sortrog.inc');
  6 +require('function/operatezero.inc');
  7 +require('function/tblctl.inc');
  8 +require('function/tblmake.inc');
  9 +fun_backhome($hiduke);
  10 +
  11 +if(isset($sousinn)){
  12 + require('function/readcsv.inc' );
  13 +
  14 + $file_name = "data/usr/username.csv";
  15 + $tbl_cnt=0;
  16 + $found1=0;
  17 + $found2=0;
  18 + $usr_tbl=array();
  19 + $usr_tbl=fun_csvread($usr_tbl,$file_name);
  20 + $id = 0;
  21 + switch($found=userchk($usr_tbl,$usr_name,$usr_pword,$tbl_cnt))
  22 + {
  23 + case "1":
  24 + $dd = 2;
  25 + break;
  26 + case "2":
  27 + $errmsg="パスワードが違います";
  28 + fun_errprint($errmsg,$hiduke);
  29 + exit;
  30 + case "3":
  31 + $errmsg="ユーザー名・パスワードはguestで入力してください";
  32 + fun_errprint($errmsg,$hiduke);
  33 + exit;
  34 + case "4":
  35 + $dd = 1;
  36 + break;
  37 +
  38 + }
  39 +
  40 +}
  41 + ?>
  42 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  43 +<HTML>
  44 +<HEAD>
  45 +<META name="GENERATOR" content="IBM WebSphere Homepage Builder V6.0.1 for Windows">
  46 +<META http-equiv="Content-Type" content="text/html; charset=shift_jis">
  47 +<META http-equiv="Content-Style-Type" content="text/css">
  48 +
  49 +<TITLE>イベント登録</TITLE>
  50 +<SCRIPT type="text/javascript" src="function/checkdata.js"></SCRIPT>
  51 +<link href="css/style.css" rel="stylesheet" type="text/css">
  52 +
  53 +</HEAD>
  54 +<BODY>
  55 +<br>
  56 +<?PHP fun_maketbl(1,"登録"); ?>
  57 +<FORM method="POST" name=event action="evententry.php" onsubmit="return datacheck();">
  58 +
  59 +<?PHP fun_makeline(1,0,0);?>
  60 +
  61 +<FONT size="-1">イベント名称:<BR></FONT>
  62 +<INPUT size="100" type="text" name="eventname"><FONT color="#ff0000">(必須)</FONT><BR>
  63 +<?PHP fun_makeline(2,0,0);?>
  64 +
  65 +<BR>
  66 +
  67 +<?PHP fun_makeline(1,0,0);?><BR>
  68 +
  69 +<FONT size="-1">
  70 +期間1:<BR>
  71 +
  72 +
  73 +<SELECT name="fyear">
  74 +<?PHP //コンボボックスに変更
  75 +list($eventy,$eventm,$eventd)=split(",",$hiduke);
  76 +// for ($intCnt = $eventy-1 ; $intCnt <= $eventy+1 ; $intCnt++) {
  77 +$intCnt = $eventy;
  78 + echo "<option value=".$intCnt;
  79 + if ($fyear==$intCnt){
  80 + echo " selected";
  81 + }
  82 + echo ">".$intCnt."年</option>";
  83 +// }
  84 +?>
  85 +</SELECT>
  86 +
  87 +<SELECT name="fmon">
  88 +<?PHP
  89 +for ($intCnt = 1 ; $intCnt <= 12 ; $intCnt++) {
  90 + if (strlen($intCnt)==1){
  91 + echo "<option value=0".$intCnt;
  92 + }else{
  93 + echo "<option value=".$intCnt;
  94 + }
  95 +
  96 + if ($eventm == $intCnt){
  97 + echo " selected";
  98 + }
  99 + echo ">".$intCnt."月</option>";
  100 +}
  101 +?>
  102 +</SELECT>
  103 +
  104 +<SELECT name="fday">
  105 +<?PHP
  106 +for ($intCnt = 1 ; $intCnt <= 31 ; $intCnt++) {
  107 + if (strlen($intCnt)==1){
  108 + echo "<option value=0".$intCnt;
  109 + }else{
  110 + echo "<option value=".$intCnt;
  111 + }
  112 +
  113 + if ($eventd == $intCnt){
  114 + echo " selected";
  115 + }
  116 + echo ">".$intCnt."日</option>";
  117 +}
  118 +?>
  119 +</SELECT>
  120 +
  121 +
  122 +
  123 +<SELECT name="tyear">
  124 +<?PHP //コンボボックスに変更
  125 +for ($intCnt = $eventy ; $intCnt <= $eventy+1 ; $intCnt++) {
  126 + echo "<option value=".$intCnt;
  127 + if ($eventy==$intCnt){
  128 + echo " selected";
  129 + }
  130 + echo ">".$intCnt."年</option>";
  131 + }
  132 +?>
  133 +</SELECT>
  134 +
  135 +<SELECT name="tmon">
  136 +<?PHP
  137 +for ($intCnt = 1 ; $intCnt <= 12 ; $intCnt++) {
  138 + if (strlen($intCnt)==1){
  139 + echo "<option value=0".$intCnt;
  140 + }else{
  141 + echo "<option value=".$intCnt;
  142 + }
  143 +
  144 + if ($eventm == $intCnt){
  145 + echo " selected";
  146 + }
  147 + echo ">".$intCnt."月</option>";
  148 +}
  149 +?>
  150 +</SELECT>
  151 +
  152 +<SELECT name="tday">
  153 +<?PHP
  154 +for ($intCnt = 1 ; $intCnt <= 31 ; $intCnt++) {
  155 + if (strlen($intCnt)==1){
  156 + echo "<option value=0".$intCnt;
  157 + }else{
  158 + echo "<option value=".$intCnt;
  159 + }
  160 +
  161 + if ($eventd == $intCnt){
  162 + echo " selected";
  163 + }
  164 + echo ">".$intCnt."日</option>";
  165 +}
  166 +print("<input type=\"hidden\" name=\"hiduke\" value =$hiduke>");
  167 +
  168 +?>
  169 +</SELECT>
  170 +
  171 +<br>
  172 +<FONT size="-1">ホームページアドレス:<BR></FONT>
  173 +<INPUT size="100" type="text" name="hpadrs"><BR><BR>
  174 +<FONT size="-1">吹き出し文言:<FONT color="#ff0000" size="-1"></FONT><BR></FONT>
  175 +<TEXTAREA rows="9" cols="71" name="tipword"></TEXTAREA><BR></FONT>
  176 +
  177 +<?PHP fun_makeline(2,0,0);?>
  178 +<BR>
  179 +<INPUT type="submit" name="submit" value=" 登録 "><INPUT type="reset" name="cancel" value="キャンセル"><INPUT type="hidden" name="dd" <?PHP print("value = $dd")?>></DIV><A href=<?PHP print($home); ?>><IMG src="image/return.gif" width="58" height="36" border="0" align="right" alt="イベントカレンダー"></A>
  180 +<INPUT type="hidden" name="pageName" value="<?PHP echo $pageName ?>">
  181 +</FORM>
  182 +<?PHP fun_maketbl(2,0);?>
  183 +
  184 +<?PHP
  185 +// カレンダー画面から引き継いだ情報を展開する。
  186 + list($eventy,$eventm,$eventd)=split(",",$hiduke);
  187 +// Keyの日付を作成する。
  188 + if ($jun != "")
  189 + {
  190 + $from_date = $jyear.fun_addzero($jmon).$jun;
  191 +
  192 + }
  193 + else
  194 + {
  195 + $from_date = $fyear.fun_addzero($fmon).fun_addzero($fday);
  196 + }
  197 + $to_date = $tyear.fun_addzero($tmon).fun_addzero($tday);
  198 +
  199 +// 送信ボタンが押されたときは、フォームの内容をファイルに保存する
  200 + if ($submit != ""){
  201 + // タグ無効化等の処理をする
  202 + $eventname = convstr($eventname);
  203 + $hpadrs = convstr($hpadrs);
  204 + $place = convstr($place);
  205 + $tipword = convstr($tipword);
  206 + $eventymd = $from_date;
  207 + //変更後の日付を取得
  208 + $after_yy = substr($eventymd,0,4);
  209 + $after_mm = substr($eventymd,4,2);
  210 + $after_dd = substr($eventymd,6,2);
  211 +
  212 + // ログファイル名###
  213 + $ddir = "data/event/";
  214 +
  215 +
  216 + //イベント登録
  217 + if (trim($to_date) ==""){
  218 + $int_E_date=date("z",mktime(0,0,0,$after_mm,$after_dd,$after_yy));
  219 + }else{
  220 + $after_to_yy = substr($to_date,0,4);
  221 + $after_to_mm = substr($to_date,4,2);
  222 + $after_to_dd = substr($to_date,6,2);
  223 + $int_E_date=date("z",mktime(0,0,0,$after_to_mm,$after_to_dd,$after_to_yy));
  224 + }
  225 + $int_S_date=date("z",mktime(0,0,0,$after_mm,$after_dd,$after_yy));
  226 +
  227 +
  228 +
  229 + for($intdateCnt = 0; $intdateCnt < ($int_E_date -$int_S_date+1) ; $intdateCnt++){
  230 +
  231 + //期間1、期間2の編集
  232 + $str_wk_dd = $after_dd + $intdateCnt;
  233 +
  234 + $str_wk_dd = fun_addzero($str_wk_dd);
  235 + $str_edit_date=date("Ymd",mktime(0,0,0,$after_mm,$str_wk_dd,$after_yy));
  236 +
  237 + //echo "日付".$str_edit_date."<BR>";
  238 +
  239 + //変更後の日付を取得
  240 + $after_yy2 = substr($str_edit_date,0,4);
  241 + $after_mm2 = substr($str_edit_date,4,2);
  242 + $after_dd2 = substr($str_edit_date,6,2);
  243 +
  244 + //入力日付が引き継ぎ情報から変更された場合
  245 + //if (fun_addzero($eventm) != $after_mm){
  246 + // $eventm = $after_mm;
  247 + //}
  248 +
  249 + $logfile = "eventmst".$after_mm2.".csv";
  250 + //$logfile = "eventmst".fun_addzero($eventm).".csv";
  251 + $filename = $ddir.$logfile;
  252 +
  253 + // ログファイルを開く
  254 + $fp = @fopen("$filename", "r+");
  255 + if ($fp == False)
  256 + {
  257 + echo $filename = $ddir.$logfile;
  258 + print("ファイルを開くのに失敗しました。<BR>\n");
  259 + exit;
  260 + }
  261 + /*
  262 + if ($from_date == $to_date){
  263 + $tyear = "";
  264 + $tmon = "";
  265 + $tday = "";
  266 + }
  267 + */
  268 + // ファイルをロックする
  269 + set_file_buffer($fp, 0);
  270 + flock($fp, 2);
  271 + // ファイルポインタをファイルの先頭に戻す
  272 + rewind($fp);
  273 + // メッセージの読み込み数を数える変数を初期化する
  274 + $count = 0;
  275 + // ファイルの最後まで読み込む
  276 + while ($readbuf = fgetcsv($fp,4096))
  277 + {
  278 + $buf[$count] = $readbuf;
  279 + $buf[$count][0]=$buf[$count][0];
  280 + $buf[$count][1]=$buf[$count][1];
  281 + $buf[$count][2]='"'.$buf[$count][2].'"';
  282 + $buf[$count][3]=$buf[$count][3];
  283 + $buf[$count][4]=$buf[$count][4];
  284 + $buf[$count][5]=$buf[$count][5];
  285 + $buf[$count][6]=$buf[$count][6];
  286 + $buf[$count][7]=$buf[$count][7];
  287 + $buf[$count][8]=$buf[$count][8];
  288 + $buf[$count][9]=$buf[$count][9];
  289 + $buf[$count][10]='"'.$buf[$count][10].'"';
  290 + $buf[$count][11]='"'.$buf[$count][11].'"';
  291 + $count++;
  292 + }
  293 +
  294 + // 配列の最後に、入力されたメッセージを追加する
  295 + //echo $str_edit_date."<BR>";
  296 + $buf[$count][0]=$str_edit_date;
  297 + $buf[$count][1]=fun_eveidx($buf,$count,$str_edit_date);
  298 + $buf[$count][2]='"'.$eventname.'"';
  299 + $buf[$count][3]=$fyear;
  300 + $buf[$count][4]=fun_addzero($after_mm);
  301 + $buf[$count][5]=fun_addzero($after_dd);
  302 + $buf[$count][6]=$tyear;
  303 + $buf[$count][7]=fun_addzero($tmon);
  304 + $buf[$count][8]=fun_addzero($tday);
  305 + $buf[$count][9]=$place;
  306 + $buf[$count][10]='"'.$hpadrs.'"';
  307 + $buf[$count][11]='"'.$tipword.'"';
  308 + usort($buf,idxsort);
  309 + usort($buf,mycmp);
  310 + // ファイルポインタを先頭に戻す
  311 + rewind($fp);
  312 +
  313 + // メッセージをファイルに書き込む
  314 + for ($i = 0; $i <= $count; $i++){
  315 + $tbl_save = join(",",$buf[$i]);
  316 + //echo join(",",$buf[$i])."<BR>";
  317 + fputs($fp, $tbl_save . "\n");
  318 + }
  319 + unset($buf);
  320 + // ファイルのロックを解除して、ファイルを閉じる
  321 + flock($fp, 3);
  322 + fclose($fp);
  323 + }
  324 +
  325 + /* ---------------------------------------------------------------------- */
  326 +
  327 + print("<script>location.replace('main_menu.php');</script></BODY></HTML>");
  328 + }
  329 +
  330 +?>
  331 +</BODY>
  332 +</HTML>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +ob_start();
  3 +
  4 +//ソート手順の読み込み
  5 +require('function/sortrog.inc');
  6 +
  7 +//ゼロ操作の読み込み
  8 +require('function/operatezero.inc');
  9 +require('function/tblctl.inc');
  10 +require('function/tblmake.inc');
  11 +fun_backhome($file_month);
  12 +$home="kannrimenu.php";
  13 +
  14 +?>
  15 +<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  16 +<HTML>
  17 +<HEAD>
  18 +<META name="GENERATOR" content="IBM WebSphere Homepage Builder V6.0.1 for Windows">
  19 +<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
  20 +<META http-equiv="Content-Style-Type" content="text/css">
  21 +<TITLE>イベント登録内容変更</TITLE>
  22 +<SCRIPT type="text/javascript" src="function/checkdata.js"></SCRIPT>
  23 +<link href="css/style.css" rel="stylesheet" type="text/css">
  24 +<SCRIPT Language="JavaScript">
  25 +<!--
  26 +
  27 +function Move_Menu(){
  28 + document.event_cal.action = "main_menu.php";
  29 + document.event_cal.method="POST";
  30 + document.event_cal.submit();
  31 + return;
  32 +}
  33 +
  34 +function Move_LogOut(){
  35 + document.event_cal.action = "login.php";
  36 + document.event_cal.method="POST";
  37 + document.event_cal.submit();
  38 + return;
  39 +}
  40 +
  41 +function Move_UpDate(){
  42 + var fyear= document.event_cal.fyear.value;
  43 + var fmon= document.event_cal.fmon.value;
  44 + var fday= document.event_cal.fday.value;
  45 + var name = document.event_cal.eventname.value;
  46 + var hpadrs = document.event_cal.hpadrs.value;
  47 + var tipword = document.event_cal.tipword.value;
  48 +
  49 + name = chrlengs(name)
  50 + if (name.length == 0){
  51 + alert("イベント名称を入力して下さい");
  52 + return false
  53 + }
  54 + if (name.length > 200){
  55 + alert("イベント名称は全角100文字以内で入力して下さい");
  56 + return false
  57 + }
  58 +
  59 + //不要なスペースの除去
  60 + fyear = chrlengs(fyear);
  61 + fmon = chrlengs(fmon);
  62 + fday = chrlengs(fday);
  63 +
  64 + //一桁月日を二桁にする。
  65 + fmon = addzero(fmon);
  66 + fday = addzero(fday);
  67 +
  68 + if (hpadrs.length > 500){
  69 + alert("ホームページアドレスは半角500文字以内です");
  70 + return false
  71 + }
  72 +
  73 + if (tipword.length > 3000){
  74 + alert("吹き出しメッセージが長過ぎます");
  75 + return false
  76 + }
  77 +
  78 + if(confirm ("登録しますか?")){
  79 + document.event_cal.action = "eventreg.php";
  80 + document.event_cal.method="POST";
  81 + document.event_cal.submit();
  82 + return;
  83 + }
  84 +
  85 +}
  86 +
  87 +-->
  88 +</SCRIPT>
  89 +</HEAD>
  90 +<BODY background="../../eventcalender/image/u009bcg.gif">
  91 +<FORM method="POST" name="event_cal">
  92 +<TABLE width="100%" border="0" align="center" cellPadding=0 cellSpacing=0 class="header">
  93 + <TBODY>
  94 + <TR>
  95 + <TD align="left"><img src="image/titilemini.gif" alt="e-イベント" width="117" height="40"></TD>
  96 + <TD align="right" width="150">
  97 + <a href="../manual/" target="_blank"><img src="image/icon_01.gif" alt="e-イベントマニュアル" width="144" hight="50" border="0"></a>
  98 + </TD>
  99 + <TD align="right" width="300">
  100 + <INPUT type="button" value="戻る" onclick="return Move_Menu()">
  101 + <INPUT type="button" value="ログアウト" onclick="return Move_LogOut()">
  102 + </TD>
  103 + </TR>
  104 + </TBODY>
  105 +</TABLE>
  106 +<br />
  107 +<?PHP
  108 + list($event_ymd,$event_idx)=split(",",$touroku);
  109 + $eventy = substr($event_ymd,0,4);
  110 + $eventm = substr($event_ymd,4,2);
  111 + $eventd = substr($event_ymd,6,2);
  112 +
  113 + //定数の設定
  114 + $ddir ="data/event/";
  115 + $logfile ="eventmst".fun_addzero($file_month).".csv";
  116 +
  117 + $logfile = $ddir.$logfile;
  118 + $fp = @fopen($logfile, "r");
  119 + $found = 0;
  120 + while (($buf = fgetcsv($fp,4096))){
  121 + //読み込んだメッセージを「,」で切り分けて変数に代入する
  122 + list($ev_date, $ev_idx, $evtname, $fnen, $fmont, $fdate,$tnen,$tmont,$tdate,$tplace,$hpadr,$popmsg) = $buf;
  123 + if (($ev_date == $event_ymd) && ($ev_idx == $event_idx)){
  124 + $evname = $evtname;
  125 + $key_date = $ev_date;
  126 + $ty = $tnen;
  127 + $tm = $tmont;
  128 + $td = $tdate;
  129 + $basyo = chgbr($tplace);
  130 + $hpd = chgbr($hpadr);
  131 + $msg = chgbr($popmsg);
  132 + $found = 1;
  133 + if (($eventd != 33) && ($eventd != 55) &&
  134 + ($eventd != 99)){
  135 + $fy = $fnen;
  136 + $fm = $fmont;
  137 + $fd = $fdate;
  138 + }else{
  139 + $jy = $eventy;
  140 + $jm = $eventm;
  141 + }
  142 + }
  143 + }
  144 + if ($found == 0){
  145 + echo "指定されたレコードが存在しませんでした";
  146 + echo '<A href="main_menu.php"><IMG src="../../eventcalender/image/return.gif" width="58" height="36" border="0" align="right" alt="管理者メニュー"></A>';
  147 + fun_maketbl(2,0);
  148 + fclose($fp);
  149 + echo "</FORM></BODY></HOME>";
  150 + exit;
  151 + }
  152 + fclose($fp);
  153 +
  154 +?>
  155 +<?PHP fun_makeline(1,0,0); ?>
  156 +<FONT size="-1">イベント名称:</FONT><BR>
  157 +<INPUT size="100" type="text" name=eventname value="<?PHP echo $evname; ?>"><FONT color="#ff0000" size="-1">(必須)</FONT><BR>
  158 +<?PHP fun_makeline(2,0,0); ?>
  159 +<?PHP fun_makeline(1,0,0); ?>
  160 +
  161 +<SELECT name="fyear">
  162 +<?PHP //コンボボックスに変更
  163 + for ($intCnt = $fy-1 ; $intCnt <= $fy+1 ; $intCnt++) {
  164 + echo "<option value=".$intCnt;
  165 + if ($eventy==$intCnt){
  166 + echo " selected";
  167 + }
  168 + echo ">".$intCnt."年</option>";
  169 + }
  170 +?>
  171 +</SELECT>
  172 +<SELECT name="fmon">
  173 +<?PHP
  174 +for ($intCnt = 1 ; $intCnt <= 12 ; $intCnt++) {
  175 + if (strlen($intCnt)==1){
  176 + echo "<option value=0".$intCnt;
  177 + }else{
  178 + echo "<option value=".$intCnt;
  179 + }
  180 +
  181 + if ($eventm == $intCnt){
  182 + echo " selected";
  183 + }
  184 + echo ">".$intCnt."月</option>";
  185 +}
  186 +?>
  187 +</SELECT>
  188 +
  189 +<SELECT name="fday">
  190 +<?PHP
  191 +for ($intCnt = 1 ; $intCnt <= 31 ; $intCnt++) {
  192 + if (strlen($intCnt)==1){
  193 + echo "<option value=0".$intCnt;
  194 + }else{
  195 + echo "<option value=".$intCnt;
  196 + }
  197 +
  198 + if ($eventd == $intCnt){
  199 + echo " selected";
  200 + }
  201 + echo ">".$intCnt."日</option>";
  202 +}
  203 +?>
  204 +</SELECT>
  205 +<br><BR>
  206 +<FONT size="-1">ホームページアドレス:</FONT><BR>
  207 +<INPUT size="100" type="text" name="hpadrs" value = <?PHP echo $hpd; ?>>
  208 +<BR><BR>
  209 +<FONT size="-1">吹き出し文言:</FONT><BR>
  210 +<TEXTAREA rows="9" cols="71" name="tipword"><?PHP echo $msg; ?></TEXTAREA><BR>
  211 +<?PHP fun_makeline(2,0,0); ?>
  212 +<INPUT type="hidden" name="kikan" value=<?PHP echo $touroku; ?>>
  213 +<INPUT type="hidden" name="file_month" value=<?PHP echo $file_month; ?>>
  214 +<INPUT type="hidden" name="filetyp" value=<?PHP echo $filetyp; ?>>
  215 +<INPUT type="hidden" name="main_year" value ="<?PHP echo $main_year; ?>">
  216 +<INPUT type="hidden" name="main_mon" value ="<?PHP echo $main_mon; ?>">
  217 +<INPUT type="hidden" name="syori" value ="<?PHP echo $syori; ?>">
  218 +<BR>
  219 +<INPUT type="button" value=" 登録 " onclick="return Move_UpDate()">
  220 +</FORM>
  221 +</BODY>
  222 +</HTML>
... ...
  1 +<?PHP
  2 +ob_start();
  3 +
  4 +//ソート手順の読み込み
  5 +require('function/sortrog.inc');
  6 +
  7 +//ゼロ操作の読み込み
  8 +require('function/operatezero.inc');
  9 +require('function/tblctl.inc');
  10 +require('function/tblmake.inc');
  11 +fun_backhome($file_month);
  12 +
  13 +list($event_ymd,$touroku_idx) = split(",",$kikan);
  14 +$eventy = substr($event_ymd,0,4);
  15 +$eventm = substr($event_ymd,4,2);
  16 +$eventd = substr($event_ymd,6,2);
  17 +
  18 +// ログファイル名
  19 +$ddir = "data/event/";
  20 +
  21 +if ($jun != ""){
  22 + $from_date = $jyear.fun_addzero($jmon).$jun;
  23 +}else{
  24 + $from_date = $fyear.fun_addzero($fmon).fun_addzero($fday);
  25 +}
  26 +$to_date = $tyear.fun_addzero($tmon).fun_addzero($tday);
  27 +
  28 +// タグ無効化等の処理をする
  29 +$eventname = convstr($eventname);
  30 +$hpadrs = convstr($hpadrs);
  31 +$place = convstr($place);
  32 +$tipword = convstr($tipword);
  33 +$eventymd = $from_date;
  34 +list($key_ymd,$ev_idx)=split(",",$kikan);
  35 +
  36 +//変更前の日付を取得
  37 +$befor_yy = substr($key_ymd,0,4);
  38 +$befor_mm = substr($key_ymd,4,2);
  39 +$befor_dd = substr($key_ymd,6,2);
  40 +
  41 +//変更後の日付を取得
  42 +$after_yy = substr($eventymd,0,4);
  43 +$after_mm = substr($eventymd,4,2);
  44 +$after_dd = substr($eventymd,6,2);
  45 +
  46 +// ログファイルを開く
  47 +$filename = "eventmst".fun_addzero($file_month).".csv";
  48 +$filename= $ddir.$filename;
  49 +
  50 +$fp = @fopen($filename, "r+");
  51 +
  52 +if ($fp == False){
  53 + print("ファイルを開くのに失敗しました。<BR>\n");
  54 + exit;
  55 +}
  56 +
  57 +// 開始年月日と終了年月日が同じなら終了年月日は登録しない。
  58 +if ($from_date == $to_date){
  59 + $tyear = "";
  60 + $tmon = "";
  61 + $tday = "";
  62 +}
  63 +
  64 +// ファイルをロックする
  65 +set_file_buffer($fp, 0);
  66 +flock($fp, 2);
  67 +// ファイルポインタをファイルの先頭に戻す
  68 +rewind($fp);
  69 +// メッセージの読み込み数を数える変数を初期化する
  70 +$count = 0;
  71 +$lengs_cnt = 0;
  72 +$found = 0;
  73 +
  74 +// ファイルの内容を読み込むクリアする元レコードの割り出し。
  75 +// とファイルのレコード件数を調べる。
  76 +while ($readbuf = fgetcsv($fp,4096)){
  77 + $buf[$count] = $readbuf;
  78 + list($mst_ymd,$mst_idx,$mstname,$mfyear,$mfmon,$mfday,$mtyear,$mtmon,
  79 + $mtday,$m_place,$mhpadr,$mmsg)=$buf[$count];
  80 + if (($mst_ymd==$key_ymd) && ($mst_idx == $ev_idx)){
  81 + $sv_evidx = $buf[$count][1];
  82 + $buf[$count]="";
  83 + $found = 1;
  84 + }
  85 + //$buf[$count][0]='"'.$buf[$count][0].'"';
  86 + //$buf[$count][1]='"'.$buf[$count][1].'"';
  87 + $buf[$count][2]='"'.$buf[$count][2].'"';
  88 + //$buf[$count][3]='"'.$buf[$count][3].'"';
  89 + //$buf[$count][4]='"'.$buf[$count][4].'"';
  90 + //$buf[$count][5]='"'.$buf[$count][5].'"';
  91 + //$buf[$count][6]='"'.$buf[$count][6].'"';
  92 + //$buf[$count][7]='"'.$buf[$count][7].'"';
  93 + //$buf[$count][8]='"'.$buf[$count][8].'"';
  94 + //$buf[$count][9]='"'.$buf[$count][9].'"';
  95 + $buf[$count][10]='"'.$buf[$count][10].'"';
  96 + $buf[$count][11]='"'.$buf[$count][11].'"';
  97 + $count++;
  98 +}
  99 +
  100 +if ($befor_mm == $after_mm){
  101 + $buf[$count][0]=$eventymd;
  102 + if ($key_ymd != $eventymd){
  103 + $buf[$count][1]=fun_eveidx($buf,$count,$eventymd);
  104 + }else{
  105 + $buf[$count][1]=$sv_evidx;
  106 + }
  107 + $buf[$count][2]='"'.$eventname.'"';
  108 + $buf[$count][3]=$fyear;
  109 + $buf[$count][4]=fun_addzero($fmon);
  110 + $buf[$count][5]=fun_addzero($fday);
  111 + $buf[$count][6]=$tyear;
  112 + $buf[$count][7]=fun_addzero($tmon);
  113 + $buf[$count][8]=fun_addzero($tday);
  114 + $buf[$count][9]=$place;
  115 + $buf[$count][10]='"'.$hpadrs.'"';
  116 + $buf[$count][11]='"'.$tipword.'"';
  117 + $count++;
  118 +}
  119 +
  120 +usort($buf,idxsort);
  121 +usort($buf,mycmp);
  122 +
  123 +fun_writetbl($buf,$count,$fp);
  124 +
  125 +// ファイルのロックを解除して、ファイルを閉じる
  126 +flock($fp, 3);
  127 +fclose($fp);
  128 +
  129 +//登録処理
  130 +if ($befor_mm != $after_mm){
  131 + $filename = "eventmst".fun_addzero($after_mm).".csv";
  132 + $filename= $ddir.$filename;
  133 +
  134 + $fp_new = @fopen($filename, "r+");
  135 + if ($fp_new == False){
  136 + print("ファイルを開くのに失敗しました。<BR>\n");
  137 + exit;
  138 + }
  139 +
  140 + if ($from_date == $to_date){
  141 + $tyear = "";
  142 + $tmon = "";
  143 + $tday = "";
  144 + }
  145 +
  146 + //ファイルをロックする
  147 + set_file_buffer($fp_new, 0);
  148 + flock($fp_new, 2);
  149 +
  150 + // ファイルポインタをファイルの先頭に戻す
  151 + // メッセージの読み込み数を数える変数を初期化する
  152 + $n_count = 0;
  153 + while ($newrec = fgetcsv($fp_new,4096)){
  154 + $newbuf[$n_count] = $newrec;
  155 + $n_count++;
  156 + }
  157 +
  158 + $newbuf[$n_count][0]=$eventymd;
  159 +
  160 + $newbuf[$n_count][1]=fun_eveidx($newbuf,$n_count,$eventymd);
  161 + $newbuf[$n_count][2]='"'.$eventname.'"';
  162 + $newbuf[$n_count][3]=$fyear;
  163 + $newbuf[$n_count][4]=fun_addzero($fmon);
  164 + $newbuf[$n_count][5]=fun_addzero($fday);
  165 + $newbuf[$n_count][6]=$tyear;
  166 + $newbuf[$n_count][7]=fun_addzero($tmon);
  167 + $newbuf[$n_count][8]=fun_addzero($tday);
  168 + $newbuf[$n_count][9]=$place;
  169 + $newbuf[$n_count][10]='"'.$hpadrs.'"';
  170 + $newbuf[$n_count][11]='"'.$tipword.'"';
  171 + $n_count++;
  172 +
  173 + if ($from_date < $to_date){
  174 + $out_date = $from_date;
  175 + while($out_date <= $to_date){
  176 + $out_date = date("Ymd", strtotime($out_date." 1 day"));
  177 +
  178 + $newbuf[$n_count][0]=$out_date;
  179 + $newbuf[$n_count][1]=fun_eveidx($newbuf,$n_count,$out_date);
  180 + $newbuf[$n_count][2]='"'.$eventname.'"';
  181 + $newbuf[$n_count][3]=$fyear;
  182 + $newbuf[$n_count][4]=fun_addzero($fmon);
  183 + $newbuf[$n_count][5]=fun_addzero($fday);
  184 + $newbuf[$n_count][6]=$tyear;
  185 + $newbuf[$n_count][7]=fun_addzero($tmon);
  186 + $newbuf[$n_count][8]=fun_addzero($tday);
  187 + $newbuf[$n_count][9]=$place;
  188 + $newbuf[$n_count][10]='"'.$hpadrs.'"';
  189 + $newbuf[$n_count][11]='"'.$tipword.'"';
  190 + $n_count++;
  191 + }
  192 + }
  193 +
  194 +
  195 + usort($newbuf,idxsort);
  196 + usort($newbuf,mycmp);
  197 + fun_writetbl($newbuf,$n_count,$fp_new);
  198 + flock($fp_new,3);
  199 + fclose($fp_new);
  200 +}
  201 +
  202 +?>
  203 +<HTML>
  204 +<HEAD>
  205 +<META http-equiv="Content-Type" content="text/html; charset=shift_jis">
  206 +<META http-equiv="Content-Style-Type" content="text/css">
  207 +<TITLE>E_イベント管理者用画面</TITLE>
  208 +<SCRIPT LANGUAGE="JAVASCRIPT">
  209 +<!--
  210 +function load_screen(){
  211 + document.event_cal.action = "adminimenu.php";
  212 + document.event_cal.method="POST";
  213 + document.event_cal.submit();
  214 +}
  215 +-->
  216 +</SCRIPT>
  217 +</HEAD>
  218 +<BODY onLoad="return load_screen();">
  219 +<form name="event_cal">
  220 +<INPUT type ="hidden" name="main_year" value ="<?PHP echo $main_year; ?>">
  221 +<INPUT type ="hidden" name="main_mon" value ="<?PHP echo $main_mon; ?>">
  222 +<INPUT type ="hidden" name="syori" value ="<?PHP echo $syori; ?>">
  223 +</form>
  224 +</BODY>
  225 +</HTML>
... ...
  1 +<?PHP
  2 + function fun_csvread($month_dat,$file_name)
  3 + {
  4 +
  5 +
  6 + global $tbl_cnt;
  7 + $fp = fopen ("$file_name","r");
  8 +//CSVファイルの読み込み
  9 + while ($data = fgetcsv ($fp, 4096)) {
  10 +//配列要素の数を変数に格納!!
  11 + $num = count ($data);
  12 + $tbl_cnt++;
  13 + for ($c=0; $c<$num; $c++) {
  14 + $month_dat[$tbl_cnt][$c]=$data[$c] ;
  15 + }
  16 + }
  17 + fclose ($fp);
  18 +//戻り値として、設定$dはテーブルの数
  19 + return $month_dat;
  20 +}
  21 +?>
  22 +
  23 +<?PHP
  24 +//カレンダの日付及び曜日を生成する
  25 + function fun_date($f_date,$f_month,$f_year)
  26 + {
  27 + $hiduke=$f_year .",". $f_month .",". $f_date;
  28 + $youbi = array("日","月","火","水","木","金","土");
  29 + $Event_cnst = "イベント登録出来ます";
  30 + $Event_gif = "image/c009icn.gif";
  31 + $jun_tbl = array("33"=>"(上旬)","55"=>"(中旬)","99"=>"(下旬)");
  32 + $day_color = "#000000";
  33 + if (($f_date != 33) && ($f_date != 55) && ($f_date != 99))
  34 + {
  35 + switch(date("w",mktime(0,0,0,$f_month,$f_date,$f_year)))
  36 + {
  37 + case "0":
  38 + $day_color = "#ff0000";
  39 + break;
  40 + case "6":
  41 + $day_color = "#0000ff";
  42 + break;
  43 + default:
  44 + $day_color = "#000000";
  45 + break;
  46 + }
  47 +//祝祭日の処理追加
  48 + if (fun_holiday($f_year,$f_month,$f_date) == "true")
  49 + {
  50 + $day_color = "#ff0000";
  51 + }
  52 +//日付出力
  53 + }
  54 + print("<TD width=50 align=\"right\" ><FONT size= \"-1\"
  55 + color=\"$day_color\">");
  56 + if (($f_date != 33) && ($f_date != 55) && ($f_date != 99))
  57 + {
  58 + printf("%d(%s)",$f_date,$youbi[date("w",mktime(0,0,0,
  59 + $f_month,$f_date,$f_year))]);
  60 + }
  61 + else
  62 + {
  63 + print($jun_tbl[$f_date]);
  64 + }
  65 + print("<A href=\"javascript:void(setdate('$hiduke'))\">");
  66 + print("<IMG src=\"$Event_gif\" width=\"13\"
  67 + height=\"13\" border=\"0\" alt=\"$Event_cnst\"></A>"); print("</FONT>");
  68 + print("</TD>");
  69 +}
  70 +?>
  71 +
  72 +<?PHP
  73 + function fun_printevent($month_dat,$dkey,$tbl_cnt)
  74 +{
  75 + global $pop_cnt;
  76 + global $tbl_cnt;
  77 + $Exp_cnst = "体験談の表示と登録できます。";
  78 + $Exp_gif = "image/b012icn.gif";
  79 + list($dk_y,$dk_m,$dk_d) = split(",",$dkey);
  80 + $day_key = $dk_y.fun_addzero($dk_m).fun_addzero($dk_d);
  81 + for ($r_ind=0 ; $r_ind <= $tbl_cnt ; $r_ind++)
  82 + {
  83 + if ($month_dat[$r_ind][0] == $day_key)
  84 +
  85 + {
  86 + $exp_date=$dkey .",".$month_dat[$r_ind][1];
  87 + if (strlen($month_dat[$r_ind][10])!= 0)
  88 + {
  89 + if (strlen($month_dat[$r_ind][11]) != 0)
  90 + {
  91 + print("<A href = \"");
  92 + print($month_dat[$r_ind][10]);
  93 + print("\"");
  94 + print(" onMouseover=");
  95 + print("\"showTips('tip");
  96 + print($pop_cnt);
  97 + print("');\" onMouseout=\"hideTips('tip");
  98 + print($pop_cnt);
  99 + print("');\" target=\"_blank\">");
  100 + print($month_dat[$r_ind][2]);
  101 + if ($month_dat[$r_ind][9] != ""){
  102 + print("(".$month_dat[$r_ind][9].")");
  103 + }
  104 + print("</A>");
  105 + print("<A href=\"javascript:void(setexp('$exp_date'))\">");
  106 + print("<IMG src=\"$Exp_gif\" width=\"13\"
  107 + height=\"13\" border=\"0\" alt=\"$Exp_cnst\"></A>");
  108 + print("<br>");
  109 +//修正
  110 + if(($month_dat[$r_ind][6]!= "")&&($month_dat[$r_ind][7] != "")
  111 + && ($month_dat[$r_ind][8] != "")){
  112 + print("〜".$month_dat[$r_ind][6]."年");
  113 + print($month_dat[$r_ind][7]."月");
  114 + print($month_dat[$r_ind][8]."日まで");
  115 + print("<BR>");
  116 + }
  117 + print("<div class=\"tips\" id=\"tip");
  118 + print($pop_cnt);
  119 + print("\">");
  120 + print($month_dat[$r_ind][11]);
  121 + print("</div>");
  122 + $pop_cnt++;
  123 + }
  124 + else
  125 + {
  126 + print("<A href = ");
  127 + print( $month_dat[$r_ind][10]);
  128 + print(" target=\"_blank\">");
  129 + print($month_dat[$r_ind][2]);
  130 + if ($month_dat[$r_ind][9] != ""){
  131 + print("(".$month_dat[$r_ind][9].")");
  132 + }
  133 + print("</A>");
  134 + print("<A href=\"javascript:void(setexp('$exp_date'))\">");
  135 + print("<IMG src=\"$Exp_gif\" width=\"13\"
  136 + height=\"13\" border=\"0\" alt=\"$Exp_cnst\"></A>");
  137 + print("<br>");
  138 +//修正
  139 + if(($month_dat[$r_ind][6]!= "")&&($month_dat[$r_ind][7] != "")
  140 + && ($month_dat[$r_ind][8] != "")){
  141 + print("〜".$month_dat[$r_ind][6]."年");
  142 + print($month_dat[$r_ind][7]."月");
  143 + print($month_dat[$r_ind][8]."日まで");
  144 + print("<BR>");
  145 + }
  146 +
  147 + }
  148 + }
  149 + else
  150 + {
  151 + if (strlen($month_dat[$r_ind][11]) != 0)
  152 + {
  153 + print("<A href ");
  154 + print(" onMouseover=");
  155 + print("\"showTips('tip");
  156 + print($pop_cnt);
  157 + print("');\" onMouseout=\"hideTips('tip");
  158 + print($pop_cnt);
  159 + print("');\">");
  160 + print($month_dat[$r_ind][2]);
  161 + if ($month_dat[$r_ind][9] != ""){
  162 + print("(".$month_dat[$r_ind][9].")");
  163 + }
  164 + print("</A>");
  165 + print("<A href=\"javascript:void(setexp('$exp_date'))\">");
  166 + print("<IMG src=\"$Exp_gif\" width=\"13\"
  167 + height=\"13\" border=\"0\" alt=\"$Exp_cnst\"></A>");
  168 + print("<br>");
  169 +//修正
  170 + if(($month_dat[$r_ind][6]!= "")&&($month_dat[$r_ind][7] != "")
  171 + && ($month_dat[$r_ind][8] != "")){
  172 + print("〜".$month_dat[$r_ind][6]."年");
  173 + print($month_dat[$r_ind][7]."月");
  174 + print($month_dat[$r_ind][8]."日まで");
  175 + print("<BR>");
  176 + }
  177 +
  178 + print("<div class=\"tips\" id=\"tip");
  179 + print($pop_cnt);
  180 + print("\">");
  181 + print($month_dat[$r_ind][11]);
  182 + print("</div>");
  183 + $pop_cnt++;
  184 + }
  185 + else
  186 + {
  187 + print($month_dat[$r_ind][2]);
  188 + if ($month_dat[$r_ind][9] != ""){
  189 + print("(".$month_dat[$r_ind][9].")");
  190 + }
  191 + print("<A href=\"javascript:void(setexp('$exp_date'))\">");
  192 + print("<IMG src=\"$Exp_gif\" width=\"13\"
  193 + height=\"13\" border=\"0\" alt=\"$Exp_cnst\"></A>");
  194 + print("<br>");
  195 +//修正
  196 + if(($month_dat[$r_ind][6]!= "")&&($month_dat[$r_ind][7] != "")
  197 + && ($month_dat[$r_ind][8] != "")){
  198 + print("〜".$month_dat[$r_ind][6]."年");
  199 + print($month_dat[$r_ind][7]."月");
  200 + print($month_dat[$r_ind][8]."日まで");
  201 + print("<BR>");
  202 + }
  203 +
  204 +
  205 +
  206 + }
  207 + }
  208 + }
  209 + }
  210 +}
  211 +?>
\ No newline at end of file
... ...
  1 +<?PHP
  2 + function fun_csvread($month_dat,$file_name)
  3 + {
  4 +
  5 + global $tbl_cnt;
  6 + $fp = fopen ("$file_name","r");
  7 +//CSVファイルの読み込み
  8 + while ($data = fgetcsv ($fp, 4096)) {
  9 +//配列要素の数を変数に格納!!
  10 + $num = count ($data);
  11 + $tbl_cnt++;
  12 + for ($c=0; $c<$num; $c++) {
  13 + $month_dat[$tbl_cnt][$c]=$data[$c] ;
  14 + }
  15 + }
  16 + fclose ($fp);
  17 +//戻り値として、設定$dはテーブルの数
  18 + return $month_dat;
  19 +}
  20 +?>
  21 +
  22 +<?PHP
  23 +//カレンダの日付及び曜日を生成する
  24 + function fun_date($f_date,$f_month,$f_year)
  25 + {
  26 + $hiduke=$f_year .",". $f_month .",". $f_date;
  27 + $youbi = array("日","月","火","水","木","金","土");
  28 + $Event_cnst = "イベント登録出来ます";
  29 + $Event_gif = "./image/c009icn.gif";
  30 + $jun_tbl = array("33"=>"(上旬)","55"=>"(中旬)","99"=>"(下旬)");
  31 + $day_color = "#000000";
  32 + if (($f_date != 33) && ($f_date != 55) && ($f_date != 99))
  33 + {
  34 + switch(date("w",mktime(0,0,0,$f_month,$f_date,$f_year)))
  35 + {
  36 + case "0":
  37 + $day_color = "#ff0000";
  38 + break;
  39 + case "6":
  40 + $day_color = "#0000ff";
  41 + break;
  42 + default:
  43 + $day_color = "#000000";
  44 + break;
  45 + }
  46 +//祝祭日の処理追加
  47 + if (fun_holiday($f_year,$f_month,$f_date) == "true")
  48 + {
  49 + $day_color = "#ff0000";
  50 + }
  51 +//日付出力
  52 + }
  53 + print("<TD width=50 align=\"right\" ><FONT size= \"-1\"
  54 + color=\"$day_color\">");
  55 + if (($f_date != 33) && ($f_date != 55) && ($f_date != 99))
  56 + {
  57 + printf("%d(%s)",$f_date,$youbi[date("w",mktime(0,0,0,
  58 + $f_month,$f_date,$f_year))]);
  59 + }
  60 + else
  61 + {
  62 + print($jun_tbl[$f_date]);
  63 + }
  64 + print("<A href=\"javascript:void(setdate('$hiduke'))\">");
  65 + print("<IMG src=\"$Event_gif\" width=\"13\"
  66 + height=\"13\" border=\"0\" alt=\"$Event_cnst\"></A>"); print("</FONT>");
  67 + print("</TD>");
  68 +}
  69 +?>
  70 +
  71 +<?PHP
  72 + function fun_printevent($month_dat,$dkey,$tbl_cnt)
  73 +{
  74 + global $pop_cnt;
  75 + global $tbl_cnt;
  76 + $Exp_cnst = "体験談の表示と登録できます。";
  77 + $Exp_gif = "../../eventcalender/image/b012icn.gif";
  78 + list($dk_y,$dk_m,$dk_d) = split(",",$dkey);
  79 + $day_key = $dk_y.fun_addzero($dk_m).fun_addzero($dk_d);
  80 + for ($r_ind=0 ; $r_ind <= $tbl_cnt ; $r_ind++)
  81 + {
  82 + if ($month_dat[$r_ind][0] == $day_key)
  83 +
  84 + {
  85 + $exp_date=$dkey .",".$month_dat[$r_ind][1];
  86 + if (strlen($month_dat[$r_ind][10])!= 0)
  87 + {
  88 + if (strlen($month_dat[$r_ind][11]) != 0)
  89 + {
  90 + print("<A href = \"");
  91 + print($month_dat[$r_ind][10]);
  92 + print("\"");
  93 + print(" onMouseover=");
  94 + print("\"showTips('tip");
  95 + print($pop_cnt);
  96 + print("');\" onMouseout=\"hideTips('tip");
  97 + print($pop_cnt);
  98 + print("');\" target=\"_blank\">");
  99 + print($month_dat[$r_ind][2]);
  100 + if ($month_dat[$r_ind][9] != ""){
  101 + print("(".$month_dat[$r_ind][9].")");
  102 + }
  103 + print("</A>");
  104 +/*
  105 + print("<A href=\"javascript:void(setexp('$exp_date'))\">");
  106 + print("<IMG src=\"$Exp_gif\" width=\"13\"
  107 + height=\"13\" border=\"0\" alt=\"$Exp_cnst\"></A>");
  108 +*/
  109 + print("<br>");
  110 +//修正
  111 + if(($month_dat[$r_ind][6]!= "")&&($month_dat[$r_ind][7] != "")
  112 + && ($month_dat[$r_ind][8] != "")){
  113 + print("〜".$month_dat[$r_ind][6]."年");
  114 + print($month_dat[$r_ind][7]."月");
  115 + print($month_dat[$r_ind][8]."日まで");
  116 + print("<BR>");
  117 + }
  118 + print("<div class=\"tips\" id=\"tip");
  119 + print($pop_cnt);
  120 + print("\">");
  121 + print($month_dat[$r_ind][11]);
  122 + print("</div>");
  123 + $pop_cnt++;
  124 + }
  125 + else
  126 + {
  127 + print("<A href = ");
  128 + print( $month_dat[$r_ind][10]);
  129 + print(" target=\"_blank\">");
  130 + print($month_dat[$r_ind][2]);
  131 + if ($month_dat[$r_ind][9] != ""){
  132 + print("(".$month_dat[$r_ind][9].")");
  133 + }
  134 + print("</A>");
  135 +/*
  136 + print("<A href=\"javascript:void(setexp('$exp_date'))\">");
  137 + print("<IMG src=\"$Exp_gif\" width=\"13\"
  138 + height=\"13\" border=\"0\" alt=\"$Exp_cnst\"></A>");
  139 +*/
  140 + print("<br>");
  141 +//修正
  142 + if(($month_dat[$r_ind][6]!= "")&&($month_dat[$r_ind][7] != "")
  143 + && ($month_dat[$r_ind][8] != "")){
  144 + print("〜".$month_dat[$r_ind][6]."年");
  145 + print($month_dat[$r_ind][7]."月");
  146 + print($month_dat[$r_ind][8]."日まで");
  147 + print("<BR>");
  148 + }
  149 +
  150 + }
  151 + }
  152 + else
  153 + {
  154 + if (strlen($month_dat[$r_ind][11]) != 0)
  155 + {
  156 + print("<A href ");
  157 + print(" onMouseover=");
  158 + print("\"showTips('tip");
  159 + print($pop_cnt);
  160 + print("');\" onMouseout=\"hideTips('tip");
  161 + print($pop_cnt);
  162 + print("');\">");
  163 + print($month_dat[$r_ind][2]);
  164 + if ($month_dat[$r_ind][9] != ""){
  165 + print("(".$month_dat[$r_ind][9].")");
  166 + }
  167 + print("</A>");
  168 +/*
  169 + print("<A href=\"javascript:void(setexp('$exp_date'))\">");
  170 + print("<IMG src=\"$Exp_gif\" width=\"13\"
  171 + height=\"13\" border=\"0\" alt=\"$Exp_cnst\"></A>");
  172 +*/
  173 + print("<br>");
  174 +//修正
  175 + if(($month_dat[$r_ind][6]!= "")&&($month_dat[$r_ind][7] != "")
  176 + && ($month_dat[$r_ind][8] != "")){
  177 + print("〜".$month_dat[$r_ind][6]."年");
  178 + print($month_dat[$r_ind][7]."月");
  179 + print($month_dat[$r_ind][8]."日まで");
  180 + print("<BR>");
  181 + }
  182 +
  183 + print("<div class=\"tips\" id=\"tip");
  184 + print($pop_cnt);
  185 + print("\">");
  186 + print($month_dat[$r_ind][11]);
  187 + print("</div>");
  188 + $pop_cnt++;
  189 + }
  190 + else
  191 + {
  192 + print($month_dat[$r_ind][2]);
  193 + if ($month_dat[$r_ind][9] != ""){
  194 + print("(".$month_dat[$r_ind][9].")");
  195 + }
  196 +/*
  197 + print("<A href=\"javascript:void(setexp('$exp_date'))\">");
  198 + print("<IMG src=\"$Exp_gif\" width=\"13\"
  199 + height=\"13\" border=\"0\" alt=\"$Exp_cnst\"></A>");
  200 +*/
  201 + print("<br>");
  202 +//修正
  203 + if(($month_dat[$r_ind][6]!= "")&&($month_dat[$r_ind][7] != "")
  204 + && ($month_dat[$r_ind][8] != "")){
  205 + print("〜".$month_dat[$r_ind][6]."年");
  206 + print($month_dat[$r_ind][7]."月");
  207 + print($month_dat[$r_ind][8]."日まで");
  208 + print("<BR>");
  209 + }
  210 +
  211 +
  212 +
  213 + }
  214 + }
  215 + }
  216 + }
  217 +}
  218 +?>
... ...
  1 + function chkdate(years,months,days)
  2 + {
  3 + months = months - 1;
  4 + var dates = new Date(years,months,days);
  5 + if (dates.getYear() < 1900) {
  6 + if (years != dates.getYear() + 1900) {
  7 + return false }
  8 + } else {
  9 + if (years != dates.getYear()) {
  10 + return false}
  11 + }
  12 +
  13 + if (months != dates.getMonth()) {
  14 + return false}
  15 + if (days != dates.getDate()) {
  16 + return false}
  17 + return true;
  18 + }
  19 + function chrlengs(str){
  20 + var name2 ="";
  21 + var name3 ="";
  22 + name2 = str.replace(/ /g,"");
  23 + name3 = name2.replace(/ /g,"");
  24 + return name3
  25 + }
  26 + function addzero(str)
  27 + {
  28 + if (str != 0)
  29 + {
  30 + if (str.length == 1)
  31 + {
  32 + str = "0"+str;
  33 + }
  34 + }
  35 + return str
  36 + }
  37 + function datacheck(){
  38 +
  39 + var fyear= document.event.fyear.value;
  40 + var fmon= document.event.fmon.value;
  41 + var fday= document.event.fday.value;
  42 +// var tyear= document.event.tyear.value;
  43 +// var tmon= document.event.tmon.value;
  44 +// var tday= document.event.tday.value;
  45 +// var jyear= document.event.jyear.value;
  46 +// var jmon= document.event.jmon.value;
  47 +// var jun= document.event.jun.value;
  48 + var name = document.event.eventname.value;
  49 +// var place = document.event.place.value;
  50 + var hpadrs = document.event.hpadrs.value;
  51 + var tipword = document.event.tipword.value;
  52 +/*
  53 + if ((fyear==tyear) && (fmon==tmon) && (fday==tday)){
  54 + tyear="";
  55 + tmon="";
  56 + tday="";
  57 + }
  58 +*/
  59 +
  60 + name = chrlengs(name)
  61 + if (name.length == 0){
  62 + alert("イベント名称を入力して下さい");
  63 + return false}
  64 + if (name.length > 200){
  65 + alert("イベント名称は全角100文字以内で入力して下さい");
  66 + return false}
  67 + //不要なスペースの除去
  68 + fyear = chrlengs(fyear);
  69 + fmon = chrlengs(fmon);
  70 + fday = chrlengs(fday);
  71 +// jyear = chrlengs(jyear);
  72 +// jmon = chrlengs(jmon);
  73 +// jun = chrlengs(jun);
  74 +//一桁月日を二桁にする。
  75 + fmon = addzero(fmon);
  76 + fday = addzero(fday);
  77 +// tmon = addzero(tmon);
  78 +// tday = addzero(tday);
  79 +// jmon = addzero(jmon);
  80 +
  81 +/* if ((fyear+fmon+fday =="") && (jyear+jmon+jun =="")){
  82 + alert("期間を入力して下さい");
  83 + return false}
  84 + if (((fyear != "")||(fmon != "")|| (fday !=""))
  85 + && (jyear+jmon+jun !="")){
  86 + alert("期間1または期間2を選択してください");
  87 + return false}
  88 + if ((tyear+tmon+tday != "")&&(jyear+jmon+jun != "")){
  89 + alert("期間の指定が間違っています");
  90 + return false}
  91 + if (((fyear+fmon+fday != "") && (tyear+tmon+tday != ""))
  92 + && (fyear+fmon+fday > tyear+tmon+tday)){
  93 + alert("期間の入力が間違っています");
  94 + return false}
  95 + if ((fyear+fmon+fday != "") && ((isNaN(fyear))||(isNaN(fmon))||
  96 + (isNaN(fday)))){
  97 + alert("日付は半角数字で入力して下さい");
  98 + return false}
  99 + if ((tyear+tmon+tday != "") &&((isNaN(tyear))||(isNaN(tmon))||
  100 + (isNaN(tday)))){
  101 + alert("日付は半角数字で入力して下さい");
  102 + return false}
  103 + if ((jyear+jmon+jun != "") &&((isNaN(jyear))||(isNaN(jmon)))){
  104 + alert("日付は半角数字で入力して下さい");
  105 + return false}
  106 + if ((fyear+fmon+fday !="")&& (!(chkdate(fyear,fmon,fday)))){
  107 + alert("開始年月日が違います");
  108 + return false}
  109 + if ((tyear+tmon+tday!="") && (!(chkdate(tyear,tmon,tday)))){
  110 + alert("終了日付が間違っています");
  111 + return false}
  112 + if ((jyear+jmon+jun!="") && (jun == "")){
  113 + alert("期間2の指定が間違っています");
  114 + return false}
  115 + if ((jyear+jmon+jun!="") && (!(chkdate(jyear,jmon,1)))){
  116 + alert("期間2の指定が間違っています");
  117 + return false}
  118 +
  119 + if (place.length > 200){
  120 + alert("場所名は全角100文字以内で入力して下さい");
  121 + return false}
  122 +*/
  123 + if (hpadrs.length > 500){
  124 + alert("ホームページアドレスは半角500文字以内です");
  125 + return false}
  126 + if (tipword.length > 3000){
  127 + alert("吹き出しメッセージが長過ぎます");
  128 + return false}
  129 + if(!(confirm ("登録しますか?"))){
  130 + return false}
  131 + }
\ No newline at end of file
... ...
  1 +function chrlengs(str){
  2 + var name2 ="";
  3 + var name3 ="";
  4 + name2 = str.replace(/ /g,"");
  5 + name3 = name2.replace(/ /g,"");
  6 + return name3
  7 + }
  8 + function datacheck(){
  9 + var name=document.expw.yourname.value;
  10 + var msg=document.expw.msg.value;
  11 + name= chrlengs(name);
  12 + if (name.length == 0)
  13 + {
  14 + alert("お名前を入力して下さい");
  15 + return false}
  16 + if (name.length > 200)
  17 + {
  18 + alert("名前は全角100文字以内で入力して下さい");
  19 + return false}
  20 +
  21 + msg= chrlengs(msg);
  22 + if (msg.length == 0)
  23 + {
  24 + alert("メッセージを入力して下さい");
  25 + return false}
  26 + if (msg.length > 200)
  27 + {
  28 + alert("メッセージは全角1800文字以内で入力して下さい");
  29 + return false}
  30 + if(!(confirm ("登録しますか?"))){
  31 + return false}
  32 + }
\ No newline at end of file
... ...
  1 +<script language="javascript" type="text/javascript">
  2 +<!--
  3 +
  4 +function sf(){document.f.q.focus();}
  5 +
  6 +// -->
  7 +</script>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +function fun_holiday($year,$month,$day)
  3 +{
  4 + $ans = "false";
  5 + $ddir = "data/day/";
  6 + $Filename = $ddir."holiday.dat";
  7 + $fp =@fopen($Filename,"r");
  8 + $today = $year.fun_addzero($month).fun_addzero($day);
  9 + while($buf=fgets($fp,9))
  10 + {
  11 + if ($buf == $today)
  12 +
  13 + {
  14 + $ans = "true";
  15 + }
  16 + }
  17 + return $ans;
  18 +}
  19 +?>
\ No newline at end of file
... ...
  1 +<?PHP
  2 + // 二桁数字の先頭に0を付加する関数
  3 + function fun_addzero($str)
  4 + {
  5 + if ($str != 0)
  6 + {
  7 + if (strlen($str) == 1)
  8 + {
  9 + $str = "0".$str;
  10 + }
  11 + }
  12 + return $str;
  13 + }
  14 + //キーを分割する関数
  15 + function fun_keysep($key)
  16 + {
  17 + $key_year = substr($key,0,4);
  18 + $key_mon = substr($key,0,2);
  19 + $key_day = substr($key,0,2);
  20 + }
  21 +?>
... ...
  1 +<?PHP
  2 + function fun_csvread($month_dat,$file_name)
  3 + {
  4 +
  5 + global $tbl_cnt;
  6 + $fp = fopen ("$file_name","r");
  7 +//CSVファイルの読み込み
  8 + while ($data = fgetcsv ($fp, 4096)) {
  9 +//配列要素の数を変数に格納!!
  10 + $num = count ($data);
  11 + $tbl_cnt++;
  12 + for ($c=0; $c<$num; $c++) {
  13 + $month_dat[$tbl_cnt][$c]=$data[$c] ;
  14 + }
  15 + }
  16 + fclose ($fp);
  17 +//戻り値として、設定$dはテーブルの数
  18 + return $month_dat;
  19 +}
  20 +?>
  21 +<?PHP
  22 +function userchk($usr_tbl,$usr_name,$usr_pword,$tbl_cnt)
  23 +{
  24 + for($u_idx=1; $u_idx<=$tbl_cnt;$u_idx++)
  25 + {
  26 + if ($usr_tbl[$u_idx][0]==$usr_name)
  27 + {
  28 + if ($usr_tbl[$u_idx][1]==$usr_pword)
  29 + {
  30 + $found = 1;
  31 + break;
  32 + }
  33 + else
  34 + {
  35 + $found = 2;
  36 + break;
  37 + }
  38 + }
  39 + elseif ($usr_name == "guest")
  40 + {
  41 + if ($usr_pword == "guest")
  42 + {
  43 + $found=4;
  44 + break;
  45 + }
  46 + else
  47 + {
  48 + $found=3;
  49 + }
  50 + }
  51 + else{
  52 + $found=3;
  53 +
  54 + }
  55 + }
  56 + return $found;
  57 +}
  58 +?>
  59 +<?PHP
  60 +function fun_errprint($err_msg,$hiduke){
  61 + print("<html><head><script language=JavaScript>\n");
  62 + print("<!--\n");
  63 + print("function send(){document.modoru.submit();}\n");
  64 + print("-->\n");
  65 + print("</script></head>");
  66 + print("<body onLoad=\"window.alert('$err_msg');\">");
  67 + print("<FORM name=\"modoru\" method=\"post\"");
  68 + print(" action=\"userchk1.php\">");
  69 + print("<INPUT type=\"hidden\" name=\"hi\" value= $hiduke>");
  70 + print("</FORM><A href=\"#\" onclick=\"send()\">戻る</A>");
  71 + print("<br><a href= main_menu.php>【ホーム】</a></body></html>");
  72 +}
  73 +?>
\ No newline at end of file
... ...
  1 +<?PHP
  2 + // タグ無効化等の処理をする関数
  3 + function convstr($str)
  4 + {
  5 + // タグを取り除く
  6 + $str = htmlspecialchars($str);
  7 + // 不要な「\」を取り除く
  8 + $str = stripslashes($str);
  9 + // 文字列内のコンマを全角に変換する
  10 + $str = ereg_replace(",", ",", $str);
  11 + // 文字列内の改行を<BR>タグに変換する
  12 + $str = ereg_replace("\r|\n|\r\n", "<BR>", $str);
  13 + //文字列の全角スペースを半角に変更
  14 + $str = ereg_replace(" ", " ",$str);
  15 + //空白を取り除く
  16 + $str =chop($str);
  17 + return $str;
  18 + }
  19 + function chgbr($str){
  20 +// 文字列内の改行を<BR>タグに変換する
  21 + $str = ereg_replace("<BR>","\n", $str);
  22 + return $str;
  23 + }
  24 + function mycmp($p1,$p2)
  25 + {
  26 + if ($p1[0] == $p2[0]) return 0;
  27 + return ($p1[0] < $p2[0]) ? -1 :1;
  28 + }
  29 + function idxsort($p1,$p2)
  30 + {
  31 + if ($p1[1] == $p2[1]) return 0;
  32 + return ($p1[1] < $p2[1]) ? -1 :1;
  33 + }
  34 + function expsort($p1,$p2)
  35 + {
  36 + if ($p1[2] == $p2[2]) return 0;
  37 + return ($p1[2] > $p2[2]) ? -1 :1;
  38 + }
  39 +
  40 + function fun_backhome($data)
  41 + {
  42 + if (!isset($data)){
  43 + $home_c ="main_menu.php";
  44 + print("<html><body>このページは直接開くことが出来ません<br>
  45 + <a href= \"$home_c\">【戻る】</a></body</html>");
  46 + exit;
  47 + }
  48 + }
  49 +
  50 +?>
\ No newline at end of file
... ...
  1 +<?PHP
  2 + function fun_writetbl($buf,$cnt,$fp)
  3 + {
  4 + $tbl_lengs = 0;
  5 + rewind($fp);
  6 +//テーブルの内容をカンマ区切りの文字列としてファイルに展開
  7 + for ($i = 0; $i < $cnt; $i++)
  8 + {
  9 + if ($buf[$i] != "")
  10 + {
  11 + $tbl_save = join(",",$buf[$i]);
  12 + $tbl_write = $tbl_save."\n";
  13 + $tbl_lengs = strlen($tbl_write);
  14 + $lengs_cnt = $lengs_cnt + $tbl_lengs;
  15 + fputs($fp, $tbl_write);
  16 + }
  17 + }
  18 + ftruncate($fp,$lengs_cnt);
  19 + return $fp;
  20 + }
  21 + function fun_eveidx($buf,$cnt,$keyymd)
  22 + {
  23 + $m_idx = 0;
  24 + $exp_cnt = 0;
  25 + //同一日付で登録があるかを判定し最終のインデックス+1でレコード内容を設定
  26 + while($m_idx < $cnt)
  27 + {
  28 + list($mst_ymd,$mst_idx,$mstname,$mfyear,$mfmon,$mfday,$mtyear,$mtmon,
  29 + $mtday,$m_place,$mhpadr,$mmsg)=$buf[$m_idx];
  30 + if ($mst_ymd==$keyymd)
  31 + {
  32 + if ($exp_cnt <= $mst_idx)
  33 + {
  34 + $exp_cnt = $mst_idx;
  35 + }
  36 + }
  37 + $m_idx++;
  38 + }
  39 + $exp_cnt++;
  40 + return $exp_cnt;
  41 + }
  42 + function fun_expidx($buf,$cnt,$keyymd,$keyidx)
  43 + {
  44 +//同一日付で登録があるかを判定し最終のインデックス+1でレコード内容を設定
  45 + $m_idx = 0;
  46 + $exp_cnt = 0;
  47 + while($m_idx < $cnt)
  48 + {
  49 + list($mst_ymd,$mst_idx,$mst_exp,$mstname,$m_rank,$mmsg,$m_time,$m_day)
  50 + =$buf[$m_idx];
  51 + if (($mst_ymd==$keyymd) && ($mst_idx==$keyidx))
  52 + {
  53 + if ($exp_cnt <= $mst_exp)
  54 + {
  55 + $exp_cnt = $mst_exp;
  56 + }
  57 + }
  58 + $m_idx++;
  59 + }
  60 + $exp_cnt++;
  61 + return $exp_cnt;
  62 + }
  63 +?>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +
  3 +function fun_maketbl($i,$rank){
  4 + switch ($i){
  5 + case 1:
  6 + print("<center>");
  7 + print("<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width='700' bgcolor=\"#ccffcc\">\n");
  8 + print("<tr><td>\n");
  9 + print("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width='700' bgcolor=\"white\">\n");
  10 + print("<tr><td>\n");
  11 + print("<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" width=\"700\" bgcolor=\"white\">\n");
  12 + print("<tr><td>\n");
  13 + print("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bgcolor=\"white\">\n");
  14 + print("<tr><td>\n");
  15 + print("<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"700\">\n");
  16 + print("<TR height=\"10\">\n");
  17 + print("<td width=\"10\" height=\"10\"></td>\n");
  18 + print("<td height=\"10\"></td><td width=\"10\" height=\"10\"></td>\n");
  19 + print("</TR><tr><td width=\"10\"></td><td>\n");
  20 + print("<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\" width=\"100%\">\n");
  21 + print("<tr><td bgcolor=\"#00cc66\"><font size=\"2\" color=\"#ffffcc\">\n");
  22 + print("<b>$rank</b></font>\n");
  23 + print("</td></tr><tr><td>\n");
  24 + break;
  25 + case 2:
  26 + print("</td></tr></table></td><td width=\"10\"></td></tr></table></td>\n");
  27 + print("</tr></table></td></tr></table><hr noshade size=1></td></tr>\n");
  28 + print("</table></td></tr></table>\n");
  29 + print("</center>");
  30 + break;
  31 + }
  32 +}
  33 +
  34 +?>
  35 +<?PHP
  36 +
  37 +function fun_makeline($i,$color1,$color2){
  38 + // 外枠のテーブル作成(枠線の色部)
  39 + switch($i){
  40 + case 1:
  41 + print("<TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"2\" width=\"600\" bgcolor=\"#ccffcc\">");
  42 + print("<TBODY><TR><TD>");
  43 + print("<TABLE border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" bgcolor=\"white\">");
  44 + print("<TBODY><TR><TD>");
  45 + break;
  46 + case 2:
  47 + print("</TD></TR></TBODY></TABLE>\n");
  48 + print("</TD></TR></TBODY></TABLE>\n");
  49 + break;
  50 + }
  51 +}
  52 +?>
... ...
No preview for this file type
  1 +<?PHP
  2 +$CONST_GROUP_NAME = "CAPCHANNEL";
  3 +
  4 +?>
\ No newline at end of file
... ...
  1 +<script type="text/javascript"><!--
  2 +google_ad_client = "pub-2421737663324361";
  3 +google_ad_width = 728;
  4 +google_ad_height = 90;
  5 +google_ad_format = "728x90_as";
  6 +google_ad_type = "text_image";
  7 +google_ad_channel ="";
  8 +//--></script>
  9 +<script type="text/javascript"
  10 + src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
  11 +</script>
\ No newline at end of file
... ...
  1 +<form method="get" action="http://www.google.co.jp/custom" target="google_window" name="f">
  2 +<table id="google">
  3 +<tr><td nowrap="nowrap" valign="top" align="left" height="32">
  4 +<a href="http://www.google.com/">
  5 +<img src="http://www.google.com/logos/Logo_25wht.gif" border="0" alt="Google" align="middle"></img></a>
  6 +<input type="text" name="q" size="31" maxlength="255" value=""></input>
  7 +<input type="submit" name="sa" value="ŒŸõ"></input>
  8 +<input type="hidden" name="client" value="pub-2421737663324361"></input>
  9 +<input type="hidden" name="forid" value="1"></input>
  10 +<input type="hidden" name="ie" value="Shift_JIS"></input>
  11 +<input type="hidden" name="oe" value="Shift_JIS"></input>
  12 +<input type="hidden" name="cof" value="GALT:#008000;GL:1;DIV:#336699;VLC:663399;AH:center;BGC:FFFFFF;LBGC:336699;ALC:0000FF;LC:0000FF;T:000000;GFNT:0000FF;GIMP:0000FF;FORID:1;"></input>
  13 +<input type="hidden" name="hl" value="ja"></input>
  14 +</td></tr></table>
  15 +</form>
\ No newline at end of file
... ...
  1 +<?PHP
  2 +/*************************************************************************
  3 + ________________________________
  4 +
  5 + jcode.phps by TOMO
  6 + ________________________________
  7 +
  8 +
  9 + [Version] : 1.34 (2002/10/10)
  10 + [URL] : http://www.spencernetwork.org/
  11 + [E-MAIL] : groove@spencernetwork.org
  12 + [Changes] :
  13 + v1.30 Changed XXXtoUTF8 and UTF8toXXX with conversion tables.
  14 + v1.31 Deleted a useless and harmful line in JIStoUTF8() (^^;
  15 + v1.32 Fixed miss type of jsubstr().
  16 + Fixed HANtoZEN_EUC(), HANtoZEN_SJIS() and HANtoZEN_JIS().
  17 + v1.33 Fixed JIStoXXX(), HANtoZEN_JIS() and ZENtoHAN_JIS().
  18 + Added jstr_split() as O-MA-KE No.4.
  19 + Added jstrcut() as O-MA-KE No.5.
  20 + Changed the logic of AutoDetect()
  21 + v1.34 Fixed ZENtoHAN_SJIS()
  22 +
  23 + * jcode.phps is free but without any warranty.
  24 + * use this script at your own risk.
  25 +
  26 +***************************************************************************/
  27 +
  28 +function JcodeConvert(&$str, $from, $to)
  29 +{
  30 + //0:AUTO DETECT
  31 + //1:EUC-JP
  32 + //2:Shift_JIS
  33 + //3:ISO-2022-JP(JIS)
  34 + //4:UTF-8
  35 +
  36 + if ($from == 0) $from = AutoDetect($str);
  37 +
  38 + if ($from == 1 && $to == 2) return EUCtoSJIS($str);
  39 + if ($from == 1 && $to == 3) return EUCtoJIS($str);
  40 + if ($from == 1 && $to == 4) return EUCtoUTF8($str);
  41 + if ($from == 2 && $to == 1) return SJIStoEUC($str);
  42 + if ($from == 2 && $to == 3) return SJIStoJIS($str);
  43 + if ($from == 2 && $to == 4) return SJIStoUTF8($str);
  44 + if ($from == 3 && $to == 1) return JIStoEUC($str);
  45 + if ($from == 3 && $to == 2) return JIStoSJIS($str);
  46 + if ($from == 3 && $to == 4) return JIStoUTF8($str);
  47 + if ($from == 4 && $to == 1) return UTF8toEUC($str);
  48 + if ($from == 4 && $to == 2) return UTF8toSJIS($str);
  49 + if ($from == 4 && $to == 3) return UTF8toJIS($str);
  50 +
  51 + return $str;
  52 +}
  53 +
  54 +function AutoDetect(&$str)
  55 +{
  56 + //0:US-ASCII
  57 + //1:EUC-JP
  58 + //2:Shift_JIS
  59 + //3:ISO-2022-JP(JIS)
  60 + //4:UTF-8
  61 + //5:Unknown
  62 +
  63 + if (!ereg("[\x80-\xFF]", $str)) {
  64 + // --- Check ISO-2022-JP ---
  65 + if (ereg("\x1B", $str)) return 3; // ISO-2022-JP(JIS)
  66 + return 0; //US-ASCII
  67 + }
  68 +
  69 + $b = unpack('C*', ereg_replace("^[^\x80-\xFF]+", "", $str));
  70 + $n = count($b);
  71 +
  72 + // --- Check EUC-JP ---
  73 + $euc = TRUE;
  74 + for ($i = 1; $i <= $n; ++$i){
  75 + if ($b[$i] < 0x80) {
  76 + continue;
  77 + }
  78 + if ($b[$i] < 0x8E) {
  79 + $euc = FALSE; break;
  80 + }
  81 + if ($b[$i] == 0x8E) {
  82 + if (!isset($b[++$i])) {
  83 + $euc = FALSE; break;
  84 + }
  85 + if (($b[$i] < 0xA1) || (0xDF < $b[$i])) {
  86 + $euc = FALSE; break;
  87 + }
  88 + } elseif ((0xA1 <= $b[$i]) && ($b[$i] <= 0xFE)) {
  89 + if (!isset($b[++$i])) {
  90 + $euc = FALSE; break;
  91 + }
  92 + if (($b[$i] < 0xA1) || (0xFE < $b[$i])) {
  93 + $euc = FALSE; break;
  94 + }
  95 + } else {
  96 + $euc = FALSE; break;
  97 + }
  98 + }
  99 + if ($euc) return 1; // EUC-JP
  100 +
  101 + // --- Check UTF-8 ---
  102 + $utf8 = TRUE;
  103 + for ($i = 1; $i <= $n; ++$i) {
  104 + if (($b[$i] < 0x80)) {
  105 + continue;
  106 + }
  107 + if ((0xC0 <= $b[$i]) && ($b[$i] <=0xDF)) {
  108 + if (!isset($b[++$i])) {
  109 + $utf8 = FALSE; break;
  110 + }
  111 + if (($b[$i] < 0x80) || (0xEF < $b[$i])) {
  112 + $utf8 = FALSE; break;
  113 + }
  114 + } elseif ((0xE0 <= $b[$i]) && ($b[$i] <= 0xEF)) {
  115 + if (!isset($b[++$i])) {
  116 + $utf8 = FALSE; break;
  117 + }
  118 + if (($b[$i] < 0x80) || (0xBF < $b[$i])) {
  119 + $utf8 = FALSE; break;
  120 + }
  121 + if (!isset($b[++$i])) {
  122 + $utf8 = FALSE; break;
  123 + }
  124 + if (($b[$i] < 0x80) || (0xBF < $b[$i])) {
  125 + $utf8 = FALSE; break;
  126 + }
  127 + } else {
  128 + $utf8 = FALSE; break;
  129 + }
  130 + }
  131 + if ($utf8) return 4; // UTF-8
  132 +
  133 + // --- Check Shift_JIS ---
  134 + $sjis = TRUE;
  135 + for ($i = 1; $i <= $n; ++$i) {
  136 + if (($b[$i] <= 0x80) || (0xA1 <= $b[$i] && $b[$i] <= 0xDF)) {
  137 + continue;
  138 + }
  139 + if (($b[$i] == 0xA0) || ($b[$i] > 0xEF)) {
  140 + $sjis = FALSE; break;
  141 + }
  142 + if (!isset($b[++$i])) {
  143 + $sjis = FALSE; break;
  144 + }
  145 + if (($b[$i] < 0x40) || ($b[$i] == 0x7F) || ($b[$i] > 0xFC)){
  146 + $sjis = FALSE; break;
  147 + }
  148 + }
  149 + if ($sjis) return 2; // Shift_JIS
  150 +
  151 + return 5; // Unknown
  152 +}
  153 +
  154 +function HANtoZEN(&$str, $encode)
  155 +{
  156 + //0:PASS
  157 + //1:EUC-JP
  158 + //2:Shift_JIS
  159 + //3:ISO-2022-JP(JIS)
  160 + //4:UTF-8
  161 +
  162 + if ($encode == 0) return $str;
  163 + if ($encode == 1) return HANtoZEN_EUC($str);
  164 + if ($encode == 2) return HANtoZEN_SJIS($str);
  165 + if ($encode == 3) return HANtoZEN_JIS($str);
  166 + if ($encode == 4) return HANtoZEN_UTF8($str);
  167 +
  168 + return $str;
  169 +}
  170 +
  171 +function ZENtoHAN(&$str, $encode, $kana=1, $alph=1)
  172 +{
  173 + //0:PASS
  174 + //1:EUC-JP
  175 + //2:Shift_JIS
  176 + //3:ISO-2022-JP(JIS)
  177 +
  178 + if ($encode == 0) return $str;
  179 + if ($encode == 1) return ZENtoHAN_EUC($str, $kana, $alph, $kana);
  180 + if ($encode == 2) return ZENtoHAN_SJIS($str, $kana, $alph, $kana);
  181 + if ($encode == 3) return ZENtoHAN_JIS($str, $kana, $alph, $kana);
  182 +
  183 + return $str;
  184 +}
  185 +
  186 +function JIStoSJIS(&$str_JIS)
  187 +{
  188 + $str_SJIS = '';
  189 + $mode = 0;
  190 + $b = unpack('C*', $str_JIS);
  191 + $n = count($b);
  192 +
  193 + for ($i = 1; $i <= $n; ++$i) {
  194 +
  195 + //Check escape sequence
  196 + while ($b[$i] == 0x1B) {
  197 + if (($b[$i+1] == 0x24 && $b[$i+2] == 0x42)
  198 + || ($b[$i+1] == 0x24 && $b[$i+2] == 0x40)) {
  199 + $mode = 1;
  200 + } elseif (($b[$i+1] == 0x28 && $b[$i+2] == 0x49)) {
  201 + $mode = 2;
  202 + } else {
  203 + $mode = 0;
  204 + }
  205 + $i += 3;
  206 + if (!isset($b[$i])) break 2;
  207 + }
  208 +
  209 + //Do convert
  210 + if ($mode == 1) {
  211 + $b1 = $b[$i];
  212 + $b2 = $b[++$i];
  213 + if ($b1 & 0x01) {
  214 + $b1 >>= 1;
  215 + if ($b1 < 0x2F) $b1 += 0x71; else $b1 -= 0x4F;
  216 + if ($b2 > 0x5F) $b2 += 0x20; else $b2 += 0x1F;
  217 + } else {
  218 + $b1 >>= 1;
  219 + if ($b1 <= 0x2F) $b1 += 0x70; else $b1 -= 0x50;
  220 + $b2 += 0x7E;
  221 + }
  222 + $str_SJIS .= chr($b1).chr($b2);
  223 + } elseif ($mode == 2) {
  224 + $str_SJIS .= chr($b[$i] + 0x80);
  225 + } else {
  226 + $str_SJIS .= chr($b[$i]);
  227 + }
  228 + }
  229 +
  230 + return $str_SJIS;
  231 +}
  232 +
  233 +function JIStoEUC(&$str_JIS)
  234 +{
  235 + $str_EUC = '';
  236 + $mode = 0;
  237 + $b = unpack('C*', $str_JIS);
  238 + $n = count($b);
  239 +
  240 + for ($i = 1; $i <= $n; ++$i) {
  241 +
  242 + //Check escape sequence
  243 + while ($b[$i] == 0x1B) {
  244 + if (($b[$i+1] == 0x24 && $b[$i+2] == 0x42)
  245 + || ($b[$i+1] == 0x24 && $b[$i+2] == 0x40)) {
  246 + $mode = 1;
  247 + } elseif (($b[$i+1] == 0x28 && $b[$i+2] == 0x49)) {
  248 + $mode = 2;
  249 + } else {
  250 + $mode = 0;
  251 + }
  252 + $i += 3;
  253 + if (!isset($b[$i])) break 2;
  254 + }
  255 +
  256 + //Do convert
  257 + if ($mode == 1) {
  258 + $str_EUC .= chr($b[$i] + 0x80).chr($b[++$i] + 0x80);
  259 + } elseif ($mode == 2) {
  260 + $str_EUC .= chr(0x8E).chr($b[$i] + 0x80);
  261 + } else {
  262 + $str_EUC .= chr($b[$i]);
  263 + }
  264 + }
  265 +
  266 + return $str_EUC;
  267 +}
  268 +
  269 +function SJIStoJIS(&$str_SJIS)
  270 +{
  271 + $str_JIS = '';
  272 + $mode = 0;
  273 + $b = unpack('C*', $str_SJIS);
  274 + $n = count($b);
  275 +
  276 + //Escape sequence
  277 + $ESC = array(chr(0x1B).chr(0x28).chr(0x42),
  278 + chr(0x1B).chr(0x24).chr(0x42),
  279 + chr(0x1B).chr(0x28).chr(0x49));
  280 +
  281 + for ($i = 1; $i <= $n; ++$i) {
  282 + $b1 = $b[$i];
  283 + if (0xA1 <= $b1 && $b1 <= 0xDF) {
  284 + if ($mode != 2) {
  285 + $mode = 2;
  286 + $str_JIS .= $ESC[$mode];
  287 + }
  288 + $str_JIS .= chr($b1 - 0x80);
  289 + } elseif ($b1 >= 0x80) {
  290 + if ($mode != 1) {
  291 + $mode = 1;
  292 + $str_JIS .= $ESC[$mode];
  293 + }
  294 + $b2 = $b[++$i];
  295 + $b1 <<= 1;
  296 + if ($b2 < 0x9F) {
  297 + if ($b1 < 0x13F) $b1 -= 0xE1; else $b1 -= 0x61;
  298 + if ($b2 > 0x7E) $b2 -= 0x20; else $b2 -= 0x1F;
  299 + } else {
  300 + if ($b1 < 0x13F) $b1 -= 0xE0; else $b1 -= 0x60;
  301 + $b2 -= 0x7E;
  302 + }
  303 + $str_JIS .= chr($b1).chr($b2);
  304 + } else {
  305 + if ($mode != 0) {
  306 + $mode = 0;
  307 + $str_JIS .= $ESC[$mode];
  308 + }
  309 + $str_JIS .= chr($b1);
  310 + }
  311 + }
  312 + if ($mode != 0) $str_JIS .= $ESC[0];
  313 +
  314 + return $str_JIS;
  315 +}
  316 +
  317 +function SJIStoEUC(&$str_SJIS)
  318 +{
  319 + $b = unpack('C*', $str_SJIS);
  320 + $n = count($b);
  321 + $str_EUC = '';
  322 +
  323 + for ($i = 1; $i <= $n; ++$i) {
  324 + $b1 = $b[$i];
  325 + if (0xA1 <= $b1 && $b1 <= 0xDF) {
  326 + $str_EUC .= chr(0x8E).chr($b1);
  327 + } elseif ($b1 >= 0x81) {
  328 + $b2 = $b[++$i];
  329 + $b1 <<= 1;
  330 + if ($b2 < 0x9F) {
  331 + if ($b1 < 0x13F) $b1 -= 0x61; else $b1 -= 0xE1;
  332 + if ($b2 > 0x7E) $b2 += 0x60; else $b2 += 0x61;
  333 + } else {
  334 + if ($b1 < 0x13F) $b1 -= 0x60; else $b1 -= 0xE0;
  335 + $b2 += 0x02;
  336 + }
  337 + $str_EUC .= chr($b1).chr($b2);
  338 + } else {
  339 + $str_EUC .= chr($b1);
  340 + }
  341 + }
  342 +
  343 + return $str_EUC;
  344 +}
  345 +
  346 +function EUCtoJIS(&$str_EUC)
  347 +{
  348 + $str_JIS = '';
  349 + $mode = 0;
  350 + $b = unpack('C*', $str_EUC);
  351 + $n = count($b);
  352 +
  353 + //Escape sequence
  354 + $ESC = array(chr(0x1B).chr(0x28).chr(0x42),
  355 + chr(0x1B).chr(0x24).chr(0x42),
  356 + chr(0x1B).chr(0x28).chr(0x49));
  357 +
  358 + for ($i = 1; $i <= $n; ++$i) {
  359 + $b1 = $b[$i];
  360 + if ($b1 == 0x8E) {
  361 + if ($mode != 2) {
  362 + $mode = 2;
  363 + $str_JIS .= $ESC[$mode];
  364 + }
  365 + $str_JIS .= chr($b[++$i] - 0x80);
  366 + } elseif ($b1 > 0x8E) {
  367 + if ($mode != 1) {
  368 + $mode = 1;
  369 + $str_JIS .= $ESC[$mode];
  370 + }
  371 + $str_JIS .= chr($b1 - 0x80).chr($b[++$i] - 0x80);
  372 + } else {
  373 + if ($mode != 0) {
  374 + $mode = 0;
  375 + $str_JIS .= $ESC[$mode];
  376 + }
  377 + $str_JIS .= chr($b1);
  378 + }
  379 + }
  380 + if ($mode != 0) $str_JIS .= $ESC[0];
  381 +
  382 + return $str_JIS;
  383 +}
  384 +
  385 +function EUCtoSJIS(&$str_EUC)
  386 +{
  387 + $str_SJIS = '';
  388 + $b = unpack('C*', $str_EUC);
  389 + $n = count($b);
  390 +
  391 + for ($i = 1; $i <= $n; ++$i) {
  392 + $b1 = $b[$i];
  393 + if ($b1 > 0x8E) {
  394 + $b2 = $b[++$i];
  395 + if ($b1 & 0x01) {
  396 + $b1 >>= 1;
  397 + if ($b1 < 0x6F) $b1 += 0x31; else $b1 += 0x71;
  398 + if ($b2 > 0xDF) $b2 -= 0x60; else $b2 -= 0x61;
  399 + } else {
  400 + $b1 >>= 1;
  401 + if ($b1 <= 0x6F) $b1 += 0x30; else $b1 += 0x70;
  402 + $b2 -= 0x02;
  403 + }
  404 + $str_SJIS .= chr($b1).chr($b2);
  405 + } elseif ($b1 == 0x8E) {
  406 + $str_SJIS .= chr($b[++$i]);
  407 + } else {
  408 + $str_SJIS .= chr($b1);
  409 + }
  410 + }
  411 +
  412 + return $str_SJIS;
  413 +}
  414 +
  415 +function SJIStoUTF8(&$str_SJIS)
  416 +{
  417 + global $table_jis_utf8;
  418 +
  419 + $str_UTF8 = '';
  420 + $b = unpack('C*', $str_SJIS);
  421 + $n = count($b);
  422 +
  423 + for ($i = 1; $i <= $n; ++$i) {
  424 + if (0xA1 <= $b[$i] && $b[$i] <= 0xDF) { //Hankaku
  425 + $b2 = $b[$i] - 0x40;
  426 + $u2 = 0xBC | (($b2 >> 6) & 0x03);
  427 + $u3 = 0x80 | ($b2 & 0x3F);
  428 + $str_UTF8 .= chr(0xEF).chr($u2).chr($u3);
  429 + } elseif ($b[$i] >= 0x80) { //Zenkaku
  430 + $b1 = $b[$i] << 1;
  431 + $b2 = $b[++$i];
  432 + if ($b2 < 0x9F) {
  433 + if ($b1 < 0x13F) $b1 -= 0xE1; else $b1 -= 0x61;
  434 + if ($b2 > 0x7E) $b2 -= 0x20; else $b2 -= 0x1F;
  435 + } else {
  436 + if ($b1 < 0x13F) $b1 -= 0xE0; else $b1 -= 0x60;
  437 + $b2 -= 0x7E;
  438 + }
  439 + $b1 &= 0xFF;
  440 + $jis = ($b1 << 8) + $b2;
  441 + if (isset($table_jis_utf8[$jis])) {
  442 + $utf8 = $table_jis_utf8[$jis];
  443 + if ($utf8 < 0xFFFF) {
  444 + $str_UTF8 .= chr($utf8 >> 8).chr($utf8);
  445 + } else {
  446 + $str_UTF8 .= chr($utf8 >> 16).chr($utf8 >> 8).chr($utf8);
  447 + }
  448 + } else {
  449 + $str_UTF8 .= '?'; //Unknown
  450 + }
  451 + } else { //ASCII
  452 + $str_UTF8 .= chr($b[$i]);
  453 + }
  454 + }
  455 +
  456 + return $str_UTF8;
  457 +}
  458 +
  459 +function EUCtoUTF8(&$str_EUC)
  460 +{
  461 + global $table_jis_utf8;
  462 +
  463 + $str_UTF8 = '';
  464 + $b = unpack('C*', $str_EUC);
  465 + $n = count($b);
  466 +
  467 + for ($i = 1; $i <= $n; ++$i) {
  468 + if ($b[$i] == 0x8E) { //Hankaku
  469 + $b2 = $b[++$i] - 0x40;
  470 + $u2 = 0xBC | (($b2 >> 6) & 0x03);
  471 + $u3 = 0x80 | ($b2 & 0x3F);
  472 + $str_UTF8 .= chr(0xEF).chr($u2).chr($u3);
  473 + } elseif ($b[$i] >= 0x80) { //Zenkaku
  474 + $jis = (($b[$i] - 0x80) << 8) + ($b[++$i] - 0x80);
  475 + if (isset($table_jis_utf8[$jis])) {
  476 + $utf8 = $table_jis_utf8[$jis];
  477 + if ($utf8 < 0xFFFF) {
  478 + $str_UTF8 .= chr($utf8 >> 8).chr($utf8);
  479 + } else {
  480 + $str_UTF8 .= chr($utf8 >> 16).chr($utf8 >> 8).chr($utf8);
  481 + }
  482 + } else { //Unknown
  483 + $str_UTF8 .= '?';
  484 + }
  485 + } else { //ASCII
  486 + $str_UTF8 .= chr($b[$i]);
  487 + }
  488 + }
  489 +
  490 + return $str_UTF8;
  491 +}
  492 +
  493 +function JIStoUTF8(&$str_JIS)
  494 +{
  495 + global $table_jis_utf8;
  496 +
  497 + $str_UTF8 = '';
  498 + $mode = 0;
  499 + $b = unpack('C*', $str_JIS);
  500 + $n = count($b);
  501 +
  502 + for ($i = 1; $i <= $n; ++$i) {
  503 +
  504 + //Check escape sequence
  505 + while ($b[$i] == 0x1B) {
  506 + if (($b[$i+1] == 0x24 && $b[$i+2] == 0x42)
  507 + || ($b[$i+1] == 0x24 && $b[$i+2] == 0x40)) {
  508 + $mode = 1;
  509 + } elseif ($b[$i+1] == 0x28 && $b[$i+2] == 0x49) {
  510 + $mode = 2;
  511 + } else {
  512 + $mode = 0;
  513 + }
  514 + $i += 3;
  515 + if (!isset($b[$i])) break 2;
  516 + }
  517 +
  518 + if ($mode == 1) { //Zenkaku
  519 + $jis = ($b[$i] << 8) + $b[++$i];
  520 + if (isset($table_jis_utf8[$jis])) {
  521 + $utf8 = $table_jis_utf8[$jis];
  522 + if ($utf8 < 0xFFFF) {
  523 + $str_UTF8 .= chr($utf8 >> 8).chr($utf8);
  524 + } else {
  525 + $str_UTF8 .= chr($utf8 >> 16).chr($utf8 >> 8).chr($utf8);
  526 + }
  527 + } else { //Unknown
  528 + $str_UTF8 .= '?';
  529 + }
  530 + } elseif ($mode == 2) { //Hankaku
  531 + $b2 = $b[$i] + 0x40;
  532 + $u2 = 0xBC | (($b2 >> 6) & 0x03);
  533 + $u3 = 0x80 | ($b2 & 0x3F);
  534 + $str_UTF8 .= chr(0xEF).chr($u2).chr($u3);
  535 + } else { //ASCII
  536 + $str_UTF8 .= chr($b[$i]);
  537 + }
  538 + }
  539 +
  540 + return $str_UTF8;
  541 +}
  542 +
  543 +function UTF8toSJIS(&$str_UTF8)
  544 +{
  545 + global $table_utf8_jis;
  546 +
  547 + $str_SJIS = '';
  548 + $b = unpack('C*', $str_UTF8);
  549 + $n = count($b);
  550 +
  551 + for ($i = 1; $i <= $n; ++$i) {
  552 + if ($b[$i] >= 0x80) { //Not ASCII
  553 + if ($b[$i] <= 0xDF) { //2 Bytes
  554 + $utf8 = ($b[$i] << 8) + $b[++$i];
  555 + } else { //3 Bytes
  556 + $utf8 = ($b[$i] << 16) + ($b[++$i] << 8) + $b[++$i];
  557 + }
  558 + if (isset($table_utf8_jis[$utf8])) {
  559 + $jis = $table_utf8_jis[$utf8];
  560 + if ($jis < 0xFF) { //Hankaku
  561 + $str_SJIS .= chr($jis + 0x80);
  562 + } else { //Zenkaku
  563 + $b1 = $jis >> 8;
  564 + $b2 = $jis & 0xFF;
  565 + if ($b1 & 0x01) {
  566 + $b1 >>= 1;
  567 + if ($b1 < 0x2F) $b1 += 0x71; else $b1 -= 0x4F;
  568 + if ($b2 > 0x5F) $b2 += 0x20; else $b2 += 0x1F;
  569 + } else {
  570 + $b1 >>= 1;
  571 + if ($b1 <= 0x2F) $b1 += 0x70; else $b1 -= 0x50;
  572 + $b2 += 0x7E;
  573 + }
  574 + $str_SJIS .= chr($b1).chr($b2);
  575 + }
  576 + } else { //Unknown
  577 + $str_SJIS .= '?';
  578 + }
  579 + } else { //ASCII
  580 + $str_SJIS .= chr($b[$i]);
  581 + }
  582 + }
  583 +
  584 + return $str_SJIS;
  585 +}
  586 +
  587 +function UTF8toEUC(&$str_UTF8)
  588 +{
  589 + global $table_utf8_jis;
  590 +
  591 + $str_EUC = '';
  592 + $b = unpack('C*', $str_UTF8);
  593 + $n = count($b);
  594 +
  595 + for ($i = 1; $i <= $n; $i++) {
  596 + if ($b[$i] >= 0x80) { //Not ASCII
  597 + if ($b[$i] <= 0xDF) { //2 Bytes
  598 + $utf8 = ($b[$i++] << 8) + $b[$i];
  599 + } else { //3 Bytes
  600 + $utf8 = ($b[$i++] << 16) + ($b[$i++] << 8) + $b[$i];
  601 + }
  602 + if (isset($table_utf8_jis[$utf8])) {
  603 + $jis = $table_utf8_jis[$utf8];
  604 + if ($jis < 0xFF) { //Hankaku
  605 + $str_EUC .= chr(0x8E).chr($jis - 0x80);
  606 + } else { //Zenkaku
  607 + $str_EUC .= chr(($jis >> 8) - 0x80).chr(($jis & 0xFF) - 0x80);
  608 + }
  609 + } else { //Unknown
  610 + $str_EUC .= '?';
  611 + }
  612 + } else { //ASCII
  613 + $str_EUC .= chr($b[$i]);
  614 + }
  615 + }
  616 +
  617 + return $str_EUC;
  618 +}
  619 +
  620 +function UTF8toJIS(&$str_UTF8)
  621 +{
  622 + global $table_utf8_jis;
  623 +
  624 + $str_JIS = '';
  625 + $mode = 0;
  626 + $b = unpack('C*', $str_UTF8);
  627 + $n = count($b);
  628 +
  629 + //Escape sequence
  630 + $ESC = array(chr(0x1B).chr(0x28).chr(0x42),
  631 + chr(0x1B).chr(0x24).chr(0x42),
  632 + chr(0x1B).chr(0x28).chr(0x49));
  633 +
  634 + for ($i = 1; $i <= $n; ++$i) {
  635 + if ($b[$i] >= 0x80) { //Not ASCII
  636 + if ($b[$i] <= 0xDF) { //2 Bytes
  637 + $utf8 = ($b[$i] << 8) + $b[++$i];
  638 + } else { //3 Bytes
  639 + $utf8 = ($b[$i] << 16) + ($b[++$i] << 8) + $b[++$i];
  640 + }
  641 + if (isset($table_utf8_jis[$utf8])) {
  642 + $jis = $table_utf8_jis[$utf8];
  643 + if ($jis < 0xFF) { //Hankaku
  644 + if ($mode != 2) {
  645 + $mode = 2;
  646 + $str_JIS .= $ESC[$mode];
  647 + }
  648 + $str_JIS .= chr($jis);
  649 + } else { //Zenkaku
  650 + if ($mode != 1) {
  651 + $mode = 1;
  652 + $str_JIS .= $ESC[$mode];
  653 + }
  654 + $str_JIS .= chr($jis >> 8).chr($jis & 0xFF);
  655 + }
  656 + } else { //Unknown
  657 + if ($mode != 0) {
  658 + $mode = 0;
  659 + $str_JIS .= $ESC[$mode];
  660 + }
  661 + $str_JIS .= '?';
  662 + }
  663 + } else { //ASCII
  664 + if ($mode != 0) {
  665 + $mode = 0;
  666 + $str_JIS .= $ESC[$mode];
  667 + }
  668 + $str_JIS .= chr($b[$i]);
  669 + }
  670 + }
  671 + if ($mode != 0) $str_JIS .= $ESC[0];
  672 +
  673 + return $str_JIS;
  674 +}
  675 +
  676 +function HANtoZEN_EUC(&$str_HAN)
  677 +{
  678 + $table_han2zen_euc = array(0xA1A3,0xA1D6,0xA1D7,0xA1A2,0xA1A6,0xA5F2,
  679 + 0xA5A1,0xA5A3,0xA5A5,0xA5A7,0xA5A9,0xA5E3,0xA5E5,0xA5E7,0xA5C3,0xA1BC,
  680 + 0xA5A2,0xA5A4,0xA5A6,0xA5A8,0xA5AA,0xA5AB,0xA5AD,0xA5AF,0xA5B1,0xA5B3,
  681 + 0xA5B5,0xA5B7,0xA5B9,0xA5BB,0xA5BD,0xA5BF,0xA5C1,0xA5C4,0xA5C6,0xA5C8,
  682 + 0xA5CA,0xA5CB,0xA5CC,0xA5CD,0xA5CE,0xA5CF,0xA5D2,0xA5D5,0xA5D8,0xA5DB,
  683 + 0xA5DE,0xA5DF,0xA5E0,0xA5E1,0xA5E2,0xA5E4,0xA5E6,0xA5E8,0xA5E9,0xA5EA,
  684 + 0xA5EB,0xA5EC,0xA5ED,0xA5EF,0xA5F3,0xA1AB,0xA1AC);
  685 +
  686 + $str_ZEN = '';
  687 + $b = unpack('C*', $str_HAN);
  688 + $n = count($b);
  689 +
  690 + for ($i = 1; $i <= $n; ++$i) {
  691 + $b1 = $b[$i];
  692 + if ($b1 == 0x8E) {
  693 + $b2 = $b[++$i];
  694 + $ofs = 0;
  695 + if ((($b2 == 0xB3) || (0xB6 <= $b2 && $b2 <= 0xC4) || (0xCA <= $b2 && $b2 <= 0xCE))
  696 + && (isset($b[$i+1]) && $b[$i+1] == 0x8E)) {
  697 + // Dakuten
  698 + if ($b[$i+2] == 0xDE) {
  699 + if ($b2 == 0xB3) $ofs = 78; else $ofs = 1;
  700 + $i += 2;
  701 + // Han-Dakuten
  702 + } elseif (($b[$i+2] == 0xDF) && (0xCA <= $b2 && $b2 <= 0xCE)) {
  703 + $ofs = 2;
  704 + $i += 2;
  705 + }
  706 + }
  707 + $b2 -= 0xA1;
  708 + $c1 = (($table_han2zen_euc[$b2]) & 0xFF00) >> 8;
  709 + $c2 = (($table_han2zen_euc[$b2]) & 0x00FF) + $ofs;
  710 + $str_ZEN .= chr($c1).chr($c2);
  711 + } elseif ($b1 >= 0xA1) {
  712 + $str_ZEN .= chr($b1).chr($b[++$i]);
  713 + } else {
  714 + $str_ZEN .= chr($b1);
  715 + }
  716 + }
  717 +
  718 + return $str_ZEN;
  719 +}
  720 +
  721 +function HANtoZEN_SJIS(&$str_HAN)
  722 +{
  723 + $table_han2zen_sjis = array(0x8142,0x8175,0x8176,0x8141,0x8145,0x8392,
  724 + 0x8340,0x8342,0x8344,0x8346,0x8348,0x8383,0x8385,0x8387,0x8362,0x815B,
  725 + 0x8341,0x8343,0x8345,0x8347,0x8349,0x834A,0x834C,0x834E,0x8350,0x8352,
  726 + 0x8354,0x8356,0x8358,0x835A,0x835C,0x835E,0x8360,0x8363,0x8365,0x8367,
  727 + 0x8369,0x836A,0x836B,0x836C,0x836D,0x836E,0x8371,0x8374,0x8377,0x837A,
  728 + 0x837D,0x837E,0x8380,0x8381,0x8382,0x8384,0x8386,0x8388,0x8389,0x838A,
  729 + 0x838B,0x838C,0x838D,0x838F,0x8393,0x814A,0x814B);
  730 +
  731 + $str_ZEN = '';
  732 + $b = unpack('C*', $str_HAN);
  733 + $n = count($b);
  734 +
  735 + for ($i = 1; $i <= $n; ++$i) {
  736 + $b1 = $b[$i];
  737 + if (0xA1 <= $b1 && $b1 <= 0xDF) {
  738 + $ofs = 0;
  739 + if ((($b1 == 0xB3) || (0xB6 <= $b1 && $b1 <= 0xC4) || (0xCA <= $b1 && $b1 <= 0xCE))
  740 + && isset($b[$i+1])) {
  741 + // Dakuten
  742 + if ($b[$i+1] == 0xDE) {
  743 + if ($b1 == 0xB3) $ofs = 79; else $ofs = 1;
  744 + ++$i;
  745 + // Han-Dakuten
  746 + } elseif (($b[$i+1] == 0xDF) && (0xCA <= $b1 && $b1 <= 0xCE)) {
  747 + $ofs = 2;
  748 + ++$i;
  749 + }
  750 + }
  751 + $b1 -= 0xA1;
  752 + $c1 = (($table_han2zen_sjis[$b1]) & 0xFF00) >> 8;
  753 + $c2 = (($table_han2zen_sjis[$b1]) & 0x00FF) + $ofs;
  754 + $str_ZEN .= chr($c1).chr($c2);
  755 + } elseif ($b1 >= 0x80) {
  756 + $str_ZEN .= chr($b1).chr($b[++$i]);
  757 + } else {
  758 + $str_ZEN .= chr($b1);
  759 + }
  760 + }
  761 +
  762 + return $str_ZEN;
  763 +}
  764 +
  765 +function HANtoZEN_JIS(&$str_HAN)
  766 +{
  767 + $table_han2zen_jis = array(0x2123,0x2156,0x2157,0x2122,0x2126,0x2572,
  768 + 0x2521,0x2523,0x2525,0x2527,0x2529,0x2563,0x2565,0x2567,0x2543,0x213C,
  769 + 0x2522,0x2524,0x2526,0x2528,0x252A,0x252B,0x252D,0x252F,0x2531,0x2533,
  770 + 0x2535,0x2537,0x2539,0x253B,0x253D,0x253F,0x2541,0x2544,0x2546,0x2548,
  771 + 0x254A,0x254B,0x254C,0x254D,0x254E,0x254F,0x2552,0x2555,0x2558,0x255B,
  772 + 0x255E,0x255F,0x2560,0x2561,0x2562,0x2564,0x2566,0x2568,0x2569,0x256A,
  773 + 0x256B,0x256C,0x256D,0x256F,0x2573,0x212B,0x212C);
  774 +
  775 + $str_ZEN = '';
  776 + $b = unpack('C*', $str_HAN);
  777 + $n = count($b);
  778 + $mode = 0;
  779 + $new_mode = 0;
  780 + $esc = FALSE;
  781 + $ESC = array(chr(0x1B).chr(0x28).chr(0x42),
  782 + chr(0x1B).chr(0x24).chr(0x42),
  783 + chr(0x1B).chr(0x28).chr(0x49));
  784 +
  785 + for ($i = 1; $i <= $n; ++$i) {
  786 +
  787 + while ($b[$i] == 0x1B) {
  788 + if (($b[$i+1] == 0x24 && $b[$i+2] == 0x42)
  789 + || ($b[$i+1] == 0x24 && $b[$i+2] == 0x40)) {
  790 + $mode = 1; //Zenkaku
  791 + } elseif ($b[$i+1] == 0x28 && $b[$i+2] == 0x49) {
  792 + $mode = 2; //Hankaku
  793 + } else {
  794 + $mode = 0; //ASCII
  795 + }
  796 + $i += 3;
  797 + if (!isset($b[$i])) break 2;
  798 + }
  799 +
  800 + if ($mode == 2) {
  801 + if ($new_mode != 1) $esc = TRUE;
  802 + $new_mode = 1;
  803 + $b1 = $b[$i];
  804 + $ofs = 0;
  805 + if ((($b1 == 0x33) || (0x36 <= $b1 && $b1 <= 0x44) || (0x4A <= $b1 && $b1 <= 0x4E))
  806 + && isset($b[$i+1])) {
  807 + // Dakuten
  808 + if ($b[$i+1] == 0x5E) {
  809 + if ($b1 == 0x33) $ofs = 78; else $ofs = 1;
  810 + ++$i;
  811 + // Han-Dakuten
  812 + } elseif (($b[$i+1] == 0x5F) && (0x4A <= $b1 && $b1 <= 0x4E) ) {
  813 + $ofs = 2;
  814 + ++$i;
  815 + }
  816 + }
  817 + $b1 -= 0x21;
  818 + $c1 = ($table_han2zen_jis[$b1] & 0xFF00) >> 8;
  819 + $c2 = ($table_han2zen_jis[$b1] & 0x00FF) + $ofs;
  820 + $str = chr($c1).chr($c2);
  821 + } else {
  822 + if ($new_mode != $mode) $esc = TRUE;
  823 + $new_mode = $mode;
  824 + $str = chr($b[$i]);
  825 + }
  826 +
  827 + if ($esc) { //add escape sequence
  828 + $str_ZEN .= $ESC[$new_mode];
  829 + $esc = FALSE;
  830 + }
  831 + $str_ZEN .= $str;
  832 + }
  833 +
  834 + if ($new_mode != 0) $str_ZEN .= $ESC[0];
  835 +
  836 + return $str_ZEN;
  837 +}
  838 +
  839 +function HANtoZEN_UTF8(&$str_HAN)
  840 +{
  841 + $table_han2zen_utf8_1 = array(0xE38082,0xE3808C,0xE3808D,0xE38081,0xE383BB,
  842 + 0xE383B2,0xE382A1,0xE382A3,0xE382A5,0xE382A7,0xE382A9,0xE383A3,0xE383A5,
  843 + 0xE383A7,0xE38383,0xE383BC,0xE382A2,0xE382A4,0xE382A6,0xE382A8,0xE382AA,
  844 + 0xE382AB,0xE382AD,0xE382AF,0xE382B1,0xE382B3,0xE382B5,0xE382B7,0xE382B9,
  845 + 0xE382BB,0xE382BD);
  846 +
  847 + $table_han2zen_utf8_2 = array(0xE382BF,0xE38381,0xE38384,0xE38386,0xE38388,
  848 + 0xE3838A,0xE3838B,0xE3838C,0xE3838D,0xE3838E,0xE3838F,0xE38392,0xE38395,
  849 + 0xE38398,0xE3839B,0xE3839E,0xE3839F,0xE383A0,0xE383A1,0xE383A2,0xE383A4,
  850 + 0xE383A6,0xE383A8,0xE383A9,0xE383AA,0xE383AB,0xE383AC,0xE383AD,0xE383AF,
  851 + 0xE383B3,0xE3829B,0xE3829C);
  852 +
  853 + $str_ZEN = '';
  854 + $b = unpack('C*', $str_HAN);
  855 + $n = count($b);
  856 +
  857 + for ($i = 1; $i <= $n; ++$i) {
  858 + if ($b[$i] >= 0x80) {
  859 + if (($b[$i] & 0xE0) == 0xC0) {
  860 + $str_ZEN .= chr($b[$i]).chr($b[++$i]);
  861 + } elseif (($b[$i] & 0xF0) == 0xE0) {
  862 + if ($b[$i+1] == 0xBD && (0xA1 <= $b[$i+2] && $b[$i+2] <= 0xBF)) {
  863 + $zen = $table_han2zen_utf8_1[$b[$i+2] - 0xA1];
  864 + $b[$i] = ($zen & 0xFF0000) >> 16;
  865 + $b[$i+1] = ($zen & 0x00FF00) >> 8;
  866 + $b[$i+2] = $zen & 0x0000FF;
  867 + } elseif ($b[$i+1] == 0xBE && (0x80 <= $b[$i+2] && $b[$i+2] <= 0x9F)) {
  868 + $zen = $table_han2zen_utf8_2[$b[$i+2] - 0x80];
  869 + $b[$i] = ($zen & 0xFF0000) >> 16;
  870 + $b[$i+1] = ($zen & 0x00FF00) >> 8;
  871 + $b[$i+2] = $zen & 0x0000FF;
  872 + }
  873 + $str_ZEN .= chr($b[$i]).chr($b[++$i]).chr($b[++$i]);
  874 + }
  875 + } else {
  876 + $str_ZEN .= chr($b[$i]);
  877 + }
  878 + }
  879 +
  880 + return $str_ZEN;
  881 +}
  882 +
  883 +function ZENtoHAN_EUC(&$str_ZEN, $kana = 1, $alph = 1, $sym = 1)
  884 +{
  885 + $kana_euc = array(
  886 + 0x00A7,0x00B1,0x00A8,0x00B2,0x00A9,0x00B3,0x00AA,0x00B4,0x00AB,0x00B5,
  887 + 0x00B6,0xB6DE,0x00B7,0xB7DE,0x00B8,0xB8DE,0x00B9,0xB9DE,0x00BA,0xBADE,
  888 + 0x00BB,0xBBDE,0x00BC,0xBCDE,0x00BD,0xBDDE,0x00BE,0xBEDE,0x00BF,0xBFDE,
  889 + 0x00C0,0xC0DE,0x00C1,0xC1DE,0x00AF,0x00C2,0xC2DE,0x00C3,0xC3DE,0x00C4,
  890 + 0xC4DE,0x00C5,0x00C6,0x00C7,0x00C8,0x00C9,0x00CA,0xCADE,0xCADF,0x00CB,
  891 + 0xCBDE,0xCBDF,0x00CC,0xCCDE,0xCCDF,0x00CD,0xCDDE,0xCDDF,0x00CE,0xCEDE,
  892 + 0xCEDF,0x00CF,0x00D0,0x00D1,0x00D2,0x00D3,0x00AC,0x00D4,0x00AD,0x00D5,
  893 + 0x00AE,0x00D6,0x00D7,0x00D8,0x00D9,0x00DA,0x00DB,0x0000,0x00DC,0x0000,
  894 + 0x0000,0x00A6,0x00DD,0xB3DE,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  895 + 0x0000,0x0000,0x0000,0x0000,0x0000
  896 + );
  897 +
  898 + $sym_euc = array(
  899 + 0x0020,0x8EA4,0x8EA1,0x0000,0x0000,0x8EA5,0x0000,0x0000,0x0000,0x0000,
  900 + 0x8EDE,0x8EDF,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  901 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x8EB0,0x0000,0x0000,
  902 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  903 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  904 + 0x0000,0x0000,0x0000,0x8EA2,0x8EA3,0x0000,0x0000,0x0000,0x0000,0x0000,
  905 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  906 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  907 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  908 + 0x0000,0x0000,0x0000,0x0000,0x0000
  909 + );
  910 +
  911 + $str_HAN = '';
  912 + $b = unpack('C*', $str_ZEN);
  913 + $n = count($b);
  914 +
  915 + for ($i = 1; $i <= $n; ++$i) {
  916 + $b1 = $b[$i];
  917 + if ($b1 >= 0x80) {
  918 + ++$i;
  919 + if ($kana == 1 && $b1 == 0xA5) { // Katakana
  920 + $c = $b[$i] - 0xA1;
  921 + $c1 = ($kana_euc[$c] & 0xFF00) >> 8;
  922 + $c2 = $kana_euc[$c] & 0x00FF;
  923 + if ($c1 == 0x00) {
  924 + if ($c2 == 0x00) {
  925 + $str_HAN .= chr($b1).chr($b[$i]);
  926 + } else {
  927 + $str_HAN .= chr(0x8E).chr($c2);
  928 + }
  929 + } else {
  930 + $str_HAN .= chr(0x8E).chr($c1).chr(0x8E).chr($c2);
  931 + }
  932 + } elseif ($sym == 1 && $b1 == 0xA1) { // Symbol
  933 + $c = $b[$i] - 0xA1;
  934 + $c1 = ($sym_euc[$c] & 0xFF00) >> 8;
  935 + $c2 = $sym_euc[$c] & 0x00FF;
  936 + if ($c1 == 0x00) {
  937 + if ($c2 == 0x00) {
  938 + $str_HAN .= chr($b1).chr($b[$i]);
  939 + } else {
  940 + $str_HAN .= chr($c2);
  941 + }
  942 + } else {
  943 + $str_HAN .= chr($c1).chr($c2);
  944 + }
  945 + } elseif ( $alph == 1 && $b1 == 0xA3 ) { // Alphabet & Number
  946 + $str_HAN .= chr($b[$i] - 0x80);
  947 + } else { // Rest of Zenkaku
  948 + $str_HAN .= chr($b1).chr($b[$i]);
  949 + }
  950 + } else { // ASCII
  951 + $str_HAN .= chr($b1);
  952 + }
  953 + }
  954 +
  955 + return $str_HAN;
  956 +}
  957 +
  958 +function ZENtoHAN_SJIS(&$str_ZEN, $kana = 1, $alph = 1, $sym = 1)
  959 +{
  960 + $kana_sjis = array(
  961 + 0x00A7,0x00B1,0x00A8,0x00B2,0x00A9,0x00B3,0x00AA,0x00B4,0x00AB,0x00B5,
  962 + 0x00B6,0xB6DE,0x00B7,0xB7DE,0x00B8,0xB8DE,0x00B9,0xB9DE,0x00BA,0xBADE,
  963 + 0x00BB,0xBBDE,0x00BC,0xBCDE,0x00BD,0xBDDE,0x00BE,0xBEDE,0x00BF,0xBFDE,
  964 + 0x00C0,0xC0DE,0x00C1,0xC1DE,0x00AF,0x00C2,0xC2DE,0x00C3,0xC3DE,0x00C4,
  965 + 0xC4DE,0x00C5,0x00C6,0x00C7,0x00C8,0x00C9,0x00CA,0xCADE,0xCADF,0x00CB,
  966 + 0xCBDE,0xCBDF,0x00CC,0xCCDE,0xCCDF,0x00CD,0xCDDE,0xCDDF,0x00CE,0xCEDE,
  967 + 0xCEDF,0x00CF,0x00D0,0x0000,0x00D1,0x00D2,0x00D3,0x00AC,0x00D4,0x00AD,
  968 + 0x00D5,0x00AE,0x00D6,0x00D7,0x00D8,0x00D9,0x00DA,0x00DB,0x0000,0x00DC,
  969 + 0x0000,0x0000,0x00A6,0x00DD,0xB3DE,0x0000,0x0000,0x0000,0x0000,0x0000,
  970 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000
  971 + );
  972 +
  973 + $sym_sjis = array(
  974 + 0x20,0xA4,0xA1,0x00,0x00,0xA5,0x00,0x00,0x00,0x00,0xDE,0xDF,0x00,0x00,
  975 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xB0,
  976 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  977 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xA2,0xA3,0x00,
  978 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  979 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
  980 + 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
  981 + );
  982 +
  983 + $str_HAN = '';
  984 + $b = unpack('C*', $str_ZEN);
  985 + $n = count($b);
  986 +
  987 + for ($i = 1; $i <= $n; ++$i) {
  988 + $b1 = $b[$i];
  989 + if ($b1 >= 0x80) {
  990 + $b2 = $b[++$i];
  991 + if ($kana == 1 && $b1 == 0x83 // Katakana
  992 + && (0x3F < $b2 && $b2 < 0x9F)) {
  993 + $c = $b2 - 0x40;
  994 + $c1 = ($kana_sjis[$c] & 0xFF00) >> 8;
  995 + $c2 = $kana_sjis[$c] & 0x00FF;
  996 + if ($c1 == 0x00) {
  997 + if ($c2 == 0x00) {
  998 + $str_HAN .= chr($b1).chr($b2);
  999 + } else {
  1000 + $str_HAN .= chr($c2);
  1001 + }
  1002 + } else {
  1003 + $str_HAN .= chr($c1).chr($c2);
  1004 + }
  1005 + } elseif ($sym == 1 && $b1 == 0x81 // Symbol
  1006 + && (0x3F < $b2 && $b2 < 0x9F)) {
  1007 + $c1 = $sym_sjis[ $b2 - 0x40 ];
  1008 + if ($c1 == 0x00) {
  1009 + $str_HAN .= chr($b1).chr($b2);
  1010 + } else {
  1011 + $str_HAN .= chr($c1);
  1012 + }
  1013 + } elseif ($alph == 1 && $b1 == 0x82 // Alphabet & Number
  1014 + && (0x3F < $b2 && $b2 < 0x9F)) {
  1015 + if ($b2 < 0x80) {
  1016 + $str_HAN .= chr($b2 - 0x1F);
  1017 + } else {
  1018 + $str_HAN .= chr($b2 - 0x20);
  1019 + }
  1020 + } else { // Rest of Zenkaku
  1021 + $str_HAN .= chr($b1).chr($b2);
  1022 + }
  1023 + } else { // ASCII
  1024 + $str_HAN .= chr($b1);
  1025 + }
  1026 + }
  1027 +
  1028 + return $str_HAN;
  1029 +}
  1030 +
  1031 +function ZENtoHAN_JIS(&$str_ZEN, $kana = 1, $alph = 1, $sym = 1)
  1032 +{
  1033 + $kana_jis = array(
  1034 + 0x0027,0x0031,0x0028,0x0032,0x0029,0x0033,0x002A,0x0034,0x002B,0x0035,
  1035 + 0x0036,0x365E,0x0037,0x375E,0x0038,0x385E,0x0039,0x395E,0x003A,0x3A5E,
  1036 + 0x003B,0x3B5E,0x003C,0x3C5E,0x003D,0x3D5E,0x003E,0x3E5E,0x003F,0x3F5E,
  1037 + 0x0040,0x405E,0x0041,0x415E,0x002F,0x0042,0x425E,0x0043,0x435E,0x0044,
  1038 + 0x445E,0x0045,0x0046,0x0047,0x0048,0x0049,0x004A,0x4A5E,0x4A5F,0x004B,
  1039 + 0x4B5E,0x4B5F,0x004C,0x4C5E,0x4C5F,0x004D,0x4D5E,0x4D5F,0x004E,0x4E5E,
  1040 + 0x4E5F,0x004F,0x0050,0x0051,0x0052,0x0053,0x002C,0x0054,0x002D,0x0055,
  1041 + 0x002E,0x0056,0x0057,0x0058,0x0059,0x005A,0x005B,0x0000,0x005C,0x0000,
  1042 + 0x0000,0x0026,0x005D,0x335E,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1043 + 0x0000,0x0000,0x0000,0x0000,0x0000
  1044 + );
  1045 +
  1046 + $sym_jis = array(
  1047 + 0x0020,0xFF24,0xFF21,0x0000,0x0000,0xFF25,0x0000,0x0000,0x0000,0x0000,
  1048 + 0xFF5E,0xFF5F,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1049 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0xFF30,0x0000,0x0000,
  1050 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1051 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1052 + 0x0000,0x0000,0x0000,0xFF22,0xFF23,0x0000,0x0000,0x0000,0x0000,0x0000,
  1053 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1054 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1055 + 0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,0x0000,
  1056 + 0x0000,0x0000,0x0000,0x0000,0x0000
  1057 + );
  1058 +
  1059 + $str_HAN = '';
  1060 + $b = unpack('C*', $str_ZEN);
  1061 + $n = count($b);
  1062 + $mode = 0;
  1063 + $new_mode = 0;
  1064 + $esc = FALSE;
  1065 + $ESC = array(chr(0x1B).chr(0x28).chr(0x42),
  1066 + chr(0x1B).chr(0x24).chr(0x42),
  1067 + chr(0x1B).chr(0x28).chr(0x49));
  1068 +
  1069 + for ($i = 1; $i <= $n; ++$i) {
  1070 + while ($b[$i] == 0x1B) {
  1071 + if (($b[$i+1] == 0x24 && $b[$i+2] == 0x42)
  1072 + || ($b[$i+1] == 0x24 && $b[$i+2] == 0x40)) {
  1073 + $mode = 1;
  1074 + } elseif ($b[$i+1] == 0x28 && $b[$i+2] == 0x49) {
  1075 + $mode = 2;
  1076 + } else {
  1077 + $mode = 0;
  1078 + }
  1079 + $i += 3;
  1080 + if (!isset($b[$i])) break 2;
  1081 + }
  1082 +
  1083 + $b1 = $b[$i];
  1084 + if ($mode == 1) { //Zenkaku
  1085 + ++$i;
  1086 + if ($alph == 1 && $b1 == 0x23) { //Alphabet & Number
  1087 + if ($new_mode != 0) $esc = TRUE;
  1088 + $new_mode = 0;
  1089 + $str = chr($b[$i]);
  1090 + } elseif ($sym == 1 && $b1 == 0x21) { //Symbol
  1091 + $c = $b[$i] - 0x21;
  1092 + $c1 = ($sym_jis[$c] & 0xFF00) >> 8;
  1093 + $c2 = $sym_jis[$c] & 0x00FF;
  1094 + if ($c1 == 0x00) {
  1095 + if ($c2 == 0x00) {
  1096 + if ($new_mode != 1) $esc = TRUE;
  1097 + $new_mode = 1;
  1098 + $str = chr($b1).chr($b[$i]);
  1099 + } else {
  1100 + if ($new_mode != 0) $esc = true;
  1101 + $new_mode = 0;
  1102 + $str = chr($c2);
  1103 + }
  1104 + } else {
  1105 + if ($new_mode != 2) $esc = TRUE;
  1106 + $new_mode = 2;
  1107 + $str = chr($c2);
  1108 + }
  1109 + } elseif ($kana == 1 && $b1 == 0x25) { //Katakana
  1110 + $c = $b[$i] - 0x21;
  1111 + $c1 = ($kana_jis[$c] & 0xFF00) >> 8;
  1112 + $c2 = $kana_jis[$c] & 0x00FF;
  1113 + if ($c1 == 0x00) {
  1114 + if ($c2 == 0x00) {
  1115 + if ($new_mode != 1) $esc = TRUE;
  1116 + $new_mode = 1;
  1117 + $str = chr($b1).chr($b[$i]);
  1118 + } else {
  1119 + if ($new_mode != 2) $esc = TRUE;
  1120 + $new_mode = 2;
  1121 + $str = chr($c2);
  1122 + }
  1123 + } else {
  1124 + if ($new_mode != 2) $esc = TRUE;
  1125 + $new_mode = 2;
  1126 + $str = chr($c1).chr($c2);
  1127 + }
  1128 + } else {
  1129 + if ($new_mode != 1) $esc = TRUE;
  1130 + $new_mode = 1;
  1131 + $str = chr($b1).chr($b[$i]);
  1132 + }
  1133 + } elseif ($mode == 2) {
  1134 + if ($new_mode != 2) $esc = TRUE;
  1135 + $new_mode = 2;
  1136 + $str = chr($b1);
  1137 + } else {
  1138 + if ($new_mode != 0) $esc = TRUE;
  1139 + $new_mode = 0;
  1140 + $str = chr($b1);
  1141 + }
  1142 +
  1143 + if ($esc) { //add escape sequense
  1144 + $str_HAN .= $ESC[$new_mode];
  1145 + $esc = FALSE;
  1146 + }
  1147 + $str_HAN .= $str;
  1148 + }
  1149 +
  1150 + if ($new_mode != 0) $str_HAN .= $ESC[0];
  1151 +
  1152 + return $str_HAN;
  1153 +}
  1154 +
  1155 +
  1156 +/*
  1157 + O-MA-KE No.1
  1158 + jsubstr() - substr() function for japanese(euc-jp)
  1159 + for using shift_jis encoding, remove comment string.
  1160 +*/
  1161 +function jsubstr($str, $start = 0, $length = 0)
  1162 +{
  1163 + $b = unpack('C*', $str);
  1164 + $m = count($b);
  1165 +
  1166 + for ($i = 1; $i <= $m; ++$i) {
  1167 + if ($b[$i] >= 0x80) { //Japanese
  1168 +// if ( 0xA0 < $b[$i] && $b[$i] < 0xE0 ) { //SJIS Hankaku
  1169 +// $jstr[] = chr($b[$i]);
  1170 +// } else {
  1171 + $jstr[] = chr($b[$i]).chr($b[++$i]);
  1172 +// }
  1173 + } else { //ASCII
  1174 + $jstr[] = chr($b[$i]);
  1175 + }
  1176 + }
  1177 + if (!isset($jstr)) $jstr[] = '';
  1178 +
  1179 + $n = count($jstr);
  1180 + if ($start < 0) $start += $n;
  1181 + if ($length < 0) $end = $n + $length; else $end = $start + $length;
  1182 + if ($end > $n) $end = $n;
  1183 +
  1184 + $s = '';
  1185 + for ($j = $start; $j < $end; ++$j) $s .= $jstr[$j];
  1186 +
  1187 + return $s;
  1188 +}
  1189 +
  1190 +/*
  1191 + O-MA-KE No.2
  1192 + jstrlen() - strlen() function for japanese(euc-jp)
  1193 + for using shift_jis encoding, remove comment string.
  1194 +*/
  1195 +function jstrlen($str)
  1196 +{
  1197 + $b = unpack('C*', $str);
  1198 + $n = count($b);
  1199 + $l = 0;
  1200 +
  1201 + for ($i = 1; $i <= $n; ++$i) {
  1202 + if ($b[$i] >= 0x80
  1203 +// && ($b[$i] <= 0xA0 || $b[$i] >= 0xE0) //exclude SJIS Hankaku
  1204 + ) {
  1205 + ++$i;
  1206 + }
  1207 + ++$l;
  1208 + }
  1209 +
  1210 + return $l;
  1211 +}
  1212 +
  1213 +/*
  1214 + O-MA-KE No.3
  1215 + jstr_replace() - str_replace() function for japanese(euc-jp)
  1216 + for using shift_jis encoding, remove comment string.
  1217 +*/
  1218 +function jstr_replace($before, $after, $str)
  1219 +{
  1220 + $b = unpack('C*', $str);
  1221 + $n = strlen($str);
  1222 + $l = strlen($before);
  1223 + if ($l == 0) $l = 1;
  1224 + $s = '';
  1225 + $i = 1;
  1226 +
  1227 + while($i <= $n) {
  1228 + for ($j = 0; $j < $l; $k = $i + (++$j)) {
  1229 + if ($b[$k] >= 0x80) { //Japanese
  1230 +// if ( 0xA0 < $b[$k] && $b[$k] < 0xE0 ) { //SJIS Hankaku
  1231 +// $c[] = chr($b[$k]);
  1232 +// } else {
  1233 + $c[] = chr($b[$k]).chr($b[$k+1]);
  1234 + $k = $i + (++$j);
  1235 +// }
  1236 + } else { //ASCII
  1237 + $c[] = chr($b[$k]);
  1238 + }
  1239 + if (!isset($b[$k+1])) break;
  1240 + }
  1241 + if ($before == implode('', $c)) {
  1242 + $s .= $after; //replace
  1243 + $i += $l;
  1244 + } else {
  1245 + $s .= $c[0];
  1246 + $i += strlen($c[0]);
  1247 + }
  1248 + unset($c);
  1249 + }
  1250 +
  1251 + return $s;
  1252 +}
  1253 +
  1254 +/*
  1255 + O-MA-KE No.4
  1256 + jchunk_split() - This function is similar to chunk_split()
  1257 + and is designed for euc-jp encoding.
  1258 +*/
  1259 +function jchunk_split($str, $width = 76, $end = "\r\n")
  1260 +{
  1261 + if ($width < 1) return '';
  1262 +
  1263 + $b = unpack('C*', $str);
  1264 + $n = count($b);
  1265 + $s = '';
  1266 + $l = 0;
  1267 +
  1268 + for ($i = 1; $i <= $n; ++$i) {
  1269 +
  1270 + if ($b[$i] >= 0x80) { // 8bit (Japanese)
  1271 +// if ( 0xA0 < $b[$i] && $b[$i] < 0xE0 ) { // SJIS Hankaku
  1272 +// $c = chr($b[$i]);
  1273 +// $w = 1;
  1274 +// } else {
  1275 + if ($b[$i] == 0x8E) { // EUC-JP Hankaku
  1276 + $w = 1;
  1277 + } else { // Zenkaku
  1278 + $w = 2;
  1279 + }
  1280 + $c = chr($b[$i]).chr($b[++$i]);
  1281 +// }
  1282 + } else { // 7bit (ASCII)
  1283 + $w = 1;
  1284 + $c = chr($b[$i]);
  1285 + }
  1286 +
  1287 + if (($l += $w) > $width) {
  1288 + $l = $w;
  1289 + $s .= $end;
  1290 + }
  1291 +
  1292 + $s .= $c;
  1293 + }
  1294 +
  1295 + return $s;
  1296 +}
  1297 +
  1298 +/*
  1299 + O-MA-KE No.5
  1300 + jstrcut() - This function is similar to mb_strcut() and substr(),
  1301 + and is designed for euc-jp encoding.
  1302 +*/
  1303 +function jstrcut($str, $start, $len = 0)
  1304 +{
  1305 + $b = unpack('C*', $str);
  1306 + $n = count($b);
  1307 + $s = '';
  1308 + $c = '';
  1309 + $l = 0;
  1310 +
  1311 + if ($start < 0) $start += $n;
  1312 + if ($start < 0) $start = 0;
  1313 +
  1314 + if ($len == 0) $len = $n;
  1315 + if ($len < 0) $len += ($n - $start);
  1316 + if ($len > $n) $len = $n;
  1317 + if ($len < 1) return '';
  1318 +
  1319 + for ($i = 1; $i <= $n; ++$i) {
  1320 +
  1321 + if ($b[$i] >= 0x80) { // 8bit (Japanese)
  1322 +// if ( 0xA0 < $b[$i] && $b[$i] < 0xE0 ) { // SJIS Hankaku
  1323 +// $c = chr($b[$i]);
  1324 +// $w = 1;
  1325 +// } else {
  1326 + if ($b[$i] == 0x8E) { // EUC-JP Hankaku
  1327 + $w = 1;
  1328 + } else { // Zenkaku
  1329 + $w = 2;
  1330 + }
  1331 + $c = chr($b[$i]).chr($b[++$i]);
  1332 +// }
  1333 + } else { // 7bit (ASCII)
  1334 + $w = 1;
  1335 + $c = chr($b[$i]);
  1336 + }
  1337 +
  1338 + if ($i > $start) {
  1339 + $l += $w;
  1340 + if ($l > $len) break;
  1341 + $s .= $c;
  1342 + }
  1343 +
  1344 + }
  1345 +
  1346 + return $s;
  1347 +}
  1348 +
  1349 +?>
... ...
  1 +<?PHP
  2 +//******************************************************************************
  3 +//* セッションスタート処理
  4 +//*
  5 +//* セッション変数
  6 +//*
  7 +//* これらのセッション変数を作成しておく
  8 +//******************************************************************************
  9 +
  10 +session_cache_limiter('private must-revalidate');
  11 +$cache_limiter = session_cache_limiter();
  12 +session_cache_expire (30);
  13 +$cache_expire = session_cache_expire();
  14 +
  15 +session_start();
  16 +
  17 +//セッションチェック
  18 +if($PHP_EEVENT_STS != "hoge"){
  19 + header("Location:login.php");
  20 + exit;
  21 +}
  22 +
  23 +?>
... ...
  1 +--broken encoding: UTF-16BE
\ No newline at end of file
... ...
Please register or login to post a comment