index.php

来自「通达OA官方提供的30源代码,感觉很实在」· PHP 代码 · 共 264 行

PHP
264
字号
<?
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 src="/inc/js/module.js"></script>

<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)
{
  URL="send_email.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);
}
</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 width="400" align="center" class="TableBlock">
    <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" align="absMiddle" 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" align="absMiddle" 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">
<?=sms_remind(4);?>
      </td>
    </tr>
   <tfoot align="center" class="TableFooter">
      <td nowrap colspan="2" align="center"><input type="submit" value="新建" class="BigButton" title="新建工资流程" name="button"></td>
    </tfoot>
  </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 width="95%" class="TableList">

<?
    }
?>
    <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>&nbsp;
<?
        }
?>

      
<?
         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 + =
减小字号Ctrl + -
显示快捷键?