⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 report.php

📁 极限网络智能办公系统 Office Automation V3.0官方100%源代码.
💻 PHP
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");

if($fld_str=="")
{
 $query = "SELECT ITEM_ID from SAL_ITEM";
 $cursor= exequery($connection,$query);
 $FLOW_COUNT=0;
 while($ROW=mysql_fetch_array($cursor))
    {
    	$STYLE=$STYLE.$ROW["ITEM_ID"].",";
    }
 }
 else
 {  
  $STYLE=$fld_str;
  }
?>

<html>
<head>
<title>工资报表 - <?=$CONTENT?></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
.small {  font-size: 9pt;}
</style>
</head>

<body>

<?
 $query = "SELECT count(*) from SAL_ITEM";
 $ITEM_COUNT=0;
 $cursor= exequery($connection,$query);
 if($ROW=mysql_fetch_array($cursor))
    $ITEM_COUNT=$ROW[0];

 if($ITEM_COUNT==0)
 {
   Message("提示","尚未定义工资项目");
   Button_back();
   exit;
 }
?>

<table border="1" bordercolor="#000000" cellspacing="0" class="small" cellpadding="3" align="center">

    <tr bgcolor="#D3E5FA">
      <td nowrap align="center"><b>部门</b></td>
      <td nowrap align="center"><b>姓名</b></td>
      <td nowrap align="center"><b>角色</b></td>
<?
 $STYLE_ARRAY=explode(",",$STYLE);
 $ARRAY_COUNT=sizeof($STYLE_ARRAY);
 $COUNT=0;
 if($STYLE_ARRAY[$ARRAY_COUNT-1]=="")$ARRAY_COUNT--;
 for($I=0;$I<$ARRAY_COUNT;$I++)
   {
   	 $query1 = "select ITEM_ID,ITEM_NAME from SAL_ITEM where ITEM_ID='$STYLE_ARRAY[$I]'";
     $cursor1= exequery($connection,$query1);
     if($ROW=mysql_fetch_array($cursor1))
        {
        	$ITEM_NAME=$ROW["ITEM_NAME"];
          $ITEM_ID[$COUNT]=$ROW["ITEM_ID"];
        }
     $COUNT++;
?>
      <td nowrap align="center"><b><?=$ITEM_NAME?></b></td>
<?
 }
?>
    </tr>

<?
if($COPY_TO_ID!="")
   {
   	$COPY_TO_ID="'".str_replace(",","','",substr($COPY_TO_ID,0,-1))."'";
    $WHERE_STR.=" and USER.USER_ID in ($COPY_TO_ID)";
   }
if($TOID!="" and $TOID!="ALL_DEPT")
   {
   	 $TOID="'".str_replace(",","','",substr($TOID,0,-1))."'";
     $WHERE_STR.=" and DEPARTMENT.DEPT_ID in ($TOID)";
   }  
 if($DEPT_FLAG!=1) 
  {
  	$query = "SELECT * from USER,USER_PRIV,DEPARTMENT where DEPARTMENT.DEPT_ID=USER.DEPT_ID and USER.USER_PRIV=USER_PRIV.USER_PRIV".$WHERE_STR." order by DEPT_NO,PRIV_NO,USER_NAME";
  }
  else
  {
  	$query = "SELECT * from USER,USER_PRIV where USER.USER_PRIV=USER_PRIV.USER_PRIV and DEPT_ID=0";
  }
 $cursor= exequery($connection,$query);
 $USER_COUNT=0;
 while($ROW=mysql_fetch_array($cursor))
 {
    $USER_COUNT++;

    $USER_ID=$ROW["USER_ID"];
    $USER_NAME=$ROW["USER_NAME"];
    $DEPT_ID=$ROW["DEPT_ID"];
    $USER_PRIV=$ROW["USER_PRIV"];

    if($DEPT_ID==0)
       $DEPT_NAME="离职人员/外部人员";
    else
    {
       $query1="select * from DEPARTMENT where DEPT_ID=$DEPT_ID";
       $cursor1= exequery($connection,$query1);
       if($ROW=mysql_fetch_array($cursor1))
          $DEPT_NAME=$ROW["DEPT_NAME"];
    }

    $query1 = "SELECT * from USER_PRIV where USER_PRIV='$USER_PRIV'";
    $cursor1= exequery($connection,$query1);
    if($ROW=mysql_fetch_array($cursor1))
         $USER_PRIV=$ROW["PRIV_NAME"];
?>
    <tr>
      <td nowrap align="center"><?=$DEPT_NAME?></td>
      <td nowrap align="center"><?=$USER_NAME?></td>
      <td nowrap align="center"><?=$USER_PRIV?></td>
<?
   $query1="select * from SAL_DATA where FLOW_ID=$FLOW_ID and USER_ID='$USER_ID'";
   $cursor1= exequery($connection,$query1);
   if($ROW=mysql_fetch_array($cursor1))
   {
     for($I=0;$I< $COUNT;$I++)
     {
       $STR="S".$ITEM_ID[$I];
       $$STR=format_money($ROW["$STR"]);
     }
   }
   else
   {
     for($I=0;$I< $COUNT;$I++)
     {
       $STR="S".$ITEM_ID[$I];
       $$STR="";
     }
   }

   for($I=0;$I< $COUNT;$I++)
   {
      $STR="S".$ITEM_ID[$I];
      $STR_COUNT=$STR."_COUNT";
      $$STR_COUNT+=$$STR;

      if($$STR=="")
         $$STR="&nbsp;";
?>
      <td nowrap align="right"><?=$$STR?></td>
<?
   }
?>
    </tr>
<?
 }

 if($USER_COUNT==0)
 {
?>
  <div align="center"><b>尚未定义用户</b></div><br>
<?
 }
 else
 {
?>
  <tr bgcolor="#EEEEEE">
   <td nowrap align="center" colspan="3"><b>合计</b></td>
<?
   for($I=0;$I< $COUNT;$I++)
   {
      $STR="S".$ITEM_ID[$I];
      $STR_COUNT=$STR."_COUNT";
      $DATA=format_money($$STR_COUNT);

      if($DATA=="")
         $DATA="&nbsp;";
?>
   <td nowrap align="right"><b><?=$DATA?></b></td>
<?
   }
?>
  </tr>
<?
 }
?>
</table>
</div>

</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -