<?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($_POST['HW']);
if(strlen($HW)==0)$HW=V($_GET['HW']);
$Z=V($_POST['Z']);
if(strlen($Z)==0)$Z=V($_GET['Z']);

$StrGT="";$LStrMsg="";$LStrFoc="";$LStrMM="";
$LStrPag=V($_POST['TxtPag']);
//----------FUN PART-----------------------
$_PDF="";
$StrId=V($_POST['TxtId']);
$StrCmd=V($_POST['TxtAc']);
$LIMPIAR=0;
//
$P_C="TXT_DATA";
//
//$LStrMsg=BL($StrGT,$LStrMsg,$LStrFoc,$P_C);
//-----------------------------------------
$VP_RegXPag=100;
$LStrTR=100;
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;
?>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reporte de codigos repetidos</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funcionex.js"></script>
<!--FIN_SCRIPT------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estilox.css"  />
<link rel="stylesheet" type="text/css" href="css/basix.css"  />
<style type="text/css">
.cF {height:600px;width:550px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

.tableFixHead          { overflow-y: auto; overflow:auto; border:solid 1px #363636;position: absolute; }
.tableFixHead thead th { position: sticky; top: 0; }
table  {border-collapse:collapse;width:100%;}
th, td {padding: 3px 3px;}
th     {background:#CCC}

.tzt{
	background-color:transparent; width:100%; font-size:11px; position:inherit!Important; border:none;
}
</style>
<script>
$(document).ready(function(){  
   Inicializar();   
});
function ZO(){
	return window.devicePixelRatio;
}
</script>

</head>

<body >
<div align="center">

<div Id="DivFRM"  class="cF" style="background-color:#B3D6EA;" >
<form id="Frm" name="Frm" method="post" action="prod_cod_rep.php">
<input name="L_USU" type="hidden" id="L_USU" value="<?php echo vbval(V($_SESSION['SYS_USER_ID']))?>">
<input name="COM_DATA" type="hidden" id="COM_DATA" value="">
<input name="HW" type="hidden" id="HW" value="<?php echo $HW;?>">
<input name="Z" type="hidden" id="Z" value="<?php echo $Z;?>">

<!--INI_TITULO-->
<div id="DivT" class="dT"  style="width:550px">
<img src="img/categorias.png" class="iT" />
<div class="tT" style="width:300px">REPORTE DE CODIGOS REPETIDOS</div>
</div>
<div class="s1" style="left:46px; top: 86px; width: 285px;">
<b>IMPORTANTE :</b> Solo productos habilitados</div>
<!--INI_TABLA----->
<div class="tableFixHead" style="left:46px; top: 110px; width: 454px; height: 238px; background-color:#FFF">
<table width="100%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px" >
<thead>
<tr>
<th width="4%" align="left">#</th>
<th width="39%" align="left">CODIGO</th>
<th width="52%" align="left">N°REPETIDOS</th>
<th width="5%" align="left">VER</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;
$s="SELECT  pro_cod as COD ,count(*) as CAN 
	FROM  ges_productos WHERE pro_hab='SI' 
	GROUP BY 1 HAVING count(*)>1 ORDER BY 2 DESC  ";	
$rs=grs($s);
while($r=$rs->fetch_assoc()){	
	$PX++;
	$CSS="";
	if($PX%2==0)$CSS=' style="background-color:#D4D4D4" ';
?>
    <tr <?php echo $CSS;?> >
    <!----------------------------------------------->
    <td><?php echo $PX;?></td>
    <td><?php echo $r['COD'];?></td>
    <td><?php echo $r['CAN'];?></td>
    <td align="center">
    <a href="javascript:void(0)" onClick="VerRep('<?php echo $r['COD'];?>');">
    <img src="img/icono.png"  border="0"/></a></td>
    <!----------------------------------------------->
    </tr>
<?php
}
?>		  

</tbody>
</table>
</div>
<script>
function VerRep(cod){
	var url="repetidos.php?KOD="+cod;
	document.getElementById("FrmCod").src=url;
}
</script>
<div style="position:absolute; left:49px; top:371px; width:451px; height:190px; overflow:auto; background-color:#FFF">
<iframe id="FrmCod" src="about:blank" style="width:100%; position:absolute; top:0px; left:0px; border:none; height:100%">
</iframe>
</div>


<!--FIN_TABLA----->
<!--INI_OCULTOS-------------------------------->
<input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
<input name="TxtAc" type="hidden" id="TxtAc" value="" />
<input name="W" type="hidden" id="W" value="<?php echo $W;?>" />
<input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
<input name="TxtFEC" type="hidden" id="TxtFEC" value="<?php echo date("d-m-y"); ?>" />
<!--FIN_OCULTOS-------------------------------->
<!--INI_BOTONES-----><!--FIN_BOTONES-->
</form>


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