EVOLUTION-NINJA
Edit File: notify_v.php
<?php echo view('includes/flow-header'); ?> <section class="notification_home"> <div class="container"> <!--row--> <div class="container-fluid"> <div class="row"> <div class="col-sm-10"></div> <!--col-10--> <div class="col-sm-2 mt-4 "> <button class="custom-btn btn-2" onclick="back()"> <img src="<?php echo base_url('public/assets/images/Import_fill.png'); ?>" alt="back"> Back</button> </div> </div> </div> <!--row--> <div class="row p-4"> <div class="col-sm-12"> <ul class="nav nav-tabs" role="tablist"> <li class="nav-item"> <a class="nav-link active" data-toggle="tab" href="#menu2">All Days</a> </li> <li class="nav-item"> <a class="nav-link" data-toggle="tab" href="#menu1">This Week</a> </li> <li class="nav-item"> <a class="nav-link" data-toggle="tab" href="#home">Today</a> </li> </ul> <!-- Tab panes --> <div class="tab-content notify_content"> <div id="home" class="container tab-pane fade"><br> <div class="today_content"> <div class="row notify_header mb-3"> <h4><i class="fa fa-bell mr-3" aria-hidden="true"></i><b>Notifications</b></h4> </div> <?php foreach($comments as $c){ $i = 0; if($c->created_at == date("Y-m-d") && $c->notify_id =='' ){ $i++; ?> <div class="notification_card" > <h4><?php echo $c->type;?></h4> <p><?php echo $c->message;?></p> <?php if(!empty($c->links_main)) {?> <a href="<?php echo $c->links_main;?>"><button type="button" class="btn btn-info">View</button></a> <?php } ?> <button type="button" class="btn btn-danger" onclick = "delete_fun(<?php echo $c->id;?>);">Delete</button> <p><?php $evdate = explode("-", $c->created_at); $exday = $evdate[2]; $exmonth = $evdate[1]; $exyear = $evdate[0]; $date = ($c->time." ".$c->created_at); echo $exday."-".strftime("%B", mktime(0, 0, 0, $exmonth, $exday, $exyear))."-".$exyear." at ".date('h:i:s a', strtotime($date));?> </p> </div> <?php } } foreach($comments1 as $c){ $i = 0; if($c->created_at == date("Y-m-d") && $c->notify_id =='' ){ $i++; ?> <div class="notification_card"> <h4><?php echo $c->type;?></h4> <p><?php echo $c->message;?></p> <?php if(!empty($c->links_main)) {?> <a href="<?php echo $c->links_main;?>"><button type="button" class="btn btn-info">View</button></a> <?php } ?> <button type="button" class="btn btn-danger" onclick = "delete_fun(<?php echo $c->id;?>);">Delete</button> <p><?php $evdate = explode("-", $c->created_at); $exday = $evdate[2]; $exmonth = $evdate[1]; $exyear = $evdate[0]; $date = ($c->time." ".$c->created_at); echo $exday."-".strftime("%B", mktime(0, 0, 0, $exmonth, $exday, $exyear))."-".$exyear." at ".date('h:i:s a', strtotime($date));?> </p> </div> <?php } } ?> </div> </div> <!----------------------------------------------------------------> <div id="menu1" class="container tab-pane fade"><br> <div class="today_content"> <div class="row notify_header mb-3"> <h4><i class="fa fa-bell mr-3" aria-hidden="true"></i><b>Notifications</b></h4> </div> <?php foreach($comments as $c){ $i = 0; if(strtotime($c->created_at) > (strtotime("-7 day",strtotime(date("Y-m-d"))) ) && $c->notify_id =='' ){ $i++; ?> <div class="notification_card"> <h4><?php echo $c->type;?></h4> <p><?php echo $c->message;?></p> <p>Date:<?php echo $c->created_at;?></p> <?php if(!empty($c->links_main)) {?> <a href="<?php echo $c->links_main;?>"><button type="button" class="btn btn-info">View</button></a> <?php } ?> <button type="button" class="btn btn-danger" onclick = "delete_fun(<?php echo $c->id;?>);">Delete</button> <p><?php $evdate = explode("-", $c->created_at); $exday = $evdate[2]; $exmonth = $evdate[1]; $exyear = $evdate[0]; $date = ($c->time." ".$c->created_at); echo $exday."-".strftime("%B", mktime(0, 0, 0, $exmonth, $exday, $exyear))."-".$exyear." at ".date('h:i:s a', strtotime($date));?> </p> </div> <?php } } foreach($comments1 as $c){ $i = 0; if(strtotime($c->created_at) > (strtotime("-7 day",strtotime(date("Y-m-d"))) ) && $c->notify_id =='' ){ $i++; ?> <div class="notification_card"> <h4><?php echo $c->type;?></h4> <p><?php echo $c->message;?></p> <p>Date:<?php echo $c->created_at;?></p> <?php if(!empty($c->links_main)) {?> <a href="<?php echo $c->links_main;?>"><button type="button" class="btn btn-info">View</button></a> <?php } ?> <button type="button" class="btn btn-danger" onclick = "delete_fun(<?php echo $c->id;?>);">Delete</button> <p><?php $evdate = explode("-", $c->created_at); $exday = $evdate[2]; $exmonth = $evdate[1]; $exyear = $evdate[0]; $date = ($c->time." ".$c->created_at); echo $exday."-".strftime("%B", mktime(0, 0, 0, $exmonth, $exday, $exyear))."-".$exyear." at ".date('h:i:s a', strtotime($date));?> </p> </div> <?php } } ?> </div> </div> <!--------------------------------------------------> <div id="menu2" class="container tab-pane active"><br> <div class="today_content"> <div class="row notify_header mb-3"> <h4><i class="fa fa-bell mr-3" aria-hidden="true"></i><b>Notifications</b></h4> </div> <?php foreach($comments as $c){ $i = 0; if($c->notify_id ==''){ $i++; ?> <div class="notification_card"> <h4><?php echo $c->type;?></h4> <p><?php echo $c->message;?></p> <p>Date:<?php echo $c->created_at;?></p> <?php if(!empty($c->links_main)) {?> <a href="<?php echo $c->links_main;?>"><button type="button" class="btn btn-info">View</button></a> <?php } ?> <button type="button" class="btn btn-danger" onclick = "delete_fun(<?php echo $c->id;?>);">Delete</button> <p><?php $evdate = explode("-", $c->created_at); $exday = $evdate[2]; $exmonth = $evdate[1]; $exyear = $evdate[0]; $date = ($c->time." ".$c->created_at); echo $exday."-".strftime("%B", mktime(0, 0, 0, $exmonth, $exday, $exyear))."-".$exyear." at ".date('h:i:s a', strtotime($date));?> </p> </div> <?php } } foreach($comments1 as $c){ $i = 0; if($c->notify_id ==''){ $i++; ?> <div class="notification_card"> <h4><?php echo $c->type;?></h4> <p><?php echo $c->message;?></p> <p>Date:<?php echo $c->created_at;?></p> <?php if(!empty($c->links_main)) {?> <a href="<?php echo $c->links_main;?>"><button type="button" class="btn btn-info">View</button></a> <?php } ?> <button type="button" class="btn btn-danger" onclick = "delete_fun(<?php echo $c->id;?>);">Delete</button> <p><?php $evdate = explode("-", $c->created_at); $exday = $evdate[2]; $exmonth = $evdate[1]; $exyear = $evdate[0]; $date = ($c->time." ".$c->created_at); echo $exday."-".strftime("%B", mktime(0, 0, 0, $exmonth, $exday, $exyear))."-".$exyear." at ".date('h:i:s a', strtotime($date));?> </p> </div> <?php } } ?> </div> </div> <!--------------------------------------------------> </div><!------tab-content-------> </div> </div> </div> </section> <script type="text/javascript"> function delete_fun(id){ $.ajax({ url:"<?php echo base_url("delete-notify")?>", type:"POST", data:{id:id}, success:function(response) { response = jQuery.parseJSON(response); console.log(response); if(response.result == 1) { toastr["success"](response.message); location.reload(); } } }); } </script> <!-- back button link --> <script> function back(){ window.location.href="<?php echo base_url('Gas'); ?>" } </script> <?php echo view('includes/flow-footer'); ?> <style> .notification_card{ color: black; } </style>