35 lines
		
	
	
		
			792 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			35 lines
		
	
	
		
			792 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
<?PHP 
 | 
						|
 | 
						|
include("config.php");
 | 
						|
 | 
						|
if (!$_POST){ header('Location: '.$site_url); }
 | 
						|
 | 
						|
// error checking
 | 
						|
if(!isset($_POST)) exit();
 | 
						|
 | 
						|
if (isset($_POST[delete])) {	
 | 
						|
	// convert the array to a SQL friendly format
 | 
						|
	$deleteList = "(".implode(",", $_POST[delete]).")";
 | 
						|
	
 | 
						|
	// build the SQL query to delete the edits that are bad
 | 
						|
	$sql = "DELETE FROM ".$prefix."Coaches WHERE coach_id IN $deleteList";
 | 
						|
			  
 | 
						|
	mysql_query($sql) or die(mysql_error());
 | 
						|
}
 | 
						|
 | 
						|
if (isset($_POST[validate])) {
 | 
						|
	// convert the array to a SQL friendly format
 | 
						|
	$idlist = "(".implode(",", $_POST[validate]).")";
 | 
						|
	
 | 
						|
	// build the SQL query
 | 
						|
	$sql = "UPDATE ".$prefix."Coaches
 | 
						|
			  SET coach_valid = 1
 | 
						|
			  WHERE coach_id IN $idlist;";
 | 
						|
			  
 | 
						|
	mysql_query($sql) or die(mysql_error());
 | 
						|
	
 | 
						|
}
 | 
						|
 | 
						|
header('Location: '.$site_url.'/validate.php');
 | 
						|
 | 
						|
?>
 |