<?
	#---------------------------------------------------------------------#
	# This source code is (c)2000 White Pajamas, Inc                      #
	# see http://www.stonekeep.com/license.html for licensing information #
	#---------------------------------------------------------------------#

	#--------------------------------------------------------------------
	# $Id: delres.php3,v 1.8 2000/12/14 19:13:47 shevett Exp $
	#--------------------------------------------------------------------
	
	#
	# Delete a resource.
	#
	# $resource should have the tag.
	#

	LogIt("DEBUG","delres.php3","Prompting for delete of rsource $resource.");
	if ($f_func == "delres") { ?>
	
	<tr bgcolor=#BBBBBB>
	<td width=100% bgcolor=#202020 align=center>
	<table width=50% bgcolor=#bbbbbb cellspacing=2>
		<tr>
			<td colspan=2 bgcolor=#909090 align=center>
				<font color=#ffffff>
				Are you sure you want to delete<br>
				Resource Tag <b><? echo "$resource"; ?></b>
			</td>
		</tr>
		<tr>
			<td bgcolor=#90FF90 align=center>
				<a href="nbrowse.php3?f_process=delres&resource=<? echo rawurlencode($resource) ?>">Yes</a>
			</td>
			<td bgcolor=#FF9090 align=center>
				<a href="nbrowse.php3">No</a>
			</td>
		</tr>
	</table>
	</td>
	</tr>
	
	<?
	
	} else {
	
		if ($f_process == "delres") {
	
			$result=db_query("delete from resources where r_tag='$resource'");
			$count = db_affected_rows($result);
			$lastresult[0]=0;
			$lastresult[1]="Delete complete.  $count rows affected.";

			# we're probably zoomed, so lets punch it out of there too.
			$result=db_query("update state set resazoom=0, resrzoom=0 where uid='$curruser'");
			
		} else {
			#
			# We shouldn't have gotten here.
			#
			
			$lastresult[0]=1;
			$lastresult[1]="Unexpected condition occured! [delslip.php3]";
		}
	}
	
	?>
