<?php

if (isset($_SESSION['usuario'])){

$user=$_SESSION['usuario'];

}

else{

?>

<script>

location.href="index.php?errorusuario=3";

</script>

<?php }

include ("conexion.php");
?>


  <table width="850" border="0" align="center">

    <tr>

      <td><p align="center" class="style10">LISTADO DE TRATAMIENTOS COMPLETOS Y SU CONTENIDO </p>      </td>

    </tr>

    <tr>

      <td><HR /></td>

    </tr>

    <tr>

      <td><table width="700" height="0" border="0" align="center" cellpadding="0" cellspacing="10">

        <tr>

          <td width="46%" valign="top"><p>
            <?php
echo "<table align='center' cellpadding='2' class='tablaBordes' width='100%'>";
echo "<tr class='tablaCabecera'>";

echo "<td>";
echo "TRATAMIENTO COMPLETO";
echo "</td>";

echo "<td align='center'>";
echo "PRECIO";
echo "</td>";

$cons1="SELECT idTratamiento,tratamientoCompleto,precio FROM tratamientocompleto ORDER BY tratamientoCompleto";
$res1=mysql_query($cons1,$conex) or die ("No se ejecuto cons1$");
while($filax = mysql_fetch_array($res1))
{
echo "<tr>";

echo "<td colspan='2'>";
echo "<hr color='#CCCCCC' noshade='noshade' size='1'>";
echo "</td>";
echo "</tr>";
echo "<tr>";

echo "<td class='style10'>";
echo $filax[1];
echo "</td>";

echo "<td class='style10' align='right'>";
printf ("$ %.2f", $filax[2]);
echo "</td>";

echo "</tr>";
echo "<tr bgcolor='#cccccc'  class='titulo'>";

echo "<td colspan='2' class='style4'>";
echo "Paquetes contenidos";
echo "</td>";

echo "</tr>";
echo "<tr>";
echo "<td colspan='2'>";
	//====== PAQUETES CONTENIDOS EN TRATAMIENTO
	echo "<table border=0>";
	
				$query="SELECT idTratamiento,idPaquete FROM contenido_tratamientocompleto WHERE idTratamiento='$filax[0]'";
				$result=mysql_query($query,$conex) or die ("No se consulto tratamiento completo");
				$numero_filas=mysql_num_rows($result);
				$numero_campos= mysql_num_fields($result);
	
				while($fila = mysql_fetch_array($result))
				{
					echo "<tr>";
					
					//paquete
					$cons2="SELECT nompaquete FROM paquetes WHERE idPaquete ='$fila[1]'";
					$res2=mysql_query($cons2,$conex) or die ("No se consulto nombre de paquete");
					$nompaquete=mysql_result($res2,0,'nompaquete');
	
					echo "<td class='style9'>";
					echo $nompaquete;
					echo "</td>";

					echo "</tr>";
				}
	echo "</table>";
	
echo "</tr>";
}
echo "</table>";
?>
            </p>            </td>
        </tr>
        <tr>
          <td valign="top"><div align="center">
            <table width="100" border="0">
              <tr>
                <td width="35"><input name="button2" type="button" class="boton2" id="button2" onClick="javascript:history.back()" value="Volver" /></td>
                <td width="55"><input name="button" type="button" class="boton2" id="button" onClick="javascript:print()" value="Imprimir" /></td>
              </tr>
            </table>
            </div></td>
        </tr>
      </table></td>

    </tr>

  </table>

