PLEASE HELP ME WITH THIS QUESTION!! Your challenge is to create a program that c
ID: 3757663 • Letter: P
Question
PLEASE HELP ME WITH THIS QUESTION!!
Your challenge is to create a program that can display an view of records from the Integrated Post Secondary Educational Data System. This process requires you to import a CSV file that contains the data, and a CSV file that is the corresponding data dictionary for that data. You must then display a list of all the colleges by name that has a link to click, which takes you to a detailed table view of that college’s records.
Here is a link to the csv data file: http://web.njit.edu/~kwilliam/is218-challenge1/hd2013.csv
Here is a link to the Excel dictionary file: http://web.njit.edu/~kwilliam/is218-challenge1/hd2013.xls
Important requirements: The table header fields should be the full title as displayed in the data dictionary and not the abbreviated heading found in the CSV data file. Specifically About these two files:
1) hd2013.csv is the main file contains details about universities and corresponding attributes information with records.
2) hd2013.xls contains the true information of attributes’ and values’ contents. For example, in hd2013.csv, the first attribute’s name is “UNITID”. But “UNITID” is not informative, so you need to go to hd2013.xls à “varlist” sheet, to find out the real content of “UNITID”, which is ”Unique identification number of the institution”. Similarly, if you display the value of FIPS for the first record in hd2013.csv as “1”, it will not be informative. And you need to go to the “Frequencies” sheet in hd2013.xls file to find that “1” is actually “Alabama” as a possible value of FIPS.
Your jobs:
1) Read the data from both files and save them in the same table style in MySQL (Optional);
2) Setup a PHP webpage to display all universities in hd2013.csv as clickable links. You can achieve this by reading the university information from either csv file(if you didn’t do step one) or retrieve the data from the database (if you did step one);
3) Once a university is clicked, you need to redirect the user to a new PHP page displaying all information about the university. Note that you need to replace the abbreviation of both the attribute name and its corresponding value with their true content by looking up the “varlist” and “Frequencies” sheet in the xls file as mentioned above.
About submission: Please submit your project with screenshots of all the web pages and source codes. If your codes are pretty long, you can also submit your whole website codes as a zip file of PHP files. But note that the screenshots of your user interfaces of
1) a list of clickable universities, and
2) one example of specific university detail page, are required for everyone (even though your final solution still contains errors). Please help! this is bit confusing. THIS IS WEB DESSIGN COURSE USING XAMPP (PHPMYADMIN) PLEASEE
Explanation / Answer
Create a file with name
hd2013.csv with data
UNITID
INSTNM
ADDR
CITY
STABBR
ZIP
FIPS
OBEREG
CHFNM
CHFTITLE
GENTITLE
FAXTELE
EIN
OPEID
OPEFLAG
WEBADDRESS
ADMINUR
PAIDURL
APPURL
1 Ans:
CREATE TABLE CSVfileimport(UNITID varchar2(50),INSTNM varchar2(50),ADDR varchar2(50),CITY vrachra2(50),
STABBR varchar2(50),ZIP varchar2(50),FIPS varchar2(50),OBEREG varchar2(50),CHFNM varchar2(50),
CHFTITLE varchar2(50),GENTITLE varchar2(50),FAXTELE varchar2(50),EIN varchar2(50),OPEID varchar2(50),
OPEFLAG varchar2(50),WEBADDRESS varchar2(50),ADMINUR varchar2(50),PAIDURL varchar2(50),APPURL varchar2(50)
);
Read the data from csv file
LOAD DATA INFILE '/home/Desktop/hd2013.csv'
INTO TABLE CSVfileimport;
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY ' '
IGNORE 1 ROWS
SELECT * FROM CSVfileimport;
insert the data from csv file
LOAD DATA LOCAL INFILE 'C:\temp\hd2013.csv'
INTO TABLE testDB.Schedule FIELDS TERMINATED BY ';' ENCLOSED BY '"'
LINES TERMINATED BY ' ' (UNITID,INSTNM,ADDR,CITY,STABBR,ZIP,FIPS,OBEREG,CHFNM,
CHFTITLE,GENTITLE,FAXTELE,EIN,OPEID,OPEFLAG,WEBADDRESS,ADMINUR,PAIDURL,APPURL);
2 Ans:
create a web page CSVfile.php
$filename = 'hd2013-'.date("Y-m-d H:i:s").'.csv'; //using hd2013.csv
$fp = fopen('php://output', "w"); // open the raw memory in write mode as file so no temp files needed
$row = mysqli_fetch_assoc($sql); //associate with my dql
$seperator = "";
$comma = "";
foreach($row as $name => $value) { //write the table headers
$seperator .= $comma . '' .str_replace('','""',$name);
$comma = ",";
}
$seperator .= " ";
fputs($fp, $seperator);
mysqli_data_seek($sql,0); //skip the past 0th value
while($row = mysqli_fetch_assoc($sql)){ //write in the table data using mysql
$seperator = "";
$comma = "";
foreach($row as $name => $value) {
$value = str_replace(",", " ", $value); //take the any commas out initially which would confuse the that csv file
$seperator .= $comma.''.str_replace('','""',$value);
$comma = ",";
}
$seperator .= " ";
fputs($fp, $seperator);
}
header('Content-Type: application/csv;'); // tell the browser it's going to be a csv file
header('Content-Disposition: attachement; filename="'.$filename.'";');// tell the browser to save it instead of displaying it
fclose($fp);
exit();
3Ans:
<?php
session_start();
$dbName = $_REQUEST['DBName'];
$tbName = $_REQUEST['TBName'];
$dbType = $_REQUEST['DBType'];
include('header.php');
switch($dbType)
{
case 'information':
include('CSVfile.php');
exit;
}
include('footer.php');
?>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.