我只需要GUI部件的帮助。请不要投票,否则我将无法提出问题。
<body>
<div class="container-fluid" style="margin-top:5%;">
<h3><b>PRODUCTION</b></h3>
<table id="StatusTable">
<tr>
<th>Phase</th>
<th>Error Code</th>
<th>Error Description</th>
<th>Turnback</th>
<th>Score</th>
<th>Start Date</th>
<th>Incorporation Date</th>
<th>Completion Date</th>
</tr>
<tr>
<th>Authoring</th>
<td>---</td>
<td>---</td>
<td>---</td>
<td>---</td>
<?php
session_start();
$WO_ID = $_SESSION['SELECTED_WO_ID'];
$sql="SELECT * FROM `associated_wos` WHERE `ID` = '$WO_ID'";
//echo $sql;
$result = mysqli_query($conn,$sql);
while ($row = mysqli_fetch_array($result))
{ ?>
<td><?php echo $row["StartDate"]; ?></td>
<td>---</td>
<td><?php echo $row["SFCK SubmissionDate"];?></td>
<?php
}?>
?>
</tr>
<tr>
<?php
$value = 'Peer Review';
$sql="SELECT * FROM `wo_errorinfo` WHERE `WO_NO` = '$WO_ID' AND `Review_Type` = '$value'";
$result = mysqli_query($conn,$sql);
$num_rows = mysqli_num_rows($result);
?>
<tr>
<th rowspan = "<?php echo $num_rows + 1 ;?>">Peer Review</th>
<?php
while ($row = mysqli_fetch_array($result)) {?>
<tr>
<td><?php echo $row["Error_Code"];?></td>
<td><?php echo $row["Error_Description"];?></td>
<td><?php echo $row["Error_Quantity"];?></td>
<?php
}?>
<?php
$select = "SELECT * FROM `wo_reviewerqa` WHERE `WO_ID` = '$WO_ID' and `reviewType` = '$value'";
$result1 = mysqli_query($conn,$select);
$num_rows1 = mysqli_num_rows($result1);
while($row1 = mysqli_fetch_array($result1))
{?>
<td rowspan = "<?php echo $num_rows + 1 ?>"><?php echo $row1["reviewScore"];?></td>
<td rowspan = "<?php echo $num_rows + 1 ?>"><?php echo $row1["reviewStartDate"];?></td>
<td rowspan = "<?php echo $num_rows + 1 ?>">---</td>
<td rowspan = "<?php echo $num_rows + 1 ?>"><?php echo $row1["reviewCompleteDate"];?></td>
<?php
}
?>
</tr>
</tr>
</table>
</div>
</body>
我应该进行哪些更改以获得所需的表。我能够生成该表的唯一方法是交换列。我应该使用JOIN
命令吗?
答案 0 :(得分:1)
您需要GUI,这是表格的HTML结构
<table border="1" cellpadding="5">
<tr>
<td colspan="8"><center>PRODUCTION</center></td>
</tr>
<tr>
<td>Phase</td>
<td>Error Code</td>
<td>Error Description</td>
<td>Turnback</td>
<td>Score</td>
<td>Start Date</td>
<td>Incorporation Date</td>
<td>Completion Date</td>
</tr>
<tr>
<td>Authoring</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="2">Peer Review</td>
<td></td>
<td></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
<tr>
<td rowspan="2">Internal Review</td>
<td></td>
<td></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
<td rowspan="2"></td>
</tr>
<tr>
<td></td>
<td></td>
</tr>
</table>