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



foreach($ads as $value) {
	if ($value['adtext'] == '') {
		$active = "<img src='./images/red.png' border=0>" ;
	} else {
		$active = "<img src='./images/green.png' border=0>" ;	
	}


	$output .= '<tr class="listingtableheader"><th>'.$value['adspace'].'</th><th>'.$value['adsize'].'</th><th>'.$value['addesc'].'</th><th>'.$active.'</th>
	
		<th class="actions">
			<input type="submit" class="preview" id="ad_preview'.$value['adid'].'" title="Preview the ad" value="">
			<input type="submit" class="edit" id="ad_edit'.$value['adid'].'" title="Edit the ad" value="">
			<input type="submit" class="delete" id="ad_delete'.$value['adid'].'" title="Delete the ad" value="">
		</th></tr>';
}

?>
<h2>Advertising</h2>


<div class="settings">
	<fieldset>
		<form action="" method="post" enctype="multipart/form-data">
		<table>
			<tr><td><b>Ad space name:</b></td><td><b>Ad size:</b></td><td><b>Ad description:</b></td><td><b>Active?:</b></td><td><b>Actions:</b></td></tr>
			
			<?=$output ?>

		</table>
		</form>

	</fieldset>
</div>	
