在我的数据库中,一个项目有很多任务。通过在单击更新按钮时解析记录ID,我能够为每条记录提供编辑选项。但是,由于一个项目现在有许多任务,我需要在单击按钮时解析项目名称并显示与该项目相关的所有任务。有人可以帮帮我吗? 这是带记录的按钮
这是代码
<table class="table table-lg">
<thead >
<tr class="filters">
<th class="col-lg-1"><input type="text" class="form-control" placeholder="Project" disabled></th>
<th class="col-lg-1"><input type="text" class="form-control" placeholder="Client" disabled></th>
<th class="col-lg-1"><input type="text" class="form-control" placeholder="Task " disabled></th>
<th class="col-lg-1"><input type="text" class="form-control" placeholder="Description" disabled></th>
<th class="col-lg-2"><input type="text" class="form-control" placeholder="Create Date and Time" disabled></th>
<th class="col-lg-2"><input type="text" class="form-control" placeholder="Start Date and Time" disabled></th>
<th class="col-lg-2"><input type="text" class="form-control" placeholder="Due Date and Time" disabled></th>
<th class="col-lg-1"> Edit</th>
<th class="col-lg-1"> Delete</th>
</tr>
</thead>
<tbody>
<?php
if(isset($view_data) && is_array($view_data) && count($view_data)): $i=1;
foreach ($view_data as $key => $data) {
?>
<tr <?php if($i%2==0){echo 'class="even"';}else{echo'class="odd"';}?>>
<td><?php echo $data['projectname']; ?></td>
<td><?php echo $data['cname']; ?></td>
<td><?php echo $data['mytext']; ?></td>
<td><?php echo $data['mytext1']; ?></td>
<td><?php echo $data['mytext2']; ?></td>
<td><?php echo $data['mytext3']; ?></td>
<td><?php echo $data['mytext4']; ?></td>
<td><?php echo $data['mytext5']; ?></td>
<td><a class="btn btn-warning" role="button" href="<?php echo site_url('Task/edit_data/'. $data['id'].''); ?>"><i class="glyphicon glyphicon-pencil"></i> Edit</a></td>
<td><a type="button" class="btn btn-danger" href="<?php echo site_url();?>/Task/delete_data/<?php print($data['id']);?>">
<img src='' title="Delete" onClick="return doconfirm();" />
</a></td>
</tr>
<?php
$i++;
}
else:
?>
<tr>
<td colspan="7" align="center" >No Records Found..</td>
</tr>
<?php
endif;
?>
</tbody>
</table>