0byt3m1n1
Path:
/
var
/
www
/
listcrawler.app
/
public_html
/
admin
/
[
Home
]
File: location_info.php
<?php session_start(); require_once 'config/config.php'; require_once BASE_PATH . '/includes/auth_validate.php'; // Lists class // Get Input data from query string $order_by = filter_input(INPUT_GET, 'order_by'); $order_dir = filter_input(INPUT_GET, 'order_dir'); $search_str = filter_input(INPUT_GET, 'search_str'); // Per page limit for pagination $pagelimit = 200; // Get current page $page = filter_input(INPUT_GET, 'page'); if (!$page) { $page = 1; } // Get DB instance. i.e instance of MYSQLiDB Library $db = getDbInstance(); $select = array('id', 'location_id', 'title', 'detail', 'is_active'); // Start building query according to input parameters // If search string if ($search_str) { $db->where('title', '%' . $search_str . '%', 'like'); $db->orwhere('detail', '%' . $search_str . '%', 'like'); } // Set pagination limit $db->pageLimit = $pagelimit; // Get result of the query $rows = $db->arraybuilder()->paginate('location_info', $page, $select); $total_pages = $db->totalPages; $count = ($page-1)*$pagelimit; ?> <?php include BASE_PATH . '/includes/header.php'; ?> <!-- Main container --> <div id="page-wrapper"> <div class="row"> <div class="col-lg-6"> <h1 class="page-header">Location Info</h1> </div> <div class="col-lg-6"> <div class="page-action-links text-right"> <a href="add_subarea.php?operation=create" class="btn btn-success"><i class="glyphicon glyphicon-plus"></i> Add New</a> </div> </div> </div> <?php include BASE_PATH . '/includes/flash_messages.php'; ?> <!-- Filters --> <div class="well text-center filter-form"> <form class="form form-inline" action=""> <label for="input_search">Search content</label> <input type="text" class="form-control" id="input_search" name="search_str" value="<?php echo htmlspecialchars($search_str, ENT_QUOTES, 'UTF-8'); ?>"> <input type="submit" value="Go" class="btn btn-primary"> </form> </div> <hr> <!-- //Filters --> <!-- Table --> <table class="table table-striped table-bordered table-condensed"> <thead> <tr> <th width="5%" class="text-center">SN. No.</th> <th width="10%">Location</th> <th width="35%" class="text-center">Title</th> <th width="5%" class="text-center">Is Active</th> <th width="10%" class="text-center">Actions</th> </tr> </thead> <tbody> <?php foreach ($rows as $row): $getLocation = $db->rawQueryOne("SELECT `location_name` FROM `locations` WHERE `id` = " . $row['location_id'] . " LIMIT 1 "); ?> <tr> <td class="text-center"><?php $count++; echo $count; ?></td> <td><?php echo $getLocation["location_name"]; ?></span></td> <td><?php echo htmlspecialchars($row['title']); ?></span></td> <td class="text-center"><?php echo htmlspecialchars($row['is_active']); ?></span></td> <td class="text-center"> <a href="edit_location_info.php?location_info_id=<?php echo $row['id']; ?>&operation=edit" class="btn btn-primary"><i class="glyphicon glyphicon-edit"></i></a> </td> </tr> <?php endforeach; ?> </tbody> </table> <!-- //Table --> <!-- Pagination --> <div class="text-center"> <?php echo paginationLinks($page, $total_pages, 'location_info.php', $count); ?> </div> <!-- //Pagination --> </div> <!-- //Main container --> <?php include BASE_PATH . '/includes/footer.php'; ?>