<?php

session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DFJSISCI.inc");
include("JQUERY.inc");
$f_f="";
?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es-es">
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<head>

<style type="text/css">
/*BODY {
scrollbar-face-color:#000000;
scrollbar-highlight-color: ;
scrollbar-shadow-color: ; 
scrollbar-3dlight-color:#000000; 
scrollbar-arrow-color: ; 
scrollbar-track-color: ;
scrollbar-darkshadow-color:#000000;
}*/

td {/*background-color:#F0FFF0;*/
   /* background-image:url(img/tdn.jpg);*/
   font-family:helvetica;
   font-style:italic;
   font-size:14px;
   color: #FFFFFF;}  

/*th {background-color:  ;
	background-image:url(img/LINE2.jpg);
    font-family:helvetica;
    font-size:15px;
	color: #FFFFFF;} */
	
/*#width_cabe{
width:450px; fondo blanco
margin:0 auto;
margin-top:0px;
margin-bottom:40px;
border:0px solid #000;
background-color:#fff;
background-image:url(img/white_grid.png);
padding:15px; ancho fondo blanco
position:absolute; top:20px; left:320px;/*altura y ancho
}*/
/*#width_cabe td.titulo{
background-image:url(img/fondotitulos.jpg);
color:#FFF;
font-weight:bold;
text-align:center;
font-size:18px;
font-family:helvetica;
}*/
#width_cabe td{
background-color:#731E35;
color:#FFF;
text-align:left;
padding:5px 5px 5px 5px;
font-weight:bold;
}
	
	
</style>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Registro con AJAX</title>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<script language="javascript">
     $(document).ready(function(){
	function formatItem(row) {
		return " (<strong>" + row[1] + "</strong>)"+row[0];
	}
	var pagRes='cat_maestros_AU.php';
	var idObjDes='tbus';
        var nomObjRad='tip_bus_ope';
	$("#"+idObjDes).autocomplete({ //Des
	    source:pagRes,	
            minChars: 1,                 //Caracteres Minimos antes de autocompletar
		max:20,                      //maximo de resultados mostrados, se manda como limit en autosugestion
		cacheLength: 0,
		delay: 200,                  //Retardo de autocompletar 
		width: 500,                  //ancho del cuadro de despliegue
		highlight: false,            //Resalta letras coincidentes
		autoFill: true,             //autocompleta en texto la posible palabra
		scroll: true,				 //si cuadro tiene barra scroll
		scrollHeight: 100,           //alto del cuadro para el scroll
		
		 select: function( event, ui ) {         
                      $("#"+idObjDes).val(ui.item.ntipo);	
//		$('#fcodgrupo').focus();        
                }
	});	
});
//$(document).ready(function(){
//	$("#tbus").autocomplete('cat_maestros_AU.php',{
//		minChars: 1,                 //Caracteres Minimos antes de autocompletar
//		//max:3                        //maximo de resultados mostrados, se manda como limit en autosugestion
//		selectFirst:false,
//		delay: 200,                  //Retardo de autocompletar 
//		width: 500,                  //ancho del cuadro de despliegue
//		highlight: false,            //Resalta letras coincidentes
//		autoFill: false,             //autocompleta en texto la posible palabra
//		scroll: true,				 //si cuadro tiene barra scroll
//		scrollHeight: 500,           //alto del cuadro para el scroll
//		formatItem:function (row, i, n, value) { //formato de presentacion de las posibles busquedas
//			return "(<strong>"+row[1]+"</strong>)"+row[0];
//		},	     
//		formatResult:function(row){  //formato de seleccion de busqueda
//			return row[0];
//		},
//		extraParams:{tipBus:'d'}     //Parametros Extra a Mandar en autosugestion
//	});
//	$("#tbus").result(function(event, row, formatted){
//		//if(!row && confirm("Articulo:'"+$(this).val()+"'\nDesea AGREGARLO?"))
//			openpage("cat_maestros_AG.php?tap2="+$(this).val(),'_self');
//		//else if(confirm("Articulo:'" +row[0]+"'\nDesea Consultar/Modificar?"))
//			openpage("cat_maestros_MO.php?bot="+row[1],'_self');
//	}).keypress (function(){
//    	var evt = (evt) ? evt : event; 
//    	var tecla = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode:((evt.which) ? evt.which : 0)); 
//    	if(tecla==13){
//			$(this).search();
//			return false;	
//		}
//		return true;
//	});	
//
//});
</script>
</head>
<body onLoad = "self.focus (); document.form1.tbus.focus ()">

  
</div>
<form name="frm1" method="post" action="" >
<body>
<div align="center">
<?php
 				 
	$sql = mysqli_query($con ,"SELECT * FROM valeryus08 order by ntipo");
	include("DE10000.php");
	?>
    
    <script>
    $(function() {
		  theTable = $("#latabla");
		  $("#q").keyup(function() {
			$.uiTableFilter(theTable, this.value);
		  });
		});
