Jump to content

PHP divs


carinacosta
 Share

Recommended Posts

Neste código que se segue  aparece me abaixo da tabela dados todos baralhados, será alguma div fora do sitio ou alguma td?

<?php
 include ('ligacao.php');
  $sql1 = "SELECT * FROM ordensfabrico "; 
$sel1 = pg_query($sql1);
if (pg_num_rows ($sel1) > 0){
echo "<center>";
echo "<div style= 'height: 500px; width:600px; overflow:scroll;'>";
echo "<table border='2' cellspacing='0' style='WIDTH:600px;BORDER-COLLAPSE:collapse' >";
echo "<tr>";
echo "<td bgcolor='#0099CC' style='WIDTH:2000px'>";
echo "<center>";
	echo  "Numordfab" ;
echo "</center>";
echo "</td>";
echo "<td bgcolor='#0099CC' style='WIDTH:2000px'>";
echo "<center>";
	echo "Datordfab";
echo "</center>";
echo "</td>";
echo "<td bgcolor='#0099CC' style='WIDTH:2000px'>";
echo "<center>";
	echo "Ficof";
echo "</center>";
echo "</td>";
echo "<td bgcolor='#0099CC' style='WIDTH:5000px'>";
echo "<center>";
	echo "Especificação";
echo "</center>";
echo "</td>";
echo "</tr>";

  while($row = pg_fetch_array($sel1)) {

echo "<tr>";
echo "<td><a href=''>";
    	echo $row ['id'];
    echo "</td>";
    echo "<td><a href=''>";
    	echo $row ['numordfab'];
    echo "</td>";
    echo "<td>";
    	echo $row ['datordfab'];
    echo "</td>";
    echo "<td>";
    	echo $row ['ficof'];
    echo "</td>";
echo "<td>";
    	echo $row ['especificacao'];
    echo "</td>";
echo "</tr>";

	if(!empty($row ['id'])){
	echo "<td colspan='4'>";
				/*$sql2 = "SELECT p.id, p.numprm, p.datprm, p.desprm, p.aprovado, p.idof ";
				$sql2.= "FROM prm as P ";
				$sql2.="INNER JOIN prmlin ";
				$sql2.="ON P.id=prmlin.idpalin ";
				$sql2.="INNER JOIN PRM ";
				$sql2.="ON prmlin.idPAI=PRM.ID ";
				$sql2.="INNER JOIN ordensfabrico ";
				$sql2.="ON ordensfabrico.ID=prm.IDOF ";
				$sql2= '".$ro$sql2.= " where p.idof ['id']."' ";
				$sel2 = pg_query ($sql2);*/
				$sql2 = "SELECT p.id, p.numprm, p.datprm, p.desprm, p.aprovado, p.idof ";
				$sql2.= "FROM prm as P ";
				$sql2.=" where p.idof = '".$row ['id']."' ";
				$sel2= pg_query($sql2);

		if (pg_num_rows ($sel2) > 0){	
           echo "<div>";
				echo "<table border='2' cellspacing='0' style='WIDTH:600px;BORDER-COLLAPSE:collapse' >";
				echo "<tr>";
					echo "<td bgcolor='#CCCCCC' style='WIDTH:1000px'>";
						echo "<center>";
							echo "Aprovado" ;
						echo "</center>";
					echo "</td>";
					echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
						echo "<center>";
							echo "Desprm" ;
						echo "</center>";
					echo "</td>";
					echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
						echo "<center>";
							echo "Datprm" ;
						echo "</center>";
					echo "</td>";
					echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
						echo "<center>";
							echo "numprm" ;
						echo "</center>";
					echo "</td>";
				echo "</tr>";

					while($row2 = pg_fetch_array($sel2)) {
						echo "<tr>";
							echo "<td>";
								echo $row2 ['aprovado'];	
							echo "</td>";
							echo "<td>";
								echo $row2 ['desprm'];	
							echo "</td>";
							echo "<td>";
								echo $row2 ['datprm'];	
							echo "</td>";
							echo "<td>";
								echo $row2 ['numprm'];	
							echo "</td>";
						echo "</tr>";	

									if(!empty($row2 ['id'])){
									echo "<td colspan='6'>";
								   		$sql3= "SELECT pr.idpai, pr.posicao, pr.qtdped, pr.codmat, pr.coduni, pr.dimmat, pr.prazo, pr.idpalin ";
										$sql3.= "FROM prmlin pr ";
										$sql3.= " where pr.idpai = '".$row2 ['id']."' ";
										$sel3= pg_query($sql3);
										if (pg_num_rows ($sel3) > 0){	

									echo "<div>";
									echo "<table border='2' cellspacing='0' style='WIDTH:600px;BORDER-COLLAPSE:collapse' >";
									echo "<tr>";
										echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
											echo "<center>";
												echo "Posição" ;
											echo "</center>";
										echo "</td>";
										echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
											echo "<center>";
												echo "Qtdped" ;
											echo "</center>";
										echo "</td>";
										echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
											echo "<center>";
												echo  "Codmat" ;
											echo "</center>";
										echo "</td>";
										echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
											echo "<center>";
												echo "Coduni" ;
											echo "</center>";
										echo "</td>";
										echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
											echo "<center>";
												echo "Dimmat" ;
											echo "</center>";
										echo "</td>";
										echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
											echo "<center>";
												echo "Prazo" ;
											echo "</center>";
										echo "</td>";
									echo "</tr>";											

										while($row3 = pg_fetch_array($sel3)) {	
											echo "<tr>";
												echo "<td>";
													echo $row3 ['posicao'];	
												echo "</td>";
												echo "<td>";
													echo $row3 ['qtdped'];	
												echo "</td>";
												echo "<td>";
													echo $row3 ['codmat'];	
												echo "</td>";
												echo "<td>";
													echo $row3 ['coduni'];	
												echo "</td>";
												echo "<td>";
													echo $row3 ['dimmat'];	
												echo "</td>";
												echo "<td>";
													echo $row3 ['prazo'];	
												echo "</td>";
											echo "</tr>";

									if(!empty($row3 ['idpalin'])){
										echo "<td colspan='8'>";
										$sql4="SELECT PL.POSICAO,PL.CODMAT, PL.QTDPED,PL.QTDSTOCK, PL.QTDENC, PL.CODUNI, PL.DIMMAT ,PL.prazo ";			
										$sql4.="FROM PALIN AS PL ";
										$sql4.="INNER JOIN prmlin ";
										$sql4.="ON PL.id=prmlin.idpalin ";
										$sql4.="INNER JOIN PRM ";
										$sql4.="ON prmlin.idPAI=PRM.ID ";
										$sql4.="INNER JOIN ordensfabrico ";
										$sql4.="ON ordensfabrico.ID=prm.IDOF ";
										$sql4.="where  prmlin.idpai= '".$row3 ['idpai']."' ";
										$sql4.="ORDER BY CODMAT";
									  	$sel4= pg_query($sql4);
											if (pg_num_rows ($sel4) > 0){
											echo "<div>";
											echo "<table border='2' cellspacing='0' style='WIDTH:600px;BORDER-COLLAPSE:collapse' >";
											echo "<tr>";
												echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
													echo "<center>";
														echo "Posição" ;
													echo "</center>";
												echo "</td>";
												echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
													echo "<center>";
														echo "Codmat" ;
													echo "</center>";
												echo "</td>";
												echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
													echo "<center>";
														echo "Qtdped" ;
													echo "</center>";
												echo "</td>";
												echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
													echo "<center>";
														echo "Qtdstock" ;
													echo "</center>";
												echo "</td>";
												echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
													echo "<center>";
														echo "Qtdenc" ;
													echo "</center>";
												echo "</td>";
												echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
													echo "<center>";
														echo "Coduni" ;
													echo "</center>";
												echo "</td>";
												echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
													echo "<center>";
														echo "Dimmat" ;
													echo "</center>";
												echo "</td>";
												echo "<td bgcolor='#CCCCCC' style='WIDTH:2000px'>";
													echo "<center>";
														echo "Prazo" ;
													echo "</center>";
												echo "</td>";
											echo "</tr>";

											while($row4 = pg_fetch_array($sel4)) {	
												echo "<tr>";
													echo "<td>";
														echo $row4 ['posicao'];	
													echo "</td>";
													echo "<td>";
														echo $row4 ['codmat'];	
													echo "</td>";
													echo "<td>";
														echo $row4 ['qtdped'];	
													echo "</td>";
													echo "<td>";
														echo $row4 ['qtdstock'];	
													echo "</td>";
													echo "<td>";
														echo $row4 ['qtdenc'];	
													echo "</td>";
													echo "<td>";
														echo $row4 ['coduni'];	
													echo "</td>";
													echo "<td>";
														echo $row4 ['dimmat'];	
													echo "</td>";
													echo "<td>";
														echo $row4 ['prazo'];		
													echo "</td>";
												echo "</tr>";
															}
														}
													}
												echo "</td>";
												echo "</table>";
												echo "</div>";
											}	
										echo "</td>";
										echo "</table>";	
										echo "</div>";
						}
					echo "</td>";									
					echo "</table>";
					echo "</div>";
			}
		}
	}		
echo "</tr>";
		} 
	}
}
echo "</table>";  
echo "</center>";
echo "</div>";
  ?>

será que me poderiam ajudar? ja ando à dias com este problema.

Muito Obrigada

Link to comment
Share on other sites

Não especifica o erro, só aparece isto:

Error found while checking this document as XHTML 1.0 Transitional!


Line 7, Column 74: end tag for "link" omitted, but OMITTAG NO was specified

  <link rel="stylesheet" type="text/css" href="../Unnamed Site 3/css.css">

You may have neglected to close an element, or perhaps you meant to "self-close" an element, that is, ending it with "/>" instead of ">".

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. 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.