<?

$str = $_SESSION[~Sstring~];

if (~$str~==``) 
  {
    echo `
<body onload=~javascript:GetSrchStr();~>
    `;
  }
else
  {
//echo ~<br>Role=$userRole<br>~;
    $NOSORT=1;
    echo `<center><font size=4>Search Results for <i><font color=red>`,$str,`</font></i></font>`,$crlf;
    $lnkT=~concat(`<a href=~.$dq.~javascript:PopTab(`,TabID,`);~.$dq.~>`,TabName,`</a>`)~;
    $lnkI=~concat(`<a href=~.$dq.~javascript:PopIss(`,IssueID,`);~.$dq.~>`,IssueID,`</a>`)~;
    ShowQueryResult(~select `Tab` as Type, $lnkT as Item, Title as Description from Tabs where ProjectId in (`$ProjectId`,0) and isDeleted=0 and (AuthorizedRoles=`` or instr(AuthorizedRoles,`$userRole;`)>0) and (instr(Description,`$str`)>0 or instr(Tabs.Title,`$str`)>0 or instr(Tabs.TabName,`$str`)>0) union select `Issue` as Type, $lnkI as Item, IssueTitle as Description from IssuesView where ProjectId in (`$ProjectId`,0) and (instr(IssueTitle,`$str`)>0 or instr(AssignedDisplayName,`$str`)>0 or instr(OwnerDisplayName,`$str`)>0 or instr(CreatorDisplayName,`$str`)>0) order by Description~);
    $_SESSION[~Sstring~]=``;
    echo `</center>`;
  }

echo `
<script language=javascript>
function GetSrchStr()
{
  lsstr=prompt(~Enter the string to search~,~`,$str,`~);
  if (lsstr==~~) {lsstr=~NULL~;}
  window.document.Help.action=~Help.php?iprm=`,$iPrm,`&iprm2=`,$iPrm2,`&tabRoot=`,$tabRoot,`&lsstr=~+lsstr ;
  window.document.Help.submit(true);
}
function PopTab(itm)
{
  return popitup(~Help.php?iprm=~+itm,50,100,600,~800,resizable=1,scrollbars=yes,location=no,toolbar=no,status=no,menubar=yes~);
}
function PopIss(itm)
{
  return popitup(~IssueEdit.php?id=~+itm,50,100,600,~800,resizable=1,scrollbars=yes,location=no,toolbar=no,status=no,menubar=yes~);
}
</script>
`;

?>