GLOBAL $LINENUMBERS;
$LINENUMBERS=0;
global $FCOLOR;
$FCOLOR='RED';
$ProjectId=$_SESSION['ProjectId'];
$sel=$_REQUEST['VendorSelect'];
if ($sel!=~~)
{
$_SESSION['Instance']=ShowQueryResultScalar(~select rInstance from Responses where rUnique='$sel' and isDeleted=0~);
/*
SetForm('VendorClient_Detail');
*/
$CaseId=ShowQueryResultScalar(~select CaseID from Responses where rUnique='$sel' and isDeleted=0~);
/*
SetInstanceCaseForm($_SESSION['Instance'],$CaseId,'VendorClient_Detail');
*/
SetCaseForm($CaseId,'VendorClient_Detail');
}
echo ~~;
echo ~
Vendors and Clients
~;
ExecuteSQL(~create temporary table b as (select CaseID,rValue as Name,rInstance from Responses where qID='CaseFirstName' and ProjectId='$ProjectId' and isDeleted=0) ~);
ExecuteSQL(~create temporary table a as (select CaseID,tText as Type, rInstance from Responses,ResponseType where qID='CaseType' and rValue in ('P') and ProjectId='$ProjectId' and isDeleted=0 and tID='CSType' and tValue=rValue) ~);
echo '
';
ShowQueryResult(~select distinct concat('') as Detail, Type, Name from a,b where b.CaseID=a.CaseID order by Name ~);
echo ~
Clicking on this button will create a new property
if ($prm=='RE_NewCase')
{
$UserId=$_SESSION['UserId'];
$ProjectId=$_SESSION['ProjectId'];
ExecuteSQL(~insert into Responses (CaseID,qID,uID,ProjectId) select 'New Case', 'CaseID',$UserId,$ProjectId~);
$CaseId=ShowQueryResultScalar(~select rUnique from Responses where CaseID='New Case' and qID='CaseID'~);
ExecuteSQL(~update Responses set CaseID=$CaseId, rValue=$CaseId, rOK=2 where rUnique=$CaseId~);
$_SESSION['CaseId']=$CaseId;
SetForm(RE_ListingDetail);
}
$stat=1;