expense_list.php

来自「CRM 不仅仅是一个管理名词和管理概念」· PHP 代码 · 共 95 行

PHP
95
字号
<?
	########################################
	#OsoonCrm
	#费用列表
	########################################
		
	include "include/db.inc.php";
	include "include/check.inc.php";
	include "include/header.inc.php";
	include "include/array.inc.php";
?> 
<?
	// 翻页
	$tblname = $tbl_crm_expense;
	$where = " where $where_account_view ";
	// expense可以查看所有费用
	if ($G_username == "expense") $where = "";
	$url = "expense_list.php?";

	$sql = "select count(*) from $tblname $where";
	$res = mysql_query($sql);
	$row = @mysql_fetch_array($res);
	$total = $row[0];

	include "include/function.inc.php";
	pagelink($total, $url);
?>
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="90%">
  <tr valign=top> 
    <td width="201"> 
      <? include "include/left.inc.php"; ?>
    </td>
    <td align=center> 
      <br>
      <table width="95%" border="0" cellspacing="0" cellpadding="0" height=25>
        <tr align="right"> 
          <td>
<? if ($G_username=="expense") { ?>
          	<a href="expense_add.php">添加费用</a>
          	|
<? } ?>
          	<a href="expense_list.php">费用列表</a>
          </td>
        </tr>
      </table>
      <hr>
      <table width=95% cellpadding="3" cellspacing="0" align=center border="1" bordercolor="#F5F1E9">
        <tr bgcolor="#ede5d2"> 
          <td>费用名</td>
          <td>费用额(元)</td>
          <td>对象客户</td>
          <td>相应项目</td>
          <td>报销人</td>
          <td>报销部门</td>
          <td width="40">操作</td>
        </tr>
<?
	$limitstart = ($page-1)*$perpage;
	$sql="select * from $tbl_crm_expense $where order by ExpenseID desc limit $limitstart,$perpage";
	$res=mysql_query($sql);
	while ($row=@mysql_fetch_array($res)) {
		// 有相应项目则获取项目名称
		$ProjectID = $row[ProjectID];
		if ($ProjectID) {
			$sql_p = "select * from $tbl_crm_project where ProjectID='$ProjectID'";
			$res_p = mysql_query($sql_p);
			$row_p = @mysql_fetch_array($res_p);
			$ProjectName = $row_p[ProjectName];
		}
?>
        <tr> 
          <td><? echo $row[ExpenseName]; ?>&nbsp;</td>
          <td><? echo $row[RealExpense]; ?>&nbsp;</td>
          <td><? echo $array_crm_id2account[$row[AccountID]]; ?>&nbsp;</td>
          <td><? echo $ProjectName; ?>&nbsp;</td>
          <td><? echo $array_crm_id2user[$row[UserID]]; ?>&nbsp;</td>
          <td><? echo $array_crm_id2dept[$row[DeptID]]; ?>&nbsp;</td>
          <td><a href="expense_view.php?eid=<? echo $row[ExpenseID]; ?>">详细</a></td>
        </tr>
<?
	}
?>
      </table>
      <table width="95%" border="0" cellspacing="0" cellpadding="0" height=25>
        <tr align="right"> 
          <td><? echo $pagelink; ?></td>
        </tr>
      </table>

      <p></p>
    </td>
  </tr>
</table>
<? include "include/footer.inc.php"; ?>

⌨️ 快捷键说明

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