TrainingDatabaseSearch.php file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Search for a Training Record</title>
<meta name="keywords" content="HTML, CSS, PHP" /> </meta>
<link rel="stylesheet" type="text/css" href="TrainingDataBase.css">
</head>
<body>
<div align="center">
<p>
<img src="Images/dsHeaderLogo.png"
width="950" height="125">
<br>
<!-- SEARCH PRODUCT DHR -->
<h1 align="center"><u><strong><font face="arial">Search for a Training Record</font></strong></u></h1>
</p>
<br>
<br>
<form action="AddTraining.php" method="get">
<h4> Please Select a Employee: </h4>
<select name = "employee">
<option value=" ">Select Employee</option>
<option value="55">Joe Blow</option>
<option value="all">All Employees</option>
</select>
<br>
<br>
<input type="submit" value="SHOW TRAINING REPORT ">
</form>
</div>
<br>
<?php
if (!empty($_GET['employee']) || !empty($_GET['sort'])){
$DBConnect = mysql_connect("localhost", "root");
if (!$DBConnect)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("training_db", $DBConnect);
$employee = $_GET['employee'];
if ($make == "all")
$result = "SELECT * FROM Emp_Id = '$employee'";
$resulttraining = mysql_query($result);
//Display Results in a Table
echo "<table align='center' table border='8'>
<tr>
<th>Employee Id</th>
<th>First Name</th>
<th>Last Name</th>
<th>Department</th>
<th>Diversity / Sexual Haarassment</th>
<th>BBP</th>
<th>LOTO</th>
<th>Haz Comm</th>
<th>PPE</th>
<th>Evacuation</th>
<th>ISO 13485</th>
<th>ISO 9001</th>
<th>Quality DHR</th>
<th>Orientation</th>
<th>Work Instructions</th>
<th>Handle Drilling</th>
<th>Assembly</th>
<th>Centerless Grinder</th>
<th>Fluter</th>
<th>Labels</th>
<th>Shafting</th>
<th>Molding</th>
<th>Laser</th>
<th>Tipping</th>
<th>QC 5000</th>
<th>Calibration</th>
<th>Staking</th>
<th>End Stamp</th>
<th>Mazak</th>
<th>Fadal</th>
<th>Screw Machine</th>
<th>Fork Lift Safety</th>
</tr>";while($row = mysql_fetch_array($resulttraining))
{
echo "<tr>";
echo "<td align='center'>" . $row['Emp_Id'] . "</td>";
echo "<td align='center'>" . $row['FirstName'] . "</td>";
echo "<td align='center'>" . $row['LastName'] . "</td>";
echo "<td align='center'>" . $row['Dept'] . "</td>";
echo "<td align='center'>" . $row['diversity'] . "</td>";
echo "<td align='center'>" . $row['bbp'] . "</td>";
echo "<td align='center'>" . $row['loto'] . "</td>";
echo "<td align='center'>" . $row['hazcomm'] . "</td>";
echo "<td align='center'>" . $row['ppe'] . "</td>";
echo "<td align='center'>" . $row['evacutation'] . "</td>";
echo "<td align='center'>" . $row['iso13485'] . "</td>";
echo "<td align='center'>" . $row['iso9001'] . "</td>";
echo "<td align='center'>" . $row['qualitydhr'] . "</td>";
echo "<td align='center'>" . $row['orientation'] . "</td>";
echo "<td align='center'>" . $row['workinstructions'] . "</td>";
echo "<td align='center'>" . $row['handledrilling'] . "</td>";
echo "<td align='center'>" . $row['assembly'] . "</td>";
echo "<td align='center'>" . $row['cg'] . "</td>";
echo "<td align='center'>" . $row['fluter'] . "</td>";
echo "<td align='center'>" . $row['labels'] . "</td>";
echo "<td align='center'>" . $row['shafting'] . "</td>";
echo "<td align='center'>" . $row['molding'] . "</td>";
echo "<td align='center'>" . $row['laser'] . "</td>";
echo "<td align='center'>" . $row['tipping'] . "</td>";
echo "<td align='center'>" . $row['qc5000'] . "</td>";
echo "<td align='center'>" . $row['calibration'] . "</td>";
echo "<td align='center'>" . $row['staking'] . "</td>";
echo "<td align='center'>" . $row['stamp'] . "</td>";
echo "<td align='center'>" . $row['mazak'] . "</td>";
echo "<td align='center'>" . $row['fadal'] . "</td>";
echo "<td align='center'>" . $row['screw'] . "</td>";
echo "<td align='center'>" . $row['forklift'] . "</td>";
echo "</tr>";
}
echo "</table>";
mysql_close($DBConnect); }
echo "<div align=\"center\">".date("Y/m/d")."</div>";
?>
<center>
<a href="TrainingDataBaseAdd.php"><img src="Images/AddTrainingBtn.png" alt="Add New Person to DataBase" /></a>
</center>
<br>
<br>
<center>
<a href="TrainingDataBaseUpdate.php"><img src="Images/UpdateTrainingBtn.png" alt="Click Here to UPDATE a Training Record" /></a>
</center>
</body>
</html>
Here is the TrainingDataBaseAdd.php file:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>ADD a NEW PERSON to theTraining Record</title>
<meta name="keywords" content="HTML, CSS, PHP" /> </meta>
<link rel="stylesheet" type="text/css" href="TrainingDataBase.css">
</head>
<body>
<div align="center">
<img src="Images/dsHeaderLogo.png" width="950" height="125">
</div>
<br>
<br>
<!-- ADD NEW PERSON and TRAINING -->
<h1 align="center"><u><strong><font face="arial">Add New Employee to Training Record</font></strong></u></h1>
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter a EMPLOYEE NUMBER: <input type="text" name="Emp_Id" />
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter a FIRST NAME: <input type="text" name="FirstName" />
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter a LAST NAME: <input type="text" name="LastName" />
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter a DEPARTMENT: <input type="text" name="Dept" />
<br>
<br>
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of DIVERSITY/ SEXUAL HARASSMENT Training: <input type="text" name="diversity" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of BBP Training: <input type="text" name="bbp" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of LOTO Training: <input type="text" name="loto" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of HAZCOMM Training: <input type="text" name="hazcomm" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of PPE Training: <input type="text" name="ppe" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of EVACUATION Training: <input type="text" name="evacuation" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of ISO 13485 Internal Audit Training: <input type="text" name="iso13485" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of ISO 9001 Training: <input type="text" name="iso9001" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of QUALITY DHR Training: <input type="text" name="qualitydhr" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of ORIENTATION: <input type="text" name="orientation" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of WORK INSTRUCTION Training: <input type="text" name="workinstructions" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of HANDLE DRILLING Training: <input type="text" name="handledrilling" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of ASSEMBLY PACKAGE Training: <input type="text" name="assembly" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of CENTERLESS GRINDING Training: <input type="text" name="cg" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of FLUTER Training: <input type="text" name="fluter" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of LABELS Training: <input type="text" name="labels" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of SHAFTING Training: <input type="text" name="shafting" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of MOLDING Training: <input type="text" name="molding" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of LASER Training: <input type="text" name="laser" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of TIPPING Training: <input type="text" name="tipping" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of QC 5000 Training: <input type="text" name="qc5000" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of CALIBRATION Training: <input type="text" name="calibration" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of STAKING Training: <input type="text" name="staking" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of END STAMP Training: <input type="text" name="stamp" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of MAZAK Training: <input type="text" name="mazak" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of FADAL Training: <input type="text" name="fadal" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of SCREW MACHINE Training: <input type="text" name="screw" /> example: mm/dd/yyyy
<br>
<br>
<form action="AddTraining.php" method="post">
Please enter the date of FORK LIFT SAFETY Training: <input type="text" name="forklift" /> example: mm/dd/yyyy
<br>
<br>
<br>
<br>
<center><input type="submit" value="Add New Person"></center>
</form>
<!-- END ADD NEW PRODUCT DHR -->
<?php
$con = mysql_connect("localhost","root","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("training_db", $con);
$Emp_Id = $_POST['Emp_Id'];
$LastName = $_POST['LastName'];
$FirstName = $_POST['FirstName'];
$Dept = $_POST['Dept'];
$diversity = $_POST['diversity'];
$bbp = $_POST['bbp'];
$loto = $_POST['loto'];
$hazcomm = $_POST['hazcomm'];
$ppe = $_POST['ppe'];
$evacuation = $_POST['evacuation'];
$iso13485 = $_POST['iso13485'];
$iso9001 = $_POST['iso9001'];
$qualitydhr = $_POST['qualitydhr'];
$orientation = $_POST['orientation'];
$workinstructions = $_POST['workinstructions'];
$handledrilling = $_POST['handledrilling'];
$assembly = $_POST['assembly'];
$cg = $_POST['cg'];
$fluter = $_POST['fluter'];
$labels = $_POST['labels'];
$shafting = $_POST['shafting'];
$molding = $_POST['molding'];
$laser = $_POST['laser'];
$tipping = $_POST['tipping'];
$qc5000 = $_POST['qc5000'];
$calibration = $_POST['calibration'];
$staking = $_POST['staking'];
$stamp = $_POST['stamp'];
$mazak = $_POST['mazak'];
$fadal = $_POST['fadal'];
$screw = $_POST['screw'];
$forklift = $_POST['forklift'];
mysql_query("INSERT INTO employee VALUES ('$Emp_Id','$FirstName','$LastName','$Dept')";
mysql_query("INSERT INTO annual VALUES ('$Emp_Id','$diversity','$bbp','$loto','$hazcomm','$ppe','$evacuation')";
mysql_query("INSERT INTO quality VALUES ('$Emp_Id','$iso13485','$iso9001','$qualitydhr','$orientation','$workinstructions')";
mysql_query("INSERT INTO endo VALUES ('$Emp_Id','$handledrilling','$assembly','$cg','$fluter','$labels','$labels','$shafting','$molding','$laser','$tipping','$qc5000','$calibration','$staking','$stamp')";
mysql_query("INSERT INTO ms VALUES ('$Emp_Id','$mazak','$fadal','$screw','$forklift')";
mysql_close($con);
?>
</body>
</html>
Here is the AddTraining.php File:
<?php
$con = mysql_connect("localhost","root","password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("training_db", $con);
mysql_query("INSERT INTO employee VALUES ('$Emp_Id','$FirstName','$LastName','$Dept')";
mysql_query("INSERT INTO annual VALUES ('$Emp_Id','$diversity','$bbp','$loto','$hazcomm','$ppe','$evacuation')";
mysql_query("INSERT INTO quality VALUES ('$Emp_Id','$iso13485','$iso9001','$qualitydhr','$orientation','$workinstructions')";
mysql_query("INSERT INTO endo VALUES ('$Emp_Id','$handledrilling','$assembly','$cg','$fluter','$labels','$labels','$shafting','$molding','$laser','$tipping','$qc5000','$calibration','$staking','$stamp')";
mysql_query("INSERT INTO ms VALUES ('$Emp_Id','$mazak','$fadal','$screw','$forklift')";
mysql_close($con);
?>
Here is the Tables in the SQL Tables:
--EMPLOYEE TABLE CREATE TABLE employee ( Emp_Id int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Dept varchar(255), ) --ANNUAL TABLE CREATE TABLE annual ( Emp_Id int NOT NULL, diversity varchar(10) NOT NULL, bbp varchar(10), loto varchar(10), hazcomm varchar(10), ppe varchar(10), evacuation varchar(10), ) --QUALITY TABLE CREATE TABLE quality ( Emp_Id int NOT NULL, iso13485 varchar(10), iso9001 varchar(10), qualitydhr varchar(10), orientation varchar(10), workinstructions varchar(10), ) --ENDO TABLE CREATE TABLE endo ( Emp_Id int NOT NULL, handledrilling varchar(10), assembly varchar(10), cg varchar(10), fluter varchar(10), labels varchar(10), shafting varchar(10), molding varchar(10), laser varchar(10), tipping varchar(10), qc5000 varchar(10), calibration varchar(10), staking varchar(10), stamp varchar(10), ) --MACHINE SHOP TABLE CREATE TABLE ms ( Emp_Id int NOT NULL, mazak varchar(10), fadal varchar(10), screw varchar(10), forklift varchar(10), )
Thanks for all your help
This post has been edited by James Bond C++ Spy: 12 January 2010 - 06:55 AM

New Topic/Question
Reply



MultiQuote









|