<?php
class Pieza 
{
  //private $mat=array();
  private $pieza;
  private $a1;
  private $top;

  public function __construct($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,$top,$left,$arri)
  {
    $this->pieza=$pieza;
    $this->a1=$a1;
    $this->a2=$a2;
    $this->a3=$a3;
    $this->a4=$a4;
    $this->a5=$a5;
    $this->a6=$a6;
    $this->extra=$extra;
    $this->perno=$perno;
    $this->implante=$implante;
    $this->circu=$circu;
    $this->prote=$prote;
    $this->prote_2=$prote_2;
    $this->prote_3=$prote_3;
    $this->prote_4=$prote_4;
    $this->prote_5=$prote_5;
    $this->tc=$tc;
    $this->rr=$rr;
    $this->cnp=$cnp;
    $this->pp=$pp;
    $this->pp1=$pp1;
    $this->pp7=$pp7;
    $this->pp8=$pp8;
    $this->pp9=$pp9;
    $this->ppinc=$ppinc;
    $this->limp=$limp;
    $this->aut=$aut;
	
    $this->top=$top;
    $this->left=$left;
    $this->arri=$arri;
  }

  public function imagen()
  {  ?>

 <div style='position:absolute;top:<?php 
 if($this->arri==1)
{
echo $this->top-25;
}
else
{
echo $this->top+35;
}
?>px;left:<?php echo $this->left+7;?>px;color:#003333'>  <?php echo $this->pieza;?> </div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/a1_<?php 
		switch($this->a1)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left+20;?>px'>
		<img src='../../imagenes/a2_<?php 
		switch($this->a2)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+20;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/a3_<?php 
		switch($this->a3)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/a4_<?php 
		switch($this->a4)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+10.5;?>px;left:<?php echo $this->left+9.67;?>px'>
		<img src='../../imagenes/a5_<?php 
		switch($this->a5)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+10.5;?>px;left:<?php echo $this->left+9.67;?>px'>
		<img src='../../imagenes/a6_<?php 
		switch($this->a6)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/cruz_<?php 
		switch($this->extra)
		{
		case '1': echo 'rojo.svg';
		break;
		case '2': echo 'azul.svg';
		break;
		case '3': echo 'verde.svg';
		break;
		default: echo 'blanco.png';
		break;
		}	?>'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/perno_<?php 
		switch($this->perno)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>.png'>
		</img>
	</div>
			<div style='position:absolute;top:<?php echo $this->top-9;?>px;left:<?php echo $this->left+2;?>px'>
				<img src='../../imagenes/limp<?php 
				switch($this->limp)
				{
				case '1': echo '';
				break;
				default: echo '_blanco';
				break;
				}	?>.png' style='width:27px;height:8px'>
				</img>
			</div>
	<div style='position:absolute;top:<?php echo $this->top+3;?>px;left:<?php echo $this->left+5;?>px'>
		<img src='../../imagenes/implante_<?php 
		switch($this->implante)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left-10;?>px'>
		<img src='../../imagenes/circu_<?php 
		switch($this->circu)
		{
		case '1': echo 'rojo.svg';
		break;
		case '2': echo 'azul.svg';
		break;
		case '3': echo 'verde.svg';
		break;
		default: echo 'transpa.svg';
		break;
		}	?>'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left-4;?>px'>
		<img src='../../imagenes/prote_<?php 
		switch($this->prote_2)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_izq_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+4;?>px;left:<?php echo $this->left+3;?>px'>
		<img src='../../imagenes/prote3_<?php 
		switch($this->prote_3)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_izq_chica.png'>
		</img>
	</div>	
	<div style='position:absolute;top:<?php echo $this->top+4;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/prote4_<?php 
		switch($this->prote_4)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_dere_chica.png'>
		</img>
	</div>	
	<div style='position:absolute;top:<?php echo $this->top+4;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/prote5_<?php 
		switch($this->prote_5)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left+30;?>px'>
		<img src='../../imagenes/prote_<?php 
		switch($this->prote)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_dere_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+29;?>px;left:<?php echo $this->left-2;?>px'>
		<?php
		switch($this->tc){
		case '1': echo "<div style='color:red;font-size:7pt'><b>TC</b></div>";
		break;
		case '2': echo "<div style='color:blue;font-size:7pt'><b>TC</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-14;?>px;left:<?php echo $this->left+2;?>px'>
		<?php
		switch($this->aut){
		case '1': echo "<div style='color:black;font-size:6pt'><b>A</b></div>";
		break;
		case '2': echo "<div style='color:black;font-size:6pt'><b>H</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-9;?>px;left:<?php echo $this->left-2;?>px'>
		<?php
		switch($this->rr){
		case '1': echo "<div style='color:red;font-size:6pt'><b>RR</b></div>";
		break;
		case '2': echo "<div style='color:blue;font-size:6pt'><b>RR</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+29;?>px;left:<?php echo $this->left+22;?>px'>
		<?php
		switch($this->cnp){
		case '1': echo "<div style='color:black;font-size:6pt'><b>CP</b></div>";
		break;
		case '2': echo "<div style='color:black;font-size:6pt'><b>CNP</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-9;?>px;left:<?php echo $this->left+22;?>px'>
		<?php
		switch($this->pp){
		case '1': echo "<div style='color:black;font-size:6pt'><b>PP</b></div>";
		break;
		case '2': echo "<div style='color:black;font-size:6pt'><b>PC</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-9;?>px;left:<?php echo $this->left+10;?>px'>
		<?php
		switch($this->ppinc){
		case '1': echo "<div style='color:red;font-size:6pt'><b>INC</b></div>";
		break;
		case '2': echo "<div style='color:darkblue;font-size:6pt'><b>INC</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+7;?>px;left:<?php echo $this->left+6;?>px'>
		<img src='../../imagenes/prote6_<?php 
		switch($this->pp1)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/p7_<?php 
		switch($this->pp7)
		{
		case '1': echo 'r';
		break;
		case '2': echo 'a';
		break;
		default: echo 'b';
		break;
		}	?>_i.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/p7_<?php 
		switch($this->pp8)
		{
		case '1': echo 'r';
		break;
		case '2': echo 'a';
		break;
		default: echo 'b';
		break;
		}	?>_m.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/p7_<?php 
		switch($this->pp9)
		{
		case '1': echo 'r';
		break;
		case '2': echo 'a';
		break;
		default: echo 'b';
		break;
		}	?>_d.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+29;?>px;left:<?php echo $this->left+9;?>px'>
		<?php
		switch($this->a6){
		case '1': echo "<div style='color:red;font-size:6pt'><b>S/C</b></div>";
		break;
		case '2': echo "<div style='color:blue;font-size:6pt'><b>S/P</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>

	<?php  
}
} //fin class pieza


class Pieza2 
{
  //private $mat=array();
  private $pieza;
  private $a1;
  private $top;

  public function __construct($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,$top,$left,$arri)
  {
    $this->pieza=$pieza;
    $this->a1=$a1;
    $this->a2=$a2;
    $this->a3=$a3;
    $this->a4=$a4;
    $this->a5=$a5;
    $this->a6=$a6;
    $this->extra=$extra;
    $this->perno=$perno;
    $this->implante=$implante;
    $this->circu=$circu;
    $this->prote=$prote;
    $this->prote_2=$prote_2;
    $this->prote_3=$prote_3;
    $this->prote_4=$prote_4;
    $this->prote_5=$prote_5;
    $this->tc=$tc;
    $this->rr=$rr;
    $this->cnp=$cnp;
    $this->pp=$pp;
    $this->pp1=$pp1;
    $this->pp7=$pp7;
    $this->pp8=$pp8;
    $this->pp9=$pp9;
    $this->ppinc=$ppinc;
    $this->limp=$limp;
    $this->aut=$aut;
	
    $this->top=$top;
    $this->left=$left;
    $this->arri=$arri;
  }

  public function imagen()
  {  ?>

 <div style='position:absolute;top:<?php 
 if($this->arri==1)
{
echo $this->top-25;
}
else
{
echo $this->top+35;
}
?>px;left:<?php echo $this->left+7;?>px;color:#003333'>  <?php echo $this->pieza;?> </div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/a1_<?php 
		switch($this->a1)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left+20;?>px'>
		<img src='../../imagenes/a2_<?php 
		switch($this->a2)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+20;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/a3_<?php 
		switch($this->a3)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/a4_<?php 
		switch($this->a4)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+9.5;?>px;left:<?php echo $this->left+9.67;?>px'>
		<img src='../../imagenes/a5_<?php 
		switch($this->a5)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		case '3': echo 'verde';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.svg'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+9.5;?>px;left:<?php echo $this->left+9.67;?>px'>
		<img src='../../imagenes/a6_<?php 
		switch($this->a6)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/cruz_<?php 
		switch($this->extra)
		{
		case '1': echo 'rojo.svg';
		break;
		case '2': echo 'azul.svg';
		break;
		case '3': echo 'verde.svg';
		break;
		default: echo 'blanco.png';
		break;
		}	?>'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top;?>px;left:<?php echo $this->left;?>px'>
		<img src='../../imagenes/perno_<?php 
		switch($this->perno)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+3;?>px;left:<?php echo $this->left+5;?>px'>
		<img src='../../imagenes/implante_<?php 
		switch($this->implante)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left-10;?>px'>
		<img src='../../imagenes/circu_<?php 
		switch($this->circu)
		{
		case '1': echo 'rojo.svg';
		break;
		case '2': echo 'azul.svg';
		break;
		case '3': echo 'verde.svg';
		break;
		default: echo 'transpa.svg';
		break;
		}	?>'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left-4;?>px'>
		<img src='../../imagenes/prote_<?php 
		switch($this->prote_2)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_izq_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+4;?>px;left:<?php echo $this->left+3;?>px'>
		<img src='../../imagenes/prote3_<?php 
		switch($this->prote_3)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_izq_chica.png'>
		</img>
	</div>	
	<div style='position:absolute;top:<?php echo $this->top+4;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/prote4_<?php 
		switch($this->prote_4)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_dere_chica.png'>
		</img>
	</div>	
	<div style='position:absolute;top:<?php echo $this->top+4;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/prote5_<?php 
		switch($this->prote_5)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-10;?>px;left:<?php echo $this->left+30;?>px'>
		<img src='../../imagenes/prote_<?php 
		switch($this->prote)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_dere_chica.png'>
		</img>
	</div>
			<div style='position:absolute;top:<?php echo $this->top+31;?>px;left:<?php echo $this->left+1;?>px'>
				<img src='../../imagenes/limp<?php 
				switch($this->limp)
				{
				case '1': echo '_abajo';
				break;
				default: echo '_blanco';
				break;
				}	?>.png' style='width:27px;height:8px'>
				</img>
			</div>
	<div style='position:absolute;top:<?php echo $this->top+29;?>px;left:<?php echo $this->left-2;?>px'>
		<?php
		switch($this->tc){
		case '1': echo "<div style='color:red;font-size:7pt'><b>TC</b></div>";
		break;
		case '2': echo "<div style='color:blue;font-size:7pt'><b>TC</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+35;?>px;left:<?php echo $this->left+2;?>px'>
		<?php
		switch($this->aut){
		case '1': echo "<div style='color:black;font-size:6pt'><b>A</b></div>";
		break;
		case '2': echo "<div style='color:black;font-size:6pt'><b>H</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-9;?>px;left:<?php echo $this->left-2;?>px'>
		<?php
		switch($this->rr){
		case '1': echo "<div style='color:red;font-size:6pt'><b>RR</b></div>";
		break;
		case '2': echo "<div style='color:blue;font-size:6pt'><b>RR</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+29;?>px;left:<?php echo $this->left+22;?>px'>
		<?php
		switch($this->cnp){
		case '1': echo "<div style='color:black;font-size:6pt'><b>CP</b></div>";
		break;
		case '2': echo "<div style='color:black;font-size:6pt'><b>CNP</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-9;?>px;left:<?php echo $this->left+22;?>px'>
		<?php
		switch($this->pp){
		case '1': echo "<div style='color:black;font-size:6pt'><b>PP</b></div>";
		break;
		case '2': echo "<div style='color:black;font-size:6pt'><b>PC</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top-9;?>px;left:<?php echo $this->left+10;?>px'>
		<?php
		switch($this->ppinc){
		case '1': echo "<div style='color:red;font-size:6pt'><b>INC</b></div>";
		break;
		case '2': echo "<div style='color:darkblue;font-size:6pt'><b>INC</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+7;?>px;left:<?php echo $this->left+6;?>px'>
		<img src='../../imagenes/prote6_<?php 
		switch($this->pp1)
		{
		case '1': echo 'rojo';
		break;
		case '2': echo 'azul';
		break;
		default: echo 'blanco';
		break;
		}	?>_chica.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+31;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/p8_<?php 
		switch($this->pp7)
		{
		case '1': echo 'r';
		break;
		case '2': echo 'a';
		break;
		default: echo 'b';
		break;
		}	?>_i.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+35;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/p8_<?php 
		switch($this->pp8)
		{
		case '1': echo 'r';
		break;
		case '2': echo 'a';
		break;
		default: echo 'b';
		break;
		}	?>_m.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+31;?>px;left:<?php echo $this->left-5;?>px'>
		<img src='../../imagenes/p8_<?php 
		switch($this->pp9)
		{
		case '1': echo 'r';
		break;
		case '2': echo 'a';
		break;
		default: echo 'b';
		break;
		}	?>_d.png'>
		</img>
	</div>
	<div style='position:absolute;top:<?php echo $this->top+29;?>px;left:<?php echo $this->left+9;?>px'>
		<?php
		switch($this->a6){
		case '1': echo "<div style='color:red;font-size:6pt'><b>S/C</b></div>";
		break;
		case '2': echo "<div style='color:blue;font-size:6pt'><b>S/P</b></div>";
		break;
		default: echo '';
		break;}?>
	</div>

	<?php  
}
} //fin class pieza2





$id_pac=$_GET['id_pac'];
?>
<div>
	<?php for($i=0;$i<=7;$i++)
	{
	$pieza=18-$i;
	$left=13+40*$i;
	$aux=consulta($id_pac,$pieza);
	$a1=$aux["a1"];
	$a2=$aux["a2"];
	$a3=$aux["a3"];
	$a4=$aux["a4"];
	$a5=$aux["a5"];
	$a6=$aux["a6"];
	$extra=$aux["extra"];
	$perno=$aux["perno"];
	$implante=$aux["implante"];
	$circu=$aux["circu"];
	$prote=$aux["prote"];
	$prote_2=$aux["prote_2"];
	$prote_3=$aux["prote_3"];
	$prote_4=$aux["prote_4"];
	$prote_5=$aux["prote_5"];
	$tc=$aux["tc"];
	$rr=$aux["rr"];
	$cnp=$aux["cnp"];
	$pp=$aux["pp"];
	$pp1=$aux["scuad"];
	$pp7=$aux["pp7"];
	$pp8=$aux["pp8"];
	$pp9=$aux["pp9"];
	$ppinc=$aux["inc"];
	$limp=$aux["limp"];
	$aut=$aux["aut"];
	
	$pieza=new Pieza($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,70,$left,1);
	$pieza->imagen();
	}?>
</div>

<div>
	<?php for($i=0;$i<=7;$i++)
	{
	$pieza=48-$i;
	$left=13+40*$i;
	$aux=consulta($id_pac,$pieza);
	$a1=$aux["a1"];
	$a2=$aux["a2"];
	$a3=$aux["a3"];
	$a4=$aux["a4"];
	$a5=$aux["a5"];
	$a6=$aux["a6"];
	$extra=$aux["extra"];
	$perno=$aux["perno"];
	$implante=$aux["implante"];
	$circu=$aux["circu"];
	$prote=$aux["prote"];
	$prote_2=$aux["prote_2"];
	$prote_3=$aux["prote_3"];
	$prote_4=$aux["prote_4"];
	$prote_5=$aux["prote_5"];
	$tc=$aux["tc"];
	$rr=$aux["rr"];
	$cnp=$aux["cnp"];
	$pp=$aux["pp"];
	$pp1=$aux["scuad"];
	$pp7=$aux["pp7"];
	$pp8=$aux["pp8"];
	$pp9=$aux["pp9"];
	$ppinc=$aux["inc"];
	$limp=$aux["limp"];
	$aut=$aux["aut"];
	
	$pieza2=new Pieza2($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,122,$left,0);
	$pieza2->imagen();
	}?>
</div>
<div>
	<?php for($i=0;$i<=7;$i++)
	{
	$pieza=21+$i;
	$left=340+40*$i;
	$aux=consulta($id_pac,$pieza);
	$a1=$aux["a1"];
	$a2=$aux["a2"];
	$a3=$aux["a3"];
	$a4=$aux["a4"];
	$a5=$aux["a5"];
	$a6=$aux["a6"];
	$extra=$aux["extra"];
	$perno=$aux["perno"];
	$implante=$aux["implante"];
	$circu=$aux["circu"];
	$prote=$aux["prote"];
	$prote_2=$aux["prote_2"];
	$prote_3=$aux["prote_3"];
	$prote_4=$aux["prote_4"];
	$prote_5=$aux["prote_5"];
	$tc=$aux["tc"];
	$rr=$aux["rr"];
	$cnp=$aux["cnp"];
	$pp=$aux["pp"];
	$pp1=$aux["scuad"];
	$pp7=$aux["pp7"];
	$pp8=$aux["pp8"];
	$pp9=$aux["pp9"];
	$ppinc=$aux["inc"];
	$limp=$aux["limp"];
	$aut=$aux["aut"];
	
	$pieza2=new Pieza($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,70,$left,1);
	$pieza2->imagen();
	}?>
</div>
<div>
	<?php for($i=0;$i<=7;$i++)
	{
	$pieza=31+$i;
	$left=340+40*$i;
	$aux=consulta($id_pac,$pieza);
	$a1=$aux["a1"];
	$a2=$aux["a2"];
	$a3=$aux["a3"];
	$a4=$aux["a4"];
	$a5=$aux["a5"];
	$a6=$aux["a6"];
	$extra=$aux["extra"];
	$perno=$aux["perno"];
	$implante=$aux["implante"];
	$circu=$aux["circu"];
	$prote=$aux["prote"];
	$prote_2=$aux["prote_2"];
	$prote_3=$aux["prote_3"];
	$prote_4=$aux["prote_4"];
	$prote_5=$aux["prote_5"];
	$tc=$aux["tc"];
	$rr=$aux["rr"];
	$cnp=$aux["cnp"];
	$pp=$aux["pp"];
	$pp1=$aux["scuad"];
	$pp7=$aux["pp7"];
	$pp8=$aux["pp8"];
	$pp9=$aux["pp9"];	
	$ppinc=$aux["inc"];
	$limp=$aux["limp"];
	$aut=$aux["aut"];
	
	$pieza2=new Pieza2($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,122,$left,0);
	$pieza2->imagen();
	}?>
</div>
<div>
	<?php for($i=0;$i<=4;$i++)
	{
	$pieza=61+$i;
	$left=340+40*$i;
	$aux=consulta($id_pac,$pieza);
	$a1=$aux["a1"];
	$a2=$aux["a2"];
	$a3=$aux["a3"];
	$a4=$aux["a4"];
	$a5=$aux["a5"];
	$a6=$aux["a6"];
	$extra=$aux["extra"];
	$perno=$aux["perno"];
	$implante=$aux["implante"];
	$circu=$aux["circu"];
	$prote=$aux["prote"];
	$prote_2=$aux["prote_2"];
	$prote_3=$aux["prote_3"];
	$prote_4=$aux["prote_4"];
	$prote_5=$aux["prote_5"];
	$tc=$aux["tc"];
	$rr=$aux["rr"];
	$cnp=$aux["cnp"];
	$pp=$aux["pp"];
	$pp1=$aux["scuad"];
	$pp7=$aux["pp7"];
	$pp8=$aux["pp8"];
	$pp9=$aux["pp9"];	
	$ppinc=$aux["inc"];
	$limp=$aux["limp"];
	$aut=$aux["aut"];
	
	$pieza2=new Pieza($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,220,$left,1);
	$pieza2->imagen();
	}?>
</div>
<div>
	<?php for($i=0;$i<=4;$i++)
	{
	$pieza=71+$i;
	$left=340+40*$i;
	$aux=consulta($id_pac,$pieza);
	$a1=$aux["a1"];
	$a2=$aux["a2"];
	$a3=$aux["a3"];
	$a4=$aux["a4"];
	$a5=$aux["a5"];
	$a6=$aux["a6"];
	$extra=$aux["extra"];
	$perno=$aux["perno"];
	$implante=$aux["implante"];
	$circu=$aux["circu"];
	$prote=$aux["prote"];
	$prote_2=$aux["prote_2"];
	$prote_3=$aux["prote_3"];
	$prote_4=$aux["prote_4"];
	$prote_5=$aux["prote_5"];
	$tc=$aux["tc"];
	$rr=$aux["rr"];
	$cnp=$aux["cnp"];
	$pp=$aux["pp"];
	$pp1=$aux["scuad"];
	$pp7=$aux["pp7"];
	$pp8=$aux["pp8"];
	$pp9=$aux["pp9"];	
	$ppinc=$aux["inc"];
	$limp=$aux["limp"];
	$aut=$aux["aut"];

	$pieza2=new Pieza2($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,270,$left,0);
	$pieza2->imagen();
	}?>
</div>
<div>
	<?php for($i=0;$i<=4;$i++)
	{
	$pieza=55-$i;
	$left=130+40*$i;
	$aux=consulta($id_pac,$pieza);
	$a1=$aux["a1"];
	$a2=$aux["a2"];
	$a3=$aux["a3"];
	$a4=$aux["a4"];
	$a5=$aux["a5"];
	$a6=$aux["a6"];
	$extra=$aux["extra"];
	$perno=$aux["perno"];
	$implante=$aux["implante"];
	$circu=$aux["circu"];
	$prote=$aux["prote"];
	$prote_2=$aux["prote_2"];
	$prote_3=$aux["prote_3"];
	$prote_4=$aux["prote_4"];
	$prote_5=$aux["prote_5"];
	$tc=$aux["tc"];
	$rr=$aux["rr"];
	$cnp=$aux["cnp"];
	$pp=$aux["pp"];
	$pp1=$aux["scuad"];
	$pp7=$aux["pp7"];
	$pp8=$aux["pp8"];
	$pp9=$aux["pp9"];	
	$ppinc=$aux["inc"];
	$limp=$aux["limp"];
	$aut=$aux["aut"];
	
	$pieza2=new Pieza($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,220,$left,1);
	$pieza2->imagen();
	}?>
</div>
<div>
	<?php for($i=0;$i<=4;$i++)
	{
	$pieza=85-$i;
	$left=130+40*$i;
	$aux=consulta($id_pac,$pieza);
	$a1=$aux["a1"];
	$a2=$aux["a2"];
	$a3=$aux["a3"];
	$a4=$aux["a4"];
	$a5=$aux["a5"];
	$a6=$aux["a6"];
	$extra=$aux["extra"];
	$perno=$aux["perno"];
	$implante=$aux["implante"];
	$circu=$aux["circu"];
	$prote=$aux["prote"];
	$prote_2=$aux["prote_2"];
	$prote_3=$aux["prote_3"];
	$prote_4=$aux["prote_4"];
	$prote_5=$aux["prote_5"];
	$tc=$aux["tc"];
	$rr=$aux["rr"];
	$cnp=$aux["cnp"];
	$pp=$aux["pp"];
	$pp1=$aux["scuad"];
	$pp7=$aux["pp7"];
	$pp8=$aux["pp8"];
	$pp9=$aux["pp9"];	
	$ppinc=$aux["inc"];
	$limp=$aux["limp"];
	$aut=$aux["aut"];
	
	$pieza2=new Pieza2($pieza,$a1,$a2,$a3,$a4,$a5,$a6,$extra,$perno,$implante,$circu,$prote,$prote_2,$prote_3,$prote_4,$prote_5,$tc,$rr,$cnp,$pp,$pp1,$pp7,$pp8,$pp9,$ppinc,$limp,$aut,270,$left,0);
	$pieza2->imagen();
	}?>
</div>
