<?php
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
//if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//
$HW=V($_SESSION['SYS_HW']);
$PRO_KOD=vbval(V($_GET['ID']));
if($PRO_KOD==0){
	$PRO_KOD=vbval(V($_POST['TXT_PRO_KOD']));
}
$PRO_KOD=1;
//
$LIMPIAR=0;
$DET_TIP=vbval(V($_POST['DET_TIP']));
//
$StrId=V($_POST['TxtId']);
$StrCmd=V($_POST['TxtAc']);
$SYS_MSG="";
$SYS_FOC="Des";
//
include("productoz_fot_vid_fly_fun.php");
//
$TI=0;
?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Productos - Fotos / Videos / Flyers</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/productoz_fot_vid_fly.js"></script>
<!--FIN_SCRIPT------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />
<link rel="stylesheet" type="text/css" href="css/mnu.css"  />

<style type="text/css">
.cF {height:550px;width:825px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

</style>
<script>
$(document).ready(function(){  
   Inicializar();
   SYS_LOAD();
});
</script>
</head>

<body  <?php echo $LStrMsg;?>>
<div align="center">


<div Id="DivFRM"  class="cF" style="background-color:#FDE1A8">
<form id="Frm" name="Frm" method="post" autocomplete="off" enctype="multipart/form-data"
action="productoz_fot_vid_fly.php"  onSubmit="return false;">

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" style="width:825px" >
<img src="png/ndd_mot.png" class="iTb"  />
<div class="tT">PRODUCTOS - FOTOS / VIDEOS / FLYERS</div>
</div>
<!--FIN_TITULO--------------------------------->


<div class="s1" style="left: 35px; top: 68px; width: 433px;">
SELECCIONE UNA ARCHIVO ( Las imagenes deben del formato <b>jpg</b>)
</div>
<div  align="left" style="position:absolute; left:35px; top: 85px; width: 454px; height: 24px">
<input name="Foto" type="file" id="Foto" tabindex="<?php echo ++$TI;?>"/>
</div>

<div class="s1" style="left:35px; top:112px; width: 102px;">
TIPO </div>
<select name="Tip" id="Tip" 
class="lt"  style="left:35px; top: 129px; width: 156px"
tabindex="<?php echo ++$TI;?>">
<?php 
	echo FCBOO("aux_nom","auxiliar","aux_des='PRO_FVF'",$Hab,"","S","aux_id");
?> 
</select>
<input name="CmdAdd" type="button" id="CmdAdd"  
value="Guardar" onClick="fAdd()" tabindex="<?php echo ++$TI;?>"
style="left: 197px; top: 129px; width: 157px; position:absolute">

<div class="datagrid" style="position: absolute; left: 35px; top: 169px; width: 454px; height: 353px;">
<table width="100%">
<thead>
<tr>
<th width="27%">TIPO</th>
<th width="61%">IMAGEN</th>
<th width="6%">&nbsp;</th>
<th width="6%">&nbsp;</th>
</tr>
</thead>
<tbody>      
	<?php
	$FW=gs("pro_fot1","productos","id_pro=$PRO_KOD");
	$TP="FOTO1";
	if(strlen($FW)==0){
		$FW="No registrada";
		$TP="";
	}
	?>
	<tr >
    <td >FOTO1</td>
    <td ><?php echo $FW;?></td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fVer('<?php echo $TP;?>');">
    <img src="img/icono.png"  border="0"/></a>
    <?php } ?>
    </td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fEli('<?php echo $TP;?>');">
    <img src="img/eliminar.png"  border="0"/></a>
    <?php } ?>
    </td>
    </tr>    
	
    <!----------------------------------------------->
    
    <?php
	$FW=gs("pro_fot2","productos","id_pro=$PRO_KOD");
	$TP="FOTO2";
	if(strlen($FW)==0){
		$FW="No registrada";
		$TP="";
	}
	?>
	<tr style="background-color:#CCC" >
    <td >FOTO2</td>
    <td ><?php echo $FW;?></td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fVer('<?php echo $TP;?>');">
    <img src="img/icono.png"  border="0"/></a>
    <?php } ?>
    </td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fEli('<?php echo $TP;?>');">
    <img src="img/eliminar.png"  border="0"/></a>
    <?php } ?>
    </td>
    </tr>    
    
    <!----------------------------------------------->
    
    <?php
	$FW=gs("pro_fot_des","productos","id_pro=$PRO_KOD");
	$TP="FOTO DESCRIP";
	if(strlen($FW)==0){
		$FW="No registrada";
		$TP="";
	}
	?>
	<tr >
    <td >FOTO DESCRIP</td>
    <td ><?php echo $FW;?></td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fVer('<?php echo $TP;?>');">
    <img src="img/icono.png"  border="0"/></a>
    <?php } ?>
    </td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fEli('<?php echo $TP;?>');">
    <img src="img/eliminar.png"  border="0"/></a>
    <?php } ?>
    </td>
    </tr>    
    
    <!----------------------------------------------->
    
    <?php
	$FW=gs("pro_fly1","productos","id_pro=$PRO_KOD");
	$TP="FLYERS 1";
	if(strlen($FW)==0){
		$FW="No registrada";
		$TP="";
	}
	?>
	<tr style="background-color:#CCC" >
    <td >FLYERS 1</td>
    <td ><?php echo $FW;?></td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fVer('<?php echo $TP;?>');">
    <img src="img/icono.png"  border="0"/></a>
    <?php } ?>
    </td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fEli('<?php echo $TP;?>');">
    <img src="img/eliminar.png"  border="0"/></a>
    <?php } ?>
    </td>
    </tr>    
    
    <!----------------------------------------------->
    
    <?php
	$FW=gs("pro_fly2","productos","id_pro=$PRO_KOD");
	$TP="FLYERS 2";
	if(strlen($FW)==0){
		$FW="No registrada";
		$TP="";
	}
	?>
	<tr >
    <td >FLYERS 2</td>
    <td ><?php echo $FW;?></td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fVer('<?php echo $TP;?>');">
    <img src="img/icono.png"  border="0"/></a>
    <?php } ?>
    </td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fEli('<?php echo $TP;?>');">
    <img src="img/eliminar.png"  border="0"/></a>
    <?php } ?>
    </td>
    </tr>    
    
    <!----------------------------------------------->
    
    <?php
	$FW=gs("pro_fly3","productos","id_pro=$PRO_KOD");
	$TP="FLYERS 3";
	if(strlen($FW)==0){
		$FW="No registrada";
		$TP="";
	}
	?>
	<tr style="background-color:#CCC" >
    <td >FLYERS 3</td>
    <td ><?php echo $FW;?></td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fVer('<?php echo $TP;?>');">
    <img src="img/icono.png"  border="0"/></a>
    <?php } ?>
    </td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fEli('<?php echo $TP;?>');">
    <img src="img/eliminar.png"  border="0"/></a>
    <?php } ?>
    </td>
    </tr>    
    
     <!----------------------------------------------->
    
    <?php
	$OC=""; 
	$DW="download";
	$FWW="";
	$PDF="";
	$FW=gs("pro_pdf","productos","id_pro=$PRO_KOD");
	$TP="PDF";
	if(strlen($FW)==0){
		$FW="javascript:void(0)";
		$OC=" onClick=\"alert('pdf no registrado')\" ";
		$TP="";
		$PDF="No registrado";
	}else{
		$FWW="adjuntos/".$FW;
		$PDF=$FW;
	}
	?>
	<tr >
    <td >PDF</td>
    <td ><?php echo $PDF;?></td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="<?php echo $FWW;?>" <?php echo $DW;?>  <?php echo $OC;?> >
    <img src="png/dw.png"  border="0"/></a>
    <?php } ?>
    </td>
    <td align="center">
    <?php if(strlen($TP)>0){ ?>
    <a href="javascript:void(0)" onClick="fEli('<?php echo $TP;?>');">
    <img src="img/eliminar.png"  border="0"/></a>
    <?php } ?>
    </td>
    </tr>    
    
  
