<?php
session_start();
require_once "../init.php";
require_once "../authority.inc.php";
require_once "../../common/Datepicker.inc.php";
if($_GET['IDFinancial'])
{
	$IDFinancial = $_GET['IDFinancial'];
}
else
{
	$IDFinancial = $_POST['IDFinancial'];
}
if($_GET['backUrl'])
{
	$backUrl = $_GET['backUrl'];
}
else
{
	$backUrl = $_GET['backUrl'];
}
$iActive = $_GET['iActive'];
if($_GET['key'])
{
	$key = $_GET['key'];
}
else
{
	$key = $_POST['key'];
}
$OnlineID = $_POST['OnlineID'];
$UserName = $_POST['UserName'];
$Amount = $_POST['Amount'];
$iStatus = $_POST['iStatus'];
$About = $_POST['About'];
$dtCreate = $_POST['dtCreate'];
$update = $_POST['update'];

if(!CheckHashKey('financial'.$IDFinancial,$key)){
   $DB->close();
   die("非法入侵");
}
if($update == 1){
	$sql = "update financial set UserName='$UserName',Amount='$Amount',iStatus='$iStatus',OnlineID='$OnlineID',".
		   "About='$About',dtCreate='$dtCreate' where IDFinancial='$IDFinancial'";
	$DB->query($sql);
}

$sql="select * from financial where IDFinancial='$IDFinancial'";
$result=$DB->query($sql);
$FInfo=$DB->fetch_array($result);
$backUrl = $backUrl?$backUrl:$_SERVER["HTTP_REFERER"];
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>修改财务信息</title>
<script language=javascript src="../share/cal.js"></script>
<LINK href="../share/style.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.7/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/icheck/icheck.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />
</head>
<body>
<? include "../share/top.php"?>
<div id="topLink">
<div id="topInfo">
	<span class="tTitle">财务记录</span>
	<span class="sarr"> >> </span>财务录款
	<span class="sarr"> >> </span><a href="<?=$GLOBALS["parentpath"]?>">返回到管理首页</a>
</div>
</div><div class="page-container">
<!--子导航-->
<? include "financial_nav.inc.php"?>
<!--结束-->
		<form action="financial_edit.php" method="post">
		<table width="100%"  border="0" cellspacing="0" cellpadding="0" class="table" class="table table-border table-bordered table-bg table-hover table-sort">
		  <tr id="tr">
			<td colspan="2">财务记录详细信息</td>
			</tr>
		  <tr>
			<td width="40%" align="right">编号:</td>
			<td><input name="IDFinancial" type="text" class="inputline" value="<?=$FInfo[IDFinancial]?>" readonly> 
			  (此项不可修改)			</td>
		  </tr>
		  <tr>
			<td align="right">网上支付订单号(OnlineID):</td>
			<td><input name="OnlineID" type="text" class="inputline" value="<?=$FInfo[OnlineID]?>"></td>
		  </tr>
		  <tr>
			<td align="right">所属用户</td>
			<td>
			    <input type="text" name="UserName" class="inputline" value="<?=$FInfo[UserName]?>">
			</td>
		  </tr>
		  <tr>
			<td align="right">金额(Amount):</td>
			<td><input name="Amount" type="text" class="inputline" value="<?=$FInfo[Amount]?>">(如果是扣款的请用负数)</td>
		  </tr>
		  <tr>
		    <td align="right">是否激活(iStatus):</td>
		    <td>
			    <select name="iStatus">
				  <option value="0" <? if($FInfo[iStatus]==0)echo "selected"?>>否</option>
				  <option value="1" <? if($FInfo[iStatus]==1)echo "selected"?>>是</option>
				</select>
			</td>
		  </tr>
		  <tr>
			<td align="right">描述(About):</td>
			<td><input name="About" type="text" class="inputline" size="50" value="<?=$FInfo[About]?>"></td>
		  </tr>
		  <tr>
			<td align="right">建立时间(dtCreate):</td>
			<td>
		<input name="dtCreate" type="text" id="dtCreate" onClick="OpenDate(dtCreate)" size="10" maxlength="10" value="<?=substr($FInfo[dtCreate],0,10)?>" class="inputcal">
			</td>
		  </tr>
		  <tr>
			<td>&nbsp;</td>
			<td><br>
			<input type="submit" class="bt2" value="提交">&nbsp;
			  <input type="reset" class="bt2" value="重置">&nbsp;
			  <input type="button" class="bt2" value="返回" onclick="location='<?=$backUrl?>'">&nbsp;
			  <input type="hidden" name="backUrl" value="<?=$backUrl?>">
			  <input type="hidden" name="key" value="<?=$key?>">
			  <input type="hidden" name="update" value="1">
			  </td>
		  </tr>
		</table>
		</form>
<br></div>
<? 
$DB->close();
include "../share/bottom.php";
?>
</body>
</html>
