Ver Mensaje Individual
  #4 (permalink)  
Antiguo 30/12/2010, 08:36
Avatar de Algadar
Algadar
 
Fecha de Ingreso: abril-2009
Mensajes: 115
Antigüedad: 15 años
Puntos: 1
Respuesta: CARICATOS: me podrias orientar un poco.Lo Necesito Urgente.

Que tal! Prais.

yo logre hacer eso pero con otro esquema, en enfoque en el código del producto.
como es unico y la imgen del producto es una sola relación uno - uno
mira este código que parte de el lo consegui por esots lares.

Código:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Producto <?php echo $_GET['DTM_SERIAL']; ?></title>
<link href="/InventarioGME/estilos.css" rel="stylesheet" type="text/css" />
</head>
<script language="javascript">
function mostrar(){
	//var dato=val;
	var dato=document.form1.DTM_SERIAL_P.value;
	var emp=dato.substr(0,3);
   //alert(dato+".png");
   if (emp=="PNP") {
   	var datoImg="EMPRESA1/"+dato+".png";
   }
  if (emp=="PMA") {
   	var datoImg="EMPRESA2/"+dato+".png";
   }
 
	document.form1.var_imagen.value=datoImg;
	var prb="/InventarioGme/picture/"+datoImg;
	document.form1.img.src=prb;
	return prb
}
//-->
</script>

<body>
<form action="" method="get" name="form1" id="form1">
<input type="hidden" id="var_imagen" /> 
<input type="hidden" value="<?php echo $_GET['DTM_SERIAL']; ?>" name="DTM_SERIAL_P" id="DTM_SERIAL_P"/>
<?php 

  if (substr($_GET['DTM_SERIAL'],0,3)=='PME') {
	$val_imagen="picture/EMPRESA1/";
   }
  if (substr($_GET['DTM_SERIAL'],0,3)=="PNP") {
   	$val_imagen="picture/EMPRESA2/";
   }
  if (substr($_GET['DTM_SERIAL'],0,3)=="PMA") {
   	$val_imagen="picture/EMPRESA3/";
   }
 
$val_imagen= $val_imagen.$_GET['DTM_SERIAL'].".png"; 
 //exec('C:\WINDOWS\notepad.exe');
?>
<?php	

// DEFINO UNA VARIABLE CUANDO NO EXISTE LA IMAGEN

    define("PATH_NO_PHOTO_LARGE","picture/SIN FOTOGRAFIA.png" );
?> 

<img src="<?php  
        $link_photo_car = $val_imagen; 
     
        if (!is_array(@getimagesize($link_photo_car))) 
          // SI NO EXISTE EL ARCHIVO EN LA RUTA 
        { 
            $show_path_photo_car = PATH_NO_PHOTO_LARGE; // Photo unavailable 
        } 
        else 
        { 
     
            $show_path_photo_car = $link_photo_car;
        } 
         
        echo $show_path_photo_car;?>" width="331" height="235" id="websoundcr" name="websoundcr" title="imagen de prueba"   />

</form>
</body>
</html>
Así fue que yo lo hice y me resulto trabajando con el serial "DTM_SERIAL". Lo coloco en caso de que pueda servirte.
__________________
Deseo poco y lo poco que deseo, lo deseo poco.!
De Colores.