$base_timestamp = strtotime('now');
// 現在が2010年3月以前か
if (date("Y-m") <= "2010-03") {
$nengetu[0] = "2009年11月";
$nengetu[1] = "2009年12月";
$nengetu[2] = "2010年01月";
$nengetu[3] = "2010年02月";
$nengetu[4] = "2010年03月";
$nengetu[5] = "2010年04月";
$nengetu[6] = "2010年05月";
$nengetu[7] = "2010年06月";
$nengetu[8] = "2010年07月";
$nengetu[9] = "2010年08月";
$nengetu[10] = "2010年09月";
$nengetu[11] = "2010年10月";
$roop = 6; //2010年3月までは
} elseif(date("m")<=03) {
$nengetu[0] = date("Y年",strtotime("-1 year",$base_timestamp))."04月";
$nengetu[1] = date("Y年",strtotime("-1 year",$base_timestamp))."05月";
$nengetu[2] = date("Y年",strtotime("-1 year",$base_timestamp))."06月";
$nengetu[3] = date("Y年",strtotime("-1 year",$base_timestamp))."07月";
$nengetu[4] = date("Y年",strtotime("-1 year",$base_timestamp))."08月";
$nengetu[5] = date("Y年",strtotime("-1 year",$base_timestamp))."09月";
$nengetu[6] = date("Y年",strtotime("-1 year",$base_timestamp))."10月";
$nengetu[7] = date("Y年",strtotime("-1 year",$base_timestamp))."11月";
$nengetu[8] = date("Y年",strtotime("-1 year",$base_timestamp))."12月";
$nengetu[9] = date("Y年")."01月";
$nengetu[10] = date("Y年")."02月";
$nengetu[11] = date("Y年")."03月";
$roop = 6;
} else {
$nengetu[0] = date("Y年")."04月";
$nengetu[1] = date("Y年")."05月";
$nengetu[2] = date("Y年")."06月";
$nengetu[3] = date("Y年")."07月";
$nengetu[4] = date("Y年")."08月";
$nengetu[5] = date("Y年")."09月";
$nengetu[6] = date("Y年")."10月";
$nengetu[7] = date("Y年")."11月";
$nengetu[8] = date("Y年")."12月";
$nengetu[9] = date("Y年",strtotime("+1 year",$base_timestamp))."01月";
$nengetu[10] = date("Y年",strtotime("+1 year",$base_timestamp))."02月";
$nengetu[11] = date("Y年",strtotime("+1 year",$base_timestamp))."03月";
$roop = 6;
}
$Connect_ID = mysql_connect('','dbuser','iKmRA446');
if ( $Connect_ID != $FALSE ) {
mysql_select_db('mydb',$Connect_ID);
mysql_query("set names utf8");
// 現在が1月から3月の間で、4月以降にセミナーが登録されていた場合は、リンクを表示
if (date("m") <= 03) {
$sql = "select seminor_id from seminor_syousai where jissibi > '" .date("Y"). "-04-01';";
$result = mysql_query($sql, $Connect_ID);
$num_rows = mysql_num_rows($result);
// 登録あり
if ($num_rows > 0) {
echo "
\n";
}
//メモリ開放
mysql_free_result($result);
}
$sql = "select seminor_id,seminor_title,bosyuu_flg,to_bosyuu_date,jissibi from seminor_syousai where bunrui=0 and jissibi between '" .substr($nengetu1,0,4). "-" .substr($nengetu1,7,2). "-01' and last_day('" .substr($nengetu8,0,4). "-" .substr($nengetu8,7,2). "-01') order by jissibi";
$result = mysql_query($sql, $Connect_ID);
$num_rows = mysql_num_rows($result);
//スポットセミナー登録件数照会
if ($nengetu[11] == "") {
$sql = "select seminor_id,seminor_title,bosyuu_flg,to_bosyuu_date,jissibi from seminor_syousai where bunrui=1 and jissibi between '" .substr($nengetu[0],0,4). "-" .substr($nengetu[0],7,2). "-01' and last_day('" .substr($nengetu[9],0,4). "-" .substr($nengetu[9],7,2). "-01') order by jissibi";
} else {
$sql = "select seminor_id,seminor_title,bosyuu_flg,to_bosyuu_date,jissibi from seminor_syousai where bunrui=1 and jissibi between '" .substr($nengetu[0],0,4). "-" .substr($nengetu[0],7,2). "-01' and last_day('" .substr($nengetu[11],0,4). "-" .substr($nengetu[11],7,2). "-01') order by jissibi";
}
//$sql = "select seminor_id,seminor_title,bosyuu_flg,to_bosyuu_date,jissibi from seminor_syousai where bunrui=1 and jissibi < '" .date("Y-m-d",strtotime("+0 month",$base_timestamp))."'";
$result = mysql_query($sql, $Connect_ID);
$num_rows = mysql_num_rows($result);
//メモリ開放
mysql_free_result($result);
if ($num_rows <> 0) {
echo"
セミナーカレンダーリンクがないところは詳細が決まり次第、順次追加していきます
";
}
echo"
";
echo"
";
//スポットセミナー登録件数によってタブの出力を変える
//if ($num_rows <> 0) {
// echo"";
// echo"- スポットセミナー
";
//} else {
echo"";
//}
echo"
";
echo"
";
echo"
\n";
echo "
\n";
//セミナー内容出力(関数呼び出し)
for ($cnt=0; $cnt<$roop;$cnt++) {
print_seminor($nengetu[$cnt],"left",$cnt);
print_seminor($nengetu[$cnt+$roop],"right",$cnt+$roop);
}
echo"
\n";
echo "
\n";
//現在日時より古い日付でセミナー実施日が登録されていれば、リンク出力
$sql = "select seminor_id,seminor_title,bosyuu_flg,to_bosyuu_date,jissibi from seminor_syousai where bunrui=0 and jissibi < '" .date("Y-m-d",strtotime("+0 month",$base_timestamp))."'";
$result = mysql_query($sql, $Connect_ID);
$num_rows = mysql_num_rows($result);
echo "
※同業他社様並びに個人等からのお申し込みはお断りさせて頂く場合が御座います。予めご了承下さい。
";
echo "
";
if ($num_rows > 0) {
echo "
";
}
echo "
\n";
//メモリ開放
mysql_free_result($result);
//スポットセミナー登録件数照会
if ($nengetu[11] == "") {
$sql = "select seminor_id,seminor_title,bosyuu_flg,to_bosyuu_date,jissibi from seminor_syousai where bunrui=1 and jissibi between '" .substr($nengetu[0],0,4). "-" .substr($nengetu[0],7,2). "-01' and last_day('" .substr($nengetu[9],0,4). "-" .substr($nengetu[9],7,2). "-01') order by jissibi";
} else {
$sql = "select seminor_id,seminor_title,bosyuu_flg,to_bosyuu_date,jissibi from seminor_syousai where bunrui=1 and jissibi between '" .substr($nengetu[0],0,4). "-" .substr($nengetu[0],7,2). "-01' and last_day('" .substr($nengetu[11],0,4). "-" .substr($nengetu[11],7,2). "-01') order by jissibi";
}
$result = mysql_query($sql, $Connect_ID);
$num_rows = mysql_num_rows($result);
if ($num_rows == 0) {
echo"