Calculating within database/on website and using repeaters correctly

I have 2 main problems currently

  1. When a user enters a new item, they put in the start and end date of the event. I need to either calculate in the backend or somehow the total number of weeks that all events for that user has. In this example, Family medicine is 4 weeks, and Psych is 4 weeks, so under COMPLETED WEEKS under the member card, I want that text to update to 8 instead of 0. Lets call that text “text1”

  2. When inputting a new item, they can choose whether the event is a CORE, ELECTIVE or SUBI. I need the little checkboxes under COMPLETED SUB I to be checked once the database contains at least 1 item with the type SUB I (this is a field they can enter when inputting data)

  3. I need to Change HEADING 1 to read the dates in the first date picker. These dates are taken from the items in the database. I first got it reading the dates correctly but only for the first item in the repeater. How do I code it so that the Heading 1 will change based on the current item in the repeater, and not just the first item in the database.

Feel free to contact me for a time to chat since this answer is quite extensive.

Below is a screenshot of my skeleton site. The repeater grabs items from my database (in this case, this user has 2 entries)