File: /home/httpd/html/baretube.com.new/admin/encoder_queue.php
<?
require "db.php";
if ($_POST['list']) {
foreach ($_POST['list'] as $i) {
if (is_numeric($i)) {
dbQuery("UPDATE `content` SET `approved` = 0 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="encoder_queue.php">Encoder Queue</a></span>
</div>
</div>
<div class="content-outer">
<h2>Encoder<strong>Queue</strong></h2>
<div class="content-inner">
<? echo getMessages(); ?>
<form method="POST" action="" class="form" novalidate autocomplete="off">
<?
$page = (isset($_GET['page']) && is_numeric($_GET['page'])) ? (int) $_GET['page'] : 1;
$max_results = (isset($_GET['setmax']) && $_GET['setmax'] > 0) ? (int) $_GET['setmax'] : 500;
$from = ($page * $max_results) - $max_results;
$result = dbQuery("SELECT * FROM `content` WHERE `approved` = 1 AND `enabled` = 0 LIMIT $from, $max_results", false);
$total_results = dbValue("SELECT COUNT(`record_num`) AS `count` FROM `content` WHERE `approved` = 1 AND `enabled` = 0", 'count');
$total_pages = ceil($total_results / $max_results);
?>
<table class="pagetable">
<thead>
<tr>
<th>Title</th>
<th>Information</th>
<th>Uploaded</th>
<th class="options"> </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>
<? if (count($result) == 0) { ?>
<tr><td colspan="5"><div class="notification alert">No entries found</div></td></tr>
<? } else { ?>
<?
foreach ($result as $row) {
$videotitle = str_replace(' ', '-', $row[title]);
$videotitle = str_replace("'", '', $videotitle);
$videotitle = str_replace('"', '', $videotitle);
$videotitle = str_replace('&', 'and', $videotitle);
$videotitle = strtolower($videotitle);
$link = "/videos/$videotitle-$row[record_num].html";
?>
<tr>
<td><strong><? echo $row['title']; ?></strong></td>
<td>Description: <? echo $row['description']; ?><br />
<? $srow = dbRow("SELECT `username` FROM `users` WHERE `record_num` = '$row[submitter]'"); ?>
Uploaded By: <a href="edit_user.php?id=<? echo $row['submitter']; ?>"><? echo $srow['username']; ?></a></td>
<td><span><? echo $row['date_added']; ?></span></td>
<td class="options">
<a href="edit_content.php?id=<? echo $row['record_num']; ?>" class="btn btn-xs btn-orange popEditPublish"><i class="ion ion-edit icon-edit"></i></a>
</td>
<td>
<label class="checkbox">
<input type="checkbox" name="list[]" value="<? echo $row['record_num']; ?>" id="ids-<? echo $row['record_num']; ?>"><i></i>
</label>
</td>
</tr>
<? } ?>
<? } ?>
<tr class="item submit">
<td colspan="5">
<? if (count($result) > 0) { ?>
<button type="submit" class="btn action-delete">Delete Selected</button>
<? } ?>
</td>
</tr>
</tbody>
</table>
<div id="adminPagination"><? echo showAdminPagination($total_pages); ?></div>
</form>
</div>
</div>
</div>
<? require "footer.php"; ?>