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
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1502
Experience:  M.S. in Internet Information Systems
59032869
Type Your Homework Question Here...
TheDoctor is online now
A new question is answered every 9 seconds

**For The Doctor** help with a group project

Resolved Question:

**For The Doctor** help with a group project
Submitted: 1 year ago.
Category: Homework
Expert:  TheDoctor replied 1 year ago.

Hello again! Thank you for requesting me.

Please provide details. If you have files that you need to share, please zip them up and upload them to http://ge.tt

Once uploaded, you will be given a link on the right. Click on the 'Copy Link' option and then paste it here.

Thank you

Customer: replied 1 year ago.

http://ge.tt/9riSToe?c

 

I need to do the highlighted part in the file MyGroupProjectPart the other word document is just instructions for the whole project in case you have a doubt. You will notice that classmate who did the first part made a wonderful job. He got 100% in his individual project.

Expert:  TheDoctor replied 1 year ago.

Hello again.

It never ceases to disappoint me how horrible many instructors are.

Your classmate should have received D at best.

1.) Every page that uses a the database creates a new database connection in that file itself.

The first professional PHP site I ever worked on had bout 2000 PHP pages. Imagine if a "good" developer got out of college and then went to work and created 2000 PHP files over the course of many years and created a new database connection, with the host, username, and password XXXXX in to each and every page.

Now imagine that the company changes host addresses or other connection parameters. You have just created a MASSIVE company issue that will cost a ton of money to correct. With your project, the site could expand as large as it needs to be and updates would require changing a single line of code. Your classmate's would require thousands of lines to be altered.

2.) He used a table for a form. That is very 1995 and violates the basic concepts of web design and the current W3C recommendations for good web design.

 

3.) His database does not have any primary key on two of the tables. That is a violation of 1st normal form, or the very most basic rule of relational databases. It is a HUGE error. It is actually going to pose an issue with your part. It is difficult to delete a record that has no ID. And the sentEmail records are supposed to refer to the record. It is impossible to make reference to a record that has no ID. So the database is complete rubbish. I will have to alter it.

Simply put. This site is bad. Very bad. In the real world, your classmate would get a talking to. It is very likely that he will at some point. They teach you a lot of bad habits in college. Usually because the instructors are such horrible developers.

But it is what it is. By when do you need this?

Customer: replied 1 year ago.

Yeah, I also noticed some of your points. But we should please the professor but if there is something that violates the established rules you may make changes just make comments. Do you think you can have it ready for Wednesday night or Thursday? if not just let me know. Take your time. Also, let know if there is any additional fee from your part. Anyway I always give you tip, but just in case. I want you happy and well paid.

Expert:  TheDoctor replied 1 year ago.
I will have it ready for you well before that.

I just also noticed that the offer and request tables appear to join the register table on a varchar field, which is very bad practice. And, because there are no keys, there is no referential integrity (no foreign keys).

I've been through college and graduate school a few different times. This is F work.

I must make changes to the database. I will make comments. But the changes are going to require that the tables are empty. So your classmates will have to delete everything from their database. It is the only way to make your part actually work.
Customer: replied 1 year ago.

This fellow created his tables based on his individual project database. My classmates do not have anything yet, I am the only one because I am doing the second part.

Expert:  TheDoctor replied 1 year ago.
Apparently, you have to already be logged in if you want to register to use the site. I guess I'll just insert a user for myself directly into the database.

I'm shocked your instructor didn't give a 0% for that right there. (It is impossible to register and log in).

Anyway. I will contact you when this is all complete.
Customer: replied 1 year ago.

I have to login using the school credentials and then register(only once). I tested that part and worked as indicated in the instructions. In order to register you must be in the school network. You can not do it. Remember this project is not a real web, is fake.

Expert:  TheDoctor replied 1 year ago.
I realize that. I have commented out the LDAP code.

I will contact you once everything is complete.
Expert:  TheDoctor replied 1 year ago.
Hello again!

You can download the completed changes here:


You will find a file called necessaryAlterations.sql

They are absolutely necessary in order to meet the requirements in your part of this project. The in no way alter the way that this other individual's site works. It is simply that we must have keys on the fields so that we know which to delete or accept.

We also need to be able to tell if an offer or request belongs to the logged in user. To do that, we need correctly set up foreign keys in order to assure referential integrity.

And, of course, we need the sentEmail table.

I've added comments to all of it. It is very easy to understand. Without these changes, your part really will not work.

So, with these changes, your part is completely done. I used the same style as the individual who made this site, so your instructor should be happy. I had to add email to the registration because the email requirements involve associating an email address to a user, not just a request or offer. The email must be on the registraiton record in order to meet that requirement. The sql file alters the registration table in order to add teh registration field. To continue using any existing accounts, you will need to update them to have an actual email. So, for instance, if you have an account called Milt, you would want to do something like:

