hi guys,
i am able to get the email comment inserted in my db but its not getting displayed via my html table. the data is getting stored in email_comment column but am able to get the content displayed. all the other columns display. the table is under job history
<html>
<head>
</head>
<body>
<?php
require('dbconnect.php');
set_time_limit(0);
$jobId=$_GET['jobId'];
$sql = "select jobId, email, room, computers, description, date FROM requests_table
WHERE requests_table.jobId='$jobId'";
$result = mysql_query($sql);
echo "<H3><b>Faults and Requests</b></H3>";
echo "<table width=\"100%\">\n";
echo " <tr bgcolor=\"8DD8C5\">\n";
echo " <th align=\"left\"><b>JobID</b></th>\n";
echo " <th align=\"left\"><b>Email</b></th>\n";
echo " <th align=\"left\"><b>Room</b></th>\n";
echo " <th align=\"left\"><b>Computers</b></th>\n";
echo " <th align=\"left\" ><b>Description</b></th>\n";
echo " <th align=\"left\"><b>Date&time</b></th>\n";
echo " </tr>\n";
$row = mysql_fetch_array($result);
echo '<td bgcolor="97DEFF">'.$row['jobId'].'</td>';
echo '<td bgcolor="97DEFF">'.$row['email'].'</td>';
echo '<td bgcolor="97DEFF">'.$row['room'].'</td>';
echo ' <td bgcolor="97DEFF">'.$row['computers'].'</td>'."\n";
echo ' <td bgcolor="97DEFF">'.$row['description'].'</td>'."\n";
echo ' <td bgcolor="97DEFF" >'.$row['date'].'</td>'."\n";
echo '</tr>'."\n";
echo '</table>';
echo '<hr>';
?>
<?php
$color[0] = "FFB9B9";
$color[1] = " 97DEFF ";
$jobId=$GET['jobId'];
$action_taken=$GET['action_taken'];
$Tech_initals=$GET['Tech_intials'];
$email = $GET['email'];
if($_POST["Submit1"]) {
$action_taken = addslashes($POST['action_taken']);
$Tech_initals = addslashes($POST['Tech_initals']);
$result = mysql_query("INSERT INTO tech_table (jobId, Tech_initals, action_taken, email_comment, date)
VALUES ('$jobId', '$Tech_initals', '$action_taken','$message', NOW())") or die("Unable to insert record: " . mysql_error());
}
$sql = "SELECT jobId, Tech_initals, action_taken, email_comment, date FROM tech_table WHERE jobId='".$_GET['jobId']."'";
$result = mysql_query($sql);
echo "<H3><b>Job History</b></H3>";
echo "<table>\n";
echo " <tr bgcolor=\"8DD8C5\">\n";
echo " <th><b>Tech Initals</b></th>\n";
echo " <th><b>Action taken</b></th>\n";
echo " <th><b>Date</b></th>\n";
echo " <th><b>Email comment</b></th>\n";
echo " </tr>\n";
while ($row = mysql_fetch_array($result)) {
$a = ($a+1)%2;
echo '<tr bgcolor='.$color[$a] . ">\n";
//echo '<td>'.$row['jobId'].'</td>';
echo ' <td>'.$row['Tech_initals'].'</td>'."\n";
echo ' <td>'.$row['action_taken'].'</td>'."\n";
echo ' <td>'.$row['date'].'</td>'."\n";
echo ' <td>'.$row['email_comment'].'</td>'."\n";
echo ' <td>'.$row['complete'].'</td>'."\n";
echo '</tr>'."\n"; }
echo '</table>';
?>
</table>
<?php
$email = $GET['email'];
if (strlen($POST['email']) > 0 ) {
$sql = "SELECT email FROM requests_table WHERE jobId='".$GET['jobId']."'";
$result = mysql_query($sql);
$row = mysql_fetch_assoc($result);
$email = $GET['email'];
$to = $row['email'];
$from = "poo@ntlworld.com";
$message = $_POST['email'];
mail($to, "technical services", $message,
"From: {$from}\r\n"
."Reply-To: {$from}\r\n"
."X-Mailer: PHP/" . phpversion());
}
mysql_query('INSERT INTO tech_table (email_comment) VALUES(\'' . $message . '\')');
//mysql_query("INSERT INTO tech_table (email_comment)
//VALUES ('" . $email. "') ") or die("Unable to insert record: " . mysql_error());
//$sql= mysql_query($result);
?>
<br>
<?php
echo '<hr>';
?>
<?php
echo "<H3><b> Technican Feedback</b></H3>";
?>
<br>
<form name="details" method="post" action= "<? echo $_SERVER['PHP_SELF'] . "?jobId=" . $jobId; ?>">
<table width="791" height="160" border="0">
<tr>
<input type="hidden" name="email">
<th width="61" bgcolor="8DD8C5" scope="row">TechId</th>
<td width="245" bgcolor="8DD8C5"><strong>Action taken </strong></td>
<td width="108" bgcolor="8DD8C5"><strong>Job finished</strong></td>
<td width="128"> </td>
<td width="126"> </td>
<td width="97"> </td>
</tr>
<tr>
<th scope="row"><input name="Tech_initals" type="text" size="2" maxlength="2"></th>
<td><textarea name="action_taken" cols="30" rows="3"></textarea></td>
<td><input type="checkbox" name="complete" value="1"></td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<th scope="row"> </th>
<td><strong>Email comment </strong></td>
</tr>
<tr>
<th scope="row"> </th>
<td><textarea name="email" cols="30" rows="3"></textarea></td>
</tr>
</tr>
<tr>
<th scope="row"> </th>
<td><input type="submit" name="Submit1" value="Submit"></td>
</tr>
</table>
</form>
<?php
if (isset($_REQUEST['complete'])){
mysql_query("UPDATE requests_table SET complete = NOW()") or die ("Unable to insert record: " . mysql_error());
echo "<script>window.location=\" http://81.106.219.191/fmp/tech.php/ \"; </script>";
}
else
{
//echo "not checked";
}
echo '<hr>';
echo "<H3><b>Knoweledgebase</b></H3>";
?>
<input name="" type="text">
<input type="button" value="search">
</body>
</html>