<?php
	session_start();
	
	require_once("db/db.php");	
	require_once("common/common.php");
	
	$strlistno=trim($_REQUEST["bitemid"]);
	$doidtype=trim($_REQUEST["doid"]);
	
	if($strlistno=="")
	{
		echo "<script>window.location.href='repotherreport.php';</script>";
		exit();
	}
	
	if($doidtype=="")
	{
		echo "<script>window.location.href='repotherreport.php';</script>";
		exit();
	}
		
	//开始搜索数据库是否可以登录
	$strTradeMan=$_SESSION['username'];
	$retval="0";
	if($doidtype=="1")
	{	//审核通过
		$sql = sprintf("Update TR_CheckItem_List Set ItemState=1,CheckTime=GetDate(),CheckMan='%s' Where ListNo=%s And ItemState=0", $strTradeMan, $strlistno);
		if(executeSql($sql))
		{
			$retval="1";
		}
	}
	else if($doidtype=="2")
	{	//不同过
		$sql = sprintf("Update TR_CheckItem_List Set ItemState=2,CheckTime=GetDate(),CheckMan='%s' Where ListNo=%s And ItemState=0", $strTradeMan, $strlistno);
		if(executeSql($sql))
		{
			$retval="1";
		}
	}
	
	echo "<script>window.location.href='repotherreport.php';</script>";
		
	//释放数据库
	freeResult($result);
	closeDb();
?>


