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' ?>

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

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

    $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 
    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>

<?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>
<form method="post" action="statresult.php" name="projectForm">
  <table width="100%" border="0" cellspacing="5" cellpadding="0">
      <td class="tableFieldName" width="12%">Project: </td>
      <td class="tableFieldContent" width="88%"><?php
                                     'select * from project',
      <td class="tableFieldName" width="12%">Software: </td>
      <td class="tableFieldContent" width="88%"><?php
                                     'select * from software',
      <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>
      <td class="tableFieldName" width="12%">&nbsp; </td>
      <td class="tableFieldContent" width="88%"> 
        <input type="submit" name="Submit" value="Get statistic">

<?php } // if ?>

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