session_start(); require_once("common/common.php"); require_once("db/CsvDb.php"); require_once("db/CategoryTable.php"); require_once("db/EventTable.php"); $categoryTable = new CategoryTable; $categoryTable->open(0); $categoryArray = $categoryTable->getAllRecord(); $eventTable = new EventTable; $eventTable->open(0); $PAGEROW = 10; //ページング $conv1="UTF-8"; //変換後エンコード $conv2="euc-jp"; //変換前エンコード if (isset($_GET[category])){ $eventResult = $eventTable->findRows(1, $_GET[category],4); }elseif (isset($_GET[y])){ $eventResult = $eventTable->findRowsStr(4, 0, 4, $_GET[y], 4); }else{ $eventResult = $eventTable->getAllRecord(); } $eventResult1 = array(); $sess_flg; if (array_key_exists("username", $_SESSION)){ $sess_flg = true; }else{ $sess_flg = false; } if (isset($_GET[kid])){ $categoryResult = $categoryTable->findRowsLastColumn(8, $_GET[kid], 1); }else{ $categoryResult = $categoryTable->findRows(3, "1", 1); } //delete category flg = 0 and delete passwd_flg $prevNo = 0; $nextNo = 0; if(isset($_GET[event_no])){ $eventResult1 = $eventTable->findRow(0, $_GET[event_no]); //get prev and next event_no $tmp_eventResult = $eventResult; $i = 0; while($i < count($tmp_eventResult)){ if($_GET[event_no] == $tmp_eventResult[$i][0]){ if($i == 0){ $prevNo = 0; if(count($tmp_eventResult) - 1 > $i){ $nextNo = $tmp_eventResult[$i+1][0]; }else{ $nextNo = 0; } }else if(count($tmp_eventResult) - 1 == $i){ $prevNo = $tmp_eventResult[$i-1][0]; $nextNo = 0; }else{ $prevNo = $tmp_eventResult[$i-1][0]; $nextNo = $tmp_eventResult[$i+1][0]; } break; } $i++; } }else{ $i=0; while($i < count($eventResult)){ $j=0; $k=false; while($j < count($categoryResult)){ if($sess_flg){ if($eventResult[$i][1] == $categoryResult[$j][0]){ $k = true; break; } }else{ if($eventResult[$i][1] == $categoryResult[$j][0] && $categoryResult[$j][4] == "1"){ $k = true; break; } } $j++; } if($k){ array_push($eventResult1, $eventResult[$i]); } $i++; } } $yResult = $eventTable->findRowsStrDist(4, 0, 4, true); function getCategoryName($no, $categoryResult){ $i=0; while($i < count($categoryResult)){ if($no == $categoryResult[$i][0]){ return $categoryResult[$i][2]; } $i++; } return "null"; } function getCategoryColor($no, $categoryResult){ $i=0; while($i < count($categoryResult)){ if($no == $categoryResult[$i][0]){ if($categoryResult[$i][5] < 10){ return "0" . $categoryResult[$i][5]; }else{ return $categoryResult[$i][5]; } } $i++; } return "01"; } ?>
=substr($eventResult1[4],0,4)."年".substr($eventResult1[4],5,2)."月".substr($eventResult1[4],8,2)."日"?>
" . $ts . "
"; } } } echo "".mb_convert_encoding($str,"$conv1","$conv2");
$fNo=0;
while($fNo++ < $IMG_NUM){
if ($eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN] != ""){
if ($eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN+2] == 2){
echo "" . $eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN+1] . "
";
}
}
}
echo "
" . mb_convert_encoding($str,"$conv1","$conv2") . "
"; $fNo=0; while($fNo++ < $IMG_NUM){ $ts = mb_convert_encoding($eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN + 3],"$conv1","$conv2"); if ($eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN+2] == "2"){ echo "" . $eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN+1] . "" . mb_convert_encoding($eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN+3],"$conv1","$conv2") . "
"; } } $fNo=0; $y = 0; while($fNo++ < $IMG_NUM){ if ($eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN+2] == "1"){ $ts = mb_convert_encoding($eventResult1[$IMG_START+($fNo-1)*$IMG_COLUMN + 3],"$conv1","$conv2"); echo "\n"; $y++; } } echo ""; } echo ""; echo "=substr($eventResult1[$i][4],0,4)."年".substr($eventResult1[$i][4],5,2)."月".substr($eventResult1[$i][4],8,2)."日"?>
" . $ts . "
"; } } } echo "".mb_convert_encoding($str,"$conv1","$conv2");
$fNo=0;
while($fNo++ < $IMG_NUM){
if ($eventResult1[$i][$IMG_START+($fNo-1)*$IMG_COLUMN] != ""){
if ($eventResult1[$i][$IMG_START+($fNo-1)*$IMG_COLUMN+2] == 2){
echo "" . $eventResult1[$i][$IMG_START+($fNo-1)*$IMG_COLUMN+1] . "
";
}
}
}
echo "
" . mb_convert_encoding($str,"$conv1","$conv2") . "
"; $fNo=0; while($fNo++ < $IMG_NUM){ $ts = mb_convert_encoding($eventResult1[$i][$IMG_START+($fNo-1)*$IMG_COLUMN + 3],"$conv1","$conv2"); if ($eventResult1[$i][$IMG_START+($fNo-1)*$IMG_COLUMN+2] == "2"){ echo "" . $eventResult1[$i][$IMG_START+($fNo-1)*$IMG_COLUMN+1] . "" . $ts . "
"; } } $fNo=0; $y = 0; while($fNo++ < $IMG_NUM){ if ($eventResult1[$i][$IMG_START+($fNo-1)*$IMG_COLUMN+2] == "1"){ $ts = mb_convert_encoding($eventResult1[$i][$IMG_START+($fNo-1)*$IMG_COLUMN + 3],"$conv1","$conv2"); echo "\n"; $y++; } } } echo ""; echo "