mirror of
				https://github.com/fspc/Yellow-Bike-Database.git
				synced 2025-11-04 09:25:34 -05:00 
			
		
		
		
	Additional check, and namespace changes.
This commit is contained in:
		
							parent
							
								
									dba651a8e8
								
							
						
					
					
						commit
						116416af06
					
				@ -486,7 +486,9 @@ $(function() {
 | 
				
			|||||||
			// sold_to error		
 | 
								// sold_to error		
 | 
				
			||||||
			if ( !$("[name='sold_to']").is("span") ) { // Patron already performed transaction and isn't logged in
 | 
								if ( !$("[name='sold_to']").is("span") ) { // Patron already performed transaction and isn't logged in
 | 
				
			||||||
				if ( !$("#anonymous").prop("checked") ) {
 | 
									if ( !$("#anonymous").prop("checked") ) {
 | 
				
			||||||
 | 
										if (sold_to.length) {
 | 
				
			||||||
						err1 = error_handler(sold_to.val(), sold_to_error, "no_selection", "*Required   ",e);
 | 
											err1 = error_handler(sold_to.val(), sold_to_error, "no_selection", "*Required   ",e);
 | 
				
			||||||
 | 
										}	
 | 
				
			||||||
				} else if ( $("#anonymous").prop("checked") ) {
 | 
									} else if ( $("#anonymous").prop("checked") ) {
 | 
				
			||||||
					sold_to_error.hide();
 | 
										sold_to_error.hide();
 | 
				
			||||||
				}	
 | 
									}	
 | 
				
			||||||
@ -513,7 +515,9 @@ $(function() {
 | 
				
			|||||||
			}
 | 
								}
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			// description error		
 | 
								// description error		
 | 
				
			||||||
 | 
								if ( $("[name='transaction_type']").val() != "Deposit" ) {	// Deposit description is implicit
 | 
				
			||||||
				err5 = error_handler(description.val(), description_error, "","*Required: a detailed description",e);
 | 
									err5 = error_handler(description.val(), description_error, "","*Required: a detailed description",e);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
			// check number error - error_handler()					
 | 
								// check number error - error_handler()					
 | 
				
			||||||
			var check_number = $("#check_number");	 // check number variable needs to be within this scope
 | 
								var check_number = $("#check_number");	 // check number variable needs to be within this scope
 | 
				
			||||||
@ -589,17 +593,17 @@ $(function() {
 | 
				
			|||||||
		$("#anonymous").click(function() { // on click
 | 
							$("#anonymous").click(function() { // on click
 | 
				
			||||||
			if ($(this).prop("checked")) { 
 | 
								if ($(this).prop("checked")) { 
 | 
				
			||||||
				sold_to.hide();
 | 
									sold_to.hide();
 | 
				
			||||||
				$.post("json/transaction.php",{ anonymous: 1, transaction_id: transaction_id } );
 | 
									$.post("json/transaction.php",{ anonymous: 1, transaction_id: $("input[name='transaction_id']").val() } );
 | 
				
			||||||
			} else {
 | 
								} else {
 | 
				
			||||||
				sold_to.show();
 | 
									sold_to.show();
 | 
				
			||||||
				$.post("json/transaction.php",{ anonymous: 0, transaction_id: transaction_id } );
 | 
									$.post("json/transaction.php",{ anonymous: 0, transaction_id: $("input[name='transaction_id']").val() } );
 | 
				
			||||||
			}
 | 
								}
 | 
				
			||||||
		});
 | 
							});
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
		// what type of payment? cash, credit or check?
 | 
							// what type of payment? cash, credit or check?
 | 
				
			||||||
		payment_type.click(function() { 
 | 
							payment_type.click(function() { 
 | 
				
			||||||
			if ($(this).prop("checked")) { 
 | 
								if ($(this).prop("checked")) { 
 | 
				
			||||||
				$.post("json/transaction.php",{ payment_type: this.value, transaction_id: transaction_id } );
 | 
									$.post("json/transaction.php",{ payment_type: this.value, transaction_id: $("input[name='transaction_id']").val() } );
 | 
				
			||||||
		
 | 
							
 | 
				
			||||||
				// check number?				
 | 
									// check number?				
 | 
				
			||||||
				if (this.value == "check") {					
 | 
									if (this.value == "check") {					
 | 
				
			||||||
@ -611,7 +615,7 @@ $(function() {
 | 
				
			|||||||
					}
 | 
										}
 | 
				
			||||||
					
 | 
										
 | 
				
			||||||
					// return check #					
 | 
										// return check #					
 | 
				
			||||||
					$.post("json/transaction.php",{ check_number: true, transaction_id: transaction_id }, function(data) {
 | 
										$.post("json/transaction.php",{ check_number: true, transaction_id: $("input[name='transaction_id']").val() }, function(data) {
 | 
				
			||||||
						var obj = $.parseJSON(data);			
 | 
											var obj = $.parseJSON(data);			
 | 
				
			||||||
	   				if (obj.check_number) {
 | 
						   				if (obj.check_number) {
 | 
				
			||||||
							$("#check_number").val(obj.check_number);		
 | 
												$("#check_number").val(obj.check_number);		
 | 
				
			||||||
@ -663,7 +667,7 @@ $(function() {
 | 
				
			|||||||
					$("#payment_type").hide();					
 | 
										$("#payment_type").hide();					
 | 
				
			||||||
					
 | 
										
 | 
				
			||||||
					// reset payment_type && amount	
 | 
										// reset payment_type && amount	
 | 
				
			||||||
					$.post("json/transaction.php",{storage_payment_reset: 1, transaction_id: transaction_id});										
 | 
										$.post("json/transaction.php",{storage_payment_reset: 1, transaction_id: $("input[name='transaction_id']").val() });										
 | 
				
			||||||
						
 | 
											
 | 
				
			||||||
				}
 | 
									}
 | 
				
			||||||
			});
 | 
								});
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user