</tbody>
</table>
</div>

<?php
$IMG="adjuntos/vacio.png";
if(strlen($DET_TIP)>0){
	$FN="";
	if($DET_TIP=="FOTO1"){
		$FN=gs("pro_fot1","productos","id_pro=$PRO_KOD");
	}
	if($DET_TIP=="FOTO2"){
		$FN=gs("pro_fot2","productos","id_pro=$PRO_KOD");
	}
	if($DET_TIP=="FOTO DESCRIP"){
		$FN=gs("pro_fot_des","productos","id_pro=$PRO_KOD");
	}
	if($DET_TIP=="FLYERS 1"){
		$FN=gs("pro_fly1","productos","id_pro=$PRO_KOD");
	}
	if($DET_TIP=="FLYERS 2"){
		$FN=gs("pro_fly2","productos","id_pro=$PRO_KOD");
	}
	if($DET_TIP=="FLYERS 3"){
		$FN=gs("pro_fly3","productos","id_pro=$PRO_KOD");	
	}
	if($DET_TIP=="PDF"){
		$FN=gs("pro_pdf","productos","id_pro=$PRO_KOD");	
	}
	if(strlen($FN)>0){
		$FN="adjuntos/".$FN;
		if(file_exists($FN)){
			$IMG=$FN;
		}
	}
}
?>

<div id="FA" class="s1" style="left: 510px; top: 83px; width: 279px; height: 438px; overflow:auto">
<img src="<?php echo $IMG; ?>" ></div>

<!--INI_OCULTOS-------------------------------->
<?php include("ocultos.php");?>
<input name="TXT_PRO_KOD" type="hidden" id="TXT_PRO_KOD" value="<?php echo $PRO_KOD;?>" />
<input name="SYS_MSG" type="hidden" id="SYS_MSG" value="<?php echo $SYS_MSG;?>" />
<input name="SYS_FOC" type="hidden" id="SYS_FOC" value="<?php echo $SYS_FOC;?>" />
<input name="DET_TIP" type="hidden" id="DET_TIP" value="<?php echo $DET_TIP;?>" />
<!--FIN_OCULTOS-------------------------------->

</form>
</div>
</div>
</body>
</html>
