在列表中显示操作时出现问题 table
Problems displaying actions in a listing table
我在涉及我的列表 table 的 Actions 列的列中遇到问题。报错如下
Parse error: syntax error, unexpected token "<" in C:\xampp\htdocs\mangas\view\form_select_manga.php on line 42`
此错误是由以下原因引起的:
<a class="btn btn-info" title="Edit" href="edit_manga.php?id_manga=<?php echo $id_manga ?>" role="button"><i class="fa fa-edit"></i> Edit</a>
<a class="btn btn-danger" title="Delete" href="delete_manga.php?id_manga=<?php echo $id_manga ?>" role="button"><i class="fa fa-trash"></i> Delete</a>
只有两个操作按钮有这个问题,我很难适应table而不导致错误。
<div class="container" style="margin-top: 40px;">
<h4 class="text-center">Manga list</h4>
<br>
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Publisher</th>
<th>Volumes</th>
<th>Discont</th>
<th>Collection value</th>
<th>Registration date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
require_once "../model/MangaDAO.php";
$manga = new MangaDAO();
foreach ($manga->selectAllMangas() as $value){
echo '<tr>';
echo '<td title="'.$value['id_manga'].'">'.$value['id_manga'].'</td>';
echo '<td title="'.$value['title'].'">'.$value['title'].'</td>';
echo '<td title="'.$value['publisher'].'">'.$value['publisher'].'</td>';
echo '<td title="'.$value['volumes'].'">'.$value['volumes'].'</td>';
echo '<td title="R$'.$value['discont'].'">R$'.$value['discont'].'</td>';
echo '<td title="R$'.$value['value'].'">R$'.$value['value'].'</td>';
echo '<td title="'.date('d/m/Y H:i:s', strtotime($value['registration_date'])).'">'.
date('d/m/Y H:i:s', strtotime($value['registration_date'])).'</td>';
<a class="btn btn-info" title="Edit" href="edit_manga.php?id_manga=<?php echo $id_manga ?>" role="button"><i class="fa fa-edit"></i> Edit</a>
<a class="btn btn-danger" title="Delete" href="delete_manga.php?id_manga=<?php echo $id_manga ?>" role="button"><i class="fa fa-trash"></i> Delete</a>
echo '</tr>'; echo '</p>';
}
?>
</tbody>
</table>
</div>
<?php
require_once "../model/MangaDAO.php";
$manga = new MangaDAO();
foreach ($manga->readAllMangas() as $value){
echo '<tr>';
echo '<td title="'.$value['id_manga'].'">'.$value['id_manga'].'</td>';
echo '<td title="'.$value['title].'">'.$value['title'].'</td>';
echo '<td title="'.$value['publisher'].'">'.$value['publisher'].'</td>';
echo '<td title="'.$value['volumes'].'">'.$value['volumes'].'</td>';
echo '<td title="R$'.$value['discount'].'">R$'.$value['discount'].'</td>';
echo '<td title="R$'.$value['value'].'">R$'.$value['value'].'</td>';
echo '<td title="'.date('d/m/Y H:i:s', strtotime($value['registering_date'])).'">'.
date('d/m/Y H:i:s', strtotime($value['registering_date'])).'</td>';
echo '<td>';
echo '<a class="btn btn-info" title="Update '.$value['title'].'"'.'href="/mangas/view/form_update_manga.php?id_manga='.$value['id_manga'].'"role="button" ><i class="fa fa-edit"></i> Update</a>';
echo " ";
echo '<a class="btn btn-danger" title="Delete '.$value['title'].'"'.'href="/mangas/controller/delete_manga.php?id_manga='.$value['id_manga'].'"role="button"><i class="fa fa-trash"></i> Delete</a>';
echo '</td>';
echo '</tr>';
}
?>
我在涉及我的列表 table 的 Actions 列的列中遇到问题。报错如下
Parse error: syntax error, unexpected token "<" in C:\xampp\htdocs\mangas\view\form_select_manga.php on line 42`
此错误是由以下原因引起的:
<a class="btn btn-info" title="Edit" href="edit_manga.php?id_manga=<?php echo $id_manga ?>" role="button"><i class="fa fa-edit"></i> Edit</a>
<a class="btn btn-danger" title="Delete" href="delete_manga.php?id_manga=<?php echo $id_manga ?>" role="button"><i class="fa fa-trash"></i> Delete</a>
只有两个操作按钮有这个问题,我很难适应table而不导致错误。
<div class="container" style="margin-top: 40px;">
<h4 class="text-center">Manga list</h4>
<br>
<table class="table table-hover">
<thead>
<tr>
<th>ID</th>
<th>Title</th>
<th>Publisher</th>
<th>Volumes</th>
<th>Discont</th>
<th>Collection value</th>
<th>Registration date</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php
require_once "../model/MangaDAO.php";
$manga = new MangaDAO();
foreach ($manga->selectAllMangas() as $value){
echo '<tr>';
echo '<td title="'.$value['id_manga'].'">'.$value['id_manga'].'</td>';
echo '<td title="'.$value['title'].'">'.$value['title'].'</td>';
echo '<td title="'.$value['publisher'].'">'.$value['publisher'].'</td>';
echo '<td title="'.$value['volumes'].'">'.$value['volumes'].'</td>';
echo '<td title="R$'.$value['discont'].'">R$'.$value['discont'].'</td>';
echo '<td title="R$'.$value['value'].'">R$'.$value['value'].'</td>';
echo '<td title="'.date('d/m/Y H:i:s', strtotime($value['registration_date'])).'">'.
date('d/m/Y H:i:s', strtotime($value['registration_date'])).'</td>';
<a class="btn btn-info" title="Edit" href="edit_manga.php?id_manga=<?php echo $id_manga ?>" role="button"><i class="fa fa-edit"></i> Edit</a>
<a class="btn btn-danger" title="Delete" href="delete_manga.php?id_manga=<?php echo $id_manga ?>" role="button"><i class="fa fa-trash"></i> Delete</a>
echo '</tr>'; echo '</p>';
}
?>
</tbody>
</table>
</div>
<?php
require_once "../model/MangaDAO.php";
$manga = new MangaDAO();
foreach ($manga->readAllMangas() as $value){
echo '<tr>';
echo '<td title="'.$value['id_manga'].'">'.$value['id_manga'].'</td>';
echo '<td title="'.$value['title].'">'.$value['title'].'</td>';
echo '<td title="'.$value['publisher'].'">'.$value['publisher'].'</td>';
echo '<td title="'.$value['volumes'].'">'.$value['volumes'].'</td>';
echo '<td title="R$'.$value['discount'].'">R$'.$value['discount'].'</td>';
echo '<td title="R$'.$value['value'].'">R$'.$value['value'].'</td>';
echo '<td title="'.date('d/m/Y H:i:s', strtotime($value['registering_date'])).'">'.
date('d/m/Y H:i:s', strtotime($value['registering_date'])).'</td>';
echo '<td>';
echo '<a class="btn btn-info" title="Update '.$value['title'].'"'.'href="/mangas/view/form_update_manga.php?id_manga='.$value['id_manga'].'"role="button" ><i class="fa fa-edit"></i> Update</a>';
echo " ";
echo '<a class="btn btn-danger" title="Delete '.$value['title'].'"'.'href="/mangas/controller/delete_manga.php?id_manga='.$value['id_manga'].'"role="button"><i class="fa fa-trash"></i> Delete</a>';
echo '</td>';
echo '</tr>';
}
?>