<?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_comment") ;
$com = $db->fetchALL() ;
$output = '';


foreach($com as $value) {

	//get video title
	$db->query("SELECT title FROM media WHERE id = '".$value['vid_id']."'") ;
	$tit = $db->fetch() ;

	$output .= '<tr class="listingtableheader" id="listingtableheader'.$value['id'].'"><th>'.$value['id'].'</th><th>'.$tit['title'].'</th><th>'.$value['date'].'</th><th>'.$value['leftbyname'].'</th><th>'.$value['regdposter'].'</th><th>'.$value['text'].'</th>
	
		<th class="actions">
			<input type="submit" class="edit" id="com_edit'.$value['id'].'" title="Edit the comment" value="">
			<input type="submit" class="delete" id="com_delete'.$value['id'].'" title="Delete the comment" value="">
		</th></tr>';
}



?>
<h2>Video Comments</h2>


<div class="settings">
	<fieldset>
		<form action="" method="post" enctype="multipart/form-data">
		<table>
			<tr>
				<td><b>ID:</b></td>
				<td><b>Video title:</b></td>
				<td><b>Added date:</b></td>
				<td><b>Poster:</b></td>
				<td><b>registered:</b></td>
				<td><b>Comment:</b></td>
				<td><b>Actions:</b></td>
			</tr>
			
			<?=$output ?>

		</table>
		</form>

	</fieldset>
</div>	

