TOP004.php 4.24 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:TOPページ
//* プログラムID:TOP004.php
//* 機能        :出勤表
//* 作成者      :K.Yoshimura
//* 
//*****************************************************************************

header("Content-type: text/html; charset=EUC-JP");
include("include/session_start.inc");
include("include/SessionChk.inc");
$strDBinc="include/dbcon.inc";

include($strDBinc);


//*****カレンダー編集*****//
	$youbi=array("日","月","火","水","木","金","土");
	$clender=array("#ffccff","#ccffcc","#ccffcc","#ccffcc","#ccffcc","#ccffcc","#99ffff");
	$schedule=array("#ffccff","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#FFFFFF","#99ffff");

	$st_year=substr($strwkdate, 0, 4);
	$st_mon=substr($strwkdate, 4, 2);
	$st_day="01";
	$dateMax=date("j", mktime (0,0,0,$st_mon+1,$st_day-1,$st_year));
	$st_sengetu =date("Ymd", mktime (0,0,0,$st_mon-1,$st_day,$st_year));
	$st_raigetu =date("Ymd", mktime (0,0,0,$st_mon+1,$st_day,$st_year));
	
	echo "先月".$st_sengetu;
	echo "来月".$st_raigetu;
	
	

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="Content-Type" content="text/html; charset=EUC-JP">
<META http-equiv="Content-Style-Type" content="text/css">
<link rel="stylesheet" type="text/css" href="basefont.css">
<TITLE>e-グル TOP</TITLE>
<?php 
include("include/TOP003.inc");
?>
</HEAD>
<BODY>
<?php 
	//**** メニュー ****//
	include("include/menu.inc");

	//**** DB接続 ****//
	$strDBinc="include/dbcon.inc";
	include($strDBinc);

?>
<form name="e_gru">
<br>
<TABLE cellSpacing=0 cellPadding=0 width=502 class="mainColor" border=0>
	<TBODY>
	<TR>
		<TD width=10 class="mainColor" height=30> </TD>
		<TD width=200></TD>
		<TD align=middle width=300>
<?php 
		echo "<SELECT name=main_year>";
		for ($intCnt = $st_year-1 ; $intCnt <= $st_year+1 ; $intCnt++) {
			if ($st_year == $intCnt) {
				echo "<option value=".$intCnt." selected>".$intCnt."年</option>\n";
			}else{
				echo "<option value=".$intCnt.">".$intCnt."年</option>\n";
			}
		}
		echo "</SELECT>";
		echo "<SELECT name=main_mon>";
		for ($intCnt = 1 ; $intCnt <= 12 ; $intCnt++) {
			if ($st_mon == $intCnt) {
				if (strlen($intCnt)==1){
					echo "<option value=\""."0".$intCnt."\" selected>".$intCnt."月</option>\n";
				}
				else{
					echo "<option value=".$intCnt." selected>".$intCnt."月</option>\n";
				}

			}else{
				if (strlen($intCnt)==1){
					echo "<option value=\""."0".$intCnt."\">".$intCnt."月</option>\n";
				}
				else{
					echo "<option value=".$intCnt.">".$intCnt."月</option>\n";
				}
			}
		}
		echo "</SELECT>";
		echo " <input type=button value=表示 onclick=javascript:getDate();>";
?>
		</TD>
		<TD align=right width=300><INPUT type=submit value="<< 先月" onclick="move_date(<?php  echo $st_sengetu; ?>)"><INPUT type=submit value="来月 >>" onclick="move_date(<?php  echo $st_raigetu; ?>)"> </TD>
		<TD width=10 class="mainColor" height=30> </TD>
	</TR>
  </TBODY>
</TABLE>
<TABLE cellSpacing=1 cellPadding=1 width=500 cellpadding="1" class="mainColor">
	<TBODY>
		<TR>
		<TD>
		<TABLE cellspacing="1" cellpadding="1" width="498" " class="mainColor" border="0">
			<TBODY>
			<TR bgColor=#cccccc>
				<TD align=center width=80><SPAN class=Normalfont>日付</SPAN></TD>
				<TD align=center width=80><SPAN class=Normalfont>出社</SPAN></TD>
				<TD align=center width=80><SPAN class=Normalfont>退社</SPAN></TD>
				<TD align=left width=300><SPAN class=Normalfont>外出先</SPAN></TD>
			</TR>
			<?php 
			for ($intDayCnt=1; $intDayCnt <= $dateMax; $intDayCnt++){
					$intYoubi=date("w", mktime (0,0,0,$st_mon,$intDayCnt,$st_year));
					$setdate=date("Ymd", mktime (0,0,0,$st_mon,$intDayCnt,$st_year));
					$intspace=date("w", mktime (0,0,0,$st_mon,$intDayCnt,$st_year));

			?>
			<TR align=left bgColor=#ffffff>
				<TD bgcolor=<?php  $schedule[$intYoubi] ?>> <?php  echo $intDayCnt."(".$youbi[$intspace].")" ?></TD>
				<TD><BR></TD>
				<TD><BR></TD>
				<TD><BR></TD>
			</TR>
			<?php 
			}
			?>
			</TBODY>
		</TABLE>
		</TD>
	</TR>
	</TBODY>
</TABLE>
<br>
<br>
<hr width="967">
<?php 
//コピーライト
include("include/copyright.inc");
?>
<input type="hidden" name="intseq" value="">
<input type="hidden" name="syain_cd" value="">
<input type="hidden" name="strwkdate" value="">
</form>
</BODY>
</HTML>