TIM001.php 2.03 KB
<?php 
//*****************************************************************************
//* 
//* プログラム名:タイムカード
//* プログラムID:TIM001.php
//* 機能        :タイムカード メイン
//* 作成者      :
//* 
//*****************************************************************************

header("Content-type: text/html; charset=EUC-JP");

include("include/session_start.inc");
include("include/SessionChk.inc");
include('./include/smarty.conf');

include("inc/header.inc");
include("inc/TIM001.inc");
include("inc/input_chk.inc");

//メニューセット
include("menu_opacity.php");

$strDBinc="include/dbcon.inc";

include($strDBinc);

//社員情報
$strSQL="select * from syain_tbl where del_flg = true order by disp_rank";
$objRecSet = pg_exec($strSQL);
if($objRecSet==false){
	echo("SQL実行に失敗しました(SELECT)");
	exit;
}
if (pg_numrows($objRecSet)>0){
	for($i=0;$i<pg_numrows($objRecSet);$i++){
		$objRecData = pg_fetch_object($objRecSet, $i);
		$strName[$i]=$objRecData->name_kj_sei.$objRecData->name_kj_mei;
		$strCD[$i]=$objRecData->syain_cd;
		if($objRecData->syain_cd == $PHP_SYAIN_CD){
			$strCDSel[$i] = "selected";
		}else{
			$strCDSel[$i] = "";
		}
	}
}

//日付
/*
$strY[0] = date("Y") - 1;
$strYSel[0] = "";
$strY[1] = date("Y");
$strYSel[1] = "selected";
$strY[2] = date("Y") + 1;
$strYSel[2] = "";
*/
$tmp=date("Y")-2;
for($i=0;$i<5;$i++){
	$strY[$i] = $tmp;
	if($tmp==date("Y")){
		$strYSel[$i] = "selected";
	}else{
		$strYSel[$i] = "";
	}
	$tmp++;
}
for($i=0;$i<12;$i++){
	$strM[$i] = $i + 1;
	if(date("n") == $i + 1){	
		$strMSel[$i] = "selected";
	}else{
		$strMSel[$i] = "";
	}
}

$strToday = date("Y年n月j日のタイムカード");

$strSQL="";
$objRec="null";

$o_smarty->assign('PHP_TITLE_NAME',$PHP_TITLE_NAME[19]);
$o_smarty->assign('strName',$strName);
$o_smarty->assign('strCD',$strCD);
$o_smarty->assign('strCDSel',$strCDSel);
$o_smarty->assign('strY',$strY);
$o_smarty->assign('strYSel',$strYSel);
$o_smarty->assign('strM',$strM);
$o_smarty->assign('strMSel',$strMSel);

$o_smarty->assign('strToday',$strToday);

$o_smarty->display('TIM001.tpl');
?>