File: /home/httpd/html/baretube.com/admin/csv_import_queue.php
<?php
require "db.php";
if ($_POST['list']) {
$count = 0;
foreach ($_POST['list'] as $i) {
if (is_numeric($i)) {
if (dbQuery("DELETE FROM `csv_import` WHERE `record_num` = '$i'")) {
$count++;
}
}
}
setMessage("$count rows deleted from CSV Import Queue");
header("Location: $_SERVER[REQUEST_URI]");
exit();
}
?>
<? require "header.php"; ?>
<div class="content-page">
<div class="header-area">
<div class="breadcrumbs">
<a href="index.php">Admin Home</a>
<span><a href="csv_import_queue.php">CSV Import Queue</a></span>
</div>
</div>
<div class="content-outer">
<h2>CSVImport<strong>Queue</strong></h2>
<div class="content-inner">
<? echo getMessages(); ?>
<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;
$results = dbQuery("SELECT * FROM `csv_import` LIMIT $from, $max_results", false);
$total_results = dbValue("SELECT COUNT(`record_num`) AS `count` FROM `csv_import`", 'count');
$total_pages = ceil($total_results / $max_results);
?>
<table class="pagetable">
<thead>
<tr>
<th>Title</th>
<th>URL</th>
<th>Added</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 (!is_array($results)) { ?>
<tr><td colspan="5"><div class="notification alert">No entries found</div></td></tr>
<?php
} else {
foreach ($results as $row) {
$videotitle = str_replace(' ', '-', $row[title]);
$videotitle = str_replace("'", '', $videotitle);
$videotitle = str_replace('"', '', $videotitle);
$videotitle = str_replace('&', 'and', $videotitle);
$videotitle = htmlentities(strtolower($videotitle));
$link = "/videos/$videotitle-$row[record_num].html";
?>
<tr>
<td><strong><?php echo htmlentities($row['title']); ?></strong></td>
<td><?php echo htmlentities($row['flv']); ?></td>
<td></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 } ?>
<?php } ?>
<tr class="item submit">
<td colspan="4">
<?php if (is_array($results)) { ?>
<button type="submit" class="btn action-delete">Delete Selected</button>
<?php } ?>
</td>
</tr>
</tbody>
</table>
</form>
<div id="adminPagination"><? echo showAdminPagination($total_pages); ?></div>
</div>
</div>
</div>
<?php require "footer.php"; ?>