-
✘✘✘ WIBUHAX0R1337 ✘✘✘
-
✘
PATCH :
/
home
/
indianstaffing
/
public_html
/
Upload File:
files >> /home/indianstaffing/public_html/GetYearWiseData.php
<?php include 'admin/database/config.php'; $year = $_POST['year']; $state = $_POST['state']; $getstate = $_POST['getstate']; $getyear = $_POST['getyear']; if (isset($year)) { $query = "SELECT * FROM `notification` WHERE YEAR(added_on)= '$year' and state=$getstate GROUP BY MONTH(added_on), year(added_on),id,heading,url,image,status ORDER BY added_on DESC"; $sql = mysqli_query($con, $query); $check = mysqli_num_rows($sql); if ($check > 0) { $notifications = array(); while ($row = mysqli_fetch_assoc($sql)) { $fulldate = $row['added_on']; $monthyear = date('M Y', strtotime($fulldate)); $yearmonth = date('Y-m', strtotime($fulldate)); $notifications[$yearmonth][] = $row; } foreach ($notifications as $yearmonth => $notifications) { ?> <div class="col-md-12"> <h4><?= date('M Y', strtotime($yearmonth)) ?></h4> </div> <div class="col-md-12 mb-30"> <ul class="list-group" style="font-size:14px;"> <?php foreach ($notifications as $notification) { ?> <li class="list-group-item d-flex"> <span style="margin-right: 8px;"><?= date('d-m-Y', strtotime($notification['added_on'])) ?></span> <span> <i class="fa fa-caret-right" style="justify-content:start;"></i> <?= $notification['heading'] ?> </span> <a href="<?= $weburl; ?>admin/uploads/advocacy/notification<?= $notification['image'] ?>" target="_blank" style="margin-left: auto;"> <i class="fa fa-download"></i> </a> </li> <?php } ?> </ul> </div> <?php } } else { echo "<h3>Data not found</h3>"; } } else if (isset($state)) { if ($getyear != 0) { $query = "SELECT * FROM `notification` WHERE state=$state and year(added_on)=$getyear GROUP BY MONTH(added_on), year(added_on),id,heading,url,image,status ORDER BY added_on DESC"; }else{ $query = "SELECT * FROM `notification` WHERE state=$state GROUP BY MONTH(added_on), year(added_on),id,heading,url,image,status ORDER BY added_on DESC"; } $sql = mysqli_query($con, $query); $check = mysqli_num_rows($sql); if ($check > 0) { $notifications = array(); while ($row = mysqli_fetch_assoc($sql)) { $fulldate = $row['added_on']; $monthyear = date('M Y', strtotime($fulldate)); $yearmonth = date('Y-m', strtotime($fulldate)); $notifications[$yearmonth][] = $row; } foreach ($notifications as $yearmonth => $notifications) { ?> <div class="col-md-12"> <h4><?= date('M Y', strtotime($yearmonth)) ?></h4> </div> <div class="col-md-12 mb-30"> <ul class="list-group" style="font-size:14px;"> <?php foreach ($notifications as $notification) { ?> <li class="list-group-item d-flex"> <span style="margin-right: 8px;"><?= date('d-m-Y', strtotime($notification['added_on'])) ?></span> <span> <i class="fa fa-caret-right" style="justify-content:start;"></i> <?= $notification['heading'] ?> </span> <a href="<?= $weburl; ?>admin/uploads/advocacy/notification<?= $notification['image'] ?>" target="_blank" style="margin-left: auto;"> <i class="fa fa-download"></i> </a> </li> <?php } ?> </ul> </div> <?php } } else { echo "<h3>Data not found</h3>"; } } else { $query = "SELECT * FROM `notification` WHERE state=$state GROUP BY MONTH(added_on), year(added_on),id,heading,url,image,status ORDER BY added_on DESC"; $sql = mysqli_query($con, $query); $check = mysqli_num_rows($sql); if ($check > 0) { $notifications = array(); while ($row = mysqli_fetch_assoc($sql)) { $fulldate = $row['added_on']; $monthyear = date('M Y', strtotime($fulldate)); $yearmonth = date('Y-m', strtotime($fulldate)); $notifications[$yearmonth][] = $row; } foreach ($notifications as $yearmonth => $notifications) { ?> <div class="col-md-12"> <h4><?= date('M Y', strtotime($yearmonth)) ?></h4> </div> <div class="col-md-12 mb-30"> <ul class="list-group" style="font-size:14px;"> <?php foreach ($notifications as $notification) { ?> <li class="list-group-item d-flex"> <span style="margin-right: 8px;"><?= date('d-m-Y', strtotime($notification['added_on'])) ?></span> <span> <i class="fa fa-caret-right" style="justify-content:start;"></i> <?= $notification['heading'] ?> </span> <a href="<?= $weburl; ?>admin/uploads/advocacy/notification<?= $notification['image'] ?>" target="_blank" style="margin-left: auto;"> <i class="fa fa-download"></i> </a> </li> <?php } ?> </ul> </div> <?php } } else { echo "<h3>Data not found</h3>"; } }
2022 - 2023 Copyright By Lutfifakee || Padang Blackhat ♥