mirror of
				https://github.com/fspc/Yellow-Bike-Database.git
				synced 2025-10-31 08:55:36 -04:00 
			
		
		
		
	1). Adds configuration options to turn off waiver & email_list options 2). Puts waiver in Connections/waiver.txt 3). New MySQL waiver column added, receive_newsletter used for email_list.
		
			
				
	
	
		
			49 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			49 lines
		
	
	
		
			1.3 KiB
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| require_once('../Connections/database_functions.php');
 | |
| require_once('../Connections/YBDB.php');
 | |
| mysql_select_db($database_YBDB, $YBDB);
 | |
| 
 | |
| 	// update waiver 
 | |
| 	if( isset($_POST['waiver']) ) {		
 | |
| 				
 | |
| 				$waiver = $_POST['waiver'];	
 | |
| 			
 | |
| 				$query = "UPDATE contacts SET waiver=" . $waiver . 
 | |
| 							" WHERE contact_id=" . $_POST['contact_id'] . ";";				 
 | |
| 				$result = mysql_query($query, $YBDB) or die(mysql_error());
 | |
| 		
 | |
| 	}
 | |
| 	
 | |
| 	// return waiver value	
 | |
| 	if (isset($_POST['waiver_value'])) {
 | |
| 		
 | |
| 			$query = 'SELECT waiver FROM contacts WHERE contact_id="' . $_POST['contact_id'] . '";';
 | |
| 			$sql = mysql_query($query, $YBDB) or die(mysql_error());
 | |
| 			$result = mysql_fetch_assoc($sql);
 | |
| 			echo $result['waiver'];
 | |
| 					
 | |
| 	}
 | |
| 	
 | |
| 	// update email_list
 | |
| 	if( isset($_POST['email_list']) ) {		
 | |
| 				
 | |
| 				$email_list = $_POST['email_list'];	
 | |
| 				$query = "UPDATE contacts SET receive_newsletter=" . $email_list .
 | |
| 							" WHERE contact_id=" . $_POST['contact_id'] . ";";				 
 | |
| 				$result = mysql_query($query, $YBDB) or die(mysql_error());
 | |
| 		
 | |
| 	}	
 | |
| 
 | |
| 	// return email_list value	
 | |
| 	if (isset($_POST['email_list_value'])) {
 | |
| 		
 | |
| 			$query = 'SELECT receive_newsletter FROM contacts WHERE contact_id="' . $_POST['contact_id'] . '";';
 | |
| 			$sql = mysql_query($query, $YBDB) or die(mysql_error());
 | |
| 			$result = mysql_fetch_assoc($sql);
 | |
| 			echo $result['receive_newsletter'];
 | |
| 				
 | |
| 	}
 | |
| 
 | |
| 
 | |
| ?>
 |