mirror of
				https://github.com/fspc/Yellow-Bike-Database.git
				synced 2025-10-31 00:45:35 -04:00 
			
		
		
		
	More preps for Deposit Calculator.
This commit is contained in:
		
							parent
							
								
									f6d392b0b5
								
							
						
					
					
						commit
						d8b74b7a79
					
				| @ -29,14 +29,12 @@ $(function() { | |||||||
| 	// Deposit Calculator
 | 	// Deposit Calculator
 | ||||||
| 	if ( $(".paid").length ) {	 // any transactions?
 | 	if ( $(".paid").length ) {	 // any transactions?
 | ||||||
| 
 | 
 | ||||||
| 		$(".deposit input").each(function(){ console.log(this.name);});		 | 		var deposit = {};		 | ||||||
|  | 		$(".deposit input").each(function(count){  | ||||||
|  | 			deposit[count] =  this.name; | ||||||
|  | 		});			 | ||||||
| 		 | 		 | ||||||
| 		var deposit_length = $(".deposit").length; | 		$.post("json/transaction.php",{"deposit": deposit}); | ||||||
| 		if ( deposit_length == 1 ) { // one visible deposit could be 1 or more invisible 
 |  | ||||||
| 				 |  | ||||||
| 				var deposit_number = $(".deposit input").attr("name");	 |  | ||||||
| 				//console.log(deposit_number);
 |  | ||||||
| 		}  |  | ||||||
| 	 | 	 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -29,6 +29,11 @@ mysql_select_db($database_YBDB, $YBDB); | |||||||
| 		 | 		 | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
|  | 	// Deposit Calculator
 | ||||||
|  | 	if (isset($_POST['deposit'])) { | ||||||
|  | 		print_r($_POST);	 | ||||||
|  | 	} | ||||||
|  | 
 | ||||||
| 	/* | 	/* | ||||||
| 		 transaction_id, date_startstorage, date,transaction_type, amount, description, sold_to, sold_by, quantity, shop_id, paid | 		 transaction_id, date_startstorage, date,transaction_type, amount, description, sold_to, sold_by, quantity, shop_id, paid | ||||||
| 	     | 	     | ||||||
|  | |||||||
| @ -134,6 +134,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "FormNew")) { | |||||||
| 	header(sprintf("Location: %s", $LoadPage)); | 	header(sprintf("Location: %s", $LoadPage)); | ||||||
| } // end Form Submit New Transaction
 | } // end Form Submit New Transaction
 | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
| //Form Edit Record ===============================================================================
 | //Form Edit Record ===============================================================================
 | ||||||
| if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "FormEdit") && ($_POST["EditSubmit"] == "Save")) { | if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "FormEdit") && ($_POST["EditSubmit"] == "Save")) { | ||||||
| 
 | 
 | ||||||
| @ -431,7 +432,7 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) { | |||||||
|         <?php while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)) { //do { ?>
 |         <?php while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)) { //do { ?>
 | ||||||
|          |          | ||||||
|         <form method="post" name="FormView_<?php echo $row_Recordset1['transaction_id']; ?>" action="<?php echo $editFormAction; ?>"> |         <form method="post" name="FormView_<?php echo $row_Recordset1['transaction_id']; ?>" action="<?php echo $editFormAction; ?>"> | ||||||
|           <tr bordercolor='#CCCCCC' <?php |           <tr  bordercolor='#CCCCCC' <?php echo "title='Transaction ID: " . $row_Recordset1['transaction_id'] . "'"; | ||||||
|           	echo ((intval($row_Recordset1['transaction_id']) == intval($trans_id)) ? "bgcolor='#CCCC33'" :  ""); |           	echo ((intval($row_Recordset1['transaction_id']) == intval($trans_id)) ? "bgcolor='#CCCC33'" :  ""); | ||||||
|           	if ($row_Recordset1['paid'] == 1) { echo "bgcolor='#E6E7E6'"; }  |           	if ($row_Recordset1['paid'] == 1) { echo "bgcolor='#E6E7E6'"; }  | ||||||
|           	if ($row_Recordset1['transaction_type'] == "Deposit") { echo "class='deposit'"; } |           	if ($row_Recordset1['transaction_type'] == "Deposit") { echo "class='deposit'"; } | ||||||
| @ -444,7 +445,18 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ChangeDate")) { | |||||||
| 		  <td><?php echo $row_Recordset1['payment_type']; ?> </td>
 | 		  <td><?php echo $row_Recordset1['payment_type']; ?> </td>
 | ||||||
| 		  <td><?php echo $row_Recordset1['format_amount']; ?> </td>
 | 		  <td><?php echo $row_Recordset1['format_amount']; ?> </td>
 | ||||||
| 		  <td><?php $record_trans_id = $row_Recordset1['transaction_id'];  | 		  <td><?php $record_trans_id = $row_Recordset1['transaction_id'];  | ||||||
| 		  				echo "<a href=\"{$_SERVER['PHP_SELF']}?trans_id={$record_trans_id}\">edit</a>"; ?></td>
 | 						foreach ($_GET as $i => $value) { | ||||||
|  | 							if ($i != "trans_id") { | ||||||
|  | 								$trans_url .= "&$i" . "=" . $value; | ||||||
|  | 							}	 | ||||||
|  | 						} | ||||||
|  | 						 | ||||||
|  | 						if (isset($trans_url)) {  | ||||||
|  | 							echo "<a href=\"{$_SERVER['PHP_SELF']}?trans_id={$record_trans_id}$trans_url\">edit</a></td>";	
 | ||||||
|  | 						} else {		  				 | ||||||
|  | 		  					echo "<a href=\"{$_SERVER['PHP_SELF']}?trans_id={$record_trans_id}\">edit</a></td>"; | ||||||
|  | 		  				}	  | ||||||
|  | 		  				?>
 | ||||||
| 		  <td><input class="paid" type="checkbox" name="<?php $ti =  $row_Recordset1['transaction_id']; echo $ti; ?>"  | 		  <td><input class="paid" type="checkbox" name="<?php $ti =  $row_Recordset1['transaction_id']; echo $ti; ?>"  | ||||||
| 		  														value="<?php echo $row_Recordset1['paid'];?>"	 | 		  														value="<?php echo $row_Recordset1['paid'];?>"	 | ||||||
| 		  														 <?php if ($row_Recordset1['paid'] == 1) { echo "  checked"; }  ?>													
 | 		  														 <?php if ($row_Recordset1['paid'] == 1) { echo "  checked"; }  ?>													
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user