Jump to content

Submit button working in Chrome but not in IE / MySQL Problem


blepblep

Recommended Posts

Hi, wondering could anyone help me here please. I've two problems -

 

1) I have a submit button which goes to another page, it works fine in Chrome but not in IE. Heres the code for it -

 

<form action = \"saveMom.php\" method = \"post\" onsubmit = \"return validateForm()\">
....

<input type = \"text\" name = \"signOff\" size = \"24\" align = \"right\" value = \"" . $row['signOff'] . "\"/>  <input type=\"submit\" name=\"save\"  class = 'eBtnSubmit' value=\"Sign off\" align = \"right\" />

 

What it does is when Sign Off is clicked, it goes to the saveMom.php file and performs an insert query. This works fine in Chrome but nothing happens in IE, an ideas what could cause this?!

 

And my second problem is -

 

2) I am trying to retrieve data from 4 tables in a database that all have one common field - reviewId. My query looks like this so far, it doesn't work 100% - It prints out the same values 4 times.

 

"SELECT * FROM review, mom, remark, action WHERE review.reviewId IN( ".$_POST['reviewIds']." )"

 

What I am doing is allowing my users to export the results to an Excel file, the above query opens the Excel file but contains the same value 4 times.

 

Could anyone help me on either problem?

 

Thanks!

 

 

Link to comment
Share on other sites

Thanks for the reply. I've tried both ways and nothing happens. Even in Chrome when I add return true the Sign Off works as expected, but in IE nothing happens. The button clicks but nothing happens after that.

 

Here is my validateForm() if it is any use?

 

