0
如何在导航栏上单击时自动重新加载页面?我有这行代码。此代码会在血液活动已超过活动结束日期时删除通知。当页面重新加载时自动删除
我有一张这样的桌子。
Latest Blood Campaign
---------------------------------------------------
id CampaignTitle CampaignAddress CampaignStartDate CampaignEndDate
1 Blood Letting New York 2016-02-24 2016-02-26
Admin Send Notifications
------------------------------------------------------------
id receiver messageBody
1 jk Please come to our blood campaign
My code to delete notification.
<?php
$dateToday2 = '2016-02-29';
$latest2 = LatestBloodCampaign::all();
foreach ($latest2 as $data2)
if($dateToday2 <= $data2->campaignEndDate)
{ }else{
DB::table('admin_send_notifications')
->where('receiver', 'jk')
->where('messageBody', $notification->messageBody)
->delete();
} ?>
我就把这行代码到通知页面,以便在加载时,它会自动删除,但是当它只是点击导航栏上不会删除。