UPDATE registration SET email = 'milt@fakeemailaddress99.net' WHERE username = 'Milt';

With the changes, you can now delete a offer or request record if it was entered by the user who is logged in. So if you are logged in as the user who entered the request, you will see a delete option. If you are not the user that logged in, you will see an accept option.

Clicking delete simply deletes the record.

Clicking accept generates an "email" to both the logged in user and to the email address on the offer or request.

And by "email" I mean entries are made into the sentEmail table, as per the instructions.

So that's it. That meets the requirements of your part to the exactly, to the letter. I did everything in the same style as the individual who created the site. To accomplish this, I altered or added:

testldapgroup.php
insertRecords.php
registration.php
acceptOffer.php
acceptRequest.php
deleteOffer.php
deleteRequest.php
viewapartmentofferdetails.php
viewapartmentrequestdetails.php
insertapartmentoffer.php
insertapartmentrequest.php

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 1 year ago.

Let me know when you are online

Expert:  TheDoctor replied 1 year ago.
I am online.
Customer: replied 1 year ago.

I am getting this error when I try to send you a message let see if this one pass


Access Denied

You don't have permission to access "http://www.justanswer.com/homework/7pwhi-for-doctor-help-group-project.html" on this server.


Reference #18.75881ab8.1366835933.521cea3

Expert:  TheDoctor replied 1 year ago.
I have nothing to do with the web site. If you have technical problems, you can contact customer support atXXX@XXXXXX.XXX

I completed your entire part exactly as you requested. Please let me know what else you need.
Customer: replied 1 year ago.

Let me try again;




I have a question that may sound silly, but I wanted to make sure before I test the program. In necessaryAlterations we have DELETE FROM apartmentoffers; and DELETE FROM apartmentRequest; Do I need to enter this statements just like this without telling the database what I am deleting?

Expert:  TheDoctor replied 1 year ago.
THIS ANSWER IS LOCKED!
You can view this answer by clicking here to Register or Login and paying $3.
If you've already paid for this answer, simply Login.
TheDoctor, Professional w/Adv. Degree
Category: Homework
Satisfied Customers: 1502
Experience: M.S. in Internet Information Systems
TheDoctor and 5 other Homework Specialists are ready to help you
Customer: replied 1 year ago.

I deleted the tables and created them and made all the changes that you gave me in the file.sql. However, when I input offers or requests I do not get the email. The delete option works but the accept option is not showing up on the browser. In other words everything works except the emails and functionality of accept offer/request. I tried to compare of what we did in my last project but could not figure out. It seems to me that a link is missing. I am sending screenshots, open the link below.


http://ge.tt/9ZvxHze/v/0?c

Expert:  TheDoctor replied 1 year ago.
Please send me the document with your part again. But upload it to http://www.wikisend.com

ge.tt appears to be having issues.

Paste the link here once it is uploaded.
Customer: replied 1 year ago.

http://wikisend.com/download/381778/Login and Not Loging screenshots.docx


 


http://wikisend.com/download/405742/MyGroupProjectPart.docx

Expert:  TheDoctor replied 1 year ago.
Alright,

Let's look at the requirements.

1.) There is no requirement for an email to be sent when you input an offer or request. That is nowhere in the highlighted parts.

2.) Please read the requirements. The accept link only shows up for REGISTERED users. The requirement state "Registered Users can also accept rental..."

So the fact that you do not see an accept link after you have logged out of the site is perfect. That is exactly what should happen. Only registered users can see the accept link.

However, the "Registered User" must be a user other than the user who entered the offer or request. So you must be logged on, but as a different user than the one who entered the request. It doesn't make sense for a user to accept their own offer or accept their own request. It also does not correctly test the functionality.

3.) No email will ever be sent. Please view the instructions. No emails are to be sent and you are not to create the functionality for emails to be sent. When you accept an offer, two entries are made into the sentEmails table. No emails are to be sent, per the instructions.

So most of your screenshots are not valid, as the instructions clearly state that you must be logged in as a registered user.

If you log in as a user other than the user who entered the offer or request, you will see the Accept link. However, it is actually missing from the search page. I will add it to that page.
Expert:  TheDoctor replied 1 year ago.
Here is the search apartments file:


Replace your file with this one. Now the apartment search will have the delete or accept link, depending on who you are logged in as and who entered the record in the first place. If it is your record, you can delete it. If it is a different user's record, you can accept it.

If you are not logged in, you can do neither.
Customer: replied 1 year ago.

The moderator of the group wants me to add the other part that we did not do and wants me to fix some errors that she gets when accepts the offer/request. I also noticed that the emails are not being stored in the sentEmail table. She wants me to remove the select statements and put the email in session variables ans pass it to insert statements. But I do not want to do anything unless you give me the OK. I highlighted in blue the part that I need to add. See link below.


