|
Server : Apache/2.4.62 System : FreeBSD fbsdweb2.web.rcn.net 14.1-RELEASE FreeBSD 14.1-RELEASE releng/14.1-n267679-10e31f0946d8 GENERIC amd64 User : www ( 80) PHP Version : 8.3.8 Disable Function : NONE Directory : /domains/logicswapweb/aplicaciones/admon/clientes/ |
Upload File : |
<?php session_start();
$pagina = (array_key_exists('pagina', $_REQUEST)) ? $_REQUEST['pagina']: 1;
$ini_line = (array_key_exists('ini_line', $_REQUEST)) ? $_REQUEST['ini_line']: 1;
$cant_line = (array_key_exists('cant_line', $_REQUEST)) ? $_REQUEST['cant_line']: 12;
$buscar = (array_key_exists('buscar', $_REQUEST)) ? $_REQUEST['buscar']: NULL;
if(!$usr_)
header("Location: ../contenido.php");
function paginas($total){
$limite = 12;
return ceil($total/$limite);
}
include("fnc/cliente.php");
$cliente = new Cliente();
$sql = $cliente->query_listar($buscar);
$ini = ($ini_line-1)*12;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Catalogo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script>
if (history.forward(1)){location.replace(history.forward(1))}
</script>
<script src="js/SortTable.js"></script>
<script language="JavaScript" type="text/JavaScript">
//Solo numeros en un campo text
function acceptNum(evt, num_pag){
// NOTE: Backspace = 8, Enter = 13, '0' = 48, '9' = 57
var nav4 = window.Event ? true : false;
var key = nav4 ? evt.which : evt.keyCode;
if(key==13) //Enter
{
if(document.form2.pag.value > num_pag || document.form2.pag.value=="" || document.form2.pag.value <= 0){
alert("El n�mero de p�gina no es v�lido");
document.form2.pag.focus();
return false;
}
window.location.href = '';
}
return (key <= 13 || (key >= 48 && key <= 57));
}
/*********************************************************************
funcion mOvr
descripcion cambia el color de una lina al pasar por encima de ella
*********************************************************************/
function mOvr(src,clrOver)
{
if (!src.contains(event.fromElement))
{
src.style.cursor = 'hand';
src.bgColor = clrOver;
}
}
/*********************************************************************
funcion mOut
descripcion cambia el color de una lina al salir de ella
*********************************************************************/
function mOut(src,clrIn)
{
if (!src.contains(event.toElement))
{
src.style.cursor = 'default';
src.bgColor = clrIn;
}
}
/*********************************************************************
funcion buscar
descripcion llama de nuevo el documento con los parametros de busqueda
*********************************************************************/
function buscar(txt, tipo){
if(txt.value==""){
alert("Debe ingresar el campo para realizar la busqueda");
txt.focus();
return;
}
window.location.href = 'index.php?tipo=' + tipo + '&pagina=1&campo=' + txt.value+'&buscar='+ txt.value;
}
/*********************************************************************
funcion getRadioValue
descripcion identifica y devuelve el valor de radiobuton seleccionado
*********************************************************************/
function getRadioValue() {
var value = null;
var sel_ = document.form1.sel;
with (form1) {
if (sel_ == null) {
return null;
}
var longitud = form1.length;
if (longitud) {
for (var i=0; i<longitud; i++) {
if (form1.elements[i].checked) {
value = form1.elements[i].value;
break;
}
}
} else {
if (sel_.checked) {
value = sel_.value;
}
}
}
return value;
}
/*********************************************************************
funcion foco
descripcion pone el foco en un campo al cargar el documento
*********************************************************************/
function foco(){
document.getElementById("campo").focus();
}
/*********************************************************************
funcion fncModificar
descripcion llama el documento que carga los datos de el cliente seleccionado
*********************************************************************/
function fncModificar(id) {
if(id){
var pag = document.getElementById("pag").value;
document.location.href = 'mod_cliente.php?id='+id+'&pagina='+pag;
}else{
id= getRadioValue();
if(id){
fncModificar(id);
}else{
return false;
}
}
}
function fncEliminar(){
var id= getRadioValue();
if(id){
var pag = document.getElementById("pag").value;
_fraUsr.location.href = 'fnc/main.php?tarea=eli_cliente&cliente='+id+'&pagina='+pag;
}else{
alert("debes seleccionar un usuario para eliminar!");
return false;
}
}
</script>
<script src="js/validaciones.js"></script>
<script src="js/fnc.js"></script>
<link href="css/fuentes.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="foco();">
<span class="Subtitblue"><span class="TXTnews"><a name="up"></a></span></span>
<table width="559" border="0" cellpadding="1" cellspacing="1">
<tr valign="top" bgcolor="#FFFFFF">
<td width="100%" height="30" bgcolor="#F9F9F9" class="listado">
<div align="left" class="vinculo"><a href="../contenido.php" style="width: 40; cursor:hand" title="Indice de Aplicaciones">Beginning</a> | <span class="nombreColum_red">Usuarios Web </span></div></td>
</tr>
<tr>
<td colspan="3">
<table width="100%" border="0" cellspacing="1" cellpadding="1" class="listado" align="center">
<tr>
<td> </td>
<td valign="bottom"><div align="right"><font color="#000000" size="1" face="Verdana, Arial, Helvetica, sans-serif"> </font></div></td>
</tr>
<tr>
<td width="44%">
<div> </div>
<div align="left" class="normal">
<input type="submit" name="Submit2" value="Listar todos" onClick="javascript: document.location.href='index.php?tipo=<? echo $tipo;?>'" title="Adicionar Cliente" class="buttonverde2">
</div>
<div align="center"></div> </td>
<td width="49%" align="right" valign="bottom">
<div align="right" class="normal">
<input type="text" name="campo" size="15" <? if($campo!=""){ echo "value=\"".$campo."\"";}else{echo "value=\"\"";}?> onKeyPress="return restringir(event, 32) && restringir(event, 34);" style="font-size:9pt ">
<input type="submit" name="Submit" value="Buscar" onClick="buscar(campo, '<? echo $tipo;?>');" title="Busqueda por nombre, apellido o email" class="buttonverde2" style="width:76<?php if($buscar){echo ";color:red";} ?>">
</div></td>
</tr>
<tr>
<td colspan="4" valign="top"><table width="100%">
<form name='form1' method='post'>
<tr bgcolor="#6666CC" class="nombreColum" align="center">
<td width="4%"> </td>
<td width="32%">Nombre</td>
<td width="30%">Email</td>
<td width="34%">Selección.
</td>
</tr>
<script>
var t = new SortTable("t");
t.AddColumn("ico","nowrap","center","");
t.AddColumn("codigo","nowrap","left","");
t.AddColumn("dire","nowrap","left","");
t.AddColumn("seleccion","","center","");
<?
$cliente->execute($sql);
$cantidad = $cliente->numRows();
if ($cantidad>0) {
$i = 1; $j=0; $limite =12;$write=0;
while ( (list($id, $nombre, $apellido, $email) = $cliente->fetchRow()) && ($j<$limite) ) {
if($write>=$ini){
$nombre= ucfirst(strtolower($nombre))." ".ucfirst(strtolower($apellido));
if($i==1){
$i++;
?>
t.AddLine('<IMG src="img/folder.gif">','<a style=" width: 80; font-family:Arial, Helvetica, sans-serif; color:#000000; font-size:12px; font-weight:normal" onClick="fncModificar(\'<?=$id?>\')"> <?=$nombre?> </a>','<a style=" width: 150; font-family:Arial, Helvetica, sans-serif; color:#000000; font-size:12px; font-weight:normal" onClick="fncModificar(\'<?=$id?>\')"> <?=$email?> </a>','<input type ="radio" name="sel" value="<?php echo $id; ?>" style=" border-width:0" checked>' );
t.AddLineProperties('align="center" onMouseOver="mOvr(this,\'#E4EDFB\');" onMouseOut="mOut(this,\'#FFFFFF\')"');
<?
}else{
?>
t.AddLine('<IMG src="img/folder.gif">','<a style=" width: 80; font-family:Arial, Helvetica, sans-serif; color:#000000; font-size:12px; font-weight:normal" onClick="fncModificar(\'<?=$id?>\')"> <?=$nombre?> </a>','<a style=" width: 150; font-family:Arial, Helvetica, sans-serif; color:#000000; font-size:12px; font-weight:normal" onClick="fncModificar(\'<?=$id?>\')"> <?=$email?> </a>','<input type ="radio" name="sel" value="<?php echo $id; ?>" style=" border-width:0">' );
t.AddLineProperties('align="center" onMouseOver="mOvr(this,\'#E4EDFB\');" onMouseOut="mOut(this,\'#FFFFFF\')"');
<?
}
$j++;
}
$write++;
}
?>
t.WriteRows();
<?
} else {
$msg = "No hay Usuarios ";
?>
document.write('<TR><TD colspan="2" align="center"><BR><?=$msg?><BR> </TD></tr>')
<?
}
?>
</script>
<tr align="center" class="textoGral" bgcolor="#FFFFFF" onMouseOut="mOut(this,'#FFFFFF')" onMouseOver="mOvr(this,'#E4EDFB')">
<td height="10" colspan="4" bgcolor="#6666CC" class="nombreColum"> <?
$total = $cliente->numRows();
$num_paginas = paginas($total);
echo $total;
?> Registros</td>
</tr>
<tr align="center" >
<td height="10"> </td>
<td height="10"><span class="normal" style="color:red "></span></td>
<td height="10"> </td>
<td height="10"><input type="button" name="Modificar" value="Modificar" onClick="javascript: fncModificar(false);" style=" font-size:10px; width:70">
<input type="button" name="eliminar" value="Eliminar" onClick="javascript: fncEliminar();" style=" font-size:10px; width:70"></td>
</tr>
</form>
</table>
</td>
</tr>
<tr>
<td colspan="3" align="center"><div><form name="form2">
<p class="normal">
<input type="button" name="inicio2" title="Inicio" value="|<" onClick="window.location.href = 'index.php?tipo=<? echo $tipo;?>&ini_line=1&buscar=<? echo $buscar;?>'" <? if($ini_line==1) echo " disabled";?>>
<input type="button" name="inicio2" title="Atras" value="<" onClick="window.location.href = 'index.php?tipo=<? echo $tipo;?>&ini_line=<? echo $ini_line - 1;?>&campo=<? echo $campo;?>&buscar=<? echo $buscar;?>'"
<? if($ini_line==1) echo " disabled";?>>
pg
<input type="text" name="pag" size="3" maxlength="4" style="text-align:center " value="<? if($num_paginas == 0) echo "0";
else echo $ini_line;?>" onKeyPress="return acceptNum(event, <? echo $num_paginas;?> );" <? if($num_paginas == 0) echo "disabled";?>>
<font color="#000000" size="2" face="Verdana, Arial, Helvetica, sans-serif">de <? echo $num_paginas;?></font>
<input type="button" name="sig2" title="Siguiente" value=">" onClick="window.location.href = 'index.php?tipo=<? echo $tipo;?>&ini_line=<? echo $ini_line + 1;?>&campo=<? echo $campo;?>&buscar=<? echo $buscar;?>'" <? if($ini_line==$num_paginas || $num_paginas==0) echo " disabled";?>>
<input type="button" name="final2" title="Ultimo" value=">|" onClick="window.location.href = 'index.php?tipo=<? echo $tipo;?>&ini_line=<? echo $num_paginas;?>&campo=<? echo $campo;?>&buscar=<? echo $buscar;?>'" <? if($ini_line==$num_paginas || $num_paginas==0) echo " disabled";?>>
<input type="hidden" name="tipo" value="<? echo $tipo;?>">
</p>
</form>
</div></td>
</tr>
<tr><td colspan="3"><iframe name="_fraUsr" src="" width="0" height="0" frameborder="0" id="_fraUsr"></iframe></td></tr>
</table> </td>
</tr>
</table>
</body>
</html>