<table width="100%" cellpadding="0" cellspacing="0" border="0">
	<tr><td class="nav"><a href="index.php?section=home">Home</a>&nbsp;&gt;&nbsp;<a href="index.php?section=ads&theme=<?php echo $data["theme"] ?>">Advertisements</a></td></tr>
	<tr><td><table cellpadding="0" cellspacing="3" border="0" align="center">
	<form action="index.php" method="post">
	<input type="hidden" name="section" value="ads">	
		<tr><td class="body">Theme:</td>
		<td class="highlight"><?php
		admin_form_element ( array ("type" => "select", "name" => "theme", "options" => $data["themes"], "value" => $data["theme"]) );
		?></td><td><?php
		admin_form_element ( array ("type" => "button", "value" => "Load") );
		?></td></tr>
	</form>
	</table></td></tr>
	<tr><td>&nbsp;</td></tr>
	<tr><td><table cellpadding="2" cellspacing="2" border="0" width="500" align="center">
		<tr><td colspan="7" class="lined blue_bcg white_body padded" align="center">Campaigns</td></tr>
		<tr><td colspan="7" class="form_cell" align="center"><?php
		admin_form_element( array ("type" => "button", "value" => "Create New Campaign", "link" => "index.php?section=ads&action=create_campaign&theme=".$data["theme"]) );
		?></td></tr>
		<tr>
		<td class="list_header" align="center">Name</td>
		<td class="list_header" align="center">Type</td>
		<td class="list_header" align="center">Impressions</td>
		<td class="list_header" align="center">Clicks</td>
		<td class="list_header" align="center">Cost</td>
		<td class="list_header" align="center">Balance</td>
		<td class="list_header" align="center">Action</td>
		</tr>
		<?php
		
			foreach($data["campaigns"] as $campaign){
				?><tr>
				<td class="list_cell"><?php echo $campaign["name"]; ?></td>
				<td class="list_cell"><?php echo $campaign["type"]; ?></td>
				<td class="list_cell"><?php echo $campaign["impressions"]; ?></td>
				<td class="list_cell"><?php echo $campaign["clicks"]; ?></td>
				<td class="list_cell"><?php echo $campaign["cost"]; ?></td>
				<td class="list_cell"><?php echo $campaign["balance"]; ?></td>
				<td class="list_cell" align="center"><?php
				admin_output_image("buttons/but_edit_small.gif",$campaign["edit"],0,"edit");
				if($campaign["pause"])
					admin_output_image("buttons/but_pause_small.gif",$campaign["pause"],0,"pause");
				elseif($campaign["resume"])
					admin_output_image("buttons/but_resume_small.gif",$campaign["resume"],0,"resume");
				admin_output_image("buttons/but_delete_small.gif",$campaign["delete"],0,"delete");
				?></td>
				</tr><?php
			}//foreach
		
		?>
	</table></td></tr>
	<tr><td>&nbsp;</td></tr>
	<tr><td><table cellpadding="2" cellspacing="2" border="0" width="500" align="center">
		<tr><td colspan="2" class="lined blue_bcg white_body padded" align="center">Banner Formats</td></tr>
		<tr><td colspan="2" class="form_cell" align="center"><?php
		admin_form_element( array ("type" => "button", "value" => "Add New Format", "link" => "index.php?section=ads&action=edit_format&theme=".$data["theme"]) );
		?></td></tr>
		<tr>
		<td class="list_header" align="center">Name</td>
		<td class="list_header" align="center">Action</td>
		</tr>
		<?php
		
			foreach($data["formats"] as $format){
				?><tr>
				<td class="list_cell"><?php echo $format["name"]; ?></td>
				<td class="list_cell" align="center"><?php
				admin_output_image("buttons/but_edit_small.gif",$format["edit"],0,"edit");
				admin_output_image("buttons/but_delete_small.gif",$format["delete"],0,"delete");
				?></td>
				</tr><?php
			}//foreach
		
		?>
	</table></td></tr>
	<tr><td>&nbsp;</td></tr>
	<tr><td><table cellpadding="2" cellspacing="2" border="0" width="500" align="center">
		<tr><td colspan="4" class="lined blue_bcg white_body padded" align="center">Advertisement Areas</td></tr>
		<tr><td colspan="4" class="form_cell" align="center"><?php
		admin_form_element( array ("type" => "button", "value" => "Add New Area", "link" => "index.php?section=ads&action=edit_area&theme=".$data["theme"]) );
		?></td></tr>
		<tr>
		<td class="list_header" align="center">Name</td>
		<td class="list_header" align="center">Formats</td>
		<td class="list_header" align="center">Smarty Tag</td>
		<td class="list_header" align="center">Action</td>
		</tr>
		<?php
		
			foreach($data["areas"] as $area){
				?><tr>
				<td class="list_cell" valign="top"><?php echo $area["name"]; ?></td>
				<td class="list_cell" valign="top"><?php echo $area["formats"]; ?></td>
				<td class="list_cell" valign="top"><?php echo $area["tag"]; ?></td>
				<td class="list_cell" align="center" valign="top"><?php
				admin_output_image("buttons/but_edit_small.gif",$area["edit"],0,"edit");
				admin_output_image("buttons/but_delete_small.gif",$area["delete"],0,"delete");
				?></td>
				</tr><?php
			}//foreach
		
		?>
	</table></td></tr>
</table>