【发布时间】:2017-07-29 20:00:18
【问题描述】:
我有一个用于我们的软件工程的管理信息系统。这就是我想要发生的事情。在我输入客户的基本信息后,他/她的记录(带ID)将显示在客户列表中。旁边是 2 个按钮,第一个按钮是“合同 1”,第二个按钮是“合同 2”。填写完任一合同后,我希望该按钮不可点击。
(另一种解释) 如果合同为空,请使“按钮”可点击,以便用户添加。但填满后,按钮就无法访问了。
我想你可能需要这个代码
<?php
include 'connect-db.php';
?>
<table class="myTable" width="80%">
<th width="5%">Customer<br>Number</th>
<th>CRC</th>
<th>Name</th>
<th>Service<br>Contract</th>
<th>Chapel<br>Contract</th>
</tr>
<?php
$sql = "SELECT * FROM records ORDER BY CustomerNumber DESC LIMIT 5";
$result = mysql_query($sql);
if(mysql_num_rows($result) > 0 ){
while($row = mysql_fetch_assoc($result)){
?>
<tr>
<td><?=$row['CustomerNumber']?></td>
<td><?=$row['CRC']?></td>
<td><?=$row['Name']?></td>
<td>
**<a href="editprocess-service.php?CustomerNumber=<?=$row['CustomerNumber']?>">Add</a>
</td>
<td>
<a href="editprocess-chapel.php?CustomerNumber=<?=$row['CustomerNumber']?>">Add</a>
</td>**
</tr>
<?php
}
}
?>
</table>
<br>
<a href="masterlist.php"><input type="button" value="New Record" style="margin-left: 785px;"></a>
粗体代码是我希望魔法发生的地方。提前谢谢!
【问题讨论】: