mirror of
				https://github.com/fspc/Yellow-Bike-Database.git
				synced 2025-10-31 08:55:36 -04:00 
			
		
		
		
	Fixes #28.
This commit is contained in:
		
							parent
							
								
									62a51320e3
								
							
						
					
					
						commit
						beeab5e775
					
				| @ -69,6 +69,7 @@ $(function(){ | |||||||
| 				err1 = error_handler(last_name.val(), last_name_error, "","*Required",e);		 | 				err1 = error_handler(last_name.val(), last_name_error, "","*Required",e);		 | ||||||
| 
 | 
 | ||||||
| 				// test whether patron's name already exists
 | 				// test whether patron's name already exists
 | ||||||
|  | 				// and if name matches a different contact_i
 | ||||||
| 				$.post("json/contact.php", {first_name: first_name.val(), middle_initial: middle_initial.val(),  | 				$.post("json/contact.php", {first_name: first_name.val(), middle_initial: middle_initial.val(),  | ||||||
| 													 last_name: last_name.val(), contact_id: contact_id, test_name: 1 }, function(data) {							 	 | 													 last_name: last_name.val(), contact_id: contact_id, test_name: 1 }, function(data) {							 	 | ||||||
| 											 | 											 | ||||||
|  | |||||||
| @ -12,12 +12,12 @@ $ssl_certificate = SSL_CERTIFICATE; | |||||||
| 	if (isset($_POST['test_name'])) { | 	if (isset($_POST['test_name'])) { | ||||||
| 		 | 		 | ||||||
| 			if( $_POST['first_name'] && $_POST['last_name'] ) { | 			if( $_POST['first_name'] && $_POST['last_name'] ) { | ||||||
| 				$query = 'SELECT first_name, middle_initial, last_name FROM contacts WHERE ' . | 				$query = 'SELECT first_name, middle_initial, last_name, contact_id FROM contacts WHERE ' . | ||||||
| 							'first_name="' . $_POST['first_name'] . '" AND middle_initial="' . $_POST['middle_initial'] .   | 							'first_name="' . $_POST['first_name'] . '" AND middle_initial="' . $_POST['middle_initial'] .   | ||||||
| 							'" AND last_name="' . $_POST['last_name'] . '";'; | 							'" AND last_name="' . $_POST['last_name'] . '";'; | ||||||
| 				$sql = mysql_query($query, $YBDB) or die(mysql_error()); | 				$sql = mysql_query($query, $YBDB) or die(mysql_error()); | ||||||
| 				$result = mysql_fetch_assoc($sql); | 				$result = mysql_fetch_assoc($sql); | ||||||
| 				if ( is_array($result) ) { | 				if ( is_array($result) && ($result["contact_id"] !== $_POST['contact_id']) ) { | ||||||
| 					echo 1;			 | 					echo 1;			 | ||||||
| 				} else { | 				} else { | ||||||
| 					echo 0;			 | 					echo 0;			 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user