Tip:
Highlight text to annotate it
X
Hi students!
Just wanted to get you some feedback about this week.
I think those of you who turned in your assignment
have done an excellent job.
I really appreciate that you are taking the time to
user test for your classmates and provide them feedback on things they might
be able to do to improve.
In addition to
starting to put some sample data into their tables.
So this week we're going to start off with
homework
five.
And let me just
go in to
this week's
section here. Okay so this week we have a quiz
on chapter ten
and we're going to be talking about homework five
Homework four is definitely the big
web project
that is going to take you from the first part of the class
the rest of class.
Because you were able to interact with your database
although it was just one page
you can assume
that we're just going to keep building from this and
you're going to
do more
advanced
forms. All of these forms we're making there's a reason for the madness
we're doing. Hopefully in homework 4 you started to see how this is all going to come
together.
Okay for homework five
we're basically going to be creating
some administrative pages.
What that's going to be it's very similar to what your reading in chapter
ten
we're going to have a user list page that's going to provide you access
to edit
a particular
user that has registered for your system.
But before we can do that we need to modify your USER table.
You'll see right here -- remember all my homework store thirty five points of
Part A)
modify your database for the user table - this is worth ten points
If you haven't already added these fields to your system I want to go ahead
and put in firstname lastname address city state zip code phone number email
address registration date. And you're going to want to save that as a timestamp
that means it will automatically
get input by the system anytime
a
new user is created.
For the users already in your table if you don't already have a registration date
then you're gonna want to go ahead and
put a sample time in there.
It's fine to use whatever the current time is when you are in the database.
Be sure to also add a status field -
you want your status to be a one character field and have it be it
an "A" for active and an "I" for inactive.
As you get your user table modifications done
then you're going to create your
administration web page. For the
purpose of this assignment
we're not going to be doing
an admin login part at this point but we will be getting there
soon.
Similar to what you've seen in chapter ten you're going to create a
view_users.php page. You're going to have a list of every single user in
your table.
What you need to be sure is before you start this
take a look
at the data that is currently in your table. If did a lot of testing and
you have a lot of blank fields in there
either delete those rows or go ahead and edit them. You want to make sure that
you have
data in all of your
required fields.
Your first
item on your user list is going to be an edit link.
This is just going to be a hyperlink that says edit
and when you mouse over that it's going to call the edit_user.php
page here in number two
you're going to
pass it
the user_id
of that particular
user in the list.
You'll see how to do that in chapter 10. We're basically going to be connecting
to the database
and doing a loop for every single user that we have in our database. We're
going to be
dynamically creating that edit link so it'll be
edit_user.php?user_id=1
edit_user.php?user_id=1
and so on
With status we're gonna have a column
that says status it's going to display whether the users is active or inactive.
I want you to first
put that status
by active users so i want you to do a order by
sort
for your
basic default user list
and I want to list all of the active users first
and then the inactive users.
Then I want you to have a column for last name first name and email address.
Now the only thing that's going to be a hyperlinked is going to be that
edit link. Everything else will just be text.
After you've created that
user list page then you're going to create the edit_user.php page.
Again, this is going to be a form.
But what you're going to be doing instead of having a blank form is similar to the
concept of sticky farm where you're going to first be
pulling
information from the database on that user that was passed to you.
So if it's user_id = 5
then you are going to run a database query
that says
get me all the information in the user table for user_id five.
Then you're going to populate
your variables with
the information from the database and display those in the form.
Again you want all of these to be shown on the edit_user.php page - first and last name address city
state zip code phone number.
There are a couple fields that i want you to have read only. So I don't
want the administrator to be able to change the user's email address
or their registration date.
Because these should not be things
that administrator
has access to. This registration date -
no one's really get to see it except the administrator and it just needs to be
there for information. There really isn't any reason to change that.
The email address is something you want the users to be able to
modify on their own,
not the admin.
When you're displaying these in a form don't put those in a form
field - don't put those a text box input
or if you do this make it so they can
modify it
You can just output it as an
actual label or
text
variable.
After you've got that edit_user.php page created, you want to make sure it actually works and allows
you to edit
the other information
in the database.
Then I want you to go back and do some advanced paging and sorting
for your
view_users.php page.
That's what we created in
number one
and i want you to
paginate your user list
by listing
only eight records at a time. So if you have sixteen user
records in your table you should have two lists -
or two pages so you'll have a next and a
previous link at the bottom of the list
and you'll be able to go from there.
Then I want you to alternate
your user row background-color.
You can pick your colors but make it readable.
The book uses just like a gray so you're going to make like a light background in
one row and then no background in the other. That way it's just easier to read
and see
which data belongs to which person.
Then I want to ad
two sortable columns so
on status (which is the default sort order
separated by active and inactive)
but then i also want you to be able to have a sortable column on the last name.
so if I don't want to see just the status and I just want
it should be by last name alphabetically
and i want you to
click that column and
have that user list be modified.
Hopefully that
make sense to you guys. Again, it's
another challenging assignment
but for those of you who
did well on homework four
hopefully
this should be able to come pretty easily to you. Again you should be following along
exactly with our textbook
and taking the information from the textbook
and putting it into our homework.
Now to let you know
we have a recommended class session
we are going to talk a little bit about
what you've been doing last week and this week
and we will probably do a quick sample
of homework five
a light version of homework five
and then we're gonna spend
about half an hour
talking about the midterm exam and what's going to be on the midterm
exam.
I will be
posting and handing out a
review sheet for the midterm exam. Now remember the mid-term is next week
week eight it is an in-class midterm. You need to come in and be
present
in order to take the midterm.
I will give you
a scenario
that you will need to complete
within the hour and a half class period
and it will be open book so you can bring your book with you, you
can use the web and
whatever resources that would be available to you in a working
environment
will be available to you
for your midterm exam.
It is an independent exam so there will be no talking in class
and I won't be able to give you answers on how to do things. I really
need you to do
the midterm exam on your own.
what exactly is it gonna be on?
I can pretty much guarantee you there will be a form
on this.
Will it be
throwing together what you did from homework 4? Probably not!
But there will be a little bit of
database
questions on there that you will need to
do as well. Okay?
Hopefully I'lll see a lot of you in class this week.
If not, I will definitely see you the following week for the midterm! Thanks!