<?php

	include ("frames_header.php"); 
	include ("connection.php");

    if ( (!isset($_SESSION["login"]))or(!isset($_SESSION["pass"])) ) {
	    print "<center><strong>you need to <a href=\"login.php\">login</a> as an authorised curator to proceed.</strong>";
	    include ("frames_footer.php"); 
		return;
	}

    $id=$_GET["id"];
    
	$khoueiry="SELECT \"PROMOTER_ID\" FROM \"PROMOTER\" WHERE \"BASE_REG_ID\"=$id AND \"PROMOTER_ID\"!=$id;";
   	$stmt = pg_query($c,$khoueiry);
   	if ($row=pg_fetch_array($stmt) ){
   	  	print "<center><strong>The region contais children. Erase them first. </strong>";
	    include ("frames_footer.php");
	    return;
	}
    
    
?>
 
 <form action="reg-region-delete-result.php" method="post" name="form1" target="_self">
 <table width="100%" border="0">

<?php

    $id=$_GET["id"];

	print "<input name=\"id\" type=\"hidden\" value=\"$id\">";
	
	print '<tr><td><font color="#CC0000"><H1><u>WARNING:</u></H1></font></td></tr>';
	print "<tr><td align=\"center\"><strong>Are you sure you want to <font size=\"+2\" color=\"#CC0000\">DELETE</font> this record ? </font> All Constructs and associated In_Situs will be deleted! </strong></td></tr>";
		
	print '<tr><td align="center"><center><img src="pictures/button-cur-delete.gif" title="Cancel"  onClick="javascript:self.close();">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
    print '<input name="submit" type="image" src="pictures/button-cur-validate.gif" onClick="submit" title="Ok">';
	
?>

 </table>
 
 </form>

<?php
include ("frames_footer.php"); 
?>
