Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

n this assignment the goal is to first write events into a SQLite3 database and then read these events from a SQLite3 database and display

n this assignment the goal is to first write events into a SQLite3 database and then read these events from a SQLite3 database and display on the calendar the upcoming events.

Description

Your PHP code in the file update_database.php, should process the data a user fills in on the create_event.html page. Then your program calendar2.php should display the events in the correct time slots and for the correct person. The functionality of your programs should be similar to the example on the homework page. For example, consider that we set in the create_event.html the person to be Joe and the date to 5-20-2011 and time is set as 15:00. The user writes the event title as: "Soccer practice" and event message: "Bring the ball". Then the calendar2.php should show for 5-20-2011 in the Joe column in the 3:00pm slot: "Soccer practice: Bring the ball". You will also "upgrade" your calendar.php from last week to display at the bottom of the calendar three buttons labeled: "previous", "now" and "next". The button labeled "previous" should move the start hour displayed back by 12 hours. The button labeled "next" should move the start hour forward by 12 hours. Finally the button labeled now should display the calendar with the current date and time.

Directions

You will write a php file called update_database.php. This program will receive the form data when the user presses submit on create_event.php. It will then process this data and save the data into a SQLite3 database.

Your program calendar2.php is much like your calendar program from HW5, except now it will also read data from your SQLite3 database. For each slot (person and time) your code should call a function called get_events($person, $timestamp). This function will return a string containing all events that should be displayed in the time slot in question.

Directions for your database

Your database is called dbyourusername.

Your table should be called event_table

Your table should contain field time which is a timestamp it is going to be an integer with perhaps as many as 12 digits.

Your table should contain a field person which has character data. (Reserve some reasonable amouunt of characters for a name.

Your table should contain fields event_title and event_message. Both contain character data max of perhaps 300 characters.

Requirements

Your program should be in two files called calendar2.php and update_database.php those files should reside in your public directory along with CSS files called calendar.css and create_event.css.

When your program is finished, create a text file called calendar2.txt and copy and paste the contents of your calendar2.php file into calendar.txt. Similarly create a text file called update_database.txt. Put calendar.txt and update_database.txt in your public directory as well.

By default when your page is loaded it should display current day, date and time as shown in the example.

Your program must use a function called get_event to get the events for the calendar to display.

Your program must function as in the example given.

You must have the three buttons: previous, today, and next that function in the way described above.

Expected Output:

image text in transcribed

Updated URLS in response to comment:

http://www.math.ucla.edu/~virtanen/40a.1.17su/assignments/hw6/calendar2.php

http://www.math.ucla.edu/~virtanen/40a.1.17su/assignments/hw6/create_event.html

url: http://www.math.ucla.edu/-virtanen/40a.1.17su/assignments/hw6/create_event.html Simple Event Joe O Joanna Lil Cub O Date should be in format M-D-Y. For example 11-24-2015. Time is 24 hour time in format H:mm. For example 15:00. Date Event title Create event Time Event message url: http://www.math.ucla.edu/-virtanen/40a.1.17su/assignments/hw6/calendar2.php Bruin Family Schedule for Sat, August 12, 2017, 11:51 am Joe oanna Lil Cub 11.00am 12.00pm 1.00pm 2.00pm 3.00pm 4.00pm S.00pm 6.00pm 7.00pm 8.00pm 9.00pm 10.00pm 11.00pm Next twelve Today Previous twelve hours

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

6th Edition

1943153035, 978-1943153039

More Books

Students also viewed these Databases questions

Question

2. How will the team select a leader?

Answered: 1 week ago