<?vsp 
--  
--  $Id: xs_t_1_hits1.vsp,v 1.2.2.1 2012/03/08 12:55:18 source Exp $
--  
--  This file is part of the OpenLink Software Virtuoso Open-Source (VOS)
--  project.
--  
--  Copyright (C) 1998-2012 OpenLink Software
--  
--  This project is free software; you can redistribute it and/or modify it
--  under the terms of the GNU General Public License as published by the
--  Free Software Foundation; only version 2 of the License, dated June 1991.
--  
--  This program is distributed in the hope that it will be useful, but
--  WITHOUT ANY WARRANTY; without even the implied warranty of
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
--  General Public License for more details.
--  
--  You should have received a copy of the GNU General Public License along
--  with this program; if not, write to the Free Software Foundation, Inc.,
--  51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
--  
--  
?>
<html>
<head><link rel="stylesheet" type="text/css" href="../demo.css"></head>
<body>

<table class="tableresult">

<TR><TD COLSPAN="3">Hits for queries</TD></TR>
<tr>
  <td>Query</td>
  <td>Comment</td>
  <td>Count</td>
</tr>

<?vsp declare _cnt, ht integer;
      for select distinct TTH_T_ID as tid, TT_QUERY, TT_COMMENT from DB.DBA.XML_TEXT2_XT_TEXT_HIT,
      DB.DBA.XML_TEXT2_XT_TEXT_QUERY
          where TTH_T_ID = TT_ID and TTH_U_ID = 1 do {

      select count (*) into _cnt from DB.DBA.XML_TEXT2_XT_TEXT_HIT, DB.DBA.XML_TEXT2
	  where TTH_T_ID = tid and TTH_U_ID = 1 and XT_ID = TTH_D_ID ;
      ht := 1;
?>
<tr>
  <td><a href="xs_t_1_hits.vsp?tt_id=<?=tid?>"><?=TT_QUERY?></a></td>
  <td><?=TT_COMMENT?></td>
  <td><?=_cnt?></td>
</tr>
<?vsp }
  if (ht <> 1)
    http ('<td colspan=5 align=center>*** No hits registered ***</td>');
?>

</table>
<p>Back to <a href="xs_t_1_list.vsp">main</a></p>
</body>
</html>
