mirror of
				https://github.com/fspc/Yellow-Bike-Database.git
				synced 2025-10-31 17:05:36 -04:00 
			
		
		
		
	Adds a hidden input field to remember non-logged user value in edit trans.
This commit is contained in:
		
							parent
							
								
									304c9e2f37
								
							
						
					
					
						commit
						50c740feb8
					
				| @ -448,15 +448,17 @@ $(function() { | |||||||
| 		$("#amount").mask("#0.00", {reverse: true, placeholder: "000.00"}); | 		$("#amount").mask("#0.00", {reverse: true, placeholder: "000.00"}); | ||||||
| 		$("#check_number").mask("#0", {reverse: true, placeholder: "check number"});	 | 		$("#check_number").mask("#0", {reverse: true, placeholder: "check number"});	 | ||||||
| 	 | 	 | ||||||
| 		$transaction_id = $("input[name='transaction_id']").val(); | 		var $transaction_id = $("input[name='transaction_id']").val(); | ||||||
| 		//var check_number = $("#check_number").on("input");
 | 		//var check_number = $("#check_number").on("input");
 | ||||||
| 
 | 
 | ||||||
| 		// If patron isn't logged in replace pull-down with patrons name
 | 		// If patron isn't logged in replace pull-down with patrons name
 | ||||||
| 		var sold_to = $("[name='sold_to']").val(); | 		var sold_to = $("[name='sold_to']").val(); | ||||||
| 		if (sold_to == "no_selection") { | 		if (sold_to == "no_selection") { | ||||||
| 			$.post("json/transaction.php",{ not_logged_in: 1, transaction_id: $transaction_id }, function(data) { | 			$.post("json/transaction.php",{ not_logged_in: 1, transaction_id: $transaction_id }, function(data) { | ||||||
| 				if (data) {				 | 				if (data) { | ||||||
| 					$("[name='sold_to']").replaceWith("<span name='sold_to'>" + data + "</span>"); | 					var obj = $.parseJSON(data);				 | ||||||
|  | 					$("[name='sold_to']").replaceWith("<span name='sold_to'>" + obj.full_name +  | ||||||
|  | 																 "</span><input value='" + obj.sold_to + "' type='hidden' name='sold_to'>"); | ||||||
| 				} | 				} | ||||||
| 			} ); | 			} ); | ||||||
| 		} | 		} | ||||||
|  | |||||||
| @ -65,13 +65,14 @@ $change_fund = CHANGE_FUND; | |||||||
| 
 | 
 | ||||||
| 	// Patron who made a transaction not logged in.
 | 	// Patron who made a transaction not logged in.
 | ||||||
| 	if (isset($_POST['not_logged_in'])) { | 	if (isset($_POST['not_logged_in'])) { | ||||||
| 		$query = "SELECT CONCAT(contacts.last_name, ', ', contacts.first_name, ' ',contacts.middle_initial) AS full_name
 | 		$query = "SELECT CONCAT(contacts.last_name, ', ', contacts.first_name, ' ',contacts.middle_initial) AS full_name, 
 | ||||||
|  | 					transaction_log.sold_to | ||||||
| 					FROM transaction_log, contacts  | 					FROM transaction_log, contacts  | ||||||
| 					WHERE transaction_id=" . $_POST['transaction_id'] .
 | 					WHERE transaction_id=" . $_POST['transaction_id'] .
 | ||||||
| 					" AND contacts.contact_id = transaction_log.sold_to;"; | 					" AND contacts.contact_id = transaction_log.sold_to;"; | ||||||
| 		 $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); | ||||||
| 		 echo $result["full_name"];			 | 		 echo json_encode($result);		 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	// Anonymous transaction - save and communicate back settings
 | 	// Anonymous transaction - save and communicate back settings
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user