Dear Coders,
Ok. Well I don't think this is actually my problem now. I believe the problem lies in that I have a couple of things going on here and I believe the main one is the form and how I need it to Post the data to the Function that process the information.
Here is the function that creates the form:
function Logging($yyyymm){
$logging_table_row_begin .= "<tr>";
$logging_table_row_end .= "</tr>";
$logging_column_begin .= "<td>";
$logging_column_end .= "</td>";
$day = $_GET["day"];
if($day != " "){
$day = "0$day";
}
$useable_date = "$yyyymm$day";
echo "<form method=post action=scripts/process.php?Logging=Update>";
echo "<table border=\"0\" width=\"100%\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">";
echo "<tr>";
echo "<th align=center> </th>";
echo "<th align=center>Track #</th>";
echo "<th align=center>Project ID</th>";
echo "<th align=center>Doc Type</th>";
echo "<th align=center>Scanner</th>";
echo "<th align=center>Processor</th>";
echo "<th align=center>Filer</th>";
echo "<th align=center>Completed</th>";
echo "</tr>";
$hostname = "localhost";
$mysql_user = "root";
$mysql_paswd = "";
$dbname = "test";
$db_table_name = "mts";
$completed_date = date('Y-m-d');
$db = mysql_connect($hostname,$mysql_user,$mysql_paswd);
mysql_select_db($dbname,$db);
$query = "SELECT * FROM $db_table_name WHERE EntryDate = '$useable_date' ORDER BY EntryID ASC";
$result = mysql_query($query, $db) or exit(mysql_error());
if(mysql_fetch_array($result) == ""){
echo "<tr><td colspan=8 align=center>No Data Entered for Selected Date.</td></tr>";
}
while ($myrow = mysql_fetch_row($result)) {
echo "<tr style='background:white;' onMouseOver=\"swapBG(this,'white','orange')\" OnMouseOut=\"swapBG(this,'orange','white')\">";
printf("<td>%s <input type='hidden' name='EntryID' value='%s'></td>", $myrow[0], $myrow[0]); // Entry ID
printf("<td align=center>%s</td>", $myrow[2]); //Tracking Number
printf("<td align=center>%s</td>", $myrow[5]); //Project ID
printf("<td align=center>%s</td>", $myrow[6]); // Document Type
//Checks to see if a Data Scanner has been set if so it returns the information
// if not is allows the person entering the data to input who is checking this
// document out to have that process complted.
if ($myrow[12] == "") {
echo "<td align=center><input type=text name=data_scanner></td>";
} else {
printf("<td align=center>%s<input type=hidden name=datascanner value=%s></td>", $myrow[12], $myrow[12]); // Data Scanner
if($myrow[14] == ""){
echo "<td align=center><input type=text name=data_scanner2></td>";
} else {
printf("<td align=center>%s<input type=hidden name=datascanner2 value=%s></td>", $myrow[14], $myrow[14]);
}
}
if($myrow[13] == ""){
echo "<input type=hidden name=datascanner_date value=$completed_date>";
} else {
echo "<input type=hidden name=datascanner_date value=$myrow[13]>";
}
if($myrow[15] == ""){
echo "<input type=hidden name=datascanner_date value=$completed_date>";
} else {
echo "<input type=hidden name=datascanner_date value=$myrow[15]>";
}
//Checks to see if a Processor has been set if so it returns the information
// if not it allows the person entering the data to input who is checking this
// document out to have that process completed.
if($myrow[8] == "") {
echo "<td align=center><input type=text name=processor></td>";
} else {
printf("<td align=center>%s<input type=hidden name=processor value=%s></td>", $myrow[8], $myrow[8]); // Processor
if ($myrow[10] == "") {
echo "<td align=center><input type=text name=processor2></td>";
} else {
printf("<td align=center>%s<input type=hidden name=processor2 value=%s><td>", $myrwo[10], $myrow[10]);
}
}
if($myrow[9] == ""){
echo "<input type=hidden name=datascanner_date value=$completed_date>";
} else {
echo "<input type=hidden name=datascanner_date value=$myrow[9]>";
}
if($myrow[11] == ""){
echo "<input type=hidden name=datascanner_date value=$completed_date>";
} else {
echo "<input type=hidden name=datascanner_date value=$myrow[11]>";
}
//Checks to see if a Filer has been set if so it returns the information
// if not is allows the person entering the data to input who is checking this
// document out to have that process complted.
if ($myrow[16] == "") {
echo "<td align=center><input type=text name=filer></td>";
} else {
printf("<td align=center>%s<input type=hidden name=filer value=%s></td>", $myrow[16], $myrow[16]); // Data Scanner
if($myrow[18] == ""){
echo "<td align=center><input type=text name=filer2></td>";
} else {
printf("<td align=center>%s<input type=hidden name=filer2 value=%s></td>", $myrow[18], $myrow[18]);
}
}
if($myrow[17] == ""){
echo "<input type=hidden name=datascanner_date value=$completed_date>";
} else {
echo "<input type=hidden name=datascanner_date value=$myrow[17]>";
}
if($myrow[19] == ""){
echo "<input type=hidden name=datascanner_date value=$completed_date>";
} else {
echo "<input type=hidden name=datascanner_date value=$myrow[19]>";
}
//Checks to see if a Completed date has been set if not it returns the current date.
if ($myrow[20] == "") {
echo "<td align=center>$completed_date<input type=hidden name=completed_date value=$completed_date></td></tr>\n"; // Completed Date
} else {
printf("<td align=center>%s <input type=hidden name=completed_date value=%s></td>", $myrow[20], $myrow[20]);
}
}
echo "<tr><td align=center colspan=11><input type=submit name=submit value=Save></td></tr>";
echo "</form>";
echo "</table>";
}
This is the statment that calls the function to enter the information to the database. I can not find any PHP errors in this.
$Logging = $_GET["Logging"];
if(isset($Logging)){
UpdateRecords($EntryID,$processor,$processor_date,$processor2, $processor2_date,$datascanner,$datascanner_date,$datascanner2,$datascanner2_date,$filer,$filer_date,$filer2,$filer2_date,$completed_date);
}
Here is the function that updates the database with the new information
//Updateing the Information in the Database or Entering it for the first time.
function UpdateRecords($EntryID,$processor,$processor_date,$processor2, $processor2_date,$datascanner,$datascanner_date,$datascanner2,$datascanner2_date,$filer,$filer_date,$filer2,$filer2_date,$completed_date){
//Saves the changes that are made by the person logging possession of the documents.
$hostname = "localhost";
$mysql_user = "root";
$mysql_paswd = "";
$dbname = "test";
$db_table_name = "mts";
$completed_date = date('Y-m-d');
$db = mysql_connect($hostname,$mysql_user,$mysql_paswd);
mysql_select_db($dbname,$db);
$query = "UPDATE $db_table_name SET processor='$processor', processor_date='$processor_date', processor2='$processor2', processor2_date='$processor2_date', datascanner='$datascanner', datascanner_date='$datascanner_date', datascanner2='$datascanner2', datascanner2_date='$datascanner2_date', filer='$filer', filer_date='$filer_date', filer2='$filer2', filer2_date='$filer2_date', completed_date='$completed_date' WHERE EntryID='$EntryID'";
$result = mysql_query($query, $db) or die(mysql_error());
echo "<a href=/logging.php>Click Here to Return to the Logging Sheet</a><br>";
}
$mailentry = $_GET["mailentry"];
if(isset($mailentry)){
MailLogged($EntryDate,$tracking_number,$delivery_type,$SentTo,$project_id,$doc_type,$logged_by);
}
Just so everyone knows I can not find any PHP errors in any of this code. If anyone else see's a problem please let me know I've been thru and thru throughly and I can not locate my error that's stopping the input data from being entered into the MySQL database.