📄 index.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>
<html>
<head>
<title>工资流程</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">
function delete_flow(FLOW_ID)
{
msg='确认要删除该流程吗?通过该流程上报的工资数据将被删除且不可恢复!';
if(window.confirm(msg))
{
URL="delete.php?FLOW_ID=" + FLOW_ID;
window.location=URL;
}
}
function send_flow(FLOW_ID)
{
msg='确认通过内部邮件发送工资条?';
if(window.confirm(msg))
{
URL="send.php?FLOW_ID=" + FLOW_ID;
window.location=URL;
}
}
function mobilesend_flow(FLOW_ID)
{
URL="send_mobile.php?FLOW_ID=" + FLOW_ID;
window.location=URL;
}
function stop_flow(FLOW_ID)
{
msg='确认要终止该流程吗?将不可恢复为执行状态!';
if(window.confirm(msg))
{
URL="stop.php?FLOW_ID=" + FLOW_ID;
window.location=URL;
}
}
function CheckForm()
{
if(document.form1.BEGIN_DATE.value=="")
{ alert("上报起始日期不能为空!");
return (false);
}
if(document.form1.END_DATE.value=="")
{ alert("上报截止日期不能为空!");
return (false);
}
return (true);
}
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());
$CUR_MON=date("m",time());
if(substr($CUR_MON,0,1)==0)
$CUR_MON=substr($CUR_MON,1,strlen($CUR_MON)-1);
?>
<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>
<?
$query = "SELECT * from SAL_ITEM";
$cursor= exequery($connection,$query);
if(!$ROW=mysql_fetch_array($cursor))
{
Message("提示","尚未定义用于上报的工资项目,不能创建工资上报流程<br><br>");
}
else
{
?>
<div align="center" class="big1">
<b>
<form action="add.php" method="post" name="form1" onsubmit="return CheckForm();">
<table border="0" width="400" cellpadding="2" cellspacing="1" align="center" bgcolor="#000000" class="small">
<tr>
<td nowrap class="TableData">起始日期:</td>
<td class="TableData"><input type="text" name="BEGIN_DATE" size="10" maxlength="10" class="BigInput" value="<?=$CUR_DATE?>">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar('form1.BEGIN_DATE');">
</td>
</tr>
<tr>
<td nowrap class="TableData">截止日期:</td>
<td class="TableData"><input type="text" name="END_DATE" size="10" maxlength="10" class="BigInput" value="<?=$CUR_DATE?>">
<img src="/images/menu/calendar.gif" border="0" style="cursor:hand" onclick="td_calendar('form1.END_DATE');">
</td>
</tr>
<tr>
<td nowrap class="TableData">备注:</td>
<td class="TableData"><input type="text" name="CONTENT" class="BigInput" size="40" maxlength="100" value="<?=$CUR_MON?>月份工资"></td>
</tr>
<tr>
<td nowrap class="TableData"> 提醒:</td>
<td class="TableData">
<input type="checkbox" name="SMS_REMIND" id="SMS_REMIND" checked><label for="SMS_REMIND">使用内部短信息</label>
<?
$query = "select * from SMS2_PRIV";
$cursor=exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
$TYPE_PRIV=$ROW["TYPE_PRIV"];
if(find_id($TYPE_PRIV,4)) //检查该模块是否允许手机提醒
{
?>
<input type="checkbox" name="SMS2_REMIND" id="SMS2_REMIND" <?if($SMS2_REMIND=="1") echo "checked";?>><label for="SMS2_REMIND">使用手机短信</label>
<?
}
?>
</td>
</tr>
<tr >
<td nowrap class="TableControl" colspan="2" align="center"><input type="submit" value="新建" class="BigButton" title="新建工资流程" name="button"></td>
</tr>
</table>
</form>
</b>
</div>
<?
}
?>
<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 SAL_FLOW order by SEND_TIME desc";
$cursor= exequery($connection,$query);
$FLOW_COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
$FLOW_COUNT++;
$FLOW_ID=$ROW["FLOW_ID"];
$BEGIN_DATE=$ROW["BEGIN_DATE"];
$BEGIN_DATE=strtok($BEGIN_DATE," ");
$END_DATE=$ROW["END_DATE"];
$END_DATE=strtok($END_DATE," ");
if($END_DATE=="0000-00-00")
$END_DATE="";
$CONTENT=$ROW["CONTENT"];
$SEND_TIME=$ROW["SEND_TIME"];
$ISSEND=$ROW["ISSEND"];
if($END_DATE=="1980-01-01")
$END_DATE_DESC="已终止";
else
$END_DATE_DESC=$END_DATE;
if($FLOW_COUNT==1)
{
?>
<table border="0" cellspacing="1" width="95%" class="small" bgcolor="#000000" cellpadding="3">
<?
}
?>
<tr class="TableData">
<td nowrap align="center"><?=$SEND_TIME?></td>
<td nowrap align="center"><?=$BEGIN_DATE?></td>
<td nowrap align="center"><?=$END_DATE_DESC?></td>
<td nowrap align="center"><?=$CONTENT?></td>
<td nowrap align="center">
<?
$RUNNING=0;
if($END_DATE=="")
{
echo "<font color='#00AA00'><b>执行中</span>";
$RUNNING=1;
}
else
{
if(compare_date($CUR_DATE,$END_DATE)>0)
{
echo "<font color='#FF0000'><b>已终止</span>";
$RUNNING=2;
}
elseif(compare_date($CUR_DATE,$BEGIN_DATE)>=0)
{
echo "<font color='#00AA00'><b>执行中</span>";
$RUNNING=1;
}
else
echo "待执行";
}
?>
</td>
<td nowrap>
<a href="import.php?FLOW_ID=<?=$FLOW_ID?>">导入工资数据</a><br>
<a href="report_manager?FLOW_ID=<?=$FLOW_ID?>">导出工资报表</a><br>
<?
if($RUNNING==1)
{
?>
<a href="javascript:stop_flow(<?=$FLOW_ID?>);">终止</a>
<?
}
?>
<?
if ($RUNNING==2)
{
if($ISSEND=="0")
{
?>
<a href="javascript:send_flow(<?=$FLOW_ID?>);">发送EMAIL工资条</a>
<?
}
else
{
?>
已发送EMAIL工资条
<?
}
?>
<br><a href="javascript:mobilesend_flow(<?=$FLOW_ID?>);">发送手机工资条</a><br>
<?
}
?>
<a href="javascript:delete_flow(<?=$FLOW_ID?>);">删除</a>
</td>
</tr>
<?
}
if($FLOW_COUNT>0)
{
?>
<thead class="TableHeader">
<td nowrap align="center">流程创建时间 <img border=0 src="/images/arrow_down.gif" width="11" height="10"></td>
<td nowrap align="center">起始日期</td>
<td nowrap align="center">截止日期</td>
<td nowrap align="center">备注</td>
<td nowrap align="center">状态</td>
<td nowrap align="center">操作</td>
</thead>
</table>
<?
}
else
Message("","尚未定义");
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -