📄 index.php
字号:
<?
include_once 'inc/auth.php';
echo '
<html>
<head>
<title>考勤节假日设置</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">
function CheckForm()
{
if(document.form1.BEGIN_DATE.value=="")
{ alert("起始日期不能为空!");
return (false);
}
if(document.form1.END_DATE.value=="")
{ alert("结束日期不能为空!");
return (false);
}
return true;
}
function delete_holiday(HOLIDAY_ID)
{
msg=\'确认要删除该项日期么?\';
if(window.confirm(msg))
{
HOLIDAY="delete.php?HOLIDAY_ID=" + HOLIDAY_ID;
window.location=HOLIDAY;
}
}
function delete_all()
{
msg=\'确认要删除所有日期么?\';
if(window.confirm(msg))
{
URL="delete_all.php";
window.location=URL;
}
}
function td_calendar(fieldname)
{
myleft=document.body.scrollLeft+event.clientX-event.offsetX-80;
mytop=document.body.scrollTop+event.clientY-event.offsetY+140;
window.showModalDialog("/inc/calendar.php?FIELDNAME="+fieldname,self,"edge:raised;scroll:0;status:0;help:0;resizable:1;dialogWidth:280px;dialogHeight:215px;dialogTop:"+mytop+"px;dialogLeft:"+myleft+"px");
}
</script>
</head>
<body class="bodycolor" topmargin="5">
';
$CUR_DATE = date ('Y-m-d', time ());
echo '<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_new.gif" align="absmiddle"><span class="big3"> 添加考勤节假日</span>
</td>
</tr>
</table>
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3" align="center" >
<form action="add.php" method="post" name="form1" onsubmit="return CheckForm();">
<tr>
<td nowrap class="TableData">起始日期:</td>
<td nowrap class="TableData">
<input type="text" name="BEGIN_DATE" class="BigInput" size="10" maxlength="10" value="';
echo $CUR_DATE;
echo '">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.BEGIN_DATE\');">
</td>
<tr>
<td nowrap class="TableData">结束日期:</td>
<td nowrap class="TableData">
<input type="text" name="END_DATE" class="BigInput" size="10" maxlength="10" value="';
echo $CUR_DATE;
echo '">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar(\'form1.END_DATE\');">
</td>
</tr>
<tr>
<td nowrap class="TableControl" colspan="2" align="center">
<input type="submit" value="添加" class="BigButton" title="添加日期" name="button">
</td>
</form>
</table>
<br>
<table width="95%" border="0" cellspacing="0" cellpadding="0" height="3">
<tr>
<td background="/images/dian1.gif" width="100%"></td>
</tr>
</table>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_open.gif" align="absmiddle"><span class="big3"> 管理考勤节假日</span>
</td>
</tr>
</table>
<br>
<div align="center">
';
$query = 'SELECT * from ATTEND_HOLIDAY order by BEGIN_DATE desc';
$connection = openconnection ();
$cursor = exequery ($connection, $query);
$HOLIDAY_COUNT = 0;
while ($ROW = mysql_fetch_array ($cursor))
{
++$HOLIDAY_COUNT;
$HOLIDAY_ID = $ROW['HOLIDAY_ID'];
$BEGIN_DATE = $ROW['BEGIN_DATE'];
$END_DATE = $ROW['END_DATE'];
if ($HOLIDAY_COUNT == 1)
{
echo '
<table border="0" cellspacing="1" width="450" class="small" bgcolor="#000000" cellpadding="3">
';
}
echo ' <tr class="TableData">
<td nowrap align="center">';
echo $HOLIDAY_COUNT;
echo '</td>
<td nowrap align="center">';
echo $BEGIN_DATE;
echo '</td>
<td nowrap align="center">';
echo $END_DATE;
echo '</td>
<td nowrap align="center" width="80">
<a href="edit.php?HOLIDAY_ID=';
echo $HOLIDAY_ID;
echo '"> 编辑</a>
<a href="javascript:delete_holiday(\'';
echo $HOLIDAY_ID;
echo '\');"> 删除</a>
</td>
</tr>
';
}
if (0 < $HOLIDAY_COUNT)
{
echo ' <thead class="TableHeader">
<td nowrap align="center">序号</td>
<td nowrap align="center">起始日期</td>
<td nowrap align="center">结束日期</td>
<td nowrap align="center">操作</td>
</thead>
<thead class="TableControl">
<td nowrap align="center" colspan="5">
<input type="button" class="BigButton" OnClick="javascript:delete_all();" value="全部删除">
</td>
</thead>
</table>
';
}
else
{
message ('', '尚未添加日期');
}
echo '
</div>
<br>
<div align="center">
<input type="button" value="返回" class="BigButton" onClick="location=\'../\';">
</div>
</body>
</html>';
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -