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

📄 expense_edit.php

📁 CRM 不仅仅是一个管理名词和管理概念
💻 PHP
字号:
<?
	########################################
	#OsoonCrm
	#费用详细信息
	########################################
		
	include "include/db.inc.php";
	include "include/check.inc.php";
	include "include/header.inc.php";
	include "include/array.inc.php";
	
	if ($G_username != "expense")
	{
		echo "没有权限!";
		exit;
	}
?> 
<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>
<?
	// 费用详细信息
	$sql="select * from $tbl_crm_expense where ExpenseID='$eid'";
	//$sql.=" and $where_account_view ";// 添加检查
	// expense可以查看所有费用
	if ($G_username != "expense") $sql.=" and $where_account_view ";
	$res=mysql_query($sql);
	$row=@mysql_fetch_array($res);
	$UserID = $row[UserID]; // 费用报销人ID
	$aid = $row[AccountID];
	$pid = $row[ProjectID];
	
	// 对象客户信息
	$sql="select * from $tbl_crm_account where AccountID='$aid'";
	$res=mysql_query($sql);
	$row_a=@mysql_fetch_array($res);

	// 相应项目信息
	$sql="select * from $tbl_crm_project where ProjectID='$pid'";
	$res=mysql_query($sql);
	$row_p=@mysql_fetch_array($res);
?>
<?
	// 功能按钮
	$btn_edit = " <input type=submit value=\"保存\" style=\"width:60\"> ";
	$btn_cancel = " <input type=button value=\"取消\" style=\"width:60\" onclick=\"javascript:history.back()\"> ";
	$btn_list = " <input type=button value=\"返回列表\" style=\"width:60\" onclick=\"javascript:document.location='expense_list.php'\"> ";
	
	$btn_display = $btn_edit.$btn_cancel.$btn_list;
?>
      <form method="post" action="expense_man.php">
      <input type="hidden" name="eid" value="<? echo $eid ?>">
      <input type="hidden" name="action" value="edit">
      <table width="95%" border="0" cellspacing="0" cellpadding="5" align="center">
        <tr> 
          <td width="50%">
		  	<b>费用详细信息</b> <font color="red"> * </font>为必填项
          </td>
          <td width="50%" align=right> 
            <? echo $btn_display; ?>
          </td>
        </tr>
      </table>
      <hr width=95% align=center>
      <table width="95%" border="0" cellspacing="0" cellpadding="5" align="center" bgcolor="#ede5d2" bordercolor="#FFFFFF">
        <tr> 
          <td colspan="2"><b>基本信息</b></td>
        </tr>
      </table>
      <table width="95%" border="1" cellspacing="0" cellpadding="5" align="center" bgcolor="#F5F1E9" bordercolor="#ede5d2">
        <tr> 
          <td width="25%">费用名 <font color=red>*</font></td>
          <td width="25%"> 
            <input type="text" size="30" name="ExpenseName" value="<? echo $row[ExpenseName]; ?>">
          </td>
          <td width="25%">费用额(元)</td>
          <td width="25%"> 
            <input type="text" size="30" name="RealExpense" value="<? echo $row[RealExpense]; ?>">
          </td>
        </tr>
        <tr> 
          <td width="25%">报销人</td>
          <td width="25%"> 
            <? echo $array_crm_id2user[$UserID]; ?>
            &nbsp;</td>
          <td width="25%">报销部门</td>
          <td width="25%"> 
            <? echo $array_crm_id2dept[$row[DeptID]]; ?>
            &nbsp;</td>
        </tr>
        <tr> 
          <td width="25%">费用类别</td>
          <td width="25%">
          	<select name="ProjectExpenseType">
          		<option value=1 <? if ($row[ProjectExpenseType]==1) echo "selected"; ?>>日常费用</option>
          		<option value=2 <? if ($row[ProjectExpenseType]==2) echo "selected"; ?>>项目费用</option>
          	</select>
          </td>
          <td width="25%">费用种类</td>
          <td width="25%">
			  <select name="ProjectExpenseName">
<?
	$sql_tmp = "select ExpenseTypeName,ExpenseType,ExpenseTypeNameID from $tbl_crm_expense_name order by ExpenseType";
	$res_tmp = mysql_query($sql_tmp);
	$flag_expense_type = 0;
	while ($row_tmp=@mysql_fetch_array($res_tmp))
	{
		if ($flag_expense_type != $row_tmp[1]) {
			$flag_expense_type = $row_tmp[1];
			echo "<option value=\"\">------".$array_crm_expense_type[$row_tmp[1]]."------</option>";
		}
		
		$key = $row_tmp[2];
		$val = $row_tmp[0];
		
		if ($key == $row[ProjectExpenseName])
			echo "<option value=\"$key\" selected>$val</option>";
		else
			echo "<option value=\"$key\">$val</option>";
	}
?>
			  </select>
          </td>
        </tr>
        <tr> 
          <td width="25%">费用发生时间</td>
          <td colspan="3"><input type="text" size="10" name="UseTime" value="<? echo $row[UseTime]; ?>"></td>
        </tr>
        <tr> 
          <td width="25%">费用事由</td>
          <td colspan=3> 
            <textarea name="ShiYou" style="height:40px;width:400px;"><? echo $row[ShiYou]; ?></textarea>
          </td>
        </tr>
        <tr> 
          <td width="25%">对象客户 <font color=red>*</font></td>
          <td colspan="3"> 
			  <select name="AccountID">
			  	<option value=""></option>
<?
	//$sql_tmp = "select AccountID,AccountName from $tbl_crm_account where $where_account_view";
	$sql_tmp = "select AccountID,AccountName from $tbl_crm_account";
	$res_tmp = mysql_query($sql_tmp);
	while ($row_tmp=@mysql_fetch_array($res_tmp))
	{
		$key = $row_tmp[0];
		$val = $row_tmp[1];
		
		if ($key == $row[AccountID])
			echo "<option value=\"$key\" selected>$val</option>";
		else
			echo "<option value=\"$key\">$val</option>";
	}
?>
			  </select>
			  <input type=button value="添加客户" style="width:80" onclick="javascript:document.location='account_add.php'">
          </td>
        </tr>
        <tr> 
          <td width="25%">相应项目</td>
          <td colspan="3"> 
			  <select name="ProjectID">
			  	<option value=""></option>
<?
	//$sql_tmp = "select ProjectID,ProjectName from $tbl_crm_project where $where_account_view";
	$sql_tmp = "select ProjectID,ProjectName from $tbl_crm_project";
	$res_tmp = mysql_query($sql_tmp);
	while ($row_tmp=@mysql_fetch_array($res_tmp))
	{
		$key = $row_tmp[0];
		$val = $row_tmp[1];
		
		if ($key == $row[ProjectID])
			echo "<option value=\"$key\" selected>$val</option>";
		else
			echo "<option value=\"$key\">$val</option>";
	}
?>
			  </select>
			  <input type=button value="添加新项目" style="width:80" onclick="javascript:document.location='project_add.php'">
          </td>
        </tr>
      </table>
      <br>
      <p></p>
    </td>
  </tr>
</table>
<? include "include/footer.inc.php"; ?>

⌨️ 快捷键说明

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