<?php

	session_start();
	
	require_once("db/db.php");	
	require_once("common/common.php");
	
	//设置统一语言格式
	//header("Content-type: text/html; charset=gb2312"); 
	
	$strSelID=trim($_REQUEST['rmdoid']);	//1临时锁房,2解除锁房
	$strChainNo=trim($_REQUEST['chainno']);	//房号
	$strRoomNo=trim($_REQUEST['romid']);	//房号

	$strTradeMan=trim($_SESSION['username']);
		
	$strRemarks='';

	$intDoID=0;
	if($strSelID=='1')
	{	
		$intDoID=1; 
		$strRemarks=trim($_REQUEST['remark']);	//备注
	}
	elseif($strSelID=='2')
	{	$intDoID=2; }
	
	
	if($intDoID==1)
	{
		//1临时锁房
		$sql = sprintf("EXECUTE TRS_App_RoomLock '%s','%s',1,'%s','%s'",$strChainNo,$strRoomNo,$strTradeMan,$strRemarks);
		executeSql($sql);
		closeDb();  
	}
	elseif($intDoID==2)
	{
		//2解除锁房
		$sql = sprintf("EXECUTE TRS_App_RoomLock '%s','%s',2,'%s',''",$strChainNo,$strRoomNo,$strTradeMan);
		executeSql($sql);
		closeDb();
	}
	else
	{
		echo '*0*';	//类型不正确，没有提交操作
		exit;
	}
	
	echo '*1*';	//成功执行
?>