mirror of
				https://github.com/fspc/Yellow-Bike-Database.git
				synced 2025-10-31 00:45:35 -04:00 
			
		
		
		
	The beginnings of showing when volunteer gains membership status.
1) Based hours/days 2) Will add calendar year spec.
This commit is contained in:
		
							parent
							
								
									67ffd06c37
								
							
						
					
					
						commit
						fd6371598a
					
				| @ -18,6 +18,18 @@ require_once('YBDB.php'); | ||||
| define("TIMEZONE", "America/New_York"); | ||||
| 
 | ||||
| 
 | ||||
| /********* | ||||
| MEMBERSHIP | ||||
| **********/ | ||||
| // Define when a volunteer becomes a member based hours and days for the calendar year vs a paid membership
 | ||||
| 
 | ||||
| // Needs to volunteer at least this amount of defined hours before being considered a member
 | ||||
| define("MEMBERSHIP_HOURS",8); | ||||
| 
 | ||||
| // Needs to volunteer at least this number of days before being considered a member
 | ||||
| define("MEMBERSHIP_DAYS",2); | ||||
| 
 | ||||
| 
 | ||||
| /******* | ||||
| CONTACTS | ||||
| ********/ | ||||
| @ -107,7 +119,9 @@ TRANSACTIONS | ||||
| define("STORAGE_PERIOD", 14); | ||||
| define("ACCOUNTING_GROUP", "Sales"); | ||||
| define("DEFAULT_TRANSACTION_TYPE", "Sale - Used Parts"); | ||||
| define("DEFAULT_SHOP_USER", "Volunteer"); | ||||
| 
 | ||||
| // shop_user_role
 | ||||
| define("DEFAULT_SHOP_USER", "Personal"); | ||||
| 
 | ||||
| /* Change Fund - A specific amount of money for the purpose of making change.  | ||||
|    The amount on hand should remain the same at all times;  | ||||
|  | ||||
| @ -47,11 +47,20 @@ if($_GET['record_count']>0){ | ||||
| } else { | ||||
| 	$record_count = 40;}	 | ||||
| 	 | ||||
| $query_Recordset1 = "SELECT shop_id, shop_hours.shop_visit_id, shop_hours.contact_id, shop_hours.shop_user_role, shop_hours.project_id, DATE(shop_hours.time_in) AS date, DAYNAME(shop_hours.time_in) AS dayname, shop_hours.time_in, shop_hours.time_out, TIME_FORMAT(TIMEDIFF(time_out, time_in),'%k:%i') as et, shop_hours.comment, CONCAT(contacts.last_name, ', ', contacts.first_name, ' ',contacts.middle_initial) AS full_name, contacts.first_name FROM shop_hours
 | ||||
| LEFT JOIN shop_user_roles ON shop_hours.shop_user_role=shop_user_roles.shop_user_role_id | ||||
| LEFT JOIN contacts ON shop_hours.contact_id=contacts.contact_id | ||||
| WHERE shop_hours.contact_id = {$contact_id} AND DATE(shop_hours.time_in) <= '{$shop_date_filter}' {$shop_dayname} ORDER BY time_in DESC | ||||
| LIMIT  0, {$record_count};";
 | ||||
| $query_Recordset1 = "SELECT shop_id, shop_hours.shop_visit_id, shop_hours.contact_id, shop_hours.shop_user_role, 
 | ||||
| 									 shop_hours.project_id, DATE(shop_hours.time_in)  | ||||
| 							AS date, DAYNAME(shop_hours.time_in)  | ||||
| 							AS dayname, shop_hours.time_in, shop_hours.time_out,  | ||||
| 								TIME_FORMAT(TIMEDIFF(time_out, time_in),'%k:%i')  | ||||
| 							AS et, shop_hours.comment,  | ||||
| 								CONCAT(contacts.last_name, ', ', contacts.first_name, ' ',contacts.middle_initial)  | ||||
| 							AS full_name, contacts.first_name  | ||||
| 							FROM shop_hours | ||||
| 							LEFT JOIN shop_user_roles ON shop_hours.shop_user_role=shop_user_roles.shop_user_role_id | ||||
| 							LEFT JOIN contacts ON shop_hours.contact_id=contacts.contact_id | ||||
| 							WHERE shop_hours.contact_id = {$contact_id}  | ||||
| 							AND DATE(shop_hours.time_in) <= '{$shop_date_filter}' {$shop_dayname}  | ||||
| 							ORDER BY time_in DESC LIMIT  0, {$record_count};";
 | ||||
| $Recordset1 = mysql_query($query_Recordset1, $YBDB) or die(mysql_error()); | ||||
| //$row_Recordset1 = mysql_fetch_assoc($Recordset1);
 | ||||
| $totalRows_Recordset1 = mysql_num_rows($Recordset1); | ||||
| @ -82,7 +91,8 @@ if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form_new") && ($_PO | ||||
| 	$error_message = '<span class="yb_heading3red">Please Select a User</span><br />'; | ||||
| } elseif ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form_new")) { | ||||
|    | ||||
|   $insertSQL = sprintf("INSERT INTO shop_hours (contact_id, shop_id, shop_user_role, time_in, comment, project_id) VALUES (%s, %s, %s, %s, %s, %s)", | ||||
|   $insertSQL = sprintf("INSERT INTO shop_hours (contact_id, shop_id, shop_user_role, time_in, comment, project_id) 
 | ||||
|   								VALUES (%s, %s, %s, %s, %s, %s)",
 | ||||
|                        GetSQLValueString($_POST['contact_id'], "int"), | ||||
|                        GetSQLValueString($individual_shop_id, "int"), | ||||
|                        GetSQLValueString($_POST['user_role'], "text"), | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user