function validateForm()
{

var x = document.forms[0]["qualityRankingOfReview"].value;
if (x == null || x == "")
{
alert("Quality Ranking of Review field is empty.");

return false;
} else {

if (isNumber(x) != true) {

	alert("Quality Ranking of Review field is not a number from 0 to 5.");
	return false;
} else if (x > 5) {

	alert("Quality Ranking of Review field should be a number from 0 to 5.");
	return false;
}

}

Link to comment
Share on other sites

Ok sorry, heres my code.

 

saveMom.php

 



<?php
///------------------------
///	Connecting to database
///------------------------

include 'connect_db.php';

///-----------------------------
///	Inserting data into database
///-----------------------------

function sanitize_data($data) // create the function sanitize_data
    {
        $data = mysql_real_escape_string(trim($data));
        return $data;
    }

$post = array(); 
foreach($_POST as $key =>$value){
$post[$key] = sanitize_data($value);   // call sanitize_data using each value from the $post array{$post['quality_ranking_review']}',


echo "

<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">
<html>
<head>
<meta http-equiv=\"REFRESH\" content=\"3;url = http://159.107.173.47/webpages/TC_Tool/Tool2/tc_tool/searchByReviewID.php?reviewID=" . $post['reviewId'] . "\"> 
</head>
</html>

";

}

if(isset($post['save']))
{

$query = "DELETE FROM tc_tool.mom WHERE reviewId = ". $post['reviewId'];

if (!mysql_query($query, $connection))
	{
		echo "Query failed: $query<br />" . mysql_error();
	}

$query = "INSERT INTO tc_tool.mom
			(
			reviewId,
			qualityRankingOfReview,
			correctDocTemplate,
			internallyReviewed,
			requirementsCovered,
			correctStorageLibrary,
			reportsDescribed,
			changeRequestsIncluded,
			openIssuesAddressed,
			docAvailable,
			statementProblemChapter,
			majorComments,
			result,
			numberOfMajorComments,
			numberOfMinorComments,
			nextReviewForum,
			reasonForReReview,
			reasonForCancellation,
			otherComments,
			date,
			time,
			venue,
			attendees,
			emailComments,
			signOff
			)
			values 
			(" . 
			"'" . $post['reviewId'] . "', " . 
			"'" . $post['qualityRankingOfReview'] . "', " . 
			(isset($_POST['correctDocTemplate']) ? 1 : 0) . ", " . 
			(isset($_POST['internallyReviewed']) ? 1 : 0) . ", " . 
			(isset($_POST['requirementsCovered']) ? 1 : 0) . ", " . 
			(isset($_POST['correctStorageLibrary']) ? 1 : 0) . ", " . 
			(isset($_POST['reportsDescribed']) ? 1 : 0) . ", " . 
			(isset($_POST['changeRequestsIncluded']) ? 1 : 0) . ", " . 
			(isset($_POST['openIssuesAddressed']) ? 1 : 0) . ", " . 
			(isset($_POST['docAvailable']) ? 1 : 0) . ", " . 
			(isset($_POST['statementProblemChapter']) ? 1 : 0) . ", " . 
			(isset($_POST['majorComments']) ? 1 : 0) . ", " . 
			"'" . $post['result'] . "', " . 
			"'" . $post['numberOfMajorComments'] . "', " . 
			"'" . $post['numberOfMinorComments'] . "', " . 
			"'" . $post['nextReviewForum'] . "', " . 
			"'" . $post['reasonForReReview'] . "', " . 
			"'" . $post['reasonForCancellation'] . "', " . 
			"'" . $post['otherComments'] . "', " . 
			"STR_TO_DATE('$post[date]', '%d-%m-%Y') , " .
			"'" . $post['time'] . "', " . 
			"'" . $post['venue'] . "', " . 
			"'" . $post['attendees'] . "', " . 
			"'" . $post['emailComments'] . "', " . 
			"'" . $post['signOff'] . "'" . 
			"
			)				
			";


	//-----------------------------
	// Prints error if there is one
	//-----------------------------

	if (!mysql_query($query, $connection))
	{
		echo "Query failed: $query<br />" . mysql_error();
	}



	$query = "DELETE FROM tc_tool.remark WHERE reviewId = ". $post['reviewId'];

	if (!mysql_query($query, $connection))
	{
		echo "Query failed: $query<br />" . mysql_error();
	}

	$rowNum = 1;
	while (isset($_POST["remark_remark_" .$rowNum])) {


		$query = "INSERT INTO tc_tool.remark
			(
			reviewId,
			number,
			location,
			severity,
			responsible,
			remark,
			status,
			comment
			)
			values 
			(" . 
			$post['reviewId'] . ", " . 
			$rowNum . ", " . 
			"'" . $_POST["remark_location_" .$rowNum] . "', " . 
			"'" . $_POST["remark_severity_" .$rowNum] . "', " . 
			"'" . $_POST["remark_responsible_" .$rowNum] . "', " . 
			"'" . $_POST["remark_remark_" .$rowNum] . "', " . 
			"'" . $_POST["remark_status_" .$rowNum] . "', " . 
			"'" . $_POST["remark_comment_" .$rowNum] .  "'
				)				
			";

		if (!mysql_query($query, $connection))
	{
		echo "Query failed: $query<br />" . mysql_error();
	}


		$rowNum = $rowNum + 1;
	}




	$query = "DELETE FROM tc_tool.action WHERE reviewId = ". $post['reviewId'];

	if (!mysql_query($query, $connection))
	{
		echo "Query failed: $query<br />" . mysql_error();
	}

	$rowNum = 1;
	while (isset($_POST["action_action_" .$rowNum])) {


		$query = "INSERT INTO tc_tool.action
			(
			reviewId,
			number,
			location,
			responsible,
			action,
			status,
			comment
			)
			values 
			(" . 
			$post['reviewId'] . ", " . 
			$rowNum . ", " . 
			"'" . $_POST["action_location_" .$rowNum] . "', " . 
			"'" . $_POST["action_responsible_" .$rowNum] . "', " . 
			"'" . $_POST["action_action_" .$rowNum] . "', " . 
			"'" . $_POST["action_status_" .$rowNum] . "', " . 
			"'" . $_POST["action_comment_" .$rowNum] . "'
				)				
			";

		if (!mysql_query($query, $connection))
	{
		echo "Query failed: $query<br />" . mysql_error();
	}


		$rowNum = $rowNum + 1;
	}




	if (mysql_affected_rows() === 1) 
	{
			echo "MOM Saved... Redirecting..." . "<br />";
	}

	else 
	{
		echo "" . "<br />";
	}	

	function died($error) 
	{
		// Error code here
		echo "Error, not saving successfully. ";
		echo "The errors are below.<br /><br />";
		echo $error."<br /><br />";
		echo "Please retry.<br /><br />";
		//var_dump($_POST);
		die();
	}

	mysql_close($connection);
}
?>

 

I can post the code from the page that has the button on it but its 1631 lines long. Here is all of the code for the saveMom part of the page that contains the button -

 

<form action = \"saveMom.php\" method = \"post\" onsubmit = \"return validateForm()\">
<input type=\"hidden\" id=\"reviewId\" name=\"reviewId\" value=\"" . $id . "\" />

<table width = \"100%\" id = \"momTable\" border = 0 >

<tr class = \"heading\">
<td ALIGN = \"center\" colspan = \"3\" class = \"heading\"><b>Minutes of Meeting</b></td>
</tr>

<tr class = \"secondHeading\">
<td width = \"100%\" class = \"secondHeading\">
<b>Quality Ranking of Review (1-5)</b>
</td>
<td>
<input type = \"text\" name = \"qualityRankingOfReview\" size = \"1\" value=\"" . $row['qualityRankingOfReview'] . "\" style = \"float:right\"/>
</td>

<td>
<img id = \"qualityRankingReviewBtn\" src = \"images/arrowright.png\" align = \"right\" title = \"Click to expand\" onclick = \"hideSection('qualityRankingReview');\"/>
</td>

</tr>

<tr id = \"qualityRankingReview\" style=\"display:none;\">
<td colspan = \"3\">
<p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'><br /><u><b>Email Comments</b>:</u>
	(To be completed by TC chairperson)<br /><br />
	1 = Undefined.<br />
	2 = Document not of sufficient quality to review, missing chapters, clear competence or schedule issue apparent in the review.<br />
    3 = Insufficient participants in the review or insufficient preparation from participants.<br />
    4 = Proper review with some major open issues but in control.<br />
        5 = Proper review with no major open issues.<br /><br />
</font>
</p>
</td>

</tr>

<tr class = \"secondHeading\">
<td width = \"100%\" class = \"secondHeading\">
<b>Quality Ranking of Input Document (1-10)</b><br />
</td>
<td>
<input type = \"text\" name = \"inputDocRank\" size = \"1\" readonly=\"readonly\" disabled=\"disabled\" style = \"float:right\"/>
</td>
<td>
<img id = \"qualityRankingDocumentBtn\" src = \"images/arrowright.png\" align = \"right\" title = \"Click to expand\" onclick = \"hideSection('qualityRankingDocument');\"/>
</td>
</tr>

<tr id = \"qualityRankingDocument\" style=\"display:none;\">
<td colspan = \"3\" width = \"100%\"><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'><b>To be completed by TC chairperson using TC OSS RC document checklist.</b></font></p>
</td>
</tr>
	<tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"correctDocTemplate\" size = \"1\""
	. ($row['correctDocTemplate'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Has the correct document instruction/template been followed?</font></p></td></tr>

    <tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"internallyReviewed\" size = \"1\""
	. ($row['internallyReviewed'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Has the document been internally reviewed?</font></p></td></tr>

        <tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"requirementsCovered\" size = \"1\""
	. ($row['requirementsCovered'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Does the requirements chapter state whether all requirements have been covered, and explain why specific requirements are not covered?</font></p></td></tr>

    <tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"correctStorageLibrary\" size = \"1\""
	. ($row['correctStorageLibrary'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Is the document stored in the correct storage library with the correct status?</font></p></td></tr>

	<tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"reportsDescribed\" size = \"1\"" 
	. ($row['reportsDescribed'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Have all trouble reports for faults corrected by the system modifications been described? It should be obvious which applications were investigated to find all relevant  trouble reports.</font></p></td></tr>

    <tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"changeRequestsIncluded\" size = \"1\""
	. ($row['changeRequestsIncluded'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Have all approved change requests been included?</font></p></td></tr>

    <tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"openIssuesAddressed\" size = \"1\""
	. ($row['openIssuesAddressed'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Are all open issues addressed?</font></p></td></tr>
    
	<tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"docAvailable\" size = \"1\""
	. ($row['docAvailable'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Has the document been available at least 5 working days before the review date?</font></p></td></tr>

    <tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"statementProblemChapter\" size = \"1\""
	. ($row['statementProblemChapter'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Does the Technical Solution chapter describe the solution to the problems described in the Statement of Problem chapter?</font></p></td></tr>

    <tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" ><input style=\"float:right;\" type = \"checkbox\" name = \"majorComments\" size = \"1\""
	. ($row['majorComments'] == 1 ? "checked=\"yes\"" : "") . 
	"\" onclick = \"updateDocumentQualityRank();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Are there more than 50% major comments?</font></p></td></tr>
	<tr id = \"qualityRankingDocument\" style=\"display:none;\"><td colspan = \"3\" >
	<input type = \"text\" name = \"inputDocRank2\" size = \"1\" readonly=\"readonly\" disabled=\"disabled\" style=\"float:right;\" />
	</tr>

<tr class = \"secondHeading\">
<td class = \"secondHeading\" colspan = \"2\">
<input type = \"text\" name = \"result2\" size = \"14\" readonly=\"readonly\" disabled=\"disabled\"/ style=\"float:right\"><b>Review Summary</b>
</td>
<td>
<img id = \"reviewSummaryBtn\" src = \"images/arrowright.png\" align = \"right\" title = \"Click to expand\" onclick = \"hideSection('reviewSummary');\"/>
</td>

<tr id = \"reviewSummary\" style=\"display:none;\">
	<td colspan = \"3\"><select name = \"result\" style = \"float:right;\" value=\"" . $row['result'] . "\" onchange=\"updateReviewSummary(this.value, true);\">
		<option value = '' SELECTED>-Please Select-</option>
		<option value = \"Approved\">Approved</option>
		<option value = \"Not Approved\">Not Approved</option>
		<option value = \"Cancelled\">Cancelled</option>
		</select><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Result</font></p></td>
</tr>

<tr id = \"reviewSummary\" style=\"display:none;\">
	<td colspan = \"3\"><input type = \"text\" name = \"numberOfMajorComments\" size = \"1\" style = \"float:right;\" value=\"" . $row['numberOfMajorComments'] . "\" /><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>No. of Major Comments</font></p></td>
</tr>


<tr id = \"reviewSummary\" style=\"display:none;\">
	<td colspan = \"3\"><input type = \"text\" name = \"numberOfMinorComments\" size = \"1\" style = \"float:right;\" value=\"" . $row['numberOfMinorComments'] . "\" /><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>No. of Minor Comments</font></p></td>
</tr>

<tr id = \"reviewSummary_nextReviewForum\" style=\"display:none;\">
	<td colspan = \"3\">
	<select name = \"nextReviewForum\" style = \"float:right;\" value=\"" . $row['nextReviewForum'] . "\">
			<option value = '' SELECTED>-Please Select-</option>
	</select><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Next Review Forum</font></p>
		</td>		

</tr>

<tr id = \"reviewSummary_reasonForCancellation\" style=\"display:none;\" >
	<td colspan = \"3\"><select name = \"reasonForCancellation\" style = \"float:right;\"  value=\"" . $row['reasonForCancellation'] . "\" onchange=\"updateOtherCommentVisibility();\">
			<option value = '' SELECTED>-Please Select-</option>
			<option value = 'Insufficient Participants' >Insufficient Participants</option>
			<option value = 'Requirements Issue' >Requirements Issue</option>
			<option value = 'Missed Impacts Issue' >Missed Impacts Issue</option>
			<option value = 'Workshop Required' >Workshop Required</option>
			<option value = 'Other' >Other...</option>
		</select><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Reason for cancellation</font></p>
		</td>		

</tr>

<tr id = \"reviewSummary_reasonForReReview\" style=\"display:none;\">
	<td colspan = \"3\"><select name = \"reasonForReReview\" style = \"float:right;\"  value=\"" . $row['reasonForReReview'] . "\" onchange=\"updateOtherCommentVisibility();\">
			<option value = '' SELECTED>-Please Select-</option>
			<option value = 'Insufficient Participants' >Insufficient Participants</option>
			<option value = 'Requirements Issue' >Requirements Issue</option>
			<option value = 'Missed Impacts Issue' >Missed Impacts Issue</option>
			<option value = 'Scope Issue' >Scope Issue</option>
			<option value = 'Workshop Required' >Workshop Required</option>
			<option value = 'Other' >Other...</option>
		</select><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Reason for re-review</p></font>
		</td>		

</tr>

<tr id = \"reviewSummary_otherComment\" style=\"display:none;\">
<td colspan = \"3\"><input type = \"text\" name = \"otherComments\" value=\"" . $row['otherComments'] . "\"  size = \"30\" style = \"float:right;\"/>
Please Specify</td>
</tr>

<tr colspan = \"3\" class = \"secondHeading\">
	<td class = \"secondHeading\" colspan = \"2\"><input type = \"text\" name = \"date2\" size = \"20\" readonly=\"readonly\" disabled=\"disabled\"/ style=\"float:right\"><b>Particulars of Meeting</b></td>
		<td>
<img id = \"particularsOfMeetingBtn\" src = \"images/arrowright.png\" align = \"right\" title = \"Click to expand\" onclick = \"hideSection('particularsOfMeeting');\"/>
</td>
</tr>

<tr id = \"particularsOfMeeting\" style=\"display:none;\">
	<td colspan = \"3\" >
	";

	if ($row['date'] != null && $row['date'] != "") {
		$date = date("d-m-Y", strtotime($row['date']));
	} else {
		$date = "";
	}
	echo "
	<input type = \"text\" name = \"date\" id = \"date\" size = \"20\" readonly=\"readonly\" class=\"tcal\" style=\"float:right\" value=\"" . $date . "\" onblur = \"updateTitleDate();\"/><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Date</font></p></td>

</tr>

<tr id = \"particularsOfMeeting\" style=\"display:none;\">
	<td colspan = \"3\"><select name = \"time\" style = \"float:right;\" value=\"" . $row['time'] . "\" >
		<option value = '' SELECTED>-Please Select a Time-</option>
		<option value = \"0800\">08:00</option>
		<option value = \"0900\">09:00</option>
		<option value = \"1000\">10:00</option>
		<option value = \"1100\">11:00</option>
		<option value = \"1200\">12:00</option>
		<option value = \"1300\">13:00</option>
		<option value = \"1400\">14:00</option>
		<option value = \"1500\">15:00</option>
		<option value = \"1600\">16:00</option>
		<option value = \"1700\">17:00</option>
		<option value = \"1800\">18:00</option>
		<option value = \"1900\">19:00</option>
		</select><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Time</font></p></td>
</tr>

<tr id = \"particularsOfMeeting\" style=\"display:none;\">
	<td colspan = \"3\"><select name = \"venue\" style = \"float:right;\" value=\"" . $row['venue'] . "\">
		<option value = '' SELECTED>-Please Select-</option>
		<option value = \"Lough Mask\">Lough Mask</option>
		<option value = \"Lough Neagh\">Lough Neagh</option>
		<option value = \"Lough Sheelin\">Lough Sheelin</option>
		<option value = \"Lough Allen\">Lough Allen</option>
		<option value = \"Shaw\">Shaw</option>
		<option value = \"Beckett\">Beckett</option>
		<option value = \"Yeats\">Yeats</option>
		<option value = \"Heaney\">Heaney</option>
		<option value = \"Tyndall\">Tyndall</option>
		<option value = \"Lilliput\">Lilliput</option>
		<option value = \"Lough Ree\">Lough Ree</option>
		k<option value = \"Goldsmith\">Goldsmith</option>
		<option value = \"Kelvin Meeting Room\">Kelvin Meeting Room</option>
		<option value = \"Blyry\">Blyry</option>
		<option value = \"Lough Conn\">Lough Conn</option>
		<option value = \"Lough Corrib\">Lough Corrib</option>
		<option value = \"Lough Derg\">Lough Derg</option>
		<option value = \"Lough Owell\">Lough Owell</option>
		<option value = \"OSS Demo Room\">OSS Demo Room</option>
		<option value = \"Synge Conference Room\">Synge Conference Room</option>
		<option value = \"Annexe Conference Room\">Annexe Conference Room</option>
		<option value = \"Lars Magnus\">Lars Magnus</option>
		<option value - \"Office\">Office</option>
		</select><p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Venue</font></p></td>

</tr>

<tr id = \"particularsOfMeeting\" style=\"display:none;\">
	<td colspan = \"3\" >
	<textarea name = \"attendees\" cols = \"25\" rows = \"8\" style=\"float:right\"  type = \"text\" value=\"" . $row["attendees"] . "\">" . $row["attendees"] . "</textarea>
	<p style = \"font-family:Arial, Helvetica, sans-serif\"><font size = '2'>Attendees</font></p>
	</td>
</tr>

<tr colspan = \"3\" class = \"secondHeading\">
	<td class = \"secondHeading\" colspan = \"2\"><b>Remarks</b></td>
		<td>
<img id = \"remarksBtn\" src = \"images/arrowright.png\" align = \"right\" title = \"Click to expand\" onclick = \"hideSection('remarks');\"/>
</td>
</tr>	

<tr id = \"remarks\" style=\"display:none;\">
	<td colspan = \"3\" >
		<table id = \"remarksTable\">
		<tr>
		<th>No. <img src = \"images/sortArrow.png\" onclick=\"sortRemarksColumn('number');\" width=\"14\" height=\"6\"></th>
		<th>Location (Chapter, page) <img src = \"images/sortArrow.png\" onclick=\"sortRemarksColumn('location');\" width=\"14\" height=\"6\"></th>
		<th>Severity <img src = \"images/sortArrow.png\" onclick=\"sortRemarksColumn('severity');\" width=\"14\" height=\"6\"></th>
		<th>Responsible <img src = \"images/sortArrow.png\" onclick=\"sortRemarksColumn('responsible');\" width=\"14\" height=\"6\"></th>
		<th>Remark <img src = \"images/sortArrow.png\" onclick=\"sortRemarksColumn('remark');\" width=\"14\" height=\"6\"></th>
		<th>Status <img src = \"images/sortArrow.png\" onclick=\"sortRemarksColumn('status');\" width=\"14\" height=\"6\"></th>
		<th>Comment <img src = \"images/sortArrow.png\" onclick=\"sortRemarksColumn('comment');\" width=\"14\" height=\"6\"></th>
		<th>Add Row <img src=\"images/addRow.png\" onclick=\"addNewRemarksRow();\"></th>
		</tr>

		";

	$sql = "
	SELECT *						
	FROM tc_tool.remark
	WHERE
	(
	reviewId = '$formattedID'
	)
	ORDER BY number ASC
	";

	$remarkData = mysql_query($sql) or die(mysql_error()."<br>-----------<br>$sql");
	$num = mysql_num_rows($remarkData); // <-- This line is counting the number of rows returned by the query

	while($remarkRow = mysql_fetch_assoc($remarkData))
	{	

		echo "<tr >
		<td>" . $remarkRow["number"] . "</td>
		<td><input name = \"remark_location_"  . $remarkRow["number"] . "\" id = \"remark_location_"  . $remarkRow["number"] . "\"  type = \"text\" value = \"" . $remarkRow["location"] . "\"></td>

		<td><select name = \"remark_severity_" . $remarkRow["number"] . "\" id = \"remark_severity_" . $remarkRow["number"] . "\">
		<option value = \"-Please Select-\">-Please Select-</option>
		<option value = \"Minor\" " . ($remarkRow["severity"] == "Minor" ? "SELECTED" : "") . ">Minor</option>
		<option value = \"Major\" " . ($remarkRow["severity"] == "Major" ? "SELECTED" : "") . ">Major</option>
		</td>

		<td><input name = \"remark_responsible_"  . $remarkRow["number"] . "\" id = \"remark_responsible_"  . $remarkRow["number"] . "\" type = \"text\" value = \"" . $remarkRow["responsible"] . "\"></td>


		<td><textarea name = \"remark_remark_"  . $remarkRow["number"] . "\" cols = \"25\" rows = \"8\" id = \"remark_remark_"  . $remarkRow["number"] . "\" type = \"text\" value = \"" . $remarkRow["comment"] . "\">" . $remarkRow["remark"] . "</textarea></td>

		<td><select name = \"remark_status_" . $remarkRow["number"] . "\" id = \"remark_status_" . $remarkRow["number"] . "\">
		<option value = \"-Please Select-\">-Please Select-</option>
		<option value = \"Acted Upon\" " . ($remarkRow["status"] == "Acted Upon" ? "SELECTED" : "") . ">Acted Upon</option>
		<option value = \"Not Accepted\" " . ($remarkRow["status"] == "Not Accepted" ? "SELECTED" : "") . ">Not Accepted</option>
		</td>

		<td><textarea name = \"remark_comment_"  . $remarkRow["number"] . "\" cols = \"25\" rows = \"8\" id = \"remark_comment_"  . $remarkRow["number"] . "\" value = \"" . $remarkRow["comment"] . "\">" . $remarkRow["comment"] . "</textarea></td>

		<td><img title = \"Delete Row\" src = \"images/deleteRow.png\" onclick = \"deleteRemarkRow('remarksRow"  . $remarkRow["number"] .  "');\"></td>
		</tr>";

	}

		/*
			=== Old comment box ===

		<td><input name = \"remark_comment_"  . $remarkRow["number"] . "\" id = \"remark_comment_"  . $remarkRow["number"] . "\" value = \"" . $remarkRow["comment"] . "\"></input></td>

		*/
	//echo " </table><br /><br />";

	echo "

	</table>
	</td>
	</tr>

<tr colspan = \"3\" class = \"secondHeading\">
	<td class = \"secondHeading\" colspan = \"2\"><b>Actions</b></td>
		<td>
<img id = \"actionsBtn\" src = \"images/arrowright.png\" align = \"right\" title = \"Click to expand\" onclick = \"hideSection('actions');\"/>
</td>
</tr>	

<tr id = \"actions\" style=\"display:none;\">
	<td colspan = \"3\" >
		<table id = \"actionsTable\">
		<tr>
		<th>No. <img src = \"images/sortArrow.png\" onclick=\"sortActionsColumn('number');\" width=\"14\" height=\"6\"></th>
		<th>Location <img src = \"images/sortArrow.png\" onclick=\"sortActionsColumn('location');\" width=\"14\" height=\"6\"></th>
		<th>Responsible <img src = \"images/sortArrow.png\" onclick=\"sortActionsColumn('responsible');\" width=\"14\" height=\"6\"></th>
		<th>Action <img src = \"images/sortArrow.png\" onclick=\"sortActionsColumn('action');\" width=\"14\" height=\"6\"></th>
		<th>Status <img src = \"images/sortArrow.png\" onclick=\"sortActionsColumn('status');\" width=\"14\" height=\"6\"></th>
		<th>Comment <img src = \"images/sortArrow.png\" onclick=\"sortActionsColumn('comment');\" width=\"14\" height=\"6\"></th>
		<th>Add Row <img src=\"images/addRow.png\" onclick=\"addNewActionRow();\"></th>

		</tr>

		";

	$sql = "
	SELECT *						
	FROM tc_tool.action
	WHERE
	(
	reviewId = '$formattedID'
	)
	ORDER BY number ASC
	";

	$actionData = mysql_query($sql) or die(mysql_error()."<br>-----------<br>$sql");
	$num = mysql_num_rows($actionData); // <-- This line is counting the number of rows returned by the query

	while($actionRow = mysql_fetch_assoc($actionData))
	{	

		echo "<tr>
		<td>" . $actionRow["number"] . "</td>
		<td><input name = \"action_location_"  . $actionRow["number"] . "\" id = \"action_location_" . $actionRow["number"] . "\" type = \"text\" value = \"" . $actionRow["location"] . "\"></td>

		<td><input name = \"action_responsible_"  . $actionRow["number"] . "\" id = \"action_responsible_" . $actionRow["number"] . "\" type = \"text\" value =\"" . $actionRow["responsible"] . "\"></td>
		<td><input name = \"action_action_"  . $actionRow["number"] . "\" id = \"action_action_" . $actionRow["number"] . "\" type = \"text\" value = \"" . $actionRow["action"] . "\"></td>

		<td><select name = \"action_status_" . $actionRow["number"] . "\" id = \"action_status_" . $actionRow["number"] . "\">
		<option value = \"-Please Select-\">-Please Select-</option>
		<option value = \"Open\" " . ($actionRow["status"] == "Open" ? "SELECTED" : "") . ">Open</option>
		<option value = \"In-Progress\" " . ($actionRow["status"] == "In-Progress" ? "SELECTED" : "") . ">In-Progress</option>
		<option value = \"Re-Opened\" " . ($actionRow["status"] == "Re-Opened" ? "SELECTED" : "") . ">Re-Opened</option>
		<option value = \"Resolved\" " . ($actionRow["status"] == "Resolved" ? "SELECTED" : "") . ">Resolved</option>
		<option value = \"Closed\" " . ($actionRow["status"] == "Closed" ? "SELECTED" : "") . ">Closed</option>
		</td>

		<td><textarea name = \"action_comment_"  . $actionRow["number"] . "\" id = \"action_comment_"  . $actionRow["number"] . "\" type = \"text\"  cols = \"25\" rows = \"8\" value = \"" . $actionRow["comment"] . "\">" . $actionRow["comment"] . "</textarea></td>
		<td><img title = \"Delete Row\" src = \"images/deleteRow.png\" onclick = \"deleteActionRow('actionsRow"  . $actionRow["number"] .  "');\"></td>
		</tr>";

	}

	echo "

	</table>
	</td>
</tr>

<tr colspan = \"3\" class = \"secondHeading\">
<td class = \"secondHeading\" colspan = \"2\"><b>Miscellaneous</b></td>
<td>
<img id = \"miscellaneousBtn\" src = \"images/arrowright.png\" align = \"right\" title = \"Click to expand\" onclick = \"hideSection('miscellaneous');\"/>
</td>
</tr>	
<tr id = \"miscellaneous\" style=\"display:none;\">

<td colspan = \"3\" >
	<p style = \"font-family:Ericsson Capital TT Regular\"><font size = '3'><br /><u>Email Comments:</u></font></p>

	<textarea name = \"emailComments\" type = \"text\" style=\"width:100%;\" rows = \"30\" value = \"" . $row["emailComments"] . "\">" . $row["emailComments"] . "</textarea><br />
	</td>
</tr>	

<tr colspan = \"3\">
	<td>
		<input type=\"button\" name=\"reset_form\"  class = 'eBtnSubmit' value=\"Clear Fields\" onclick=\"this.form.reset();\">
		<input type=\"submit\" name=\"save\" class = 'eBtnSubmit' value=\"Save Minutes Of Meeting\" />
		</form>
	</td>
	<td>
";

// When this echo is included here it disables the Sign Off button
// echo " </table><br /><br />";

$impl_exportArray = implode(",", $exportArray);

		echo "

		<form id='exportToExcel' action = \"momExport.php\" method = \"post\">
		<input type = \"hidden\" name = \"reviewIds\" value=\"".$impl_exportArray."\"/>
		<input type = \"submit\" value = \"Export to Excel\" class='eBtnSubmit' style='display:inline;' onclick =\"momExport.php\">
		</form>			
	</td>

	<td>
		<input type = \"text\" name = \"signOff\" size = \"24\" align = \"right\" value = \"" . $row['signOff'] . "\"/>  <input type=\"submit\" name=\"save\"  class = 'eBtnSubmit' value=\"Sign off\" align = \"right\" />
	</td> 
	</tr>

</p>
</div>
";

}
echo " </table><br /><br />";

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.