http://ge.tt/755QoUf?c

Expert:  TheDoctor replied 1 year ago.
Those "errors" are caused by the statement not succeeding in the first place. It is "false". That means that the database schema that your moderator is using is not the schema that I have. The prepare statement is failing and returning false. It does that when you attempt to use a column that doesn't exist, or some other database issue. Which means that someone did not successfully apply the database changes that I provided. Those pages work perfectly if the database is set up correctly. The fact that the page is stating that the statement is a boolean means that the database is not set up correctly. I couldn't even begin to tell what her "error" is without seeing her database schema. She would need to completely dump her database and send it so that I can see it.

The pages DO insert into the sentEmail table. However, with the prepare statement failing, no inserts are occurring, obviously. Again, this is due to the prepare failing, which is not displayed in the errors. She needs to do a complete export of her database and send it over. That way I can see where she screwed up.
Customer: replied 1 year ago.

These screenshots were taken on my computer using my database. I forgot how to make copy of the cmd database.

Expert:  TheDoctor replied 1 year ago.
It appears that every prepare statement in those files are failing. So either the database is massively incorrect on your system or the connection parameters is wrong in those files.

Open up acceptRequest.php

Go to this line:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')");

Change it to:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')") or die (mysqli_error($conn);

And make certain that the connection information is correct at line 34. Then try to accept a request again. This time, the page will die and display why the prepare statement is failing.
Expert:  TheDoctor replied 1 year ago.
Sorry, that should be:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')") or die (mysqli_error($conn));

I missed a left parentheses
Expert:  TheDoctor replied 1 year ago.

Let me know what the die message is for the prepare statement. You can also do this on the mysql command line:

SHOW CREATE TABLE sentEmail \G

Please use the \G instead of the semicolon.

Send me the die statement and the command line results from the create table statement.

The prepare is failing, which means that there is something wrong with that table. Perhaps you forgot to type in the default CURRENT_TIMESTAMP ?

 

Also, the blue highlighted part in the requirements that you just sent me are not in the requirements that you previously sent me at all. I have both copies open.

 

I look forward to hearing back from you.

Customer: replied 1 year ago.

http://ge.tt/54UmyUf/v/0?c

Expert:  TheDoctor replied 1 year ago.
You did not send what I really, really needed, which is the die statement for that prepare. The warning on the bind are completely useless.

Doing this should take less than a minute. On line 55, you will find:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')");

Change it to:

$iquery = mysqli_prepare($conn, "INSERT INTO sentEmail (recipient, type) VALUES (?, 'Request Accepted')") or die (mysqli_error($conn));

Then, when you attempt to approve a REQUEST. You will get a white page with a message.

I need that message.
Customer: replied 1 year ago.

http://ge.tt/54UmyUf?c


 


I hope is this...

Expert:  TheDoctor replied 1 year ago.
No. Did you type in or die after the semicolon? There is now a parse error.
Customer: replied 1 year ago.

http://ge.tt/5zZ71Vf/v/0?c New Photo

Expert:  TheDoctor replied 1 year ago.

Hello again,

The error is very obvious. It is due to your wonderful team mate who created the database in the first place. Who apparently granted access to each table within the database instead of granting your web user access to the database itself. I have never seen anyone grant access to each table independently. It is horrible practice and leads to things like this. The error you're getting is because the user does not have access to this new table. In contrast, my user on my computer has access to the entire database because that is the sane way of doing things.

So, you see, there are no errors in the database or the code. It is simply that the GRANTS are set up really poorly. Run this on the command line (assuming you are logged in as root):

GRANT SELECT, INSERT, UPDATE, DELETE ON kmandadi.sentEmail TO 'kmandadi'@'localhost';

Though, most people would have done:

GRANT SELECT, INSERT, UPDATE, DELETE ON kmandadi.* TO 'kmandadi'@'localhost';

In the first place so that any new table in the database would be reachable from the web app.

Your team mates will have to run this additional GRANT command also.

Now for the blue part. As I mentioned, the blue highlighted part was not in the original requirements that you sent me at all. I can implement this additional functionality, but it is not part of what you requested in this question. I have both the original document you sent open and this new one. The blue-highlighted part does not exist in the original. The requirement isn't in the document at all.

For items that were not part of your additional request, I am required to kindly request that you enter a new question. Please remember to start it with **For TheDoctor**. And let me know by when you will need this additional part.

Thank you

Customer: replied 1 year ago.

I understand I will make a new request. Yeah I was changing the credentials manually it seems that is going to work. But let you tomorrow, because it is bedtime.

Expert:  TheDoctor replied 1 year ago.
I look forward to hearing from you. Have a good night.

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4520
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3121
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    3035
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2457
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2341
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1975
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1873
    Bachelors Degree and CPA with Accounting work experience