<?

	
	include_once("define.php");
	include_once("class.php");
	include_once("tmpl.php");
	
	
	$tool = new TOOL();
	
	
	
//program/////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	//ブログ1取得
	/*$url="http://shj.ti-da.net/index.rdf";
	$blog="./data/knhd.xml";
	$accesstime="30";//分
	//ファイルがなければ作る
	if(!file_exists($blog)){
		$tool->SET_RSS($blog,$url);
	}
	//更新して○○時間が経っているかちぇーっく
	$filetime=filectime($blog);
	$chktime=time()-(60*$accesstime);
	//時間すぎてたら更新
	if($filetime<$chktime){
		$tool->SET_RSS($blog,$url);
	}
	
	//ファイルを読み込み。
	$fdata1=file($blog);
	//精査
	if(count($fdata1)){
		$data1=$tool->READ_RSS1_0($fdata1);
	}*/
	
	//ブログ2取得
	/*$url="http://mpagarihama.ti-da.net/index.rdf";
	$blog="./data/knhd2.xml";
	$accesstime="30";//分
	//ファイルがなければ作る
	if(!file_exists($blog)){
		$tool->SET_RSS($blog,$url);
	}
	//更新して○○時間が経っているかちぇーっく
	$filetime=filectime($blog);
	$chktime=time()-(60*$accesstime);
	//時間すぎてたら更新
	if($filetime<$chktime){
		$tool->SET_RSS($blog,$url);
	}
	$fdata2=file($blog);
	//精査
	if(count($fdata2)){
		$data2=$tool->READ_RSS1_0($fdata2);
	}*/
	
	
	//カラム設定
	$tool->column=3;
	//トップイメージ部分
	$SQL="select * from link_data where SAKUJO=0 and now() between VIEW_DATE_ST and VIEW_DATE_ED and CATEGORI='top' order by RAND() limit 1";
	$tmps=$tool->SQL($SQL);
	$tops=$tmps[0];
	if(count($tops)){
		
		if($tops['LINK']){
			$tool->mainimage="<a href='".$tops['LINK']."' alt='".$tops['TITLE']."' title='".$tops['TITLE']."' ";
			if($tops['TYPES']=="new"){$tool->mainimage.=" target='_blank' ";}
			$tool->mainimage.=">";
		}
		$fnl="./image/linkimg".$tops['ID'].".jpg";
		if(file_exists($fnl)){
			$size=$tool->SIZE_HOSEI($fnl,"950","350");
			$tool->mainimage.="<img src='".$fnl."' style='width:".$size['X']."px;height:".$size['Y']."px;' alt='".$tops['TITLE']."' title='".$tops['TITLE']."'>";
		}else{
			$tool->mainimage.=$tops['TITLE'];
		}
		if($tops['LINK']){
			$tool->mainimage.="</a>\n";
		}
		
	
	}else{
	
		$tool->mainimage="<table style='width:900px;height:200px;z-index:10;position:relative;top:10px;'><tr><td style='width:650px;text-align:center;'>";

$tool->mainimage.="<!--ムービーで使用されている URL-->\n";
$tool->mainimage.="<!--ムービーで使用されているテキスト-->\n";
$tool->mainimage.="<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0\" width=\"530\" height=\"170\" id=\"goodjob\" align=\"middle\">\n";
$tool->mainimage.="<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n";
$tool->mainimage.="<param name=\"movie\" value=\"".URL."img/goodjob.swf\" />\n";
$tool->mainimage.="<param name=\"quality\" value=\"high\" />\n";
$tool->mainimage.="<PARAM NAME=wmode VALUE=transparent>\n";
$tool->mainimage.="<embed src=\"".URL."img/goodjob.swf\" quality=\"high\" wmode=\"transparent\"  width=\"530\" height=\"170\" name=\"goodjob\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n";
$tool->mainimage.="</object>\n";
//<img src='".URL."img/flashimg.png'  title='tmp' style='z-index:10;'>

$tool->mainimage.="</td><td style='width:300px;background:url(".URL."/img/shadowkun.png) no-repeat 0% 0%;'>
</td>
</tr>
</table>
";

	/*	$tool->mainimage="<object style='' classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0\" width=\"950\" height=\"350\" id=\"flash\" align=\"middle\">\n";
	
		$tool->mainimage.="<param name=\"allowScriptAccess\" value=\"sameDomain\" />\n";
		$tool->mainimage.="<param name=\"allowFullScreen\" value=\"false\" />\n";
		$tool->mainimage.="<param name=\"movie\" value=\"./img/flash.swf\" />\n";
		$tool->mainimage.="<param name=\"quality\" value=\"high\" />";
		$tool->mainimage.="<param name=\"bgcolor\" value=\"#ffffff\" />";
		$tool->mainimage.="<embed src=\"./img/flash.swf\" quality=\"high\" bgcolor=\"#ffffff\" width=\"950\" height=\"350\" name=\"flash\" align=\"middle\" allowScriptAccess=\"sameDomain\" allowFullScreen=\"false\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" />\n";
		$tool->mainimage.="</object>\n";*/
	
	}
	
	
	//トピックデータ取得　最新5件
	$SQL="select * from topic_data where 1=1 and SAKUJO=0 and now() between VIEW_DATE_ST and VIEW_DATE_ED order by NO asc,VIEW_DATE_ST desc ,ID desc limit 5";
	$TDATA=$tool->SQL($SQL);
	
	//スケジュールデータ取得　今日から2週間分
	$week2=date("Y-m-d",mktime(0,0,0,date("m"),(date("d")+14),date("Y")));
	$SQL="select * from schedule_data where DATE >= '".date("Y-m-d")."%' and DATE < '".$week2."%' order by DATE desc , ST_HOUR asc,ST_TIME asc;";
	$SDATA=$tool->SQL($SQL);
	//店舗情報を5件ランダムで表示
	/*$SQL="select * from shop_data where 1=1 and SAKUJO=0 ";
	//検索項目
	$SQL.=" order by RAND() desc limit 3";
	$SDATA=$tool->SQL($SQL);*/
	
	//2週間前
	$week2rate=time()-(60*60*24*7);
	
	//グローバルボタン設定
	$tool->menu_no=1;