</script>
<table width="598" id="latabla">
    <thead>
      <tr>
        <th colspan="8"> 
          <div align="center">
               <div id="sticky-anchor"></div>
          <div align="center" id="sticky">
              <input type="button" name="bot3" value="Agregar"  onClick="openpage('cat_maestros_AG.php','_self')"/>
		  <input type="button" name="bot3" value="Consultar"  onClick="openpage('cat_maestros_CO.php','_self')"/>
			<input type="button" name="bot2" value="Modificar" class="original" onClick="openpage('cat_maestros_MO.php','_self')"/>
            <input type="button" name="bot4" value="Imprimir" class="bot_WsW"   onClick="openpage('cat_maestros_IM.php','_self')"/>  
            <input type="button" name="bot422" value="Eliminar" class="bot_RjR" onclick="openpage('cat_maestros_EL.php','_self')"/>
            <input type="button" name="bot42" value="Exporta Exel" class="original" onClick="openpage('AL10000_IME.php','_self')"/>
            <input type="button" name="Submit" value="Atributos" onClick="openpage('cat_maestros_AG-DET.php','_self')"/>
          </div> </div> 
   		</th></tr>
<tr>
      <td colspan="4"><div align="center"></div></td>
        <th colspan="4"><div align="center">ULTIMO CAMBIO</div></th>
        
    </tr>
<tr>
      <th width="42"><div align="center">SEL</div></th>
        <th width="92"><div align="center">CLAVE</div></th>
		<th width="281"><div align="center">DESCRIPCION</div></th>
	    <th width="144">STATUS RECEPCION</th>
		<th width="144">STATUS AMA DE LLAVES</th>
		<th width="144">USUARIO</th>
		<th width="144">FECHA</th>
		<th width="144">HORA</th>
    </tr>
        </thead>
    <tbody>
	  <?php

	$vart=(isset($_POST['tbus']))?$_POST['tbus']:"";  
	echo '<input name="txt_bus" type="hidden" value="'.$vart.'">';
	$vars=(isset($_POST['submit']))?$_POST['submit']:""; 
	if($vars=="")
	{
		echo '<input name="tip_bus" type="hidden" value="nombre">';
            
		@$sql = mysqli_query($con ,"SELECT * FROM valeryus08 WHERE ntipo like '%".$vart."%'order by ncto");
	}
	while($reg = mysqli_fetch_array($sql))
	{
	  	echo "<tr>";
		echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["n_reg"].'"></div></td>';
		echo "<td> <div align='center' style='color:#000'><a style=\"text-decoration:underline;cursor:pointer;\" onclick=\"openpage('movimientos_maestros.php?clave=".$reg["ncto"]."','_self')\"><strong>" . $reg["ncto"] . "&nbsp;</strong></div></td>";
		echo "<td> <div align='center'><strong>" . $reg["ntipo"] . "&nbsp;</strong></div></td>";
		echo "<td> <div align='center'><strong>" . $reg["nstarecep"] . "&nbsp;</strong></div></td>";
		echo '<td style='.$reg["ocupado"].'> <div align="center" style="color:#fff"><strong>' . $reg["nstaamalla"] . '</strong></div></td>';
		echo '<td> <div align="center"><strong>' . $reg["usuario"] . '</strong></div></td>';
		$fec1=$reg["acc_fec"];
		include('DF20000.php');
		echo "<td> <div align='center'><strong>" . $f_f . "&nbsp</strong></div></td>";
		echo '<td> <div align="center"><strong>' . $reg["acc_hor"] . '</strong></div></td>';
		
		
		//echo "<td> <div align='center' style=' '><strong>" . $reg["nstaamalla"] . "&nbsp;</strong></div></td>";
		//echo "<td> <div align='center' style=' '><strong>" . $reg["status"] . "&nbsp;</strong></div></td>";
		//echo "<td> <div align='center' style=' '><strong>" . $reg["ntfa_senc"] . "&nbsp;</strong></div></td>";
		echo "</tr>";
		
		/*
		echo "<tr>";
		echo '<td> <div align="center"><input name="bot" type="radio" value="'. $reg["n_reg"].'"></div></td>';
		echo "<td> <div align='center'><strong>" . $reg["ncto"] . "&nbsp;</strong></div></td>";
		echo "<td> <div align='center'><strong>" . $reg["ntipo"] . "&nbsp;</strong></div></td>";
		echo "<td> <div align='center'><strong>$" . number_format($reg["ntfa_senc"],2,'.',',') . "&nbsp;</strong></div></td>";
		echo "<td> <div align='center'> <strong>$" . number_format($reg["ntfa_doble"],2,'.',',') . "&nbsp;</strong></div></td>";
		echo "<td> <div align='center'><strong>" . $reg["status"] . "&nbsp;</strong></div></td>";
		
		$show=mysqli_query($con ,"select * from valeryus080 where nparte1='".$reg['n_reg']."'");
		while ($aTrI=mysqli_fetch_array($show)){
		$deSAtr=mysqli_fetch_array(mysqli_query($con ,"select * from fatributos where n_reg='".$aTrI['nparte1_det']."'"));
		echo "<td> <div align='center'><strong>" . $deSAtr["tpdescrip"] . "&nbsp;</strong></div></td></tr>";
		*/
	}
	    //echo "<tr>";
		//echo "<td colspan='3'> <div align='center'><h5>TOTAL CUARTOS :</h5></div></td>";
		//echo "<td> <div align='center'><h5>" . $total . "&nbsp;</h5></div></td>";
	//echo "".$total."";
	mysqli_close($con);
	?>
    </tbody>
  </table>
