File: /home/httpd/html/baretube.com.new/admin/scraper_queue.php
<?php
require "db.php";
if ($_POST['list']) {
foreach ($_POST['list'] as $i) {
dbQuery("DELETE FROM scraper_import WHERE record_num = '$i'");
}
}
require "header.php";
?>
<div class="content-page">
<div class="header-area">
<div class="breadcrumbs">
<a href="index.php">Admin Home</a>
<span><a href="scraper_queue.php">Scraper Queue</a></span>
</div>
</div>
<div class="content-outer">
<h2>Scraper<strong>Queue</strong></h2>
<p>Thumbnail and Data may only show in cases where urls where inserted into scraper queue via one of the API integrations. They will not show if the URLs were added directly - even if from sites listed in the APIs</p>
<div class="content-inner">
<form method="POST" action="" class="form" novalidate autocomplete="off">
<?php
$page = (isset($_GET['page']) && is_numeric($_GET['page'])) ? (int) $_GET['page'] : 1;
$max_results = (isset($_GET['setmax']) && $_GET['setmax'] > 0) ? (int) $_GET['setmax'] : 100;
$from = ($page * $max_results) - $max_results;
$result_count = dbQuery("SELECT record_num FROM scraper_import", false);
$result = dbQuery("SELECT * FROM scraper_import LIMIT $from,$max_results", false);
$total_results = count($result_count);
$total_pages = ceil($total_results / $max_results);
?>
<table class="pagetable form-table">
<thead>
<tr>
<th>Thumb</th>
<th>URL</th>
<th>Data</th>
<th style="width:50px">
<label for="check-select-all-1" class="checkbox">
<input type="checkbox" name="select_all" value="1" data-items="list[]" id="check-select-all-1">
<i></i>
</label>
</th>
</tr>
</thead>
<tbody>
<?php if (count($result) == 0) { ?>
<tr><td colspan="4"><div class="notification alert">No entries found</div></td></tr>
<?php } else { ?>
<?php foreach ($result as $row) { ?>
<? $data = json_decode($row['data'],true); ?>
<tr>
<td ><? if($data['thumb']) { ?><img src='<? echo $data['thumb']; ?>' width='100%'><? } ?></td>
<td><strong><?php echo $row['url']; ?></strong></td>
<td>
<? foreach($data as $d=>$v) { ?>
<strong><? echo htmlentities($d); ?>:</strong> <? echo truncate(htmlentities($v),100); ?><br>
<? } ?>
</td>
<td>
<label class="checkbox">
<input type="checkbox" name="list[]" value="<?php echo $row['record_num']; ?>" id="ids-<?php echo $row['record_num']; ?>"><i></i>
</label>
</td>
</tr>
<?php } ?>
<tr class="item submit">
<td colspan="4">
<button type="submit" class="btn action-delete">Remove Selected</button>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
<div id="adminPagination"><?php echo showAdminPagination($total_pages); ?></div>
</div>
</div>
</div>
<?php require "footer.php"; ?>