//view/////////////////////////////////////////////////////////////////////////////////////////////////////////
	
	$tool->HEAD();
		
		
		
		
		
					print "<div>\n";
						print "<img src='./img/top_box_shadowing.png' class='pngs'  alt='ジョブシャドウイングとは top' title='ジョブシャドウイングとは top'>";
						print "<div class='boxinner'>\n";
							print "<div class='p2'>";
								print "<img src='./img/shadowkun_mark01.gif' style='float:right;' alt='ジョブシャドウイングとは' title='ジョブシャドウイングとは' />";
								print "<div style='border-bottom:1px dotted gray; padding:3px;'><h1>ジョブシャドウイング</h1>とは…</div>";
								print "沖縄型ジョブシャドウイングとは、<strong>「みんなでグッジョブ運動」</strong>の一環として実施しています。<br>";
								print "<b>ジョブシャドウイング</b>とは、生徒が実際に仕事をしている人の後ろに影（シャドウ）のように寄り添い、仕事をしている人の様子を観察する。というものです。<br>";
								print "基本的に働く人１人に対し、生徒1人がつくマンツーマン方式で行われています。";
								print "<div class='end'>&nbsp;</div>";
								print "<img src='./img/shadowkun_mark08.gif' style='float:left;' alt='ジョブシャドウイングとは' title='ジョブシャドウイングとは' />";
								print "<div style='border-bottom:1px dotted gray; padding:3px;'><h1>ジョブシャドウイング</h1>の効果…</div>";
								print "ジョブシャドウイングを経験することで、仕事や職種に関する認識の幅を広げてもらう機会とし、働くことについての気づきを促すことができます。<br>";
								print "様々な職務をジョブシャドウイングをすることで、あいさつやコミュニケーション、チームワークの大切さを感じ学校での学習の大切さに気づくことができます。<br>";
								print "<div class='end'>&nbsp;</div>";
							print "</div>\n";
						print "</div>";
						print "<img src='./img/top_box_bottom.png' alt='ジョブシャドウイングとは bottom' title='ジョブシャドウイングとは bottom'>";
					print "</div>";
					print "<div>\n";
						print "<img src='./img/top_box_goodjob.png' class='pngs' alt='ジョブシャドウイング グッジョブ運動とは top' title='ジョブシャドウイング グッジョブ運動とは top'>";
						print "<div class='boxinner'>\n";
							print "<p>";
								print "<img src='./img/shadowkun_mark02.gif' style='float:left;padding-right:10px;' alt='ジョブシャドウイング シャドウ君' title='ジョブシャドウイング　シャドウ君'>";
								print "<strong>「みんなでグッジョブ運動」</strong>とは、沖縄の県民一人ひとりが<b>「働くこと」</b>について真摯に向き合い、働くことの意義や大切さを常に考え、子どもたちに伝えていく。そして、沖縄県民みんなが働くことに生きがいを感じられるような<b>「働く夢」</b>を広げていく。<br>\n";
								print "このように沖縄県民が一丸となって就業意識の向上を目指し取り組む沖縄県民運動のことです。";
								print "<div class='end'>&nbsp;</div>\n";
							print "</p>";
						print "</div>";
						print "<img src='./img/top_box_bottom.png' alt='ジョブシャドウイング　グッジョブ運動とは bottom' title='ジョブシャドウイング グッジョブ運動とは bottom'>";
					print "</div>";
					
					/*print "<div>\n";
						print "<img src='./img/top_box_shadowing.png' class='pngs'  alt='ジョブシャドウイングとは top' title='ジョブシャドウイングとは top'>";
						print "<div class='boxinner'>\n";
							print "<p>";
								print "<img src='./img/shadowkun_mark01.gif' style='float:right;' alt='ジョブシャドウイングとは' title='ジョブシャドウイングとは'>";
								print "<strong>ジョブシャドウイング</strong>は、<strong>「みんなでグッジョブ運動」</strong>の一環として実地しています。<br>\n";
								print "<b>ジョブシャドウイング</b>とは、生徒が実際に仕事をしている人の後ろに影（シャドウ）のように立ち、仕事をしている人の様子を観察する。というものです。<br>\n";
								print "基本的に働く人１人に対し、生徒1人がつくマンツーマン方式で行われています。";
								print "<div class='end'>&nbsp;</div>\n";
							print "</p>";
						print "</div>";
						print "<img src='./img/top_box_bottom.png' alt='ジョブシャドウイングとは bottom' title='ジョブシャドウイングとは bottom'>";
					print "</div>";
					print "<div>\n";
						print "<img src='./img/top_box_goodjob.png' class='pngs' alt='ジョブシャドウイング グッジョブ運動とは top' title='ジョブシャドウイング グッジョブ運動とは top'>";
						print "<div class='boxinner'>\n";
							print "<p>";
								print "<img src='./img/shadowkun_mark02.gif' style='float:left;padding-right:10px;' alt='ジョブシャドウイング シャドウ君' title='ジョブシャドウイング　シャドウ君'>";
								print "<strong>「みんなでグッジョブ運動」</strong>とは、県民一人ひとりが<b>「働くこと」</b>について真摯に向き合い、働くことの意義や大切さを常に考え、子どもたちに伝えていく。そして、県民みんなが働くことに生きがいを感じられるような<b>「働く夢」</b>を広げていく。<br>\n";
								print "このように県民が一丸となって就業意識の向上を目指し取り組む県民運動のことです。";
								print "<div class='end'>&nbsp;</div>\n";
							print "</p>";
						print "</div>";
						print "<img src='./img/top_box_bottom.png' alt='ジョブシャドウイング　グッジョブ運動とは bottom' title='ジョブシャドウイング グッジョブ運動とは bottom'>";
					print "</div>";
					*/
					$rss = @simplexml_load_file("http://goodjoboki.ti-da.net/index.xml");
					if(count($rss)){
						$cnt=0;
						print "<div>\n";
							print "<img src='./img/top_box_news.png' class='pngs' alt='ジョブシャドウイング お知らせ news top' title='ジョブシャドウイング お知らせ news top'>";
							print "<div class='boxinner'>\n";
								print "<p>";
									print "<table class='box_list'>\n";
									foreach($rss->channel->item as $item){
										print "<tr>\n";
											print "<td align='left' valign='top' style='width:15%;'>\n";
												print date("m月d日",strtotime($item->pubDate));
											print "</td>\n";
											print "<td align='left' valign='top' style='width:55%;'>\n";
												print "<a href='".$item->link;
												print"' target='_blank'>".$item->title."</a>";
											print "</td>\n";
										print "</tr>\n";
										$cnt++;
										if($cnt>6){
											break;
										}
									}
									print "<tr>\n";
										print "<td colspan='2' align='right'><a href='http://goodjoboki.ti-da.net/' target='_blank'>もっと見る</a></td>";
									print "</tr>\n";
									print "</table>\n";
								print "</p>";
							print "</div>";
							print "<img src='./img/top_box_bottom.png' alt='ジョブシャドウイング お知らせ news bottom' title='ジョブシャドウイング お知らせ news bottom'>";
						print "</div>";
					}
					
					if(count($SDATA)){
						print "<div>\n";
							print "<img src='./img/top_box_schedule.png' class='pngs' alt='ジョブシャドウイング スケジュール一覧' title='ジョブシャドウイング スケジュール一覧'>";
							print "<div class='boxinner'>\n";
								print "<p>";
									print "<table class='box_list'>\n";
										foreach($SDATA as $key=>$value){
											print "<tr>\n";
												print "<td align='left' valign='top' style='width:15%;'>\n";
													print date("m月d日",strtotime($value['DATE']));
												print "</td>\n";
												print "<td align='left' valign='top' style='width:55%;'>\n";
													print "<a href='";
													if($value['LINK']){print $value['LINK'];}else{print "schedule_view_".$value['ID'].".html";}
													if($value['TYPES']=="new"){print "' target='_blank";}
													print"'>".$value['TITLE']."</a>";
												print "</td>\n";
											print "</tr>\n";
										}
										print "<tr>\n";
										print "<td colspan='2' align='right'><a href='schedule.html'>スケジュールを確認する</a></td>";
									print "</tr>\n";
									print "</table>\n";
								print "</p>";
							print "</div>";
							print "<img src='./img/top_box_bottom.png' alt='ジョブシャドウイング　スケジュール一覧 bottom' title='ジョブシャドウイング スケジュール一覧 bottom'>";
						print "</div>";
					}
					
					print "<img src='./img/top_map.jpg' style='margin-right:3px;' alt='ジョブシャドウイング　みんなでグッジョブ運動活動マップ' title='ジョブシャドウイング　みんなでグッジョブ運動活動マップ' width='372' height='257'>";
		
		/*//メインバナー
		$SQL="select * from link_data where SAKUJO=0 and now() between VIEW_DATE_ST and VIEW_DATE_ED and CATEGORI='main' order by NO asc";
		$mains=$tool->SQL($SQL);
		if(count($mains)){
			foreach($mains as $key=>$value){
				print "<div  style='padding-left:2px;padding-bottom:10px;text-align:center;'>\n";
				if($value['LINK']){
					print "<a href='".$value['LINK']."' alt='".$value['TITLE']."' title='".$value['TITLE']."' ";
					if($value['TYPES']=="new"){print " target='_blank' ";}
					print ">";
				}
				$fnl="./image/linkimg".$value['ID'].".jpg";
				if(file_exists($fnl)){
					$size=$tool->SIZE_HOSEI($fnl,"740","650");
					print "<img src='".$fnl."' style='width:".$size['X']."px;height:".$size['Y']."px;' alt='".$value['TITLE']."' title='".$value['TITLE']."'>";
				}else{
					print $value['TITLE'];
				}
				if($value['LINK']){
					print "</a>\n";
				}
				print "</div>\n";
			}
		
		}
		
		//新着１
		if(count($TDATA)){
			print "<div><img src='".URL."img/news_bar.png' alt='新着情報' title='新着情報' ></div>\n";
			print "<table class='top_news' style='	margin-left:10px;width:90%;'>\n";
				foreach($TDATA as $key=>$value){
					print "<tr>\n";
						print "<td align='right' valign='top' style='width:10%;'>";
							//新着は最近1週間ぐらい？
							if(strtotime($value['VIEW_DATE_ST'])>$week2rate){
								print "<img src='".URL."img/new.gif' alt='新着！' title='new!'>";
							}
						print "</td>";
						print "<td align='left' valign='top' style='width:15%;' class='dash'>\n";
							print "<img src='".URL."img/file_mark.gif' style='margin-right:3px;'>";
							print date("m月d日",strtotime($value['VIEW_DATE_ST']));
						print "</td>\n";
						print "<td align='left' valign='top' style='width:20%;' class='dash'>\n";
							print $value['SHOP_NAME'];
						print "</td>\n";
						print "<td align='left' valign='top' style='width:55%;' class='dash'>\n";
							print "<a href='";
							if($value['LINK']){print $value['LINK'];}else{print "view.php?ID=".$value['ID'];}
							if($value['TYPES']=="new"){print "' target='_blank";}
							print"'>".$value['TITLE']."</a>";
						print "</td>\n";
					print "</tr>\n";
				}
				print "<tr>\n";
					print "<td colspan='4' class='t_right'><a href='".URL."view.php' class='dash'>more</a></td>";
				print "</tr>\n";
			print "</table>\n";
		}
		
		if(count($data1)){
			print "<div><img src='".URL."img/blog01_bar.png' alt='金秀商事公式ブログ' title='金秀商事公式ブログ' ></div>\n";
			//print "<div style='margin:10px;padding:10px;width:500px;margin-left:70px;'>".ereg_replace("\]\]>","",ereg_replace("<!\[CDATA\[","",$data1[0][3]))."</div>";
			print "<table class='top_news' style='	margin-left:10px;width:90%;'>\n";
				foreach($data1 as $key=>$value){
					
					//最大4件にしておこうかな
					if($key>=4){break;}
					print "<tr>\n";
						print "<td align='right' valign='top' style='width:10%;'>";
							//新着は最近1週間ぐらい？
							if(strtotime($value[6])>$week2rate){
								print "<img src='".URL."img/new.gif' alt='新着！' title='new!'>";
							}
						print "</td>";
						print "<td align='left' valign='top' style='width:15%;' class='dash'>\n";
							print "<img src='".URL."img/file_mark.gif' style='margin-right:3px;'>";
							print date("m月d日",strtotime($value[6]));
						print "</td>\n";
						print "<td align='left' valign='top' style='width:20%;' class='dash'>\n";
							print "<a href='".$value['1']."' target='_blank'>".$value[0]."</a>";
						print "</td>\n";
						print "<td align='left' valign='top' style='width:55%;' class='dash'>\n";
							if($value[1]){
								print "<a href='".$value['1']."' target='_blank'>".$tool->TXT_CUT($value[2],"25")."</a>";
							}else{
								print $tool->TXT_CUT($value[2],"25");
							}
							
						print "</td>\n";
					print "</tr>\n";
					
				}
				print "<tr>\n";
					print "<td colspan='4' class='t_right'><a href='http://shj.ti-da.net/' class='dash'>more</a></td>";
				print "</tr>\n";
			print "</table>\n";
		}
		
		if(count($data2)){
			print "<div><img src='".URL."img/blog02_bar.png' alt='タウンプラザ東浜ブログ' title='タウンプラザ東浜ブログ' ></div>\n";
			//	print "<div style='margin:10px;padding:10px;width:500px;margin-left:70px;'>".ereg_replace("\]\]>","",ereg_replace("<!\[CDATA\[","",$data2[0][3]))."</div>";
			print "<table class='top_news' style='	margin-left:10px;width:90%;'>\n";
				foreach($data2 as $key=>$value){
					//最大1件
					if($key>=1){break;}
					print "<tr>\n";
						print "<td align='right' valign='top' style='width:10%;'>";
							//新着は最近1週間ぐらい？
							if(strtotime($value[6])>$week2rate){
								print "<img src='".URL."img/new.gif' alt='新着！' title='new!'>";
							}
						print "</td>";
						print "<td align='left' valign='top' style='width:15%;' class='dash'>\n";
							print "<img src='".URL."img/file_mark.gif' style='margin-right:3px;'>";
							print date("m月d日",strtotime($value[6]));
						print "</td>\n";
						print "<td align='left' valign='top' style='width:20%;' class='dash'>\n";
							print "<a href='".$value['1']."' target='_blank'>".$value[0]."</a>";
						print "</td>\n";
						print "<td align='left' valign='top' style='width:55%;' class='dash'>\n";
							if($value[1]){
								print "<a href='".$value['1']."' target='_blank'>".$tool->TXT_CUT($value[2],"25")."</a>";
							}else{
								print $tool->TXT_CUT($value[2],"25");
							}
							
						print "</td>\n";
					print "</tr>\n";
					
				}
				print "<tr>\n";
					print "<td colspan='4' class='t_right'><a href='http://mpagarihama.ti-da.net/' class='dash'>more</a></td>";
				print "</tr>\n";
			print "</table>\n";
		}
		*/
		
		
		
		
	$tool->FOOT();
	
?>