Location: PHPKode > projects > Druid Defect Control > defectcontrol_0.9.4/tts/querybysample.php
<?php include 'usercheck.php' ?>
<?php include 'genform.php' ?>
<?php include 'errors.php' ?>

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

<script language="javascript">

function fieldChanged() {
    queryform.action = "querybysample.php"; 
    queryform.submit();
}

</script>

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

<?php 

    ttdb_connect($db); 

?>

<h1>Basic query form<?php echo $iddefect?></h1>

<form method="post" action="querybysamplepost.php" name="queryform">
  <input type="hidden" name="iddefect" value="<?php print($iddefect); ?>">
  <p>&nbsp;</p>
  <table width="100%" border="0" cellpadding="2" class="tableFieldContent" cellspacing="2">

  <tr> 
    <td class="tableFieldName" width="30%">Defect id</td>
    <td class="tableFieldContent" width="70%">
        <input type="text" name="fDefectId" size="20" maxlength="20" 
            value="<?php echo $fDefectId; ?>">
      </td>
  </tr>

  <tr> 
    <td class="tableFieldName" width="30%">Headline</td>
    <td class="tableFieldContent" width="70%">
        <input type="text" name="fHeadline" size="60" maxlength="50" 
            value="<?php echo $fHeadline; ?>">
      </td>
  </tr>

  <tr> 
    <td class="tableFieldName" width="30%">Enclosure title</td>
    <td class="tableFieldContent" width="70%">
        <input type="text" name="fEnclosureTitle" size="60" maxlength="50" 
            value="<?php echo $fEnclosureTitle; ?>">
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Enclosure text</td>
    <td class="tableFieldContent" width="70%">
        <input type="text" name="fEnclosureText" size="60" maxlength="50" 
            value="<?php echo $fEnclosureText; ?>">
      </td>
  </tr>

  <tr> 
      <td class="tableFieldName" width="30%">Status</td>
      <td class="tableFieldContent" width="70%"> 
	<?php 	
	    gf_generateLookupFieldSelected($db, 
                                     'fStatus', 
                                     '',
                                     'select * from defectstatus',
                                     'iid',
                                     'sname',
                                     $fStatus,
                                     true);
         ?>
      </td>
  </tr>

  <tr> 
    <td class="tableFieldName" width="30%">Created by</td>
      <td class="tableFieldContent" width="70%"> 
        <?php gf_generateLookupFieldSelected($db, 
                                     'fCreatedBy', 
                                     '',
                                     'select * from users order by sname',
                                     'iid',
                                     'sname',
                                     $fCreatedBy,
                                     true);
         ?>  
     </td> 
  </tr>

  <tr> 
    <td class="tableFieldName" width="30%">Assigned to</td>
      <td class="tableFieldContent" width="70%"> 
        <?php gf_generateLookupFieldSelected($db, 
                                     'fAssignedTo', 
                                     '',
                                     'select * from users order by sname',
                                     'iid',
                                     'sname',
                                     $fAssignedTo,
                                     true);
         ?>  
     </td> 
  </tr>

  <tr> 
      <td class="tableFieldName" width="30%">Project</td>
      <td class="tableFieldContent" width="70%"> 
	<?php 	
	    $selectedProject = gf_generateLookupFieldSelected($db, 
                                     'fProject', 
                                     '',
                                     'select * from project',
                                     'iid',
                                     'sname',
                                     $fProject,
                                     true,
                                     'fieldChanged()');
         ?>
      </td>
  </tr>


  <tr> 
    <td class="tableFieldName" width="30%">Software</td>
      <td class="tableFieldContent" width="70%"> <?php 
            $selectedSoftware = gf_generateLookupFieldSelected($db, 
                                     'fSoftware', 
                                     '',
                                     'select * from software where iidproject = '.$selectedProject,
                                     'iid',
                                     'sname',
                                     $fSoftware,
                                     true,
                                     'fieldChanged()');
         ?> <font size="1">(Choose a project) </font> </td> 
  </tr>


  <tr> 
    <td class="tableFieldName" width="30%">Found on release</td>
      <td class="tableFieldContent" width="70%"> <?php 
            gf_generateLookupFieldSelected($db, 
                'fDetectedInRelease', 
                '',
                "select * from releases where iidsoftware = $selectedSoftware order by sname",
                'iid',
                'sname',
                $fDetectedInRelease,
                true);
         ?> <font size="1">(Choose a software) </font></td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Integrated on release</td>
      <td class="tableFieldContent" width="70%"> <?php 
            gf_generateLookupFieldSelected($db, 
                'fIntegratedOnRelease',
                '',
                "select * from releases where iidsoftware = $selectedSoftware order by sname",
                'iid',
                'sname',
                $fIntegratedOnRelease,
                true);
         ?> <font size="1">(Choose a software)</font> </td>
  </tr>

  <tr> 
      <td class="tableFieldName" width="30%">Repeatability</td>
      <td class="tableFieldContent" width="70%"> 
	<?php gf_generateLookupFieldSelected($db, 
                                     'fRepeat', 
                                     '',
                                     'select * from repeat order by iid',
                                     'iid',
                                     'sname',
                                     $fRepeat,
                                     true);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Defect type</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                                     'fDefectType', 
                                     '',
                                     'select * from defecttype order by iid',
                                     'iid',
                                     'sname',
                                     $fDefectType,
                                     true);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Detection method</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                                     'fDetectionMethod', 
                                     '',
                                     'select * from detectionmethod order by iid',
                                     'iid',
                                     'sname',
                                     $fDetectionMethod,
                                     true);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Priority</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                                     'fPriority', 
                                     '',
                                     'select * from priority order by iid',
                                     'iid',
                                     'sname',
                                     $fPriority,
                                     true);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Resolution type</td>
    <td class="tableFieldContent" width="70%">
	<?php gf_generateLookupFieldSelected($db, 
                                     'fResolutionType',
                                     '',
                                     'select * from resolution',
                                     'iid',
                                     'sname',
                                     $fResolutionType,
                                     true);
         ?>
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Created on or after</td>
    <td class="tableFieldContent" width="70%">
        <input type="text" name="fCreatedAfter" size="20" maxlength="30" 
            value=""> (YYYY/MM/DD)
      </td>
  </tr>
  <tr> 
    <td class="tableFieldName" width="30%">Created on or before</td>
    <td class="tableFieldContent" width="70%">
        <input type="text" name="fCreatedBefore" size="20" maxlength="30" 
            value=""> (YYYY/MM/DD)
      </td>
  </tr>


  <tr>
      <td class="tableFieldName" width="30%">&nbsp; </td>
      <td class="tableFieldContent" width="70%">&nbsp; </td>
  </tr>
</table>

  <div align="center">
    <p><input type="submit" name="Submit" value="Query">
    <input type="button" name="cancel" value="Cancel">
  </p></div>
</form>
<?php ttdb_close($db); ?>
</body>
<?php include 'footer.php'; ?>
</html>
Return current item: Druid Defect Control