Location: PHPKode > projects > Druid Defect Control > defectcontrol_0.9.4/tts/statistics.php
<?php require_once 'usercheck.php' ?>
<?php require_once 'genform.php' ?>
<?php require_once 'database.php' ?>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="style.css">
</head>

<body bgcolor="#FFFFFF">
<?php include 'header.php'; ?>

<?php
    ttdb_connect($db);    
    $userInfo = ttus_getLoginUserInfo($db);
?>

<h1>Statistics module</h1>
<p>Database backend: <font color="#990000"><b><?php echo DATABASE_BACKEND; ?></b></font></p>
<?php if (DATABASE_BACKEND == 'MySQL') { ?>

<p>Currently MySQL does not support the full SQL standard, so some queries (involving 
  subselects) do not work. Here is a sample of what we are talking about: </p>
<pre>SELECT DISTINCT(type) AS distinctfields 
FROM (
    SELECT count(d.iid), p.sname AS priority, t.sname AS type 
    FROM defect d, defecttype t, priority p 
    WHERE  d.iidpriority = p.iid AND 
           d.iiddefecttype = t.iid AND 
           d.iidproject = 0 AND 
           d.iidsoftware = 0 
    GROUP BY priority,type 
    ORDER BY priority
) AS f</pre>
<p>While this can be done in other ways, fully SQL conformant databases support 
  it, so this module is disabled for MySQL until we find a workaround. If you 
  want to see it working, you can download a copy and try with a postgres backend 
  (sourceforge only supports MySQL).</p>
<p>&nbsp;</p>

<?php } else { ?>

<p><b><font color="#993300">Note</font></b>: This is still an experimental module, 
  so its functionality is limited. Expect more graphs to be added in upcoming 
  releases (and, of course, feel free to add yours and mail them to us).</p>
<p>&nbsp;</p>
<form method="post" action="statresult.php" name="projectForm">
  <table width="100%" border="0" cellspacing="5" cellpadding="0">
    <tr> 
      <td class="tableFieldName" width="12%">Project: </td>
      <td class="tableFieldContent" width="88%"><?php
        gf_generateLookupFieldSelected($db, 
                                     'fProject', 
                                     '',
                                     'select * from project',
                                     'iid',
                                     'sname',
									 $userInfo['iiddefaultproject'],
									 true);        
      ?></td>
    </tr>
    <tr> 
      <td class="tableFieldName" width="12%">Software: </td>
      <td class="tableFieldContent" width="88%"><?php
              gf_generateLookupFieldSelected($db, 
                                     'fSoftware',
                                     '',
                                     'select * from software',
                                     'iid',
                                     'sname',
									 '');
      ?>
      </td>
    </tr>
    <tr> 
      <td class="tableFieldName" width="12%">Statistic: </td>
      <td class="tableFieldContent" width="88%"> 
        <select name="idquery">
          <option value="3" selected>Priority / solved-pending</option>
          <option value="2">Defect type / priority distribution</option>
          <option value="1">Absolute monthly defect status</option>
        </select>
      </td>
    </tr>
    <tr> 
      <td class="tableFieldName" width="12%">&nbsp; </td>
      <td class="tableFieldContent" width="88%"> 
        <input type="submit" name="Submit" value="Get statistic">
      </td>
    </tr>
  </table>
  </form>
<p>&nbsp;</p>

<?php } // if ?>


<?php ttdb_close($db) ?>
<?php include 'footer.php'; ?>
</body>
</html>
Return current item: Druid Defect Control