Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I am working on a new Project were I have to display data from DB in these 2 different pages. This is the first page(customerLookup)

I am working on a new Project were I have to display data from DB in these 2 different pages.

This is the first page(customerLookup) were I need to get the information from the DB and display it. In the second page(customerMaster) I will have to display the information from the first page.

I need to do a few things.

1- Make the search box work with AJAX.

2-Make each row a primary id so when you click will send you to the second page with the rigth information getting it from the primary id.

Try to:

1-Make each row a form and add a view button to the last cell of each row.

2-Make form action the appropriate master page.

3-Add a hidden input value to each row form and place the primary id of the row as the value.

image text in transcribed

This is the second page.

Now, on the master pages, load the hidden input value with GET or POST into a variable and use it to run a query to load the correct info.

image text in transcribed

This is the DB scripts. Let me know if I have to do any modification to the DB:

CREATE TABLE Jobs ( JobID INT NOT NULL AUTO_INCREMENT, JobTitle VARCHAR(45) NULL, CustomerID INT NOT NULL, Department VARCHAR(45) NULL, ContactID1 INT NULL, ContactID2 INT NULL, StartDate DATE NULL, EndDate DATE NULL, Shift VARCHAR(5) NULL, StartTime VARCHAR(45) NULL, EndTime VARCHAR(45) NULL, Pay VARCHAR(45) NULL, Requirements VARCHAR(200) NULL, Description VARCHAR(200) NULL, Active BOOLEAN NULL, Filled BOOLEAN NULL, PRIMARY KEY (JobID), FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID) );

CREATE TABLE CustomerContacts ( ContactID INT NOT NULL AUTO_INCREMENT, CustomerID INT NOT NULL, FirstName VARCHAR(45) NULL, LastName VARCHAR(45) NULL, Title VARCHAR(45) NULL, Phone VARCHAR(45) NULL, Email VARCHAR(45) NULL, PRIMARY KEY (ContactID), FOREIGN KEY (CustomerID) REFERENCES Customers(CustomerID) );

This is the code for each page:

customerLookup:

Customer Lookup

Software X

Customer Lookup

  • Menu
  • Dashboard
  • Employees
  • Customers
  • Schedule
  • Settings
  • Logout

$sql="SELECT * FROM Customers";

$results= mysqli_query($db, $sql); $customerMaster = 'customerMaster.php'; while($row = mysqli_fetch_array($results)) { echo "

"; } ?>

Name Division Address City State Phone Email
".$row["Name"]." ".$row["Division"]." ".$row["Address"]." ".$row["City"]." ".$row["State"]." ".$row["Phone"]." ".$row["Email"]."

customerMaster:

Customer Master

Software X

Customer Master

  • Menu
  • Dashboard
  • Employees
  • Customers
  • Schedule
  • Settings
  • Logout

$sql="SELECT * FROM Customers";

$results= mysqli_query($db, $sql); if($row = mysqli_fetch_array($results)){

?>

Contacts

$sql="SELECT * FROM CustomerContacts";

$results= mysqli_query($db, $sql); while($row = mysqli_fetch_array($results)) { echo "

"; } ?>
First Name Last Name Job Title Phone Department Email
".$row["FirstName"]." ".$row["LastName"]." ".$row["Title"]." ".$row["Phone"]." ".$row["Department"]." ".$row["Email"]."

ID Chega Study | Guided Solutions and Chegg Study I Guided Solutions and Chegg Study | Guided Solutions and localhost:8080 localhost Projecti Erik - Lookup Page Solution and Exp.. Customer Lookup Software X Menu A Dashboard Customer Lookup Search Employees Customers Schedule Settings AddresS City 1800 Manager at Ernk Quincy IL +12175178899 erik@applemanager.com Ave Management Joan xXlil O Logout Oscar Spain ID Chega Study | Guided Solutions and Chegg Study I Guided Solutions and Chegg Study | Guided Solutions and localhost:8080 localhost Projecti Erik - Lookup Page Solution and Exp.. Customer Lookup Software X Menu A Dashboard Customer Lookup Search Employees Customers Schedule Settings AddresS City 1800 Manager at Ernk Quincy IL +12175178899 erik@applemanager.com Ave Management Joan xXlil O Logout Oscar Spain

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions

Question

c. Supply increases and demand is constant.

Answered: 1 week ago