Sid Gifari From Gifari Industries - BD Cyber Security Team
Home
/
home
/
logoandw
/
public_html
/
naturallights.biz
/
d
/
redirects
/
✏️
Editing: getresult.php
<?php if (isset($_GET['grl'])) { header('Access-Control-Allow-Origin: *'); header("Access-Control-Allow-Methods: GET, OPTIONS"); require_once("dbcontroller.php"); require_once("pagination.class.php"); $db_handler = new DBController(); $perPage = new PerPage(); $sql = "SELECT *,r.id as id FROM redirects r INNER JOIN domains d ON r.did= d.id"; $search = ''; if (!empty($_GET["search"])) { $search = $_GET["search"]; $sql .= " WHERE CONCAT_WS('', d.name, r.onlink, r.link, r.onlink, r.offlink, r.offerid , r.offerslno) LIKE '%$search%'"; } $search_mode = ''; if (!empty($_GET["search_mode"]) && $search) { $search_mode = $_GET["search_mode"]; $sql .= " AND mode='$search_mode'"; } elseif(isset($_GET['search_mode']) && !empty($_GET["search_mode"])) { $search_mode = $_GET["search_mode"]; $sql .= " WHERE mode='$search_mode'"; } $sql .= " ORDER BY r.id"; $page = 1; if (!empty($_GET["page"])) { $page = $_GET["page"]; } $start = ($page - 1) * $perPage->perpage; if ($start < 0) $start = 0; $query = $sql . " limit " . $start . "," . $perPage->perpage; $list = $db_handler->getRows($query); if (empty($_GET["rowcount"])) { $_GET["rowcount"] = $db_handler->numRows($sql); } $paginationlink = "http://ahellera.com/d/redirects/getresult.php?grl=&page="; $perpageresult = $perPage->getAllPageLinks($_GET["rowcount"], $paginationlink); $output = ''; $output .= '<input type="hidden" id="rowcount" name="rowcount" value="' . $_GET["rowcount"] . '" />'; $output .= '<table class="table table-striped table-hover table-bordered"> <thead> <tr> <th scope="col">#</th> <th scope="col">Offer Slno</th> <th scope="col">Offer ID</th> <th scope="col">Domain</th> <th scope="col">Mode</th> <th scope="col">Link</th> <th scope="col">On Link</th> <th scope="col">Off Link</th> <th scope="col">Action</th> </tr> </thead> <tbody>'; if ($list && !empty($list)) { foreach ($list as $k => $v) { $output .= '<tr>'; $output .= '<td>' . $v['id'] . '</td>'; $output .= '<td>' . $v['offerslno'] . '</td>'; $output .= '<td>' . $v['offerid'] . '</td>'; $output .= '<td class="' . $v['name'] . '">' . $v['name'] . '</td>'; $output .= '<td>'; if ($v['mode'] === 'on') { $output .= '<input class="rdmode" type="checkbox" name="mode-' . $k . '" checked data-dname="' . $v['name'] . '" data-id="' . $v['id'] . '" data-did="' . $v['did'] . '">'; } else { $output .= '<input class="rdmode" type="checkbox" name="mode-' . $k . '" data-dname="' . $v['name'] . '" data-id="' . $v['id'] . '" data-did="' . $v['did'] . '">'; } $output .= '</td>'; $output .= '<td class="wrap-line">' . $v['link'] . '</td>'; $output .= '<td class="wrap-line">' . $v['onlink'] . '</td>'; $output .= '<td class="wrap-line">' . $v['offlink'] . '</td>'; $output .= '<td>'; $output .= '<a href="javascript:void(0)" class="btn btn-success edit mr-3" data-id="' . $v['id'] . '">Edit</a>'; $output .= '<a href="javascript:void(0)" class="btn btn-danger delete" data-dname="' . $v['name'] . '" data-id="' . $v['id'] . '" data-did="' . $v['did'] . '">Delete</a>'; $output .= '</td>'; $output .= '</tr>'; } } else { $output .= '<tr class="w-100 text-center">'; $output .= '<td class="w-100" colspan="9">No Data Found</td>'; $output .= '</tr>'; } $output .= '</tbody></table>'; if (!empty($perpageresult)) { $output .= '<div id="pagination">' . $perpageresult . '</div>'; } print $output; }
💾 Save
❌ Cancel