<?php
/*
 **************************************************************************************************
 *    Copyright (c) 2010-2012 Just Another Video script
 *
 * 	  This file is part of Just Another Video Script.
 *    Version 1.4.3
 *    info@justanothervideoscript.com
 **************************************************************************************************
 *    Come to website for support or buying additional plugins/modules.
 *    http://justanothervideoscript.com/
 **************************************************************************************************
 *    By using this software you agree that you have read and acknowledged our End-User License
 *    Agreement available at http://justanothervideoscript.com/license and can be bound by it.
 **********************************************************************************
 */
include_once("adminfunctions.inc");

$db->query("SELECT * FROM media WHERE flagged = '1'") ;
$flag = $db->fetchALL() ;
$output = '';


foreach($flag as $value) {
	$thumb = "<img src='".$sitepath."uploads/thumbs/".$value['fileid']."/".$value['mainthumb'].".jpg' width='160px' height='120px'>" ;
	$added = date("m/d/Y h:i:s a", $value['added']);
	$db->query("SELECT * FROM category WHERE id = '".$value['category']."' ") ;
	$cat = $db->fetch() ;
		if ($value['hd'] == "1") {
			$hdcheck = "yes" ;
		} else {
			$hdcheck = "no" ;
		}
		if ($value['mobile'] == "1") {
			$mobilecheck = "yes" ;
		} else {
			$mobilecheck = "no" ;
		}

	$output .= '<tr id="listingtableheader'.$value['id'].'" class="listingtableheader"><th>'.$value['id'].'</th><th>'.$thumb.'</th>
	
	<th>Title: '.$value['title'].'<br>Desc: '.$value['description'].'<br>Tags: '.$value['tags'].'</th>
	<th>'.$cat['name'].'</th>
	<th>Poster: '.$value['poster'].'<br>Duration: '.$value['duration'].'<br>Added: '.$added.'</th>
	<th>Mobile: '.$mobilecheck.'<br>HD: '.$hdcheck.'</th>
	
	
		<th class="actions">
			<input type="submit" class="preview" id="flag_preview'.$value['id'].'" title="Check the video" value="">
			<input type="submit" class="delete" id="flag_unflag'.$value['id'].'" title="Unflag the video" value="">
		</th></tr>';
}



?>
<h2>Flagged Videos</h2>


<div class="settings">
	<fieldset>
		<form action="" method="post" enctype="multipart/form-data">
		<table>
			<tr>
				<td><b>ID:</b></td>
				<td><b>Thumb:</b></td>
				<td><b>Media info:</b></td>
				<td><b>Category:</b></td>
				<td><b>video info:</b></td>
				<td><b>Addon info:</b></td>
				<td><b>Actions:</b></td>
			</tr>
			
			<?=$output ?>

		</table>
		</form>

	</fieldset>
</div>	