</div>
</body>
</form>
</div>
</body>
</html>

<?php

/*session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php"); 

require_once("DFJQUERY.inc");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es-es">

<link rel="stylesheet" href="ALMACEN.css" type="text/css"/>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>

<style type="text/css">
BODY {
scrollbar-face-color:#000000;
scrollbar-highlight-color: ;
scrollbar-shadow-color: ; 
scrollbar-3dlight-color:#000000; 
scrollbar-arrow-color: ; 
scrollbar-track-color: ;
scrollbar-darkshadow-color:#000000;
}

td {/*background-color:#F0FFF0;*/
   /* background-image:url(img/tdn.jpg);*/
  /* font-family:helvetica;
   font-style:italic;
   font-size:14px;
   color: #FFFFFF;}  

th {background-color:  ;
	/*background-image:url(img/LINE2.jpg);*/
    /*font-family:helvetica;
    font-size:15px;
	color: #FFFFFF;} 
	
</style>

<script language="javascript">
$(document).ready(function(){
	$("#tbus").autocomplete('DYAUTPRODSSS.php',{
		minChars: 1,                 //Caracteres Minimos antes de autocompletar
		//max:3                        //maximo de resultados mostrados, se manda como limit en autosugestion
		selectFirst:false,
		delay: 200,                  //Retardo de autocompletar 
		width: 500,                  //ancho del cuadro de despliegue
		highlight: false,            //Resalta letras coincidentes
		autoFill: false	,             //autocompleta en texto la posible palabra
		scroll: true,				 //si cuadro tiene barra scroll
		scrollHeight: 500,           //alto del cuadro para el scroll
		formatItem:function (row, i, n, value) { //formato de presentacion de las posibles busquedas
			return "(<strong>"+row[1]+"</strong>)"+row[0];
		},	     
		formatResult:function(row){  //formato de seleccion de busqueda
			return row[0];
		},
		extraParams:{tipBus:'d'}     //Parametros Extra a Mandar en autosugestion
	});
	$("#tbus").result(function(event, row, formatted){
		//if(!row && confirm("Articulo:'"+$(this).val()+"'\nDesea AGREGARLO?"))
			openpage("AL10000_AG.php?tap2="+$(this).val(),'_self');
		//else if(confirm("Articulo:'" +row[0]+"'\nDesea Consultar/Modificar?"))
			openpage("AL10000_MO.php?bot="+row[1],'_self');
	}).keypress (function(){
    	var evt = (evt) ? evt : event; 
    	var tecla = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode:((evt.which) ? evt.which : 0)); 
    	if(tecla==13){
			$(this).search();
			return false;	
		}
		return true;
	});	

});
</script>
</head>
<div style="position:absolute; top:20px; left:100px"><img src="img/logo2.png"/></div>   	

<body onLoad = "self.focus (); document.form1.tbus.focus ()">

<div align="left">
<a style="text-decoration:underline;cursor:pointer;" href="AL00000_PR.php"/><img src="logos/WER.gif" align="center"/></a>
</div>




/*< form name="frm1" method="post" action="" >

//* < body>
<div align="center">
 <?php
 
	$sql = mysqli_query($con ,"");
	include("DE10000.php");
	?>
<table width="587" border='1' bordercolor="#9B0F1A" bordercolordark="#9B0F1A">
      <tr>
        <th colspan="4"> 
          <div align="center">
			
		  </div>
     		</td></tr>
<tr>
        
      </tr>
	  <?php

	echo '<input name="tip_bus" type="hidden" value="'.$_POST['tbus'].'">';
	if($_POST['r1']=="")
	{
		echo '<input name="tip_bus" type="hidden" value="clave">';
	  	@$sql = mysqli_query($con ,"SELECT * FROM valeryus08 WHERE ncto like '%".$_POST['tbus']."%' order by ncto");
		
	}
	while($reg = mysqli_fetch_array($sql))
	{
	  	
	/*}
	mysqli_close($con);
	?>
	 </table>
	 </div>
</body>
/*< /form>
</html>
*/ ?>