211 lines
7.5 KiB
HTML
211 lines
7.5 KiB
HTML
<!---
|
|
application: Cuentas a Pagar
|
|
version: 1.0.0
|
|
filename: g_centro.html
|
|
description: Esta página busca las filas de la tabla de acuerdo con el
|
|
criterio de búsqueda establecido. Las filas tinen un hiper-enlace para
|
|
poder ver los detalles completos, modificarla o Borrala.
|
|
El botón de Alta permite acceder al form para crear una nueva fila
|
|
--->
|
|
<HTML>
|
|
<HEAD>
|
|
<TITLE>centros</TITLE>
|
|
</HEAD>
|
|
<SERVER>
|
|
var baseHtml="";
|
|
dbAcl();
|
|
if (request.gofunc)
|
|
writeln(' <BODY OnLoad="RunFunction(\''+request.gofunc+'\',\''+request.valor+'\')"');
|
|
else {
|
|
if ( request.FrameType == "F" || request.FrameType == "T" )
|
|
writeln(' <BODY OnLoad="WriteFrameButtons()"');
|
|
else
|
|
writeln(' <BODY');
|
|
}
|
|
writeln(' BACKGROUND="images/backgrnd.gif">');
|
|
writeln('<SCRIPT SRC="global.js">');
|
|
writeln('</SCRIPT>');
|
|
writeln('<SCRIPT SRC="ctasapagar.js">');
|
|
writeln('</SCRIPT>');
|
|
if (request.gofunc) {
|
|
writeln("<SCRIPT LANGUAGE='JavaScript'>");
|
|
writeln('function RunFunction(obj,valor) {');
|
|
writeln(' var mainFrame=find_frame(top,"main");');
|
|
writeln(' var f_frame=mainFrame.document.g_centro;');
|
|
writeln(' if ( obj == "Alta" ) {');
|
|
writeln(' f_frame.action="o_centro.html?nvo=1&'+baseHtml+'";');
|
|
writeln(' f_frame.submit(); ');
|
|
writeln(' }');
|
|
writeln(' if ( obj == "Ayuda" )');
|
|
writeln(' NetHelp(valor);');
|
|
writeln(' history.back();');
|
|
writeln('}');
|
|
writeln('</SCRIPT>');
|
|
}
|
|
if(request.search1 || request.search2) {
|
|
dbConnect();
|
|
if(request.search1 && !request.gofunc) {
|
|
//Si se busca usando el texto de entrada
|
|
c_centros = database.cursor("SELECT * FROM centros WHERE "+ client.criteria +" MATCHES '" + request.search1 + "' ORDER BY " + client.criteria);
|
|
if (!c_centros)
|
|
DbsError(false,-1);
|
|
client.search1 = request.search1;
|
|
}
|
|
if(request.search2 && !request.gofunc) {
|
|
if(request.search2 == "all") {
|
|
//Selecciono todos los centros, sin criterio
|
|
c_centros = database.cursor("SELECT * FROM centros ORDER BY descripcion ");
|
|
if (!c_centros)
|
|
DbsError(false,-1);
|
|
}
|
|
else {
|
|
//Selecciona todas las filas en las que el descripcion empieza con la letra elejida.
|
|
var lowcaps = request.search2.toLowerCase();
|
|
c_centros = database.cursor("SELECT * FROM centros WHERE "+ client.criteria + " MATCHES '" + request.search2 + "*' OR " + client.criteria +" MATCHES '" + lowcaps + "*' ORDER BY " + client.criteria);
|
|
if (!c_centros)
|
|
DbsError(false,-1);
|
|
}
|
|
client.search2 = request.search2;
|
|
}
|
|
}
|
|
else {
|
|
if (!request.cod_centro && !request.descripcion ) {
|
|
request.descripcion ="descripcion";
|
|
}
|
|
}
|
|
if (request.cod_centro) {
|
|
client.criteria="cod_centro";
|
|
client.des_criteria="cuyo código";
|
|
}
|
|
if (request.descripcion ) {
|
|
client.criteria="descripcion ";
|
|
client.des_criteria="cuya descripción";
|
|
}
|
|
if ( client.criteria == "descripcion " ) {
|
|
criterio=" por descripción ";
|
|
}
|
|
if ( client.criteria == "cod_centro" ) {
|
|
criterio=" por Código ";
|
|
}
|
|
if ( request.FrameType == "F" || request.FrameType == "T" ) {
|
|
writeln("<SCRIPT LANGUAGE='JavaScript'>");
|
|
writeln('function WriteFrameButtons() {')
|
|
if (!request.waux) {
|
|
writeln(' var topFrame=find_frame(top,"top");');
|
|
writeln(' var ndoc=topFrame.document; ');
|
|
writeln(' var mainFrame=find_frame(top,"main");');
|
|
writeln(' var formAction=mainFrame.document.location.href;');
|
|
QueryButtons("Centros",criterio,"ce_");
|
|
}
|
|
writeln('}');
|
|
writeln("</SCRIPT>");
|
|
}
|
|
if (!request.waux) {
|
|
if (request.gofunc) {
|
|
writeln('</BODY>');
|
|
writeln('</HTML>');
|
|
writeln(' <!--');
|
|
}
|
|
else {
|
|
if ( request.FrameType == "L" ) {
|
|
writeln('<FORM METHOD="post" ACTION="o_centro.html?'+baseHtml+'&nvo=1">');
|
|
QueryHeadBar("Centros",criterio,"ce_")
|
|
writeln('</FORM>');
|
|
}
|
|
writeln('<FORM method="Post" NAME="g_centro" action="g_centro.html?'+baseHtml+'">');
|
|
}
|
|
}
|
|
else {
|
|
writeln('<FORM method="Post" NAME="g_centro" action="g_centro.html?waux='+request.waux+"&"+baseHtml+'">');
|
|
writeln('<CENTER><FONT SIZE=+2>'+criterio+' </FONT></FONT></H1></CENTER>');
|
|
}
|
|
if ( client.criteria == "descripcion " ) {
|
|
writeln("<B>Cambiar Seleccion Datos por: </B>");
|
|
writeln("<INPUT TYPE='submit' NAME='cod_centro' value='Código'>");
|
|
writeln("<HR>");
|
|
writeln("<b>descripción contiene:</b>");
|
|
}
|
|
if ( client.criteria == "cod_centro" ) {
|
|
writeln("<B> Buscar por: </B>");
|
|
writeln("<INPUT TYPE='submit' NAME='descripcion' value='Descripción'>");
|
|
writeln("<HR>");
|
|
writeln("<b>Código contiene:</b>");
|
|
}
|
|
if(request.search1 == null) {
|
|
writeln("<INPUT type='text' name='search1'>");
|
|
}
|
|
else {
|
|
writeln("<INPUT type='text' name='search1' VALUE='" + request.search1 + "'>");
|
|
}
|
|
writeln('<INPUT TYPE="submit" value="Buscar">');
|
|
writeln('</FORM>');
|
|
if (!client.criteria) {
|
|
client.criteria="descripcion ";
|
|
client.des_criteria="cuya descripción";
|
|
}
|
|
if ( client.criteria == "descripcion " ) {
|
|
client.des_criteria="cuya descripción";
|
|
writeln("descripcion empieza por:</BR>")
|
|
}
|
|
if ( client.criteria == "cod_centro" ) {
|
|
client.des_criteria="cuyo Código";
|
|
writeln("Código empieza por:<BR>")
|
|
}
|
|
|
|
writeln("<CENTER>");
|
|
if (!request.waux) {
|
|
refHtml="g_centro.html?"+baseHtml+"&search2=";
|
|
}
|
|
else {
|
|
refHtml="g_centro.html?waux="+request.waux+"&"+baseHtml+"&search2=";
|
|
}
|
|
LoadHidden(refHtml);
|
|
buttonsLetrasNros(refHtml,true);
|
|
writeln("</CENTER><HR>");
|
|
if (request.search1) {
|
|
writeln("centros "+ client.des_criteria +" contiene <FONT SIZE=+2>" + request.search1 + "</FONT><BR>")
|
|
}
|
|
if (request.search2) {
|
|
if(request.search2 == "all") {
|
|
writeln("Lista de todos los centros<BR>");
|
|
}
|
|
else {
|
|
writeln("centros " + client.des_criteria + " empieza por <FONT SIZE=+2>" + request.search2 + "</FONT><BR>");
|
|
}
|
|
}
|
|
writeln("<HR>");
|
|
if (request.search1 || request.search2) {
|
|
if ( client.criteria == "cod_centro" )
|
|
writeln('<TABLE ALIGN="CENTER" BORDER=0>');
|
|
while (c_centros.next()) {
|
|
//lista de todos los centros devueltos por el cursor.
|
|
if ( client.criteria == "descripcion " ) {
|
|
if (!request.waux)
|
|
writeln("<IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_centro.html?ce_cod_centro=" + escape(StringClip(false,c_centros.cod_centro)) +"&"+baseHtml+ "'>" + c_centros.descripcion + "</A><BR>");
|
|
else
|
|
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_centro.html?waux="+request.waux+"&ce_cod_centro="+ escape(StringClip(false,c_centros.cod_centro))+"&"+baseHtml + "'>" + c_centros.cod_centro + "</TD><TD>"+ c_centros.descripcion + "</A><BR></TD></TR>");
|
|
}
|
|
if ( client.criteria == "cod_centro" ) {
|
|
if (!request.waux)
|
|
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_centro.html?ce_cod_centro=" + escape(StringClip(false,c_centros.cod_centro)) +"&"+baseHtml+ "'>" + c_centros.cod_centro + "</TD><TD>" +c_centros.descripcion + "</A></TD></TR>");
|
|
else
|
|
writeln("<TR><TD><IMG SRC='images/sphere.gif' ALT='Bullet'> <A HREF='o_centro.html?waux="+request.waux+"&ce_cod_centro="+ escape(StringClip(false,c_centros.cod_centro))+"&"+baseHtml + "'>" + c_centros.cod_centro + "</TD><TD>"+ c_centros.descripcion + "</A><BR></TD></TR>");
|
|
}
|
|
}
|
|
c_centros.close();
|
|
if ( client.criteria == "cod_centro" )
|
|
writeln("</TABLE>");
|
|
}
|
|
|
|
if (!request.waux) {
|
|
writeSignature(true);
|
|
}
|
|
if (request.gofunc) {
|
|
writeln('-->');
|
|
}
|
|
else {
|
|
writeln('</BODY>');
|
|
writeln('</HTML>');
|
|
}
|
|
</SERVER>
|