How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask TheDoctor Your Own Question
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1757
Experience:  M.S. in Internet Information Systems
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

Finish GUI for Project ---------------------- I need some

This answer was rated:

Finish GUI for Project
I need some help with the AJAX and PHP. Basically, I already have the site in HTML and process.php to call the functions instead of directly to DB. It is involved with insert, update,
 and delete the data. I would like to improve the site by less repeative and more effective.


Hello again! Thank you for requesting me.

By when do you need this?
Customer: replied 4 years ago.

Tom morrow morning is alright with you?

Do you have a URL for the site? You have me FTP info, but not the actual URL.
Customer: replied 4 years ago.
And the user name is?
Customer: replied 4 years ago.


What do you need help with?

Pretend that I have no idea what this site is or what it is supposed to do. Provide details that would get me up to speed.
Customer: replied 4 years ago.

The Design Doc will help you understand the purpose of each site and the whole websites.




I am still unsure as to what it is you need. You sent me a project with dozens of PHP files, information for an FTP site, and a name of a database. You didn't send me the actual database so that I could implement it locally, and the site that you sent me to does not appear to work at all. None of the menu items work. Press "back" results in a 404 error. Loan/Add/Delete appears to do nothing.

So far, all you have stated is that you need PHP and AJAX help. To accomplish what? Is there a part of the system you need help on? Or do you need help on the entire system?
Hello again,

One of the folders that you sent me appears to be phpMyAdmin. I don't think that I need any of that.

I've studied the code. I see there are some functions. Though they do not appear to be used. The buttons do not do anything because there they are just buttons with no action or event handling.

You stated earlier "each site", which I assume means each page. Each page right now is an HTML page. It appears that the only functionality that is implemented is the login. There appears to be files that are not relevant to the project. One of the includes appears to be dealing with with e-commerce stuff.

Is Page.class.php actually used anywhere, or Database.class.php? (Or anything in the includes folder).

I believe the reason that I am having confusion is all this extra code, files that are not being used, I have a copy of phpMyAdmin that I am not sure why you sent me. There are a number of functions in LabManager, but they do not appear to be used anywhere. The only functionality implemented is the log in. The rest of the pages are html and have buttons with no event handling, and the data in them is just written into the HTML. Looking at the html mockups, I don't see any area where staff permissions could be managed.

Looking at the database, it doesn't appear to be complete either. There are no tables for resource categories or resources. I'm not certain what the point of the Staff table is. If it just has a reference to the user id and then active or not, then breaking out into a separate table is not correct.

I would new a few days to work on this to try and get it functional and clean up what is already there. Let me know if you do not have that much time.
Customer: replied 4 years ago.

You are right. There are some irrelevant files.

Files are not needed:

includes folder, Page.class.php, Database.class.php and phpmyadmin

(Although I would like to restrict some users from getting the full functionalty by not revealing the portion of menu, maybe that is why I left it there for that reason)


Functionality: What I need help right now with is functionality of buttons that would be able to modify, update and delete. Then we can work for few days.

Database: Would you able to sketch up what the database should look like?


Hello again,

I will contact you once this is complete. At latest, before Sunday morning. Though it may be much sooner.

Thank you
Customer: replied 4 years ago.

Thank you.

You're welcome.
Customer: replied 4 years ago.

I will strongly preferred before Sun. Just let you know...

I will do my best.
Customer: replied 4 years ago.

I want to let you know that I care more about the functionality.

All I am working on is the functionality.
Customer: replied 4 years ago.

What is the status?


The users page is functional. The staff page is almost done.

Then I will do the resources page. Then I will send you the results.
Customer: replied 4 years ago.


Hello again!

You can download the completed files here:

I also uploaded them and updated the database at the site you gave me.

I tested each page and they are working as intended. You can add new users. If you want to log in as a new user, you have to go to the staff page and add them as staff and set them to active (1).

And you can loan out resources or mark them as returned.

I'm sure that there will be a lot of additional work to be completed. As you will see, this functionality required many hundreds of lines of JavaScript and PHP. It may not be a 100% completely project at this point, but at least it now has working functionality.

If you would like to continue working on this together, I would kindly ask that you rate based on the work that is done and then enter a new question to move forward. The level of effort put into this has been high, given the question value. Though I am happy that I was finally able to figure the site out and get something working for you!


If you need the database changes that I made, you can get them from the database server you pointed me to.

Let me know if you have any questions. I'm here to help.

Please remember to rate my answer. Thank you so much!

Customer: replied 4 years ago.

Little modification. I would like to edit the user data with edit button..

That is actually quite a large change. I will contact you when it is complete.

You need to spend $3 to view this post. Add Funds to your account and buy credits.
TheDoctor and other Homework Specialists are ready to help you
Customer: replied 4 years ago.

Could you help me and fix the name of the user in the following, first name and last name? But right now it is Last name and Middle name. Don't have to fix it. I just need instructions.

Customer: replied 4 years ago.

There is an problem with the login system. It should say invalid user instead of no privilege user

I never touched anything with the log in system. The message "No Privilege User" was in the system that you sent me.

I will take a look at this later tonight. I am currently working on other projects.
Customer: replied 4 years ago.


For the logged in as name,

Go to LabManager, line 136, in the getUserData function.

Most SQL text books tell you to never use SELECT *. Also, in every professional organization I have encountered, there are "coding standards". These standards always state that SELECT * is not permitted. This is because 1.) Your fellow developer cannot see what it is you are selecting without consulting the database. This is a huge waste of time, and 2.) You are leaving the order of the selected columns up to the database rather than specifying a guaranteed order in your code. This is sloppy.

In this case, you are doing a SELECT *, which will only work as long as the database is never altered. If it is altered, then your binding a couple lines later will be wrong. It is very poor form to use SELECT *. It should always be avoided.

If the query had been SELECT FirstName, MiddleName, LastName, etc... You would never run into an issue, and any other developer looking at the code would immediately know what you are selecting. As it is, your binds are in a different order than the columns are in the database. That is why you are getting middle name an last name. You can change the select statement to select the columns in the order that you want them or you can change your bind statement to be in the order of the database, which is:

$id, $lastName, $firstName, $middleName

I would suggest changing the select to actually select specific columns in the order that you want. I promise you that in the real world, this will be a requirement.

For the log in, the code that you sent me has two different messages. One is invalid user. This will show up if you type in a user name that is not found in the database at all. For instance, type in sfkwefklshfekj. You will receive "Invalid User".

Type in the name of a user who has not been added as Staff, but is a user, and you will receive "No Privilege User". This is how the code you sent me works. The log in AJAX is a two-step nested AJAX call. First it sees if there is a user with that user name. If there is not, it gives the invalid user message. If there is, it checks to see if that user is an active staff member. If they are not, you receive the "No Privilege User" message. Otherwise, you are logged in. It appears to be working perfectly as it is designed.
Customer: replied 4 years ago.

Thank you so much. I will contact you if I have any further questions.