0
대시 보드에 로그인 할 때 사용자에게 알림을 표시하려는 프로젝트에서 작업하고 있습니다. 알림은 다음과 같이보기로 전달 및 표시 : 내가 경고를 해제 할 경우 통지 한 후 데이터베이스에서 삭제 할 수있는 방법을 찾는 것입니다 달성하기 위해 노력하고 무엇PHP보기에서 경고를 닫을 때 SQL 데이터베이스에서 삭제
<div class="box-body">
<?php foreach ($notifications as $notification) {?>
<div class="alert alert-danger" style="padding: 0px; margin-bottom: 10px;">
<a href="#" class="close" data-dismiss="alert" aria-label="close">×</a>
<strong><?php echo $notification->getNotificationTitle();?></strong>
<?php echo $notification->getNotificationDescription();?>
</div>
<?php }?>
</div>
. 나는 codeigniter와 MySQL 데이터베이스를 사용하고있다.
해고를 감지하기 위해 JS 코드가 필요하다면 서버에 아약스 요청을 보내 관련 레코드를 삭제하라. 순수하게 서버 쪽 일 뿐이며 클라이언트에서하는 일을 전혀 감지 할 수 없으므로 php 자체에서이를 수행 할 수 없습니다. –