-
<?php
-
$nTestPlan = $_REQUEST["TestPlatform"];
-
$nTestType = $_REQUEST["TestType"];
-
echo $nTestPlan . "<br>";
-
echo $nTestType . "<br>";
-
///////////////////////
-
// Connect to DB
-
///////////////////////
-
$nDBInfo = array(
-
"Server"=> "**********",
-
"Database"=> "*********",
-
"UserName"=> "********",
-
"Password"=> "******");
-
$nDBLink = mysql_connect($nDBInfo['Server'], $nDBInfo['UserName'], $nDBInfo['Password']);
-
if (!$nDBLink) {
- die('Could not connect: ' . mysql_error());
- }
- //Select the database we want to use
-
mysql_select_db($nDBInfo['Database']) or die("Could not select database");
- mysql_query("set names utf8;");
-
-
if ($nTestPlan != ""){
-
//Selects All the Test Types in `Test_Data` ....
-
$nSQL = "SELECT DISTINCT(TestType) AS 'Test Type' FROM `Test_Data` WHERE `TestPlan` = '".$nTestPlan."' ;";
-
$result = mysql_query($nSQL);
- while ($row = mysql_fetch_array($result)) {
- if ($row[0] == $nTestType & $row[0] != ""){
- $nOptions .= '<option value="'. $row[0] .'" selected="selected">'. $row[0] .'</option>';
- }else{
- $nOptions .= '<option value="'. $row[0] .'">'. $row[0] .'</option>';
-
}
-
}
-
}
-
if ($nTestType != ""){
- //Selects All the Test Types in `Test_Data` ....
- $nSQL = "SELECT DISTINCT(TestName) AS 'Test Name' FROM `Test_Data` WHERE `TestPlan` = '".$nTestPlan."' AND `TestType` = '".$nTestType."' ;";
- $result = mysql_query($nSQL);
- while ($row = mysql_fetch_array($result)) {
-
$nOptions1 .= '<option value="'. $row[0] .'">'. $row[0] .'</option>';
-
}
-
}
-
mysql_close($nDBLink);
-
?>
- <input type="hidden" id="TestPlan" value="<?php echo $nTestPlan; ?>">
- <input type="hidden" id="TestType" value="<?php echo $nTestType; ?>">
- <select id="TestTypeSelect" size="4" multiple="multiple">
- <?php echo $nOptions; ?>
- </select>
- <select id="TestName" size="4" multiple="multiple">
- <?php echo $nOptions1; ?>
- </select>
- <select id="TestResult" size="4" multiple="multiple">
- <option value="1">Pass</option>
- <option value="2">Fail</option>
- </select>