1
https://www.dropbox.com/s/e89hjxrogghll9a/1.jpg?dl=0 https://www.dropbox.com/s/sjqfsuwj9mlpc2o/2.jpg?dl=0 請參閱上面的圖像鏈接。圖像顯示的過程獲取正確的ID值並填充到模態彈出框
如果我點擊我選擇的表,它不能選擇正確的數據。這是我的代碼。謝謝你的幫助
<table id="example2" class="table table-bordered table-hover">
<thead>
<tr>
<th>Code</th>
<th>Date of Request</th>
<th>Requestor Name</th>
<th>Form Type</th>
<th>Request Type</th>
<th>Details</th>
<th>Date Needed</th>
<th>Action</th>
</tr>
</thead>
<?php
$req1 = mysql_query('select * from mainviewrequestor where username="'.$_SESSION['username'].'" and req_dateapprove IS NULL');
while($dn1 = mysql_fetch_array($req1))
{
?>
<tr>
<td><?php echo date($dn1['req_code']); ?></td>
<td><?php echo date($dn1['req_date']); ?></td>
<td class="left"><a href="read_pm.php?id=<?php echo $dn1['id']; ?>"><?php echo htmlentities($dn1['empname'], ENT_QUOTES, 'UTF-8'); ?></a></td>
<td><?php echo htmlentities($dn1['form_name'], ENT_QUOTES, 'UTF-8'); ?></td>
<td> <?php echo $dn1['itrf_type']?></td>
<td> <?php echo $dn1['itrf_details']?></td>
<td> <?php echo $dn1['req_dateneeded']?></td>
<td class="left"><a href="#proceed" data-toggle="modal"><button type="submit" class="btn btn-primary" name="approved">View</button></a>
<button type="submit" class="btn btn-primary" name="btn-sub2">DisApproved</button></td>
</tr>
<?php
}
if(intval(mysql_num_rows($req1))==0)
{
?>
<tr>
<td colspan="4" class="center">You have no unread message.</td>
</tr>
<?php
}
?>
</table>
<br />
<?php
}
?>
</table>
</div><!-- /.box-body -->
</div><!-- /.box -->
</div><!-- /.col -->
</div><!-- /.row -->
</section><!-- /.content -->
</div><!-- /.content-wrapper -->
<?php
$req1 = mysql_query('select * from mainviewrequestor2');
while($dn1 = mysql_fetch_array($req1))
{
?>
<!--Pop-up modal Code-->
<div class = "modal fade" id="proceed" role="dialog">
<div class = "modal-dialog modal-lg">
<div class = "modal-content">
<div class = "modal-header">
<h4>REQUEST TABLES</h4>
<h2>------------------------------------------------------------------------------------------</h2>
<div class="content">
<form>
<label>Date Created: </label><input type="text" name="req_date" id="req_date" value="<?php echo ($dn1['req_date']); ?>" /><br />
<label>Request By: </label><input type="text" name="empname" id="empname" value="<?php echo ($dn1['empname']) ?>" /><br />
<label>Form Name: </label><input type="text" name="form_name" id="form_name" value="<?php echo $dn1['form_name']?>" /><br />
<label>Request Type: </label><input type="text" name="itrf_type" id="itrf_type" value="<?php echo $dn1['itrf_type']?>" /><br />
<label>Details: </label><input type="text" name="itrf_details" id="itrf_details" value="<?php echo $dn1['itrf_details']?>" /><br />
<label> Date Needed:</label><input type="text" name="req_dateneeded" id="req_dateneeded" value="<?php echo $dn1['req_dateneeded']?>" /><br />
<button type="submit" class="btn btn-primary" name="req_code">Approved</button>
<button type="submit" class="btn btn-primary" name="update2">Disapproved</button>
</form>
</div>
<?php
}
?>
先生,它的工作感謝幫助:) –