用户单击锚点返回时如何隐藏表和锚标记中的值

时间:2017-08-16 03:56:47

标签: javascript php jquery html

我想在管理员点击锚点返回时隐藏该行,因为它已经保存在return.php中,所以只需要隐藏返回的状态,而挂起则不是。谢谢你的帮助

  <thead>
                                <tr>
                                    <th>Book title</th>                                 
                                    <th>Borrower</th>                                 
                                    <th>Type</th>                                 
                                    <th>Date Borrow</th>                                 
                                    <th>Due Date</th>                            
                                    <th>Date Returned</th>
                                    <th>Fines</th>
                                    <th>Borrow Status</th>
                                </tr>
                            </thead>
                            <tbody>

                              <?php  $user_query=mysqli_query($dbcon,"select * from borrow
                            LEFT JOIN member ON borrow.member_id = member.member_id
                            LEFT JOIN borrowdetails ON borrow.borrow_id = borrowdetails.borrow_id
                            LEFT JOIN book on borrowdetails.book_id =  book.book_id 
                            ORDER BY borrow.borrow_id DESC
                              ")or die(mysqli_error());
                                while($row=mysqli_fetch_array($user_query)){


$currentdate = date('Y/m/d');

$start = new DateTime($returndate=$row['due_date']); 

$end = new DateTime($currentdate);  

$fines =0;

if(strtotime($currentdate) > strtotime($returndate)){


 $days= $start->diff($end, true)->days;
$fines = $days > 0 ? intval(floor($days)) * 10 : 0;
$fi = $row['borrow_details_id'];
mysqli_query($dbcon,"update borrowdetails set fines='$fines' where borrow_details_id = '$fi'");
}

                                $id=$row['borrow_id'];
                                $book_id=$row['book_id'];
                                $borrow_details_id=$row['borrow_details_id'];

                                    ?>
                                <tr class="del<?php echo $id ?>">


                                <td><?php echo $row['book_title']; ?></td>
                                <td><?php echo $row['firstname']." ".$row['lastname']; ?></td>
                                <td><?php echo $row['type']; ?></td>
                                <td><?php echo $row['date_borrow']; ?></td> 
                                <td><?php echo $row['due_date']; ?> </td>
                                <td><?php echo $row['date_return']; ?> </td>
                                 <td><?php echo "₱ ".$fines; ?></td>
                                <td><?php echo $row['borrow_status'];?></td>
                                <td> <a rel="tooltip"  title="Return" id="<?php echo $borrow_details_id; ?>"
                                 href="#delete_book<?php echo $borrow_details_id; ?>" data-toggle="modal"   
                                  class="btn btn-success"><i class="icon-check icon-large"></i>Return</a>
                                <?php include('modal_return.php'); ?>
                                <td></td> 

                                </tr>
                                <?php  }  ?>
                            </tbody>
                        </table>

这是view_return.php,管理员将在其中查看待处理的所有图书 Returning Book

这是图书已经退回的历史/交易 History of Return book

1 个答案:

答案 0 :(得分:0)

为此,您可以执行以下示例:添加课程&#34; test&#34;在anchorTag或td中 并使用jquery

&#13;
&#13;
$('.test').click(function(){
            $(this).parent().hide();
        });
&#13;
<table>
<tr>
    <td>Test</td>
    <td class="test" id="returnId1">Return</td>
</tr>
<tr>
    <td>Test2</td>
    <td class="test" id="returnId2">Return</td>
</tr>
</table>
&#13;
&#13;
&#13;