Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION...

141
INGENIERIA ELECTRONICA EN COMPUTACION ELABORACION PÁGINA DIA MES AÑO SISTEMA DE REGISTRO Y CONSULTA DE PUBLICACIONES PARA EL INSTITUTO NACIONAL DE INVESTIGACIONES FORESTALES, AGRICOLAS Y PECUARIAS (INIFAP) 30 01 2005 1 de 141 SISTEMA DE REGISTRO Y CONSULTA DE PUBLICACIONES PARA EL INSTITUTO NACIONAL DE INVESTIGACIONES FORESTALES, AGRÍCOLAS Y PECUARIAS (INIFAP). Pablo Soto Carvantes 79325867 Enero 2005

Transcript of Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION...

Page 1: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20051 de 141

SISTEMA DE REGISTRO Y CONSULTA DE PUBLICACIONES PARA EL INSTITUTO NACIONAL DE INVESTIGACIONES

FORESTALES, AGRÍCOLAS Y PECUARIAS

(INIFAP).

Pablo Soto Carvantes 79325867

Enero 2005

Page 2: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20052 de 141

CONTENIDO Página

INTRODUCCION 3

ANTECEDENTES, PROBLEMÁTICA 4

OBJETIVOS E IMPACTOS 5

MODULOS 6

ESPECIFICACIONES 16

BASE DE DATOS (ESTRUCTURA) 25 REQUERIMIENTOS TECNICOS 31 RESUMEN Y BIBLIOGRAFIA 33

ANEXO A 35 Modulos de perl empleados ANEXO B 59

Programas fuente en PERL

ANEXO C CD

Page 3: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20053 de 141

INTRODUCCION

En estos tiempos, evitar la adopción de la tecnología para resolver los problemas actuales, es colocarse en serias desventajas con respecto a nuestros competidores e inclusive este estilo de vida nos pondría en situaciones de enfrentamiento de convivencia, se imagina a alguien enviándonos un documento extenso en maquina de escribir a través del servicio de mensajería urgente con el propósito de que le demos nuestro punto de vista y le realicemos algunos ajustes al texto, que absurdo pero puede suceder y en ese caso tendríamos un serio problema y lo mas probable es que le demos una excusa para evitar hacer esa labor titánica e inútil al menos con esa herramienta inoperante para el día de hoy. La época que vivimos nos lleva constantemente estar desarrollando nuevas herramientas para realizar nuestras actividades comunes, mismas que nos obligan a adaptarnos rápidamente a su uso y aplicación, de lo contrario el aislamiento seria inevitable. Una de las muchas excusas que tienen los tomadores de decisiones en las empresas privadas o gubernamentales para evitar el uso, o la adopción de tecnologías modernas en especial las de información, es por su elevado costo, en efecto es muy caro el hacerse de estas herramientas pero puedo asegurarles a ellos que les será mas caro el carecer de ellas ya que tarde o temprano perderan competitividad y así, no podrans invertir mañana en ellas, cuando se encuentren fuera del mercado. El gobierno federal hoy ha invertido y le apuesta a la tecnología, sabe que si no reducimos la brecha tecnológica respecto a países con los que desarrollamos intensos intercambios comerciales, estos buscaran otros proveedores y seremos remplazados rápidamente, es por eso necesario reducir esa brecha tecnológica que nos tiene en situación de vulnerabilidad. El desarrollo de herramientas empleando software libre, da la oportunidad a que los costos en el concepto de software, se reduscan significativamente en la adquisición y licenciamiento por el uso del mismo, ofreciendonos una excelente oportunidad para países con economias emergentes como el nuestro, donde abunda la mano de obra calificada y verdaderamente, escasean los recursos económicos, a hacer uso de las mismas y desarrollar nuestros sistemas. Tomando como referencia estos puntos, se da una excelente oportunidad para el desarrollo de sistemas, con herramientas de software libre y en este caso, implemntar el sistema de registro y consulta, de publicaciones en ambiente WEB, para el Instituto Nacional de Investigaciones Forestales, Agrícolas y Pecuarias (INIFAP), mismas que son producto de la investigación agropecuria, desarrollada por sus mas 1000 investigadores, distribuidos en mas de 80 Campos Experimentales en todo el país.

Page 4: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20054 de 141

ANTESEDENTES: Gran parte de la población en nuestro país, vive en zonas rurales donde su economía se basa

en la producción agropecuaria, el incremento en la calidad y rendimiento de sus productos, impacta directamente, en beneficio de su economía.

Para ello requieren de mejorar no solo el proceso de producción, si no también los insumos, materias primas en el desarrollo de su actividad, ejemplo fertilizantes, semillas mejoradas con resistencia a sequías o plagas, técnicas de (siembra, riego, cosecha y manejo post cosecha), mejoramiento genético de semovientes, mediante la cruza con sementales de alto registro, con resistencia a enfermedades, etc.

Los mecanismos que hasta el día de hoy permiten la difusión y transferir esta tecnología, producto de la investigación generada por el INIFAP al productor, son mediante materiales impresos en diferentes formatos (fichas tecnológicas, folletos, trípticos, etc.), dicha tecnología tiene el propósito de incrementar la rentabilidad y calidad de los productos del productor en nuestro país.

PROBLEMÁTICA:

El mecanismo actual no permite llegar con la oportunidad deseada al usuario final de estas tecnologías que este caso, es al técnico tranferencista de la tecnología al productor mexicano, debido a que su difusión se realiza a través de formatos impresos los cuales son en numero de ejemplares, limitados y su distribución o comercialización son ferias agropecuarias, en las asociaciones de productores de la región o en las oficinas del INIFAP en el interior del país.

Page 5: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20055 de 141

OBJETIVO: Crear un mecanismo adicional a los existentes, que facilite el acceso a los usuarios

consumidores de la tecnología, producto de la investigación desarrollada por el INIFAP. IMPACTO

Mayor difusión de las publicaciones generadas por el INIFAP facilitándoles su acceso, a los

usuarios de la misma en menores tiempos y sin limitar el número de ejemplares, ejemplo.

1. Menor costo de obtención: Los usuarios no tendrán que desplazarse a los centros de Investigación y así obtener la información requerida.

2. Mayor Impacto: Debido a que podran estar al dia en la información recien

generada, esta misma podrá ser aplicada en su sistema producto y obtener los beneficios que se pretenda con esta información.

Page 6: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20056 de 141

Modulos del Sistema

Page 7: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20057 de 141

ACCESO

PRESENTACION REGISTRO ACTUALIZACION ADMINISTRADOR

INIFAP (INFOTECA)

CONSULTA PARA USUARIOS

EXTERNOS

Page 8: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20058 de 141

Descripción de los módulos del sistema.

Modulo de Entrada al Sistema Infoteca INIFAP (ACCESO): Modulo de registro de cuentas para usuarios internos los cuales podran ingresar al sistema

para dar de alta publicaciones al sistema de Publicaciones del INIFAP.

Este modulo les permitira inclusive recuperar su contraseña en caso de haberla olvidado.

Acceso:

https://intranet.inifap.gob.mx/cgi-bin/infoteca/chk_login.cgi

Page 9: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 20059 de 141

Modulo de Registro:

Lugar donde el usuario interno autorizado, tiene acceso a los diferentes tipos de registro de publicaciones, para este proyecto solo tendremos los siguientes tipos de publicación:

Registro de Nombre del programa

Artículos act_articulos.cgi Tesis act_tesis.cgi Tesis Asesoradas act_tesis_dir.cgi Libros act_libros.cgi Boletines act_libros.cgi Folletos act_libros.cgi Memorias act_libros.cgi Videos act_libros.cgi

Page 10: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200510 de 141

Modulo de Actualización:

Lugar donde el usuario interno autorizado, actualiza la información de las publicaciones ya registradas en el sistema, a demás de subir al mismo, tanto el resumen de la publicación y su correspondiente archivo a texto completo en formato PDF, para ser consultado en la pagina WEB del INIFAP. Programa: act_citas.cgi

Page 11: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200511 de 141

Modulo de Administración: Sitio donde el administrador del sistema controla y supervisa los accesos a los usuarios

internos autorizados en el país, registran las publicaciones del INIFAP. Programa: corri_usuario.cgi

Page 12: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200512 de 141

Aplicación de consulta de usuarios externos:

Montada en la pagina web del INIFAP para relaizar las consultas a traves de la construcción de filtros de busqueda, para las publicaciones registradas en la infoteca del INIFAP, que contengan el resumen y su respectivo archivo digitalizado en formato PDF. Acceso: http://www.inifap.gob.mx/cgi-bin/pagina_web/cons_infoteca1.cgi

Pagina de consulta en la pagina WEB del INIFAP http://www.inifap.gob.mx

Ejemplo de una consulta en este caso la haremos para todo lo relacionado con el jitomate

Page 13: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200513 de 141

Pantalla de salida después de haber solicitado buscar la palabra jitomate

Page 14: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200514 de 141

Pantalla de salida después de haber seleccionado ver el Resumen de una de las publicaciones resultado de la busqueda. Pantalla de salida después de haber solicitado buscar la palabra jitomate

Page 15: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200515 de 141

Pantalla donde muestra el documento a texto completo en formato PDF solicitado.

Page 16: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200516 de 141

Especificasiones (Tablas de datos del Sistema)

Page 17: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200517 de 141

Diagrama de Entidades y Asociaciones

Tabla Principal Cátalogo Sistema Producto

num_registro integer 1 nombre char(65)autor1 char(30) region charvar(3)coautores char(200) nombre_reg charvar(35)anio char(4) Cátalogo Especialidad uaa charvar(3)titulo char(200) nombre charvar(47)entrada char(4) 1 especialidad char(60) cve_edo charvar(2)volumen char(11) direccion charvar(50)numero char(10) colonia charvar(30)paginas char(10) municipio charvar(30)tpublicación char(36) num_consec integer ciudad charvar(30)nomcir char(40) usuario char(10) estado charvar(30)nomcampo char(80) clave char(10) codpost charvar(5)nomdiv char(18) region char(30) tel charvar(30)sistprod char(25) 1 activo char(1) estrategico booleanespeciali char(40) 1 sistema char(10)fecha date aplicación char(200)revista char(100) tusuario char(12)fecha_reg date fecha timestampfecha_pub date salida char(20)ip char(15) ip char(15)grado_academico char(30) referencia char(80)universidad char(30) pregunta char(50)facultad char(30) respuesta char(35)editorial char(30) fechanac dateedicion integer correo char(50)lugar_publ char(30) nombre char(50)inst_respon char(30) sexo char(1)nom_seri_colec char(50) sector char(25)tipo_reg char(1) rfc char(13)nom_reg char(32) uaa char(3)arbitraje char(2)usuario char(20)fuente_var char(20)importe_inifap integer rfc charvarimporte_otros integer curp charvar(18)importe_var integer nombre_comp charvar(120)tiraje integer nombre charvar(40)usr char(10) paterno charvar(40)abstrac text materno charvar(40)documento char(40) uaa charvar(3)autor2 char(30)rfc char(13)nombre_comp char(120)

publica2uaa

plantilla

sistema_producto

especialidad

login y logintemp

Page 18: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200518 de 141

Diccionario de datos.

A

Abstrae Campo que contiene el Resumen de la Publicación

Activo Campo que nos indica si el usuario esta activo o no para entrar al

sistema

Anio Año de la publicación

Aplicación Campo en la tabla de login y logintemp donde aparecen los permisos

de los usuarios

Arbitraje Se especifica si hubo necesidad de revisión por parte de algún comité.

autor1 Nombre del Autor de la publicación

autor2 Nombre Completo del Autor de la Publicación

C Ciudad Ciudad donde esta el campo experimental

Clave Palabra necesaria para que el usuario ingrese al sistema

coautores Nombre de los colaboradores de la publicación

Colonia Colonia del campo experimental

Codpost Codigo postal del campo experimental

Correo Cuenta de correo electrónico del usuario del sistema

Curp Curp del Investigador

cve_edo Clave del estado al que pertenece el Campo Experimental

D

Direccion Dirección del campo experimental donde se desarrollo la publicación

documento

Campo donde se almacena el nombre del archivo pdf que contiene la

publicación

Page 19: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200519 de 141

E

Edicion Numero de Edición de la publicación

Editorial Nombre de la editorial de la publicación

Especiali Tipo de Especialidad de la publicación

especialidad Especialidad de la publicación

Estado Nombre del Estado de la republica

estrategico Especifica si un campo experimental es estratégico o no

F

Facultad Nombre de la facultad donde se desarrollo la publicación (Tesis)

Fecha En la tabla de publica2 es la fecha de la

Fecha En la tabla de login y logintemp es la fecha en que el usuario ingreso a

un sistema

fecha_nac Fecha de nacimiento del trabajador

fecha_pub Indica la fecha de Elaboración de la Publicación

fecha_reg Fecha de registro de la publicación en el sistema

Fuente_var

G

Grado_academico Grado Académico del trabajador

I

importe_inifap Importe que el INIFAP aporto para el desarrollo de la publicación

importe_otros Importe que realizarón otros aportantes para el desarrollo de la

publicación

importe_var

inst_respon Institución responsable de la publicación

Ip Numero Identificador de la Pc que entra al sistema

Page 20: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200520 de 141

L lugar_publ Lugar donde se edito la Publicación

M

Materno Apellido Materno del Trabajador

Municipio Nombre del municipio del campo experimental

N

nom_reg

nom_seri_colec Nombre de la Serie o Colección donde se encuentra el Articulo

nombre En la Tabla uaa es el nombre del campo experimental

nombre En la tabla de Plantilla es el nombre o nombres del trabajador

nombre En las tablas de login y logintemp es el nombre del usuario

nombre Nombre del sistema producto que maneja la publicación

nombre_comp Es el nombre con apellidos del trabajador

Nombre_reg Es el nombre de la region a que pertenece el campo experimental

Nomcampo Es el nombre del campo experimental en la Tabla publica2

Nomcir Es el nombre que de la Region en la Tabla publica2

Nomdiv Se cuenta con 4 divisiones para clasificar los proyectos y estas son

(Agrícola, Pecuaría, Forestal y Multisectorial)

num_consec Consecutivo de registro de usuarios

num_registro Consecutivo de las publicaciones

numero Especifica cuantos

P

paginas Numero de paginas que contiene la publicación

paterno Apellido paterno del trabajador

pregunta Pregunta que se formula al usuario, para recuperar su contraseña

Page 21: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200521 de 141

R referencia Campo que contiene la liga para ingresar al Sistema

region Nombre de la región a la que pertenece el usuario o el campo

experimental.

respuesta Respuesta de seguridad para recuperar contraseña

revista Nombre de la revista donde se publico el articulo en cuestion

rfc Registro Federal de Causantes del autor de la publicación

salida Contiene fecha y hora cuando el usuario abandono el sistema

Sector Sector al que pertence el usuario del sistema.

Sexo Genero del usuario (femenino o masculino)

sistema Nombre del Sistema que en este caso es INFOTECA

sistprod Nombre del sistema producto de la publicación

T

tel Numero telefónico del campo experimental donde se genero la

publicación

tipo_reg

tiraje Tiraje de la publicación

titulo Nombre de la Publicación

tpublicación Tipo de la Publicación

tusuario Tipo de Usuario para el acceso al sistema

U

uaa Numero de la Unidad Administrativa

universidad Nombre de la Universidad donde se desarrollo la publicación

usr

usuario nombre del usuario

V

volumen Volumen de la publicación

Page 22: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200522 de 141

Especificasiones (Programas del Sistema)

Page 23: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200523 de 141

Descripción de la aplicación que registra los Artículos: Programa: act_articulos.cgi

El programa fuente lo encuentra en los anexos de este documento.

En esta aplicación nos permite registrar los articulos Cientificos o tecnicos, publicados en revistas cientificas con arbitraje o sin el. Los campos solicitados que nos permiten clasificarlos y registrarlos en el sistema son:

Page 24: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200524 de 141

Campos Relacionados a este tipo de Publicaciones:

Nombre del Campo en la Tabla: Nombre Campo publica2 nomina Uaa

Autor Autor1 Volumen volumen Nombre del Autor nombre_comp Colaboradores coautores Numero de Publicación numero Titulo de la Publicación Titulo Paginas de la Publicación paginas Revista a que pertenece revista Año de la Publicación Anio Mes de la Publicación Mes Arbitraje en la Publicación arbitraje Subsector nomdiv Campo experimental UaaLugar de la Publicación Lugar_publ Institución Responsable inst_respon Sistema Producto sistprod Usuario usuario Especialidad especiali Fuente INIFAP importe_inifap Fuente otra importe_otros Otros Financiamientos importe_var Tiraje Publicación Tiraje

Nota: tpublicación = “Artículos” Inserta un consecutivo de acuerdo al tipo de Publicación de que se trate.

Page 25: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200525 de 141

Descripción de la aplicación que registra los Tesis:

Programa: act_tesis.cgi El programa fuente lo encuentra en los anexos de este documento.

En esta aplicación nos permite registrar las Tesis que realizaron los investigadores del INIFAP, para la obtención de sus grados académicos en las diferentes Universidades tanto de México como del extranjero.

Page 26: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200526 de 141

Los campos solicitados que nos permiten clasificarlos y registrarlos en el sistema son:

Nombre del Campo en la Tabla: Nombre Campo publica2 nomina uaa

Autor autor1 Nombre del Autor nombre_comp Colaboradores coautores Titulo de la Tesis Titulo Paginas de la Publicación paginas Grado que Obtuvo Grado_academico Año de la Publicación Anio Mes de la Publicación Mes Universidad Universidad Facultad facultad Campo experimental Uaa Lugar de la Publicación lugar_publ Institución Responsable inst_respon Sistema Producto sistprod Especialidad especiali Subsector nomdiv

Nota: tpublicación = “Tesis” Inserta un consecutivo de acuerdo al tipo de Publicación de que se trate.

Page 27: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200527 de 141

Descripción de la aplicación que registra los Tesis Dirigida o Asesorada:

Programa: act_tesis_dir.cgi El programa fuente lo encuentra en los anexos de este documento.

En esta aplicación nos permite registrar las Tesis que asesoraron los investigadores del INIFAP, a los alumnos en las diferentes Universidades.

Page 28: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200528 de 141

Campos relacionados a este tipo de publicaciones:

Nombre del Campo en la Tabla: Nombre Campo publica2 nomina uaa

Director/Asesor autor1 Nombre del Asesor nombre_comp Tesistas coautores Titulo de la Tesis Titulo Paginas de la Publicación paginas Grado que Obtuvo Grado_academic

o

Año de la Publicación Anio Mes de la Publicación Mes Universidad Universidad Facultad facultad Campo experimental Uaa Lugar de la Publicación lugar_publ Institución Responsable inst_respon Sistema Producto sistprod Especialidad especiali Subsector nomdiv

Nota: tpublicación = “Tesis_dir” Inserta un consecutivo de acuerdo al tipo de Publicación de que se trate.

Page 29: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200529 de 141

Descripción de la aplicación que registra los Libros, Boletines, Memorias, Folletos, Videos,:

Programa: act_libros.cgi El programa fuente lo encuentra en los anexos de este documento.

En esta aplicación nos permite registrar las Tesis que realizaron los investigadores del INIFAP, para la obtención de sus grados académicos en las diferentes Universidades tanto de México como del extranjero.

Page 30: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200530 de 141

Campos relacionados a este tipo de publicaciones:

Nombre del Campo en la Tabla: Nombre Campo publica2 nomina uaa

Autor autor1 Nombre del Autor nombre_comp Coautor coautores Numero de Publicación numero Titulo del Libro Titulo Paginas de la Publicación paginas Nombre de la serie Nom_seri_colec Año de la Publicación Anio Mes de la Publicación Mes Numero de Edición edicion Arbitraje arbitraje Editorial editorial Lugar de la Publicación lugar_publ Usuario Usr Sistema Producto sistprod Especialidad especiali Subsector nomdiv Campo experimental uaa Fuente Inifap importe_inifap Fuente Otra importe_otros Otros Financiamientos importe_var Tiraje Tiraje

Nota: tpublicación = “Libro” Inserta un consecutivo de acuerdo al tipo de Publicación de que se trate.

Page 31: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200531 de 141

Requerimientos Tecnicos

Page 32: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200532 de 141

Requerimientos del sistema:

Servidor de datos:

Procesador Intel Pentium IV de al menos 3.0 GHz.

Memoria RAM de 1 GB. Sistema Operativo Linux AS 3.1 de Red Hat. Disco duro de al menos 70 GB.

Software: Perl Release 5.8.6 http://www.perl.org/ Postgresql ver 8.0.1 http://www.postgresql.org/

Módulos de PERL requeridos: Modulo Descripción CGI.pm-2.80.tar Librería para crear con PERL 5, CGI scrips CGI-SecureState-0.30.tar Librería para encriptar la información a transferir DBI-1.20.tar Librería para crear la interface con la Base de Datos Digest-MD5-2.20.tar Librería qu te permite usar el RSA Data Security HTML-Table-1.17.tar Librería para crear tablas en html IO-File-Multi-1.02.tar Librería para crear la interface de io de archivos Number-Format-1.42.tar Librería para formatear numeros (intercalar comas) PlRPC-0.2016.tar Storable-1.0.13.tar Time-modules-2003.0211.tar Libreria para obtener la hora y fecha del servidor

Page 33: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200533 de 141

Resumen

Page 34: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200534 de 141

En este momento contamos con un numero de 1,170 publicaciones a texto completo numero que es incrementado al registrarse cada publicación que se genera en el INIFAP y que pone a disposición de los productores. En esta estadistica nos muestra la distribución de publicaciones por region y por subsector Agrícola, Pecuario, Forestal y Multisecorial.

Región Agrícola Pecuario Forestal Multisectorial Total NOROESTE 44 19 10 14 87 NORTE CENTRO 64 46 21 11 142 NORESTE 69 7 9 2 87

PACIFICO CENTRO 12 8 2 1 23

CENTRO 535 14 17 11 577 PACIFICO SUR 23 3 7 33 GOLFO CENTRO 26 21 4 51 SURESTE 9 4 2 1 16

OFICINAS CENTRALES 8 3 11

MICROBIOLOGIA 2 2 RASPA 7 2 3 12 COMEF 5 104 109 CENAPROS 18 1 1 20 TOTALES 820 124 179 47 1170

Y en este momento se cuenta con un promedio de 490 vicitas al día .

Page 35: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200535 de 141

Bibliografía:

Titlo: Perl in NUTSHELL Author: Ellen Siever Spainbour & Natban Patwardban O’REILLY.

Comprehensive Perl Archive Network

2005-03-21 online since 1995-10-26 772 MB 271 mirrors 4249 authors 7789 modules http://www.cpan.org

Title: PostgreSQL: Introduction and Concepts Author: Bruce Momjian Format: Paperback Available online

Page 36: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200536 de 141

Page 37: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200537 de 141

ANEXO A (Modulos de Perl)

Page 38: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200538 de 141

CGI.pm-2.80.tar This is CGI.pm, an easy-to-use Perl5 library for writing World Wide Web CGI scripts. HOW DO I INSTALL IT? To install this module, cd to the directory that contains this README file and type the following: perl Makefile.PL make make test make install If this doesn't work for you, try: cp CGI.pm /usr/local/lib/perl5 If you have trouble installing CGI.pm because you have insufficient access privileges to add to the perl library directory, you can still use CGI.pm. See the docs for details. WHAT SYSTEMS DOES IT WORK WITH? This module works with NT, Windows, Macintosh, OS/2 and VMS servers, although it hasn't been tested as extensively as it should be. See the docs for notes on your particular platform. WHERE IS THE DOCUMENTATION? You'll find very verbose documentation in the file cgi_docs.html, located in the top level directory. Terser documentation is found in POD (plain old documentation) form in CGI.pm itself. When you install CGI, the MakeMaker program will automatically install the manual pages for you (on Unix systems, type "man CGI"). WHERE ARE THE EXAMPLES? A collection of examples demonstrating various CGI features and techniques are in the directory "examples". Many more examples of CGI scripts of various degrees of complexity can be found at: http://www.genome.wi.mit.edu/WWW/examples/Ch9/ WHERE IS THE ONLINE DOCUMENTATION? Online documentation of for CGI.pm, and notifications of new versions

Page 39: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200539 de 141

can be found at: http://stein.cshl.org/WWW/software/CGI/ A copy of the HTML documentation can be found in the package in the file cgi_docs.html or in the standard POD pages. WHERE CAN I LEARN MORE? I have written a book about CGI.pm called "The Official Guide to Programming with CGI.pm" which was published by John Wiley & Sons in May 1998. If you like CGI.pm, you'll love this book. IMPORTANT NOTES: Version 2.69 emits XHTML by default. To get the old behavior, use the -no_xhtml pragma. Versions 2.44-2.46 introduce two API changes that will affect users of previous versions: 1) The accept() function has been renamed Accept() to avoid conflicting with Perl's built-in function of the same name. 2) The sub() function has been renamed Sub() for similar reasons. My apologies for these changes, but they were necessary in order for CGI to pass the perl 5.005 regression tests! Have fun, and let me know how it turns out! Lincoln D. Stein [email protected]

Page 40: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200540 de 141

CGI-SecureState-0.30.tar

The source files in this distribution are Copyright (C) 2000-2002 Peter Behroozi and are licensed for use under the same terms as Perl itself. CGI::SecureState NOTE: If you are upgrading from the 0.2x series, you must read the documentation or risk fire, disaster, or sudden death from upper management as they cremate you when all your scripts have nasty warnings at the top. Maybe they are a little more relaxed, but I highly doubt it. CGI::SecureState was written to resemble CGI::Persistent as closely as possible. To install CGI::SecureState, all you should have to do is the standard % perl Makefile.PL % make % make install Then test the installation: % make test and everything should work. This assumes that you have the following: Long file names (at least 27 chars): needed to ensure remote ticket authenticity. Crypt::Blowfish: it couldn't be called "Secure" without. At some point in the future (as better algorithms become available), this requirement may be changed. Tested with versions 2.06, 2.09. Digest::SHA1: for super-strong (160 bit) hashing of data. It is used in key generation and filename generation. Tested with versions 1.03, 2.01. CGI: it couldn't be called "CGI" without. Should not be a problem as it comes standard with Perl 5.004 and above. Tested with versions 2.56, 2.74, 2.79. Fcntl: for file flags that are portable (like LOCK_SH and SEEK_SET). Comes with Perl. Tested with version 1.03. File::Spec: for concatenating directories and filenames in a portable way. Comes with Perl. Tested with version 0.82. Perl: Hmmm. Tested with v5.6.[01]. This module has NOT been tested with 5.005 or below. Use at your own risk. There may be several bugs induced by lower versions of Perl, a few of which may include: failure to compile, failure to

Page 41: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200541 de 141

run, or the mysterious absence of your favorite pair of lemming slippers. The author is exempt from wrongdoing and liability in case you decide to use CGI::SecureState with a version of Perl less than 5.6.0.

Page 42: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200542 de 141

DBI-1.20.tar

DBI - The Perl Database Interface by Tim Bunce. Copyright (c) 1994-2000 Tim Bunce England. See COPYRIGHT section in DBI.pm for usage and distribution rights. RECENT NEWS: The DBI comes bundled with DBI::Shell, DBD::ADO, DBD::Proxy and DBI::ProxyServer modules. Those are still alpha releases. Note that recent additions to the DBI spec (marked *NEW*) may take a little while to be fully supported by individual drivers. QUICK START GUIDE: The DBI requires one or more 'driver' modules to talk to databases. Check that a DBD::* module exists for the database you wish to use. Read the DBI README then Build/test/install the DBI by doing perl Makefile.PL make make test make install Then delete the source directory tree since it's no longer needed. Use the 'perldoc DBI' command to read the DBI documentation. Fetch the DBD::* driver module you wish to use and unpack it. It is often important to read the driver README file carefully. Generally the build/test/install/delete sequence is the sameas for the DBI module. The DBI.pm file contains the DBI specification and other documentation. PLEASE READ IT. It'll save you asking questions on the mailing list which you will be told are already answered in the documentation. For more information and to keep informed about progress you can join the a mailing list via mailto:[email protected] Much useful information and online archives of the mailing lists can be found at http://dbi.perl.org/ See also http://www.perl.com/CPAN/ BEFORE BUILDING, TESTING AND INSTALLING this you will need to:

Page 43: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200543 de 141

Build, test and install Perl 5 (preferably 5.004_04 or later). It is very important to test it and actually install it! (You can use "Configure -Dprefix=..." to build a private copy.) BUILDING perl Makefile.PL make make test make test TEST_VERBOSE=1 (if any of the t/* tests fail) make install (if the tests look okay) IF YOU HAVE PROBLEMS: First, carefully read the notes at the bottom of this file. If you can't fix it your self please post details to [email protected]. You can CC them to me at [email protected] BUT please DON'T send them just to me (I'm likely to ignore it). Please include: 1. A complete log of a complete build, e.g.: perl Makefile.PL (do a make realclean first) make make test make test TEST_VERBOSE=1 (if any of the t/* tests fail) 2. The output of perl -V 3. If you get a core dump, try to include a stack trace from it. (Try installing the Devel::CoreStack module to get a stack trace.) If the stack trace mentions XS_DynaLoader_dl_load_file then rerun make test after setting the environment variable PERL_DL_DEBUG to 2. 4. If your installation succeeds, but your script does not behave as you expect, the problem is possibly in your script. Before sending to dbi-users, try writing a small, easy to use test case to reproduce your problem. Also, use the DBI->trace method to trace your database calls. Please don't post problems to comp.lang.perl.* or perl5-porters. This software is supported via the dbi-users mailing list. For more information and to keep informed about progress you can join the mailing list via mailto:[email protected] (please note that I do not run or manage the mailing list). It is important to check that you are using the latest version before posting. If you're not then I'm *very* likely to simply say "upgrade to the latest". You would do yourself a favour by upgrading beforehand.

Page 44: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200544 de 141

Please remember that I'm _very_ busy. Try to help yourself first, then try to help me help you by following these guidelines carefully. (Note specifically that I'm unlikely to answer a question that's answered clearly in the on-line documentation.) Regards, Tim Bunce. ============================================================= --- If you get an error like "fatal: relocation error: symbol not found: ..." do not use GNU as or GNU ld on Solaris. Delete or rename them, they are just bad news. In the words of John D Groenveld <[email protected]>: Run, dont walk, to your console and 'mv /opt/gnu/bin/as /opt/gnu/bin/gas; mv /opt/gnu/bin/ld /opt/gnu/bin/gld'. You can add -v to the gcc command in the Makefile to see what GCC is using. --- If you get compiler warnings like "value computed is not used" and "unused variable" you can ignore them. --- For perl5.005 onwards: If you get "`thr' undeclared" compiler error, you'll need to add "dTHR;" to the top of the function that has the error. --- If you get compiler errors refering to Perl's own header files (.../CORE/*.h) or the compiler complains about bad options etc then there is something wrong with your installation. It is best to use a Perl that was built on the system you are trying to use and it's also important to use the same compiler that was used to build the Perl you are using. End.

Page 45: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200545 de 141

Digest-MD5-2.20.tar

The Digest::MD5 module allows you to use the RSA Data Security Inc. MD5 Message Digest algorithm from within Perl programs. The algorithm takes as input a message of arbitrary length and produces as output a 128-bit "fingerprint" or "message digest" of the input. MD5 is described in RFC 1321. You will need perl version 5.004 or better to install this module. Copyright 1998-2002 Gisle Aas. Copyright 1995-1996 Neil Winton. Copyright 1990-1992 RSA Data Security, Inc. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Page 46: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200546 de 141

HTML-Table-1.17.tar

NAME HTML::Table - Create HTML tables using simple interface INSTALL In order to install and use this package you will need Perl version 5.002 or better. Installation as usual: perl Makefile.PL make make test make install DESCRIPTION HTML::Table is used to generate HTML tables for CGI scripts. By using the methods provided fairly complex tables can be created, manipulated, then printed from Perl scripts. The module also greatly simplifies creating tables within table from Perl. It is possible to create an entire table using the methods provided and never use an HTML tag. HTML::Table also allows for creating dynamically sized tables via its addRow and addCol methods. These methods automatically resize the table if passed more cell values than will fit in the current table grid. Methods are provided for nearly all valid table, row, and cell tags specified for HTML 3.0. HISTORY This module was originally created in 1997 by Stacy Lacy and whose last version was uploaded to CPAN in 1998. The module was adopted in July 2000 by Anthony Peacock in order to distribute a revised version. This adoption took place without Stacy Lacy's explicit consent as it proved impossible to contact them at the time. Although explicit consent was not obtained at the time, there was some evidence that Stacy Lacy was looking for somebody to adopt the module in 1998. AUTHOR Anthony Peacock, [email protected] Stacy Lacy (Original author) COPYRIGHT Copyright (c) 1998-2000 Anthony Peacock, CHIME. Copyright (c) 1997 Stacy Lacy This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Page 47: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200547 de 141

IO-File-Multi-1.02.tar

This is the README file for IO::File::Multi (v 1.02), a simple module to handle printing to multiple (output) filehandles, with single print() or printf() calls. Requires: IO::File (and it's requirements) Installation: You should know the routine by now... perl Makefile.PL make test make install If for some reason MakeMaker is broken or you have a personal problem with the make command (seek help), you can just copy Multi.pm into your perl site directory and everything should be okay. Author: Nem W Schlecht ([email protected]) Multi.pm - Copyright (c) 1996 by Nem W Schlecht. All rights reserved. This is free software; you can distribute it and/or modify it under the same terms as Perl itself. Simple example: #!/local/bin/perl use IO::File::Multi; $mh1 = new IO::File::Multi; $mh1->open(">-"); # print to stdout $mh1->open("| lpr"); # print to hard-copy printer $mh1->open(">>log"); # append to log file $mh1->print("This line goes to multiple places!\n"); $mh1->printf("This is just a number: %2.2f\n", 12.535632); $mh1->close(); # close all filehandles

Page 48: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200548 de 141

Number-Format-1.42.tar

Number::Format - Convert numbers to strings with pretty formatting Version: 1.42 WHAT IS IT Number::Format is a library for formatting numbers. Functions are provided for converting numbers to strings in a variety of ways, and to convert strings that contain numbers back into numeric form. The output formats may include thousands separators - characters inserted between each group of three characters counting right to left from the decimal point. The characters used for the decimal point and the thousands separator come from the locale information or can be specified by the user. Also of note is the format_picture command which converts a number into a string using a "picture" string that you provide. This is similar to the PRINT USING statement that some versions of BASIC have. BUILDING/INSTALLING Perl version 5.003 or higher is required. This package is set up to configure and build like a typical Perl extension. To build: perl Makefile.PL make && make test && make install make install NOTE: You may need super-user access to install. PROBLEMS/BUG REPORTS Please send any reports of problems or bugs to [email protected]. MAILING LIST We have an electronic mailing list for announcements of new releases of this module. To join send mail to [email protected] with the command in the body of the message: subscribe number-format-announce CREDITS AND LICENSES This package is copyright 1997-8 by William R. Ward <[email protected]> and may be distributed under terms of the Artistic License used to cover Perl itself. See the file Artistic in the distribution of Perl 5.002 or

Page 49: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200549 de 141

later for details of copy and distribution terms. CHANGE HISTORY This is version 1.42: - Fixed bug in format_picture that was causing subsequent calls to return the previous result and the current one concatenated together. This is actually due to a bug in Perl, but a workaround was implemented. To avoid this problem in your own code, don't use code like this: "my VARIABLE = EXPRESSION if CONDITION" because if the CONDITION is false, the previous value of VARIABLE will still be there, even if it had gone out of scope! This bug was pointed out by Buddy Burden <[email protected]> on 21 Mar 1999, Frank Tobin <[email protected]> on 11 Jun 1999, Mark William Rostron <[email protected]> on 12 Dec 1999, and Ben Tilly <[email protected]> on 16 May 2000. Fix suggested by Buddy Burden, Mark William Rostron, and Ben Tilly. - Fixed bug in round() that was causing e.g. round(1.005, 2) to return 1 instead of 1.01. This is due to the vagaries of floating point arithmetic. I changed .5 to .5000001 in the rounding formula and added a check for this in the test suite. That seems to fix it but please let me know if you experience any weird results. This bug was reported by Kentaro Takatomi <[email protected]> on 25 May 1999. - Fixed several points in the code where 'use of uninitialized value' warnings were generated. Reported by Frank Tobin <[email protected]> on 11 Jun 1999. - In format_picture, replaced the use of $_ with a locally scoped variable ($char). This should reduce interference between this routine and any use of $_ by the calling program. Bug report and suggested fix by Mark William Rostron <[email protected]> on 29 Dec 1999. version 1.41: - Fix 'undefined value' warnings in format_picture - Fix bug in format_picture to show decimal point if and only if it is present in the picture string (bug reported by Michael Scoltock <[email protected]>) - Fix bug in format_price that would suppress currency symbol if no decimal digits (bug reported by Michael Scoltock <[email protected]>) version 1.40: - Add new function format_bytes() to display '1K' for '1024', etc. (suggested by Curt Tilmes <[email protected]>) - Fix bugs in round() and format_picture() when dealing with negative

Page 50: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200550 de 141

numbers. NOTE: format_picture() now includes at least one extra space in its output for positive numbers. This may present a minor incompatibility issue in some obscure cases. - Minor documentation updates. version 1.30: - Fix several major bugs, including the POSIX-not-required issue, as well as better support for negative values. - Add setting for default size of decimal area so you don't have to specify the number of digits if it's other than 2. - Add setting and function to display negative numbers in different formats. - Add setting to force trailing 0's in the decimal portion to fill out the number of digits required. - Fix problem where 0's inside format_picture()'s output were being replaced with spaces. - Add 0 before decimal point if number is between -1 and 1. version 1.20: - Make POSIX no longer required (users on MicroSoft systems sometimes don't have it); uses US defaults if no POSIX.pm found. - Add new optional third argument to format_number() to add trailing zeroes. version 1.12: - Remove 'use of undefined value' warnings when used with perl -w version 1.10: - Add object oriented interface and support for POSIX locales. - NOTE: Some aspects of the API have changed. Please reread the documentation carefully if you used 1.0 previously!!! Initial version 1.0: - Limited release beta version.

Page 51: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200551 de 141

PlRPC-0.2016.tar

NAME RPC::PlServer - Perl extension for writing PlRPC servers SYNOPSIS # Create a subclass of RPC::PlServer use RPC::PlServer; package MyServer; $MyServer::VERSION = '0.01'; @MyServer::ISA = qw(RPC::PlServer); # Overwrite the Run() method to handle a single connection sub Run { my $self = shift; my $socket = $self->{'socket'}; } # Create an instance of the MyServer class package main; my $server = MyServer->new({'localport' => '1234'}, \@ARGV); # Bind the server to its port to make it actually running $server->Bind(); DESCRIPTION PlRPC (Perl RPC) is a package for implementing servers and clients that are written in Perl entirely. The name is borrowed from Sun's RPC (Remote Procedure Call), but it could as well be RMI like Java's "Remote Method Interface), because PlRPC gives you the complete power of Perl's OO framework in a very simple manner. RPC::PlServer is the package used on the server side, and you guess what RPC::PlClient is for. Both share the package RPC::PlServer::Comm for communication purposes. See the PlRPC::Client(3) manpage and the RPC::PlServer::Comm manpage for these parts. PlRPC works by defining a set of methods that may be executed by the client. For example, the server might offer a method "multiply" to the client. Now the clients method call @result = $client->multiply($a, $b); will be immediately mapped to a method call @result = $server->multiply($a, $b);

Page 52: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200552 de 141

on the server. The arguments and results will be transferred to or from the server automagically. (This magic has a name in Perl: It's the Storable module, my thanks to Raphael Manfredi for this excellent package.) Simple, eh? :-) The RPC::PlServer and RPC::PlClient are abstract servers and clients: You have to derive your own classes from it. Additional options The RPC::PlServer inherits all of Net::Daemon's options and attributes and adds the following: *cipher* The attribute value is an instance of Crypt::DES, Crypt::IDEA or any other class with the same API for block encryption. If you supply such an attribute, the traffic between client and server will be encrypted using this option. *maxmessage* (--maxmessage=size) The size of messages exchanged between client and server is restricted, in order to omit denial of service attacks. By default the limit is 65536 bytes. users This is an attribute of the client object used for Permit/Deny rules in the config file. It's value is an array ref of user names that are allowed to connect from the given client. See the example config file below. the section on "CONFIGURATION FILE". Error Handling Error handling is simple with the RPC package, because it is based on Perl exceptions completely. Thus your typical code looks like this: eval { # Do something here. Don't care for errors. ... }; if ($@) { # An error occurred. ... } Server Constructors my $server = RPC::PlServer(\%options, \@args);

Page 53: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200553 de 141

(Class method) This constructor is immediately inherited from the Net::Daemon package. See the Net::Daemon(3) manpage for details. Access Control $ok = $self->AcceptApplication($app); $ok = $self->AcceptVersion($version); $ok = $self->AcceptUser($user, $password); The RPC::PlServer package has a very detailed access control scheme: First of all it inherits Net::Daemon's host based access control. It adds version control and user authorization. To achieve that, the method *Accept* from Net::Daemon is split into three methods, *AcceptApplication*, *AcceptVersion* and *AcceptUser*, each of them returning TRUE or FALSE. The client receives the arguments as the attributes *application*, *version*, *user* and *password*. A client is accepted only if all of the above methods are returning TRUE. The default implementations are as follows: The AcceptApplication method returns TRUE, if $self is a subclass of $app. The AcceptVersion method returns TRUE, if the requested version is less or equal to ${$class}::VERSION, $self being an instance of $class. Whether a user is permitted to connect depends on the client configuration. See the section on "CONFIGURATION FILE" below for examples. Method based access control Giving a client the ability to invoke arbitrary methods can be a terrible security hole. Thus the server has a *methods* attribute. This is a hash ref of class names as keys, the values being hash refs again with method names as the keys. That is, if your hash looks as follows: $self->{'methods'} = { 'CalcServer' => { 'NewHandle' => 1, 'CallMethod' => 1 }, 'Calculator' => { 'new' => 1, 'multiply' => 1, 'add' => 1, 'divide' => 1, 'subtract' => 1 } };

Page 54: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200554 de 141

then the client may use the CalcServer's *NewHandle* method to create objects, but only via the permitted constructor Calculator->new. Once a Calculator object is created, the server may invoke the methods multiply, add, divide and subtract. CONFIGURATION FILE The server config file is inherited from Net::Daemon. It adds the *users* and *cipher* attribute to the client list. Thus a typical config file might look as follows: # Load external modules; this is not required unless you use # the chroot() option. #require DBD::mysql; #require DBD::CSV; # Create keys my $myhost_key = Crypt::IDEA->new('83fbd23390ade239'); my $bob_key = Crypt::IDEA->new('be39893df23f98a2'); { # 'chroot' => '/var/dbiproxy', 'facility' => 'daemon', 'pidfile' => '/var/dbiproxy/dbiproxy.pid', 'user' => 'nobody', 'group' => 'nobody', 'localport' => '1003', 'mode' => 'fork', # Access control 'clients' => [ # Accept the local LAN (192.168.1.*) { 'mask' => '^192\.168\.1\.\d+$', 'accept' => 1, 'users' => [ 'bob', 'jim' ], 'cipher' => $myhost_key }, # Accept myhost.company.com { 'mask' => '^myhost\.company\.com$', 'accept' => 1, 'users' => [ { 'name' => 'bob', 'cipher' => $bob_key } ] }, # Deny everything else { 'mask' => '.*',

Page 55: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200555 de 141

'accept' => 0 } ] } Things you should note: The user list of 192.168.1.* contains scalar values, but the user list of myhost.company.com contains hash refs: This is required, because the user configuration is more specific for user based encryption. EXAMPLE Enough wasted time, spread the example, not the word. :-) Let's write a simple server, say a server for MD5 digests. The server uses the external package MD5, but the client doesn't need to install the package. the MD5(3) manpage. We present the server source here, the client is part of the RPC::PlClient man page. See the RPC::PlClient(3) manpage. #!/usr/bin/perl -wT # Note the -T switch! This is always recommended for Perl servers. use strict; # Always a good choice. require RPC::PlServer; require MD5; package MD5_Server; # Clients need to request application # "MD5_Server" $MD5_Server::VERSION = '1.0'; # Clients will be refused, if they # request version 1.1 @MD5_Server::ISA = qw(RPC::PlServer); eval { # Server options below can be overwritten in the config file or # on the command line. my $server = MD5_Server->new({ 'pidfile' => '/var/run/md5serv.pid', 'configfile' => '/etc/md5serv.conf', 'facility' => 'daemon', # Default 'user' => 'nobody', 'group' => 'nobody', 'localport' => 2000, 'logfile' => 0, # Use syslog 'mode' => 'fork', # Recommended for Unix 'methods' => { 'MD5_Server' => { 'ClientObject' => 1, 'CallMethod' => 1,

Page 56: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200556 de 141

'NewHandle' => 1 }, 'MD5' => { 'new' => 1, 'add' => 1, 'hexdigest' => 1 }, } }); $server->Bind(); }; SECURITY It has to be said: PlRPC based servers are a potential security problem! I did my best to avoid security problems, but it is more than likely, that I missed something. Security was a design goal, but not *the* design goal. (A well known problem ...) I highly recommend the following design principles: Protection against "trusted" users perlsec Read the perl security FAQ (`perldoc perlsec') and use the `-T' switch. taintperl Use the `-T' switch. I mean it! Verify data Never untaint strings withouth verification, better verify twice. For example the *CallMethod* function first checks, whether an object handle is valid before coercing a method on it. Be restrictive Think twice, before you give a client access to a method. perlsec And just in case I forgot it: Read the `perlsec' man page. :-) Protection against untrusted users Host based authorization PlRPC has a builtin host based authorization scheme; use it! See the section on "/CONFIGURATION FILE". User based authorization

Page 57: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200557 de 141

PlRPC has a builtin user based authorization scheme; use it! See the section on "/CONFIGURATION FILE". Encryption Using encryption with PlRPC is extremely easy. There is absolutely no reason for communicating unencrypted with the clients. Even more: I recommend two phase encryption: The first phase is the login phase, where to use a host based key. As soon as the user has authorized, you should switch to a user based key. See the DBI::ProxyServer for an example. AUTHOR AND COPYRIGHT The PlRPC-modules are Copyright (C) 1998, Jochen Wiedmann Am Eisteich 9 72555 Metzingen Germany Phone: +49 7123 14887 Email: [email protected] All rights reserved. You may distribute this package under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. SEE ALSO the RPC::PlClient(3) manpage, the RPC::PlServer::Comm(3) manpage, the Net::Daemon(3) manpage, the Net::Daemon::Log(3) manpage, the Storable(3) manpage, the Sys::Syslog(3) manpage, the Win32::EventLog(3) manpage See the DBI::ProxyServer(3) manpage for an example application.

Page 58: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200558 de 141

Storable-1.0.13.tar

Storable 1.0 Copyright (c) 1995-2000, Raphael Manfredi ------------------------------------------------------------------------ This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Perl 5 License schemes for more details. ------------------------------------------------------------------------ +============================================================ | Storable is distributed as a module, but is also part of the official | Perl core distribution. Maintenance is still done by the Author, | whilst the perl5-porters ensure that no change to the Perl internals | can break the version of Storable distributed with it. +============================================================ The Storable extension brings persistency to your data. You may recursively store to disk any data structure, no matter how complex and circular it is, provided it contains only SCALAR, ARRAY, HASH (possibly tied) and references (possibly blessed) to those items. At a later stage, or in another program, you may retrieve data from the stored file and recreate the same hiearchy in memory. If you had blessed references, the retrieved references are blessed into the same package, so you must make sure you have access to the same perl class as the one used to create the relevant objects. There is also a dclone() routine which performs an optimized mirroring of any data structure, preserving its topology. Objects (blessed references) may also redefine the way storage and retrieval is performed, and/or what deep cloning should do on those objects. To compile this extension, run: perl Makefile.PL [PERL_SRC=...where you put perl sources...] make make install There is an embeded POD manual page in Storable.pm.

Page 59: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200559 de 141

Raphael Manfredi <[email protected]> ------------------------------------------------------------------------ Thanks to (in chronological order): Jarkko Hietaniemi <[email protected]> Ulrich Pfeifer <[email protected]> Benjamin A. Holzman <[email protected]> Andrew Ford <[email protected]> Gisle Aas <[email protected]> Jeff Gresham <[email protected]> Murray Nesbitt <[email protected]> Albert N. Micheev <[email protected]> Marc Lehmann <[email protected]> Justin Banks <[email protected]> Jarkko Hietaniemi <[email protected]> (AGAIN, as perl 5.7.0 Pumpking!) Salvador Ortiz Garcia <[email protected]> Dominic Dunlop <[email protected]> Erik Haugan <[email protected]> for their contributions. There is a Japanese translation of this man page available at http://member.nifty.ne.jp/hippo2000/perltips/storable.htm, courtesy of Kawai, Takanori <[email protected]>. ------------------------------------------------------------------------

Page 60: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200560 de 141

Time-modules-2003.0211.tar

This package contains the following perl5 modules: Time::CTime.pm ctime, strftime, and asctime Time::JulianDay.pm Julian Day conversions Time::ParseDate.pm Reverses strftime and also understands relative times Time::Timezone.pm Time::DaysInMonth.pm To install these modules, cd to the directory that this README file is in and type the following: perl Makefile.PL make make test make install Documentation for these modules is part of the files themselves using the pod (Plain Old Documentation) format. This documentation will be installed as part of the installation process.

Podrán ser bajados de la pagina:

http://search.cpan.org/ Estructura de las tablas empleadas

Diagrama de Entidades y Asociaciones. Guía de operación y mantenimiento.

Page 61: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200561 de 141

ANEXO B (Programas fuente)

Page 62: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200562 de 141

Infoteca_html.pm (Libreria de funciones comunes)

use CGI qw/:standard :html3/; use DBI; use diagnostics -verbose; use Number::Format; use CGI::Carp('fatalsToBrowser'); use CGI param,header,p; use HTML::Table; use Time::localtime; use IO::File; use Mail::Sendmail; use strsql; use POSIX; use IO::File; use Net::FTP; use vars qw($n $imgAct $imgReg $imgInf $return_url $s_mail $server $dominio $dbh1 $dbh); # Regreso URL link usado para mensages de OK o de error $dominio = ".inifap.gob.mx"; $server = "intranet".$dominio; $s_mail = "inifap2".$dominio; $return_url = "https://".$server."/cgi-bin/infoteca/act_citas.cgi"; $return_url1 = "https://".$server."/cgi-bin/infoteca/publica.cgi"; $n="\n"; $imgAct=<<EOT; <img src="../../infoteca/barras/actualizaciones.jpg"> EOT $imgReg=<<EOT; <img src="../../infoteca/barras/registro_publi.jpg"> EOT $imgInf=<<EOT; <img src="../../infoteca/barras/imagen.jpg"> EOT #================================================== # Bases de Datos #================================================== $dbh0 = DBI->connect("dbi:Pg:dbname=pulsa","postgres","mysql") or die \ "Imposible conectar a la base de datos pulsa: $DBI::errstr"; $dbh = DBI->connect("dbi:Pg:dbname=infoteca","postgres","mysql") or die \ "Imposible conectar a la base de datos infoteca: $DBI::errstr"; $dbh1 = DBI->connect("dbi:Pg:dbname=nomina","postgres","mysql") or die \

Page 63: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200563 de 141

"Imposible conectar a la base de datos nomina: $DBI::errstr"; sub act_not { print header(-expires=>'now'), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html(),-link=>'maroon', -vlink=>'maroon');

print "<html><body><center><font size=+1 color=\"00CC00\"><b>Registro NO ACTUALIZADO </b></font><br><br><font size=+1 color=\"007777\"><b> Espere un momento ... </b></font></center>\n"; print "<p><center><b><meta HTTP-EQUIV=\"refresh\" content=\"3; URL=$return_url?query_tex=$qry&region=$xreg\"</b></center></p></body></html>\n";

print end_html(); exit; } sub regresar { $qry =~ s/ /%20/ig; $xreg =~ s/ /%20/ig; print header(-expires=>'now'), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html(),-link=>'maroon', -vlink=>'maroon');

print "<html><body><center><font size=+1 color=\"00CC00\"><b> $_[0] </b></font></font><br><br><font size=+1 color=\"007777\"><b> Espere un momento ... </b></font></center>\n"; #print "$qry "; print "<p><center><b><meta HTTP-EQUIV=\"refresh\" content=\"3; URL=$return_url?region=$xreg&query_tex=$qry&forma=$forma&xframe=0\"</b></center></p></body></html>\n"; print end_html(); exit; } sub insert_ok { my ($link); $xreg =~ s/ /%20/ig; $link = $return_url1.'?xreg='.$xreg.'&nc='.$nc.'$tp='.$tp; print header(-expires=>'now'), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html(),-link=>'maroon', -vlink=>'maroon');

print "<html><body><center><font size=+1 color=\"00CC00\"><b> Información Registrada Satisfactoriamente </b></font></font><br><br><font size=+1 color=\"007777\"><b> Espere un momento ... </b></font></center>\n"; #print "$xreg"; print "<p><center><b><meta HTTP-EQUIV=\"refresh\" content=\"3; URL=$link\"</b></center></p></body></html>\n"; print end_html(); exit; } sub cabeza_html { my ($titulo,$linea,$ret); $titulo=$_[0];

Page 64: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200564 de 141

$JSCRIPT=$_[1]; if (-f "/var/www/cgi-bin/comun/cabeza2.html") { open (IN,"/var/www/cgi-bin/comun/cabeza2.html"); while ($linea=<IN>) { $linea =~ s/\%tit\%/$titulo/; $ret.=$linea; } close(IN); } else { $ret = "/images/backgrnd.gif"; } return $ret; } sub cola_html { my ($linea,$ret,$link,$texto); ($link,$texto)=@_; if (-f "/var/www/cgi-bin/comun/pie.html") { open (IN,"/var/www/cgi-bin/comun/pie.html"); while ($linea=<IN>) { $linea =~ s/\%link\%/$link/; $linea =~ s/\%texto\%/$texto/; $ret.=$linea } close(IN); } else { $ret="</BODY></HTML>"; } return $ret; } sub registro { my ($ip,$quien_soy,$uaa,$sql0,$sth0); $ip = $_[0]; $quien_soy = $_[1]; $uaa = $_[2]; # Definimos la sentencia SQL $sql0 = "Insert into registro values (\'$ip\',\'$quien_soy\',\'$uaa\')"; # Preparamos y ejecutamos la sentencia. $sth0 = $dbh->prepare($sql0); $sth0->execute; } sub quien { my ($ip,$sql,$sth); $ip = $_[0]; # Definimos la sentencia SQL $sql = "SELECT titular FROM i_p WHERE i_p.ip LIKE \'$ip%%\'"; # Preparamos y ejecutamos la sentencia.

Page 65: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200565 de 141

$sth = $dbh->prepare($sql0); $sth->execute; # Almacenamos el resultado de la sentencia en la varible quien_soy $quien_soy = $sth->fetchrow_array(); return $quien_soy; } sub catalogo { my ($tabla, $campo, $numcampo, @salida); ($tabla,$campo) = @_; $numcampo = 0; $salida = ['']; $sql0 = "SELECT $campo FROM $tabla order by $campo"; $sth0 = $dbh0->prepare($sql0); $sth0->execute; while ($salida[$numcampo] = trim($sth0->fetchrow_array)) { $numcampo = $numcampo + 1; } return wantarray ? @salida : $salida[0]; } sub catalogo_selectivo # catalogo_selectivo: extrae la información de un campo contenido en una tabla, # seleccionando el valor de otro campo de la misma tabla. # # parametros catalogo_selectivo ( $tabla, $campo_1, $campo_2, $valor, $campo_index ) # # $tabla nombre de la tabla donde se encuentra la información. # $campo1 nombre del campo del que requerimos la información. # $campo2 nombre del campo que usamos para la selección # $valor del campo2 que debe tener para la sección de los registros. # $campo_index nombre del campo en la tabla por el cual queremos se ordene la salida. # { my ($tabla, $campo_1, $numcampo, @salida, $campo_2, $val_campo_2,$campo_indice); ($tabla,$campo_1,$campo_indice) = @_; $numcampo = 0; $sql = "SELECT $campo_1 FROM $tabla order by $campo_indice"; $sth = $dbh1->prepare($sql); $sth->execute; while ($salida[$numcampo] = trim($sth->fetchrow_array)) { $numcampo = $numcampo + 1; }

Page 66: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200566 de 141

return wantarray ? @salida : $salida[0]; } sub catalogo8 { my ($tabla1, $campo1, $numcampo1, @salida1,$campo2,$campo3); ($tabla1,$campo1,$campo2,$campo3,$campo4) = @_; $numcampo1 = 0; $salida1 = ['']; if ($campo4 == '1') # UAA sin regionales 100,200 etc. { $sql = "SELECT $campo1 FROM $tabla1 WHERE $campo2 = 'S' and ($campo3 <> '000' and substr($campo3,2,2) <> '00') ORDER BY $campo3"; $sth = $dbh->prepare($sql); $sth->execute; } if ($campo4 == '2') # UAA con regionales 100,200 etc. { $sql = "SELECT $campo1 FROM $tabla1 ORDER BY $campo3"; $sth = $dbh1->prepare($sql); $sth->execute; } if ($campo4 == '3') # UAA sin regionales 100,200 etc. { $sql = "SELECT $campo1 FROM $tabla1 where substr($campo3,2,2) <> '00' ORDER BY $campo3"; $sth = $dbh1->prepare($sql); $sth->execute; } while ($salida1[$numcampo1] = trim($sth->fetchrow_array)) { $numcampo1 = $numcampo1 + 1; } return wantarray ? @salida1 : $salida1[0]; }

sub trim { my (@out) = @_; for (@out) { s/^\s+//; s/\s+$//; } return wantarray ? @out : $out[0]; }

Page 67: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200567 de 141

sub upcase_in { for (@_) { tr/a-z/A-Z/ } } #----------------------------------------------------------- sub javacaja { my ($campo, $mensaje, $linea, $nc); $campo = $_[0]; $mensaje = $_[1]; $nc = $_[2]; $linea = "<div class=\"Section1\">$n<p class=\"MsoNormal\"><a style=\"mso-comment-reference:N_$nc\"></a><![if !supportAnnotations]><a class=\"msocomanchor\" id=\"_anchor_$nc\" onmouseover=\"msoCommentShow(\'_anchor_$nc\',\'_com_$nc\')\" onmouseout=\"msoCommentHide(\'_com_$nc\')\" language=\"JavaScript\" name=\"_msoanchor_$nc\"> $campo </a><![endif]><span class=\"MsoCommentReference\"><span style=\"font-size:8.0pt;display:none;mso-hide:all\"><span style=\"mso-special-character: comment\">&nbsp;</span></span></span></p> </div><div style=\"mso-element:comment-list\"><![if !supportAnnotations]> <hr class=\"msocomoff\" align=\"left\" size=\"1\" width=\"33%\"> <![endif]> <div style=\"mso-element:comment\"><![if !supportAnnotations]> <div id=\"_com_$nc\" class=\"msocomtxt\" language=\"JavaScript\" onmouseover=\"msoCommentShow(\'_anchor_$nc\',\'_com_$nc\')\" onmouseout=\"msoCommentHide(\'_com_$nc\')\"><![endif]> <span style=\"mso-comment-author: NOTA\"><![if !supportAnnotations]> <p><a name=\"_msocom_$nc\"></a></p> <![endif]> </span> <p class=\"MsoCommentText\"><span class=\"MsoCommentReference\"><span style=\"font-size:6.0pt\"><span style=\"mso-special-character: comment\">&nbsp;<![if !supportAnnotations]><a class=\"msocomoff\">[N1]</a><![endif]></span></span></span> $mensaje </p> <![if !supportAnnotations]> </div><![endif]> </div></div>"; return $linea; } sub java0 { my ($ancho, $base); $ancho = $_[0]; $base = "<style id=\"dynCom\" type=\"text/css\"><!-- --></style> <![if !supportAnnotations]> <script language=\"JavaScript\"><!--

Page 68: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200568 de 141

function msoCommentShow(anchor_id, com_id) { if(msoBrowserCheck()) { c = document.all(com_id); if (null != c) { a = document.all(anchor_id); var cw = c.offsetWidth; var ch = c.offsetHeight; var aw = a.offsetWidth; var ah = a.offsetHeight; var x = a.offsetLeft; var y = a.offsetTop; var el = a; while (el.tagName != \"BODY\") { el = el.offsetParent; x = x + el.offsetLeft; y = y + el.offsetTop; } var bw = document.body.clientWidth; var bh = document.body.clientHeight; var bsl = document.body.scrollLeft; var bst = document.body.scrollTop; if (x + cw + ah / 2 > bw + bsl && x + aw - ah / 2 - cw >= bsl ) { c.style.left = x + aw - ah / 2 - cw; } else { c.style.left = x + ah / 2; } if (y + ch + ah / 2 > bh + bst && y + ah / 2 - ch >= bst ) { c.style.top = y + ah / 2 - ch; } else { c.style.top = y + ah / 2; } c.style.visibility = \"visible\"; } } } function msoCommentHide(com_id) { if(msoBrowserCheck()) { c = document.all(com_id); if (null != c) { c.style.visibility = \"hidden\"; c.style.left = -1000; c.style.top = -1000; } } } function msoBrowserCheck() {

Page 69: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200569 de 141

ms = navigator.appVersion.indexOf(\"MSIE\"); vers = navigator.appVersion.substring(ms + 5, ms + 6); ie4 = (ms > 0) && (parseInt(vers) >= 4); return ie4; } if (msoBrowserCheck()) { document.styleSheets.dynCom.addRule(\".msocomoff\",\"display: none\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"visibility: hidden\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"position: absolute\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"top: -1000\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"left: -1000\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"width: $ancho%\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"background: infobackground\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"color: infotext\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"border-top: 1pt solid threedlightshadow\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"border-right: 2pt solid threedshadow\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"border-bottom: 2pt solid threedshadow\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"border-left: 1pt solid threedlightshadow\"); document.styleSheets.dynCom.addRule(\".msocomtxt\",\"padding: 3pt 3pt 3pt 3pt\"); } // --></script> <![endif]>"; return $base; } sub verifica { my($text,$pos,$word,$line,$i,@char); ($text) = @_; @char = ("\\","\'","\&"); $i = 0; foreach(@char) { while($i > -1){ $pos = index($text,$_); if($pos == -1) { $i = $pos; $pos = length($text); } $word = substr($text,0,$pos); if ($i != -1) { $text = substr($text,$pos + 1); } if(!$line) { $line = $word; } else { $line = $line.'\\'.$_.$word; } } $i = 0; $text = $line; $line = ''; } return $text;

} # Fin de la librería infoteca_html.pm

Page 70: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200570 de 141

envia_clave.cgi #!/usr/bin/perl -w #******************************************************************** # ENVIO DE CLAVE DE ACCESO A USUARIOS DEL SISTEMA #******************************************************************** BEGIN { # Declaramos la ruta de ubicacion del modulo 'comun'. @INC=(@INC,"/var/www/cgi-bin/comun"); } use infoteca_html; use strict; # aqui se declaran las variables globales use vars qw(@resultado $query_tex $sth $dbh $nombre $sql $sql2 $from_address $to_address $Subject

$Con_copia $mailer $message $error %mail $usuario $clave $respuesta $ip $palabra $Nlineas $table $font6 $status $Nlineastmp $sistema); # ------------------------------------------------------- #conectamos a la bases de datos local $dbh = DBI->connect("dbi:Pg:dbname=infoteca","postgres","mysql") or die \ "Imposible conectar a la base de datos infraestructura : $DBI::errstr"; # ------------------------------------------------------- # se inician las variables de parametros $sistema = param('sistema') || 1; $respuesta = param('respuesta') || ''; $Nlineastmp = param('Nlineas'); $usuario = param('usuario'); $clave = param('clave') || ''; $Nlineas = param('Nlineas') || 0; $Nlineastmp = param('Nlineastmp') || 0; $ip = remote_host(); $query_tex = "login.usuario = '$usuario'"; $Nlineastmp = 0; if ($usuario) { $sql = "SELECT count(*) FROM login WHERE $query_tex"; $sth = $dbh->prepare($sql); $sth->execute; $Nlineastmp = $sth->fetchrow_array; if ($Nlineastmp == 1) { $sql = "SELECT pregunta,respuesta,correo,usuario,nombre,clave FROM login WHERE $query_tex"; $sth = $dbh->prepare($sql); $sth->execute; @resultado = $sth->fetchrow_array; if ($respuesta eq trim($resultado[1]))

Page 71: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200571 de 141

{ notifica(@resultado); $Nlineastmp = -1; } } } else { $Nlineastmp = -2; } #----------------------------------------------------------- # condicion de busqueda form(); #------------------------------------------------------------------ #DECLARACION DE FORMULARIO #----------------------------------------------------------- sub form { my ($encontre, @centro, @caja, @campos, @estado, $table0, $table1, $table2, $table3, $table4, $table5,

$table6, $table7, $table8, $table9, $table10, $table11, $table98, $table99, $font1, $font2, $font3, $font4, $font5, $font6, @resultmp); #Declaramos las variables para manipular las fuentes en HTML $font1='<font face="Arial,Helvetica"><font color="white">'; $font2='<font face="Arial,Helvetica" size ="-1"><font color="#FFCC00">'; $font5='<font face="Arial,Helvetica" size ="4"><font color="navy">'; $font4='<font face="Times New Roman" size = "8"><font color="#FFCC00">'; $font6='<font face="Arial,Helvetica" size ="-1"><font color="navy">'; $font3='</font>'; $table11 = new HTML::Table(-rows=>1, -cols=>1, -style=>"margin-top:0"); $table11->setCell(1,1, "<img src='/infoteca/barras/imagen.jpg'>"); $table11->setCellAlign(1,1,"CENTER"); $table11->setWidth("100%"); $table11->setCellHeight(1,1,"423"); if ($Nlineastmp == 1) { #Creamos las tablas que contiene las areas de consulta= $table5 = new HTML::Table(1,2, -width=>"80\%"); $table5->setCell(1,1, "$font2 <b> Muy bien $usuario, contesta la siguiente pregunta </b> $font3"); $table5->setCell(1,2,hidden(-name=>'usuario',-value=>$usuario)); $table5->setCellAlign(1,1,"CENTER"); $table5->setBGColor('#000033'); $table5->setWidth("80%"); $table4 = new HTML::Table(1,1); $table4->setCell(1,1, "$font2 <b>$resultado[0]</b> $font3"); $table4->setCellAlign(1,1,"CENTER"); $table4->setBGColor('#000033'); $table4->setWidth("80%");

Page 72: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200572 de 141

$table2 = new HTML::Table(2,2); $table2->setCell(1,1, "$font6 <b>Respuesta:</b> $font3");

$table2->setCell(2,1,textfield(-name=>'respuesta',-value=>$respuesta, -override=>1,-size=>35,-maxlength=>35));

$table2->setBorder("0"); $table2->setWidth("50%"); $table2->setCellSpacing("6"); $table2->setCellPadding("0"); $table2->setCellAlign(1,1,"LEFT"); $table2->setCellAlign(2,1,"LEFT"); # Creamos la tabla que contiene los botones enviar y o cancelar $table99 = new HTML::Table(1,2); $table99->setCellWidth(1, 1, "50%"); $table99->setCellWidth(1, 2, "50%"); $table99->setBorder("0"); $table99->setWidth("50%"); $table99->setCellSpacing("0"); $table99->setCellPadding("10"); $table99->setCellAlign(1,1,"CENTER"); $table99->setCellAlign(1,2,"CENTER"); $table99->setCell(1,1, submit(-value=>'Iniciar sesión',-name=>'envia')); $table99->setCell(1,2, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las tablas anteriores. $table0 = new HTML::Table(12,2, -border=>0, -style=>"margin-top:0"); $table0->setCell(1,1, "<TD ROWSPAN = 12> $table11 </TD>"); $table0->setCell(1,2, "<img src='/infoteca/barras/envio.jpg'>"); $table0->setCell(2,2, $table5->getTable); $table0->setCell(3,2, $table4->getTable); $table0->setCell(4,2, $table2->getTable); $table0->setCell(5,2, $table99->getTable); #--------------------------------------------------------------- $table0->setCellAlign(1,2,"CENTER"); $table0->setCellAlign(2,2,"CENTER"); $table0->setCellAlign(3,2,"CENTER"); $table0->setCellAlign(4,2,"CENTER"); $table0->setCellAlign(5,2,"CENTER"); } if ($Nlineastmp == -2 ) { #Creamos las tablas que contiene las areas de consulta= $table5 = new HTML::Table(1,2, -width=>"80\%"); $table5->setCell(1,1, "$font2 <b> Cuál es tu usuario </b> $font3"); $table5->setCell(1,2,textfield(-name=>'usuario',-value=>$usuario)); $table5->setCellAlign(1,1,"CENTER"); $table5->setBGColor('#007577'); $table5->setWidth("80%");

Page 73: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200573 de 141

# Creamos la tabla que contiene los botones enviar y o cancelar $table99 = new HTML::Table(1,2); $table99->setCellWidth(1, 1, "50%"); $table99->setCellWidth(1, 2, "50%"); $table99->setBorder("0"); $table99->setWidth("50%"); $table99->setCellSpacing("0"); $table99->setCellPadding("10"); $table99->setCellAlign(1,1,"CENTER"); $table99->setCellAlign(1,2,"CENTER"); $table99->setCell(1,1, submit(-value=>'Enviar',-name=>'envia')); $table99->setCell(1,2, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las tablas anteriores. $table0 = new HTML::Table(12,2, -border=>0, -style=>"margin-top:0"); $table0->setCell(1,1, "<TD ROWSPAN = 12> $table11 </TD>"); $table0->setCell(1,2, "<img src='/infoteca/barras/envio.jpg'>"); $table0->setCell(2,2, $table5->getTable); $table0->setCell(5,2, $table99->getTable); #--------------------------------------------------------------- $table0->setCellAlign(1,2,"CENTER"); $table0->setCellAlign(2,2,"CENTER"); $table0->setCellAlign(3,2,"CENTER"); $table0->setCellAlign(4,2,"CENTER"); $table0->setCellAlign(5,2,"CENTER"); } if ($Nlineastmp == 0) { $table2 = new HTML::Table(2,1); $table2->setCell(1,1,"$font6 <b>El usuario $usuario no existe ó fue eliminado</b> $font3"); $table2->setBorder("0"); $table2->setWidth("50%"); $table2->setCellSpacing("6"); $table2->setCellPadding("0"); $table2->setCellAlign(1,1,"LEFT"); $table2->setCellAlign(2,1,"LEFT"); # Creamos la tabla que contiene los botones enviar y o cancelar $table99 = new HTML::Table(1,2); $table99->setCellWidth(1, 1, "50%"); $table99->setCellWidth(1, 2, "50%"); $table99->setBorder("0"); $table99->setWidth("50%"); $table99->setCellSpacing("0"); $table99->setCellPadding("10"); $table99->setCellAlign(1,1,"CENTER");

Page 74: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200574 de 141

$table99->setCellAlign(1,2,"CENTER"); $table99->setCell(1,1, submit(-value=>'Enviar',-name=>'envia')); $table99->setCell(1,2, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las tablas anteriores. $table0 = new HTML::Table(5,2, -border=>0, -style=>"margin-top:0"); $table0->setCell(1,1, "<TD ROWSPAN = 12> $table11 </TD>"); $table0->setCell(1,2, "<img src='/images/envio.jpg'>"); $table0->setCell(2,2, $table2->getTable); $table0->setCell(5,2, $table99->getTable); $table0->setCellAlign(5,2,"CENTER"); } if ($Nlineastmp == -1) { $table2 = new HTML::Table(2,1);

$table2->setCell(1,1, "$font6 <b>De ser correcta la respuesta $usuario, a tu cuenta de correo enviaremos la clave de acceso.</b> $font3"); $table2->setCell(2,1, "<meta http-equiv=\"refresh\" content=\"5; URL=https://$server/cgi-bin/infoteca/chk_login.cgi\" taget=\"top\">");

$table2->setBorder("0"); $table2->setWidth("80%"); $table2->setCellSpacing("0"); $table2->setCellPadding("0"); $table2->setCellAlign(1,1,"LEFT"); $table2->setCellAlign(2,1,"LEFT"); # Creamos la tabla que contiene los botones enviar y o cancelar $table99 = new HTML::Table(1,2); $table99->setCellWidth(1, 1, "50%"); $table99->setCellWidth(1, 2, "50%"); $table99->setBorder("0"); $table99->setWidth("50%"); $table99->setCellSpacing("0"); $table99->setCellPadding("10"); $table99->setCellAlign(1,1,"CENTER"); $table99->setCellAlign(1,2,"CENTER"); $table99->setCell(1,1, submit(-value=>'Iniciar sesión',-name=>'envia')); $table99->setCell(1,2, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las tablas anteriores. $table0 = new HTML::Table(5,2, -border=>0, -style=>"margin-top:0"); $table0->setCell(1,1, "<TD ROWSPAN = 12> $table11 </TD>"); $table0->setCell(1,2, "<img src='/images/envio.jpg'>"); $table0->setCell(2,2, $table2->getTable); $table0->setCellAlign(5,2,"CENTER");

Page 75: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200575 de 141

} $table0->setBorder("0"); $table0->setCellWidth(1,1,"0"); $table0->setColWidth(2,"500"); $table0->setCellSpacing("0"); $table0->setCellPadding("0"); $table0->setWidth("100%"); print header(), start_html(-title=>'Infoteca INIFAP', -background=>&cabeza_html(),-link=>'navy', -vlink=>'navy'), start_multipart_form(-action=>'envia_clave.cgi'); # print header(),$n, cabeza_html('SIIG del INIFAP (SEMILLAS) '),java0('80'),$n,'<center>',$n, start_multipart_form(-action=>'envia_clave.cgi', -target=>'_top') ,$n; #Imprimimos la tabla que generamos arriba. $table0->print; print end_form(), end_html(); } sub notifica { # print $message,$n; $nombre = trim($resultado[4]); $clave = trim($resultado[5]); $to_address = $resultado[2]; $from_address = 'admsiig@'.$s_mail; $Con_copia = 'soto.pablo@'.$s_mail; $Subject = 'Envio de contraseña de la Infoteca INIFAP'; $message = "$nombre tu contraseña es [$clave]"; %mail = ( To => $to_address, From => $from_address, Cc => $Con_copia, Subject => $Subject, Message => $message ); sendmail(%mail) or die $Mail::Sendmail::error; } # Fin de envia_clave.cgi $dbh->disconnect();

Page 76: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200576 de 141

registro.cgi #!/usr/bin/perl -w BEGIN { # Declaramos la ruta de ubicacion del modulo 'comun'. @INC=(@INC,"/var/www/cgi-bin/comun"); } use infoteca_html; use strict; use vars qw($table50 $siexiste $n $region @region $mensaje1 $mensaje2 $mensaje3 $error1 $arroba $num_registro $nombre $login $clave $ip $fecha_reg $email $actividad $sexo $pregunta $respuesta $fechanac $sector $correo $usuario $num_consec $nivel $sql $sth $dbh $cabeza $from_address $to_address $subject $Con_copia $mailer $message $error $quien_soy %mail @resultado $font1 $font2 $font3 $font4 $sistema); # Nos conectamos a la bases de datos local $dbh = DBI->connect("dbi:Pg:dbname=infoteca","postgres","mysql") or die \ "Imposible conectar a la base de datos plantilla: $DBI::errstr"; #$quien_soy = "LA PANTALLA DE REGISTRO DE SOLICITANTES DE INFORMACION"; $font1='<font face="Arial,Helvetica"><font color="007777">'; $font2='</font>'; $font3='<font face="Arial,Helvetica" size=+2><font color="maroon">'; $font4='<font face="Arial,Helvetica"><font color="007678">'; $ip = remote_host(); $sistema = param('sistema') || 1; $num_consec = param('num_consec'); $usuario = param('usuario'); $clave = param('clave'); $pregunta = param('pregunta'); $respuesta = param('respuesta'); $fechanac = param('fechanac'); $correo = param('correo'); $nombre = param('nombre'); $nombre =~ s/ /_/g; $sexo = param('sexo'); $sector = param('sector');

$mensaje1 = "De la manera mas atenta le solicito, me registre en la Infoteca INIFAP, para poder consultar la información que ahí se encuentra";

Page 77: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200577 de 141

$mensaje2 = "Favor de presionar en la siguiente liga para dar de alta al nuevo usuario. Gracias $n

https://$server/cgi-bin/infoteca/act_usuario.cgi?usuario=$usuario&clave=$clave&ip=$ip&correo=$correo&nombre=$nombre $n"; $mensaje3 = ""; # Aqui da inicio el programa y lo que pregunta es que si ya se capturarón al menos los datos minimos para un registro en caso de que no llama de nuevo a la forma if (($correo) and ($nombre) and ($usuario) and ($clave)) { registra(); } else { form(); } sub registra { # Definimos la sentencia SQL para traer el numero de registro # preparamos la informacion a enviar por correo $from_address = $correo; $to_address = '[email protected]'; $Con_copia = ''; #'psc@'.$s_mail; $subject = 'Registro a la Infoteca INIFAP'; $message = "$mensaje1 $mensaje2 "; # Comentamos con el usuario de su aceptacion por medio del web # y que lo notificaremos por medio del correo llamando a la subrutina avisa # insertamos y enviamos el correo electronico $sql = "select MAX(num_consec) from login"; $sth = $dbh->prepare($sql); $sth->execute; $num_consec = $sth->fetchrow_array() + 1; #avisa($nombre); if ($num_consec == 0) {$num_consec = 1} if (not($nombre)) {$nombre = 'No se identifico'} if (not($usuario)) {$usuario = 'No se identifico'}

Page 78: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200578 de 141

# para este caso el nivel es 0 salvo que se requiera otro # $nivel = '0'; #$region = 'Centro'; # Definimos la sentencia SQL para registrar la solicitud $sql = "select * from login where usuario = '$usuario'"; $sth = $dbh->prepare($sql); $sth->execute; @resultado = $sth->fetchrow_array(); if (@resultado) { notifica2(); } else { $sql="INSERT INTO login (num_consec, usuario, clave, ip, pregunta, respuesta, correo, nombre) VALUES ($num_consec,'$usuario','$clave','$ip','$pregunta','$respuesta','$correo','$nombre')"; $sth = $dbh->prepare($sql); $sth->execute; avisa($nombre); notifica1(); } #if ($error eq 1) } sub avisa { my($nombre , $error1, $table_salto, $table_0, $table_1, $table_2, $table_3, $table99, $salta, $brinca); $nombre = $_[0]; $salta='<P>'; $brinca='<BR>'; #Creamos las tabla que contiene las notas #Creamos las tabla que contiene las notas $table_1 = new HTML::Table(2,1); $table_1->setCell(1,1, "$font3 AVISO $font2 $salta"); $table_1->setBorder("0"); $table_1->setWidth("100%"); $table_1->setCellSpacing("0"); $table_1->setCellPadding("0"); $table_1->setBGColor('white');

Page 79: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200579 de 141

$table_2 = new HTML::Table(2,1); $error1 = 0; if ($error1 == 0) { $table_2->setCell(1,1, "$font3 Sr(a). $nombre su solicitud fue recibida $font2"); $table_2->setCell(2,1, "$font3 En su cuenta de correo le llegara la notificación. Muchas Gracias $font2"); } else { $table_2->setCell(1,1, "$font3 Registro no fue aceptado por alguna razon por lo que le solicitamos que sea $font2"); $table_2->setCell(2,1, "$font3 Enviado por correo electrónico de manera manual y por la misma via le

notificaremos su registro Gracias $font2"); } $table_2->setBorder("0"); $table_2->setWidth("100%"); $table_2->setCellSpacing("0"); $table_2->setCellPadding("0"); $table_2->setBGColor('white'); #Creamos la tabla que contiene las tablas anteriores. $table_0 = new HTML::Table(2,1); $table_0->setCell(1,1, $table_1->getTable); $table_0->setCell(2,1, $table_2->getTable); $table_0->setCellAlign(1,1,"CENTER"); $table_0->setCellAlign(2,1,"CENTER"); $table_0->setCellBGColor(1, 1, "#003366"); $table_0->setBorder("0"); $table_0->setWidth("100%"); $table_0->setCellSpacing("0"); $table_0->setCellPadding("0"); $table_0->setBGColor('white'); print header(), start_html(-title=>'Registro a (Infoteca INIFAP) en proceso ',-script=>'', -background=>&cabeza_html()); $table_0->print; print end_form(), cola_html(); } sub notifica1 { # print $message,$n; %mail = ( To => $to_address, From => $from_address, Cc => $Con_copia,

Page 80: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200580 de 141

Subject => $subject, Message => $message ); sendmail(%mail) or die $Mail::Sendmail::error; # print "OK. Log says:\n", $Mail::Sendmail::log; } sub notifica2 { my(@resultado, $error1, $table_salto, $table_0, $table_1, $table_2, $table99, $salta, $brinca); $resultado[0] = $_[0]; $resultado[1] = $_[1]; $resultado[2] = $_[2]; #Declaramos las variables para manipular las fuentes en HTML $salta='<P>'; $brinca='<BR>'; #Creamos las tabla que contiene las notas $table_1 = new HTML::Table(2,1); $table_1->setCell(1,1, "$font3 AVISO $font2 $salta"); $table_1->setBorder("0"); $table_1->setWidth("100%"); $table_1->setCellSpacing("0"); $table_1->setCellPadding("0"); $table_1->setBGColor('white'); $table_2 = new HTML::Table(2,1); $error1 = 0; if ($error1 eq 0) { $table_2->setCell(1,1, "$font3 Sr. $resultado[1] , él ID ya ha sido ocupado por otro de nuestros usuarios, le sugerimos utilice otro, para que su registro pueda ser aceptado.$font2"); $table_2->setCell(2,1, "$font3 Gracias. $font2"); } else { $table_2->setCell(1,1, "$font3 Registro no fue aceptado por alguna razon por lo que le solicitamos que sea $font2"); $table_2->setCell(2,1, "$font3 Enviado por correo electrónico de manera manual y por la misma via le

notificaremos su registro Gracias "); } $table_2->setBorder("0"); $table_2->setWidth("100%"); $table_2->setCellSpacing("0"); $table_2->setCellPadding("0"); $table_2->setBGColor('white'); #Creamos la tabla que contiene las tablas anteriores.

Page 81: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200581 de 141

$table_0 = new HTML::Table(2,1); $table_0->setCell(1,1, $table_1->getTable); $table_0->setCell(2,1, $table_2->getTable); $table_0->setCellAlign(1,1,"CENTER"); $table_0->setCellAlign(2,1,"CENTER"); $table_0->setCellBGColor(1, 1, "#003366"); $table_0->setBorder("0"); $table_0->setWidth("100%"); $table_0->setCellSpacing("0"); $table_0->setCellPadding("0"); $table_0->setBGColor('white'); print header(), start_html(-title=>'Registro a (Infoteca INIFAP) en proceso ',-script=>'', -background=>&cabeza_html()); $table_0->print; print end_form(), cola_html(); } sub notifica3 { $from_address = $correo; $to_address = '[email protected]'; $subject = 'Solicitud de Acesso a INIFAP (Infoteca)'; $message = "$nombre"; # print $message,$n; %mail = ( To => $to_address, From => $from_address, Cc => $Con_copia, Subject => $subject, Message => $message ); sendmail(%mail) or die $Mail::Sendmail::error; # print "OK. Log says:\n", $Mail::Sendmail::log; } sub form { my($table_salto, $table0, $table1, $table2, $table21, $table3, $table31, $table32, $table33, $table4,

$table41, $table42, $table5, $table6, $table7, $table8, $table9, $table10, $table11, $table12, $table99, $salta, $brinca); # limpiamos las variables a capturar $usuario = '';

Page 82: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200582 de 141

$clave = ''; $region = ''; $pregunta = ''; $respuesta = ''; $fechanac = ''; $correo = ''; $nombre = ''; $sexo = ''; $sector = ''; #Declaramos las variables para manipular las fuentes en HTML $brinca='<BR>'; #Creamos las tabla que contiene las areas de captura $table_salto = new HTML::Table(1,1); $table_salto ->setCell(1,1, "$font3 . $font2"); $table_salto->setBorder("0"); $table_salto->setWidth("100%"); $table_salto->setCellSpacing("0"); $table_salto->setCellPadding("0"); $table_salto->setBGColor('white'); $table11 = new HTML::Table(-rows=>1, -cols=>1); $table11->setCell(1,1, "<img src='/infoteca/barras/imagen.jpg'>"); $table11->setCellAlign(1,1,"CENTER"); $table11->setWidth("100%"); #$table11->setCellHeight(1,1,"423"); $table1 = new HTML::Table(2,1); $table1->setCell(1,1, "$font3 &nbsp; $font2"); $table1->setCell(2,1, "<img src='/infoteca/barras/registro.jpg'>"); $table1->setBorder("0"); $table1->setWidth("100%"); $table1->setCellSpacing("0"); $table1->setCellPadding("0"); $table1->setCellAlign(1,1,"CENTER"); $table1->setCellAlign(2,1,"CENTER"); $table21 = new HTML::Table(4,3); $table21->setCell(1,1, "$font1 Usuario$font2"); $table21->setCell(3,1, "$font1 Contraseña$font2"); $table21->setCell(1,2, textfield(-name=>'usuario', -size=>12, -maxlength=>12)); $table21->setCell(1,3, "$font1 ejemplos: \"pancho\" (No usar \".\" ni espacios en blanco)$font2"); $table21->setCell(3,2, password_field(-name=>'clave', -size=>8,

Page 83: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200583 de 141

-maxlength=>8)); $table21->setCell(3,3, "$font1(\"Maximo 8 caracteres\")$font2"); $table21->setBorder("0"); $table21->setWidth("100%"); $table21->setCellWidth(1,1,"25%"); $table21->setCellAlign(1, 1, "RIGHT"); $table21->setCellAlign(2, 1, "RIGHT"); $table21->setCellAlign(3, 1, "RIGHT"); $table21->setCellAlign(4, 1, "RIGHT"); $table21->setCellAlign(1, 2, "LEFT"); $table21->setCellAlign(2, 2, "LEFT"); $table21->setCellAlign(3, 2, "LEFT"); $table21->setCellAlign(4, 2, "LEFT"); $table21->setRowVAlign(1,"TOP"); $table21->setRowVAlign(2,"TOP"); $table21->setRowVAlign(3,"TOP"); $table21->setRowVAlign(4,"TOP"); $table21->setCellSpacing(" 0"); $table21->setCellPadding("2"); $table2 = new HTML::Table(2,1); $table2->setCell(1,1, $table21->getTable); $table2->setCell(2,1, "$font1 <b>Elegir tu ID:</b> \nDe aquí en adelante deberás utilizar siempre esta información para ingresar al sistema !El uso de mayúsculas si influye en tu contraseña! $font2"); $table2->setBorder("0"); $table2->setCellWidth(1,1,"80%"); $table2->setWidth("100%"); $table2->setCellVAlign(1, 2, "TOP"); $table2->setCellVAlign(1, 1, "TOP"); $table2->setCellSpacing("0"); $table2->setCellPadding("0"); $table33 = new HTML::Table(2,2); $table33->setCell(1,1, "$font4 <b>Si olvidaste tu contraseña, te identificaremos con esta información <b> $font2"); $table33->setRowVAlign(1,"BOTTOM"); $table32 = new HTML::Table(4,2); $table32->setCell(1,1, "$font1 Pregunta de seguridad$font2"); $table32->setCell(1,2, popup_menu(-name=>'pregunta', values=>[('Selecciona una pregunta a responder','¿Cuál es el nombre de tu mascota?','¿Como se llama tu primera escuela?','¿Quién era tu héroe de la infancia?','¿Cuál es tu pasatiempo favorito?','¿Cuál es tu equipo deportivo favorito?','¿Cuál es el segundo apellido de tu padre?','¿En qué calle se situaba tu colegio?','¿Marca de tu primer coche o bicicleta?','¿Dónde conociste a tu pareja?')])); $table32->setCell(2,1, "$font1 Tu respuesta$font2"); $table32->setCell(2,2, textfield(-name=>'respuesta', -size=>40, -maxlength=>40));

Page 84: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200584 de 141

$table32->setBorder("0"); $table32->setWidth("100%"); $table32->setCellWidth(1,1,"25%"); $table32->setCellWidth(2,1,"25%"); $table32->setCellAlign(1, 1, "LEFT"); $table32->setCellAlign(1, 2, "LEFT"); $table32->setCellAlign(2, 1, "LEFT"); $table32->setCellAlign(2, 2, "LEFT"); $table32->setRowVAlign(1,"TOP"); $table32->setRowVAlign(2,"TOP"); $table32->setCellSpacing("0"); $table32->setCellPadding("3"); $table50 = new HTML::Table(4,2); $table50->setCell(1,1, "$font1 Nombre$font2"); $table50->setCell(1,2, textfield(-name=>'nombre', -size=>20, -maxlength=>40)); $table50->setCell(4,1, "$font1 Cuenta de correo$font2"); $table50->setCell(4,2, textfield(-name=>'correo', -size=>25, -maxlength=>40)); $table50->setBorder("0"); $table50->setCellAlign(1, 1, "RIGHT"); $table50->setCellAlign(1, 2, "LEFT"); $table50->setCellAlign(2, 1, "RIGHT"); $table50->setCellAlign(2, 2, "LEFT"); $table50->setCellAlign(3, 2, "LEFT"); $table50->setCellAlign(4, 1, "RIGHT"); $table50->setCellAlign(4, 2, "LEFT"); $table50->setCellWidth(1,1,"25%"); $table50->setRowVAlign(1,"TOP"); $table50->setRowVAlign(2,"TOP"); $table50->setRowVAlign(3,"TOP"); $table50->setCellSpacing("0"); $table50->setCellPadding("5"); $table31 = new HTML::Table(2,1); $table31->setCell(1,1, $table33->getTable); $table31->setCell(2,1, $table32->getTable); $table31->setCellAlign(1,1, "CENTER"); $table31->setCellAlign(2,1, "CENTER"); $table31->setWidth("100%"); $table31->setCellWidth(1,1,"100%"); $table31->setCellWidth(1,2,"100%"); $table31->setBorder("0"); $table3 = new HTML::Table(2,1); $table3->setCell(1,1, $table31->getTable);

Page 85: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200585 de 141

$table3->setCell(2,1, "$font1 <b>Para recordar tu contraseña:</b> \nEsta es la única manera en que puedes verificar tu identidad. Para proteger tu cuenta, asegúrate de que tu 'respuesta' sea <b>fácil de recordar</b>, pero también <b>difícil de adivinar.</b> $font2"); $table3->setBorder("0"); $table3->setCellWidth(1,1,"80%"); $table3->setWidth("100%"); $table3->setCellVAlign(1, 2, "TOP"); $table3->setCellVAlign(1, 1, "TOP"); $table3->setCellSpacing("0"); $table3->setCellPadding("0"); $table41 = new HTML::Table(2,3); $table41->setCell(1,2, popup_menu(-name=>'sexo', values=>[('','F','M')])); $table41->setCell(1,1, "$font1 Sexo $font2"); $table41->setCell(1,3, "$font1 (F)emenino. (M)asculino. $font2"); $table41->setCell(2,1, "$font1 Sector $font2"); $table41->setCell(2,2, popup_menu(-name=>'sector', values=>[('Investigador','Agricultor','Consultor','Estudiante','Profesor')])); $table41->setBorder("0"); $table41->setWidth("85%"); $table41->setCellWidth(1,1,"35%"); #setCe4lAlign(row_num, col_num, [CENTER|RIGHT|LEFT]) $table41->setCellAlign(1, 1, "RIGHT"); $table41->setCellAlign(2, 1, "RIGHT"); $table41->setCellAlign(1, 2, "LEFT"); $table41->setCellAlign(1, 3, "LEFT"); $table41->setCellAlign(2, 2, "LEFT"); $table41->setCellWidth(1,3,"50%"); $table41->setRowVAlign(1,"TOP"); $table41->setRowVAlign(2,"TOP"); $table41->setCellSpacing(" 0"); $table41->setCellPadding("9"); $table4 = new HTML::Table(2,1); $table4->setCell(1,1, $table50->getTable); información nos permitirá conocer el perfil de los usuarios que nos visitan. $font2"); $table4->setBorder("0"); $table4->setCellWidth(1,1,"80%"); $table4->setWidth("100%"); #$table4->setCellVAlign(2, 2, [CENTER|TOP|BOTTOM]) $table4->setCellVAlign(1, 2, "TOP"); $table4->setCellVAlign(1, 1, "TOP"); $table4->setCellSpacing("0"); $table4->setCellPadding("0"); # Creamos la tabla que contiene los botones enviar y # o cancelar $table99 = new HTML::Table(1,2); $table99->setCellWidth(1, 1, "50%"); $table99->setCellWidth(1, 2, "50%");

Page 86: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200586 de 141

$table99->setBorder("0"); $table99->setWidth("100%"); $table99->setCellSpacing("0"); $table99->setCellPadding("0"); $table99->setCellAlign(1,1,"CENTER"); $table99->setCellAlign(1,2,"CENTER"); $table99->setCell(1,1, submit(-value=>'Registrar', -name=>'buscar')); $table99->setCell(1,2, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las 8 tablas anteriores. $table0 = new HTML::Table(7,2, -border=>0); $table0->setCell(1,1, "<TD ROWSPAN = 7> $table11 </TD>"); $table0->setCell(1,2, $table1->getTable); $table0->setCell(2,2, $table2->getTable); $table0->setCellBGColor(3, 2, "#003366"); $table0->setCell(4,2, $table3->getTable); $table0->setCellBGColor(5, 2, "#003366"); $table0->setCell(6,2, $table4->getTable); $table0->setCell(7,2, $table99->getTable); $table0->setCellAlign(1,1,"LEFT"); $table0->setCellAlign(2,2,"CENTER"); $table0->setWidth("100%"); $table0->setBorder("0"); $table0->setCellSpacing("0"); $table0->setCellPadding("0"); print header(), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html()), start_form(-action=>'registro.cgi'); $table0->print; print end_form(); } # Fin de registro.cgi

Page 87: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200587 de 141

chk_login.cgi

#!/usr/bin/perl -w BEGIN { # Declaramos la ruta de ubicacion del modulo 'comun'. @INC=(@INC,"/var/www/cgi-bin/comun"); } use infoteca_html; use strict; # Aquí se declaran las variables globales use vars qw(@resultado $actualiza $query_tex $sth $dbh $cabeza $error $sql $sql2 $num_consec $tusuario $usuario $clave $centro $activo $hora $ip $hoy $hoydia $hoymes $hoyanio $hhour $hmin $hsec $sistema $aplicacion $palabra $Nlineas $table $font6 $query_tex2 $inicia $status $Nlineastmp $pasa $sistema $aplicacion $item $referencia $region $todo $return_url); # ------------------------------------------------------- #conectamos a la bases de datos local $dbh = DBI->connect("dbi:Pg:dbname=infoteca","postgres","mysql") or die \ "Imposible conectar a la base de datos infraestructura : $DBI::errstr"; # ------------------------------------------------------- # se inician las variables de parametros $actualiza = param('actualiza') || ''; $num_consec = param('num_consec') || 0; $usuario = param('usuario') || ''; $referencia = param('referencia') || ''; $clave = param('clave') || ''; $centro = param('centro') || ''; $hora = param('hora') || ''; $ip = param('ip') || ''; $item = param('item') || ''; $tusuario = param('tusuario') || ''; $activo = param('activo') || ''; $todo = param('todo') || ''; $region = param('region') || ''; #$region = ~s/ /_/ig; $sistema = param('sistema') || 1; $aplicacion = param('aplicacion') || ''; $hoy = param('hoy'); $hoydia = param('hoydia') || 0; $hoymes = param('hoymes') || 0; $hoyanio = param('hoyanio') || 0; $hhour = param('hhour') || ''; $hmin = param('hmin') || ''; $hsec = param('hsec') || ''; $pasa = param('pasa') || 'N';

Page 88: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200588 de 141

$inicia = param('inicia') || ''; $Nlineas = param('Nlineas') || 0; $Nlineastmp = param('Nlineastmp') || 0; $query_tex2 = param('query_tex2') || ''; $return_url = param('return_url'); $ip = remote_host(); $query_tex = "logintemp.usuario = '$usuario' and logintemp.clave = '$clave'"; $query_tex2 = "login.usuario = '$usuario' and login.clave = '$clave'"; $return_url = 'https://'.$server.'/cgi-bin/infoteca/chk_login.cgi'; if ($usuario && $clave) { verificausr(); } else { form(); } sub verificausr() { my ($cuantos, $sql2, $fecha); $sql2 = "SET DATESTYLE TO 'SQL, EUROPEAN'"; $sql2 = $dbh->prepare($sql2); $sql2->execute; $sql = "select MAX(num_consec) from logintemp"; $sth = $dbh->prepare($sql); $sth->execute; $num_consec = $sth->fetchrow_array() + 1; $hora = localtime(); $hhour = $hora->hour; $hmin = $hora->min; $hsec = $hora->sec; $hora = trim("$hhour:$hmin:$hsec"); $fecha = localtime(); ($hoydia, $hoymes, $hoyanio) = ($fecha->mday, $fecha->mon + 1, $fecha->year + 1900); $fecha = "$hoydia/$hoymes/$hoyanio"; $sql = "SELECT * FROM login WHERE $query_tex2"; $sth = $dbh->prepare($sql); $sth->execute; @resultado = $sth->fetchrow_array; if (@resultado) { if ($resultado[11] ne '') { $sql = "INSERT into logintemp values ($num_consec,'$resultado[1]','$resultado[2]','$resultado[3]','$resultado[4]','$resultado[5]','$resultado[6]', '$resultado[7]', '$fecha', '','$ip', '$resultado[11]', '$resultado[12]', '$resultado[13]', '01/01/1800', '$resultado[15]', '$resultado[16]', '$resultado[17]', '$resultado[18]' )"; $sth = $dbh->prepare($sql);

Page 89: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200589 de 141

$sth->execute; $region = $resultado[3]; $tusuario = $resultado[7]; $sistema = $resultado[5]; $aplicacion = $resultado[6]; $referencia = trim($resultado[11]); &valido(); } else { &invalido(); } } else { &invalido(); } } sub valido() { print header(); print <<EOT; <script language="JavaScript1.2"> <!-- function full(pagina) { window.open(pagina, '', 'fullscreen=yes, scrollbars=auto'); location.replace('$return_url'); //document.menu.SetVariable("num_consec", $num_consec); //document.menu.SetVariable("region", $region); //top.close(); } //--> </script> <body bgcolor="#336699" text="#000000" onload='javascript:full("$referencia?num_consec=$num_consec&region=$region")'> </body> EOT print end_html(); } sub invalido() { print header(), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html(), -link=>'navy', -vlink=>'navy'); print "<center><font size=+1 color=\"FF0000\"><b>ERROR: En el Usuario o Contraseña.</b></font></center>"; print "<p>Compruebe por favor su entrada e intente otra vez.</p>\n"; print "<p><center><b><meta HTTP-EQUIV=\"refresh\" content=\"4; URL=$return_url\"</b></center></p>"; print end_html(); }

Page 90: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200590 de 141

sub form { my ($num_consec, $encontre, @centro, @caja, @campos, @estado, $table0, $table1, $table2, $table3, $table4, $table5, $table6, $table7, $table8, $table9, $table98, $table99, $font1, $font2, $font3, $font4, $font5, $font6, @resultmp, $JSCRIPT1); #Declaramos las variables para manipular las fuentes en HTML $font1='<font face="Arial,Helvetica"><font color="white">'; $font2='<font face="Arial,Helvetica" size ="-1"><font color="#FFCC00">'; $font5='<font face="Arial,Helvetica" size ="-1"><font color="navy">'; $font4='<font face="Times New Roman" size = "8"><font color="#FFCC00">'; $font6='<font face="Arial,Helvetica" size ="-1"><font color="007777">'; $font3='</font>'; $table5 = new HTML::Table(1,1, -width=>"80\%"); $table5->setCell(1,1, "$font2 <b> ¿Dispone ya de una cuenta del sistema? </b> $font3"); $table5->setCellAlign(1,1,"CENTER"); $table5->setBGColor('#007777'); $table5->setWidth("80%"); $table4 = new HTML::Table(1,1); $table4->setCell(1,1, "$font2 <a href=\"registro.cgi\" target=\"_self\"> <b>Regístro de Cuentas </b></a> $font3"); $table4->setCellAlign(1,1,"CENTER"); $table4->setWidth("90%"); $table4->setCellPadding("15"); $table6 = new HTML::Table(1,1); $table6->setCell(1,1, "$font2 <b> ¿Olvidó la contraseña? </b> $font3"); $table6->setCellAlign(1,1,"CENTER"); $table6->setBGColor('#007777'); $table6->setWidth("80%"); $table7 = new HTML::Table(1,1); $table7->setCell(1,1, "$font2 <a href=\"envia_clave.cgi\" target=\"_self\"><b>Recupere contraseña</b></a> $font3"); $table7->setCellAlign(1,1,"CENTER"); $table7->setWidth("100%"); $table7->setCellPadding("15"); $table1 = new HTML::Table(1,1); $table1->setCell(1,1, "$font2 <b> ¡ Bienvenido a la Infoteca INIFAP! </b> $font3"); $table1->setCellAlign(1,1,"CENTER"); $table1->setBGColor('#007777'); $table1->setWidth("80%"); $table2 = new HTML::Table(4,2); $table2->setCell(1,1, "$font5 <b>Usuario:</b> $font3");

Page 91: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200591 de 141

$table2->setCell(2,1,textfield(-name=>'usuario',-value=>$usuario, -override=>1,-size=>10,-maxlength=>10)); $table2->setCell(3,1, "$font5 <b>Contraseña: </b>$font3"); $table2->setCell(4,1,password_field(-name=>'clave', -value=>$clave, -override=>1,-size=>10,-maxlength=>10)); $table2->setCell(4,2, submit(-value=>'Iniciar',-name=>'envia')); #$table2->setBGColor('#007777'); $table2->setWidth("80%"); $table2->setBorder("0"); $table2->setWidth("50%"); $table2->setCellSpacing("6"); $table2->setCellPadding("0"); $table2->setCellAlign(1,1,"LEFT"); $table2->setCellAlign(2,1,"LEFT"); #Creamos la tabla que contiene las tablas anteriores. $table0 = new HTML::Table(12,2, -border=>0, -style=>"margin-top:0"); $table0->setCell(1,1, "<TD ROWSPAN = 12> $imgInf </TD>"); $table0->setCell(3,2, "<img src='/infoteca/barras/acceso.jpg'>"); $table0->setCell(4,2, $table5->getTable); $table0->setCell(5,2, $table4->getTable); $table0->setCell(6,2, $table1->getTable); $table0->setCell(7,2, $table2->getTable); $table0->setCell(8,2, $table6->getTable); $table0->setCell(9,2, $table7->getTable); $table0->setColAlign(2,"CENTER"); $table0->setBorder("0"); $table0->setCellWidth(1,1,"0"); $table0->setColWidth(2,"500"); $table0->setCellSpacing("0"); $table0->setCellPadding("0"); $table0->setWidth("100%"); $JSCRIPT1=<<EOF; <!-- Hide function setfocus() { document.login.usuario.focus(); return; } // --> EOF ; print header(), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html(), -link=>'navy', -vlink=>'navy', -onload=>''), start_multipart_form(-name => 'login', -action=>'chk_login.cgi'); $table0->print; print end_form(), end_html(); } # fin del programa chk_login.cgi

Page 92: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200592 de 141

act_articulos.cgi #!/usr/bin/perl -w # FUNCIONES DE FORMATO DE NUMEROS # THOUSANDS_SEP - character inserted between groups of 3 digits # DECIMAL_POINT - character separating integer and fractional parts # MON_THOUSANDS_SEP - like THOUSANDS_SEP, but used for format_price # MON_DECIMAL_POINT - like DECIMAL_POINT, but used for format_price # INT_CURR_SYMBOL - character(s) denoting currency (see format_price()) # DECIMAL_DIGITS - number of digits to the right of dec point (def 2) # DECIMAL_FILL - boolean; whether to add zeroes to fill out decimal # NEG_FORMAT - format to display negative numbers (def ``-x'') # KILO_SUFFIX - suffix to add when format_bytes formats kilobytes # MEGA_SUFFIX - suffix to add when format_bytes formats megabytes BEGIN { # Declaramos la ruta de ubicacion del modulo 'comun'. @INC=(@INC,"/var/www/cgi-bin/comun"); } use infoteca_html; use strict; use vars qw($num_registro1 $graba $actualiza $hoy $hoydia $hoymes $hoyanio $reg0 $reg1 $reg2 $reg3 $reg4 $reg5 $reg6 $reg7 $reg8 $reg9 $reg10 $reg11 $reg12 $reg13 $reg14 $reg15 $reg16 $reg17 $reg18 $reg19 $reg20 $reg21 $reg22 $reg23 $reg24 $reg25 $reg26 $reg27 $reg28 $reg29 $reg30 $reg31 $reg32 $reg33 $reg34 $reg35 $reg36 $reg37 $mes $ip $sql $sth $dbh $cabeza $error $quien_soy $table0 $sql0 $sth0 $dbh0 $de $entero $nc $xreg $lista $indice @resultado_rfc @resultado_nom %etiquetas $tt $nombrecomp @resultado3 $dbh1); my $de = new Number::Format(-mon_thousands_sep => ',', -mon_decimal_point => '.', -int_curr_symbol => '$'); my $entero = new Number::Format(-thousands_sep => ','); # ------------------------------------------------------- #conectamos a la bases de datos local $dbh0 = DBI->connect("dbi:Pg:dbname=pulsa","postgres","mysql") or die \ "Imposible conectar a la base de datos pulsa: $DBI::errstr"; $dbh = DBI->connect("dbi:Pg:dbname=infoteca","postgres","mysql") or die \ "Imposible conectar a la base de datos infoteca: $DBI::errstr"; $ip = remote_host(); $nc = param('nc'); $xreg = param('xreg'); $num_registro1 = param('num_registro1'); $graba = param('graba') || 'N'; $actualiza = param('actualiza'); $reg0 = param('reg0'); $reg1 = param('reg1');

Page 93: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200593 de 141

$reg2 = param('reg2'); $reg3 = param('reg3'); $reg4 = param('reg4'); $reg5 = param('reg5'); $reg6 = param('reg6'); $reg7 = param('reg7'); $reg8 = param('reg8'); $reg9 = param('reg9'); $reg10 = param('reg10'); $reg11 = param('reg11'); $reg12 = param('reg12'); $reg13 = param('reg13'); $reg14 = param('reg14'); $reg15 = param('reg15'); $reg16 = param('reg16'); $reg18 = param('reg18'); $reg19 = param('reg19'); $reg20 = param('reg20'); $reg21 = param('reg21'); $reg22 = param('reg22'); $reg23 = param('reg23'); $reg24 = param('reg24'); $reg25 = param('reg25'); $reg26 = param('reg26'); $reg27 = param('reg27'); $reg28 = param('reg28'); $reg29 = param('reg29'); $reg30 = param('reg30'); $reg31 = param('reg31'); $reg32 = param('reg32'); $reg33 = param('reg33'); $reg34 = param('reg34'); $reg35 = param('reg35'); $reg36 = param('reg36'); $reg37 = param('reg37'); $mes = param('mes'); $hoy = param('hoy'); $hoydia = param('hoydia'); $hoymes = param('hoymes'); $hoyanio = param('hoyanio'); #----------------------------------------------------------- if (($reg1) && ($reg3) && ($reg18)) { inserta(); &insert_ok;

Page 94: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200594 de 141

} form(); imprime(); #------------------------------------------------------------------ #DECLARACION DE FORMULARIO sub form { my (@caja, @resultado, @campos, @sistema_prod, @especialidad, $uaa, $region, $numcampo, $sth, $table1, $table13, $table14, $table15, $table2, $table3, $table35, $table99, $font1, $font2, $font3, $font4, $font5); #Declaramos las variables para manipular las fuentes en HTML $font1='<font face="Arial,Helvetica"><font color="white">'; $font2='<font face="Arial,Helvetica" size ="-1"><font color="007777">'; $font4='<font face="Arial,Helvetica"><font color="007777"><font size="-1">'; $font5='<font face="Arial,Helvetica" size ="-1"><font color="007777">'; $font3='</font>';

$sql = "SELECT * FROM publica2 WHERE (ip='$ip' and num_registro=0 and tipo_reg = '1')"; $sth = $dbh->prepare($sql); $sth->execute; @resultado = $sth->fetchrow_array(); $actualiza =\'N'; if (@resultado) { $actualiza =\'S'; $reg1 = $resultado[1]; $reg2 = $resultado[2]; $reg3 = $resultado[3]; $reg4 = $resultado[4]; $reg5 = $resultado[5]; $reg6 = $resultado[6]; $reg7 = $resultado[7]; $reg8 = $resultado[8]; $reg9 = $resultado[9]; $reg10 = trim($resultado[10]); $reg11 = $resultado[11]; $reg12 = trim($resultado[12]); $reg13 = trim($resultado[13]); $reg14 = trim($resultado[14]); $reg15 = $resultado[15]; $reg16 = $resultado[16]; $reg18 = $resultado[18]; $mes = substr($reg18,3,2); $reg19 = $resultado[19]; $reg20 = $resultado[20];

Page 95: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200595 de 141

$reg21 = $resultado[21]; $reg22 = $resultado[22]; $reg23 = $resultado[23]; $reg24 = $resultado[24]; $reg25 = $resultado[25]; $reg26 = $resultado[26]; $reg27 = $resultado[27]; $reg28 = $resultado[28]; $reg29 = $resultado[29]; $reg30 = trim($resultado[30]); $reg31 = trim($resultado[31]); } else { $reg0 =''; $reg1 =''; $reg2 =''; $reg3 =''; $reg4 =''; $reg5 =''; $reg6 =''; $reg7 =''; $reg8 =''; $reg9 =''; $reg10 =''; $reg11 =''; $reg12 =''; $reg13 =''; $reg14 =''; $reg15 =''; $reg16 =''; $reg17 =''; $reg18 =''; $reg19 =''; $reg20 =''; $reg21 =''; $reg22 =''; $reg23 =''; $reg24 =''; $reg25 =''; $reg26 =''; $reg27 =''; $reg28 =''; $reg29 =''; $reg30 =''; $reg31 =''; $reg32 =''; $reg33 = 0; $reg34 = 0;

Page 96: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200596 de 141

$reg35 = 0; $reg36 = 0; $reg37 =''; } #Creamos las tablas que contiene las areas de consulta $table1 = new HTML::Table(7,5); $caja[1] = javacaja('Autor','Indicar por el apellido paterno, separado del materno por un espacio y consignar el apellido materno por su inicial en mayúscula de igual que las iniciales en mayúsculas del nombre(s).','1'); $table1->setCell(1,1, "$font1 .... $font3"); $table1->setCell(1,2, "$font4 e.g. Salinas G.,G.E. $font3"); $table1->setCell(1,3, "$font1 .... $font3"); $table1->setCell(1,4, "$font4 e.g. (1)$font3"); $table1->setCell(2,1, "$font5 $caja[1] $font3"); $table1->setCell(2,2, textfield(-name=>'reg1',-value=>trim($reg1),-override=>1,-size=>30,-maxlength=>30)); $indice = 0; $lista = ''; @resultado_nom = catalogo_selectivo('plantilla','nombre_comp','nombre_comp'); @resultado_rfc = catalogo_selectivo('plantilla','rfc','nombre_comp'); while ($resultado_nom[$indice]) { $etiquetas{$resultado_rfc[$indice]} = $resultado_nom[$indice]; $indice = $indice + 1; } $table1->setCell(3,1,"$font2 Seleccione Nombre Completo del Autor $font3"); $table1->setCell(3,2, popup_menu(-name=>'reg37',-values=>[(' ',@resultado_rfc)],-labels=>\%etiquetas));

$caja[6] = javacaja('Volumen','Número del Volumen entre paréntesis, seguido de dos puntos ejemplo (1):','6'); $table1->setCell(2,3, "$font5 $caja[6] $font3"); $table1->setCell(2,4, textfield(-name=>'reg6',-value=>trim($reg6),-override=>1, -size=>11,-maxlength=>11)); $table1->setCell(4,1, "$font1 .... $font3"); $table1->setCell(4,2, "$font4 e.g. Salinas G.,G.E.;Sosa P.,P. $font3"); $table1->setCell(4,3, "$font1 .... $font3"); $table1->setCell(4,4, "$font4 e.g. 4 $font3");

$caja[2] = javacaja('Coautor','El registro de este campo debera de ser igual que al de autor y solo separado por un punto y coma por cada coautor','2'); $table1->setCell(5,1, "$font5 $caja[2] $font3"); $table1->setCell(5,2, textfield(-name=>'reg2',-value=>trim($reg2),-override=>1, -size=>30,-maxlength=>200)); $caja[7] = javacaja('Número de Publicación','Número de la publicación','7'); $table1->setCell(5,3, "$font5 $caja[7] $font3");

Page 97: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200597 de 141

$table1->setCell(5,4, textfield(-name=>'reg7',-value=>trim($reg7),-override=>1, -size=>10,-maxlength=>10)); $table1->setCell(6,1, "$font1 .... $font3"); $table1->setCell(6,2, "$font4 e.g. Rearing and Biology of Lydella:Subtitulo. $font3"); $table1->setCell(6,3, "$font1 .... $font3"); $table1->setCell(6,4, "$font4 e.g. 4-8 o 125 $font3");

$caja[4] = javacaja('Título','Iniciar con mayúsculas y separar por dos puntos el subtitulo y por un punto el final del texto','4'); $table1->setCell(7,1, "$font5 $caja[4] $font3"); $table1->setCell(7,2, textfield(-name=>'reg4',-value=>trim($reg4),-override=>1,-size=>30,-maxlength=>200));

$caja[8] = javacaja('Páginas','Numero de Páginas ó entre que paginas se encuentra la publicación','8'); $table1->setCell(7,3, "$font5 $caja[8] $font3"); $table1->setCell(7,4, textfield(-name=>'reg8',-value=>trim($reg8),-override=>1,-size=>10,-maxlength=>10)); $table1->setCell(7,5, hidden(-name=>'reg37',-value=>'$37')); $table1->setBorder("0"); $table1->setWidth("80%"); $table1->setCellSpacing("7"); $table1->setCellPadding("0"); $table1->setCellAlign(1,1,"LEFT"); $table1->setCellAlign(1,2,"LEFT"); $table1->setCellAlign(1,3,"LEFT"); $table1->setCellAlign(1,4,"LEFT"); $table1->setCellAlign(2,1,"LEFT"); $table1->setCellAlign(2,2,"LEFT"); $table1->setCellAlign(2,3,"LEFT"); $table1->setCellAlign(2,4,"LEFT"); $table1->setCellAlign(3,1,"LEFT"); $table1->setCellAlign(3,2,"LEFT"); $table1->setCellAlign(3,3,"LEFT"); $table1->setCellAlign(3,4,"LEFT"); $table1->setCellAlign(4,1,"LEFT"); $table1->setCellAlign(4,2,"LEFT"); $table1->setCellAlign(4,3,"LEFT"); $table1->setCellAlign(4,4,"LEFT"); #------------------------------------------------------------- $table13 = new HTML::Table(1,4); $table13->setCell(1,1, "$font1 .... $font3"); $table13->setCell(1,2, "$font4 e.g. Annals of Entomological Society. $font3"); $table13->setCell(1,3, "$font1 .... $font3"); $table13->setCell(1,4, "$font4 e.g. 1998 $font3"); $table13->setBorder("0");

Page 98: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200598 de 141

$table13->setWidth("80%"); $table13->setCellSpacing("7"); $table13->setCellPadding("0"); #------------------------------------------------------------- $table14 = new HTML::Table(5,3); $caja[32] = javacaja('Otra Fuente especifique','En caso de existir otra fuente de financiaminet o para la publicación, especifique el nombre de la misma a demas del importe que aporto.','32'); $caja[33] = javacaja('INIFAP','Registre el importe que aporto el INIFAP al tiraje de esta publicación ','33'); $caja[34] = javacaja('Otros','En caso de existir otras fuentes de aportación a este tiraje sume todas estas sin incluir las ya registradas','34'); $caja[36] = javacaja('Tiraje','El tiraje es el numero de ejemplares que se imprimierón en la edición de la publicación','36'); $table14->setCell(1,1, "$font1 .... $font3"); $table14->setCell(1,2, "$font4 FUENTE $font3"); $table14->setCell(1,3, "$font4 IMPORTE $font3"); $table14->setCell(2,1, "$font4 . $font3"); $table14->setCell(2,2, "$font5 $caja[33] $font3"); $table14->setCell(2,3,textfield(name=>'reg33',value=> $de>format_price($reg33),-override=>1, -size=>11,-maxlength=>11)); $table14->setCell(3,1, "$font5 $caja[32] $font3"); $table14->setCell(3,2, textfield(-name=>'reg32',-value=>$reg32,-override=>1, -size=>10,-maxlength=>20));

$table14->setCell(3,3, textfield(-name=>'reg35',-value=>$de->format_price($reg35),-override=>1, -size=>11,-maxlength=>11)); $table14->setCell(4,1, "$font4 . $font3"); $table14->setCell(4,2, "$font5 $caja[34] $font3"); $table14->setCell(4,3, textfield(-name=>'reg34',-value=>$de->format_price($reg34),-override=>1, -size=>11,-maxlength=>11)); $table14->setCell(5,1, "$font4 . $font3"); $table14->setCell(5,2, "$font5 $caja[36] $font3"); $table14->setCell(5,3, textfield(-name=>'reg36',-value=>$entero->format_number($reg36),-override=>1, -size=>11,-maxlength=>11)); $table14->setBorder("0"); $table14->setWidth("70%"); $table14->setCellSpacing("7"); $table14->setCellPadding("0"); $table14->setCellAlign(1,1,"LEFT"); $table14->setCellAlign(1,2,"LEFT"); $table14->setCellAlign(1,3,"RIGHT"); $table14->setCellAlign(2,1,"LEFT"); $table14->setCellAlign(2,2,"LEFT"); $table14->setCellAlign(2,3,"RIGHT"); $table14->setCellAlign(3,1,"LEFT"); $table14->setCellAlign(3,2,"LEFT"); $table14->setCellAlign(3,3,"RIGHT"); $table14->setCellAlign(4,1,"LEFT"); $table14->setCellAlign(4,2,"RIGHT");

Page 99: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 200599 de 141

$table14->setCellAlign(4,3,"RIGHT"); #------------------------------------------------------------- $table15 = new HTML::Table(1,6); $table15->setCell(1,1, "$font2 Revista $font3"); $table15->setCell(1,2, textfield(-name=>'reg16',-value=>trim($reg16),-override=>1,-size=>15,-maxlength=>100)); $table15->setCell(1,3, "$font2 Año $font3"); $table15->setCell(1,4, textfield(-name=>'reg3',-value=>trim($reg3),-override=>1,-size=>4,-maxlength=>4)); $table15->setCell(1,5, "$font2 Mes $font3"); $table15->setCell(1,6, popup_menu(-name=>'reg18', values=>[($mes,'01','02','03','04','05','06','07' ,'08','09','10','11','12')])); $table15->setBorder("0"); $table15->setWidth("100%"); $table15->setCellSpacing("7"); $table15->setCellPadding("0"); $table15->setCellAlign(1,1,"LEFT"); $table15->setCellAlign(1,3,"LEFT"); $table15->setCellAlign(1,5,"LEFT"); #------------------------------------------------------------- $numcampo = 0; if ($xreg eq 'OFICINAS CENTRALES') { $sql0 = "SELECT nombre FROM uaa order by nombre"; } else { $sql0 = "SELECT nombre FROM uaa WHERE\ nombre_reg = '$xreg' order by nombre"; } $sth0 = $dbh1->prepare($sql0); $sth0->execute; while ( $campos[$numcampo] = $sth0->fetchrow_array) { $numcampo=$numcampo + 1; } $table2 = new HTML::Table(4,4); $table2->setCell(1,1, "$font2 Arbitraje $font3"); $table2->setCell(1,2, popup_menu(-name=>'reg30',-override=>1, -values=>[($reg30,'SI','NO')])); $table2->setCell(1,3, hidden(-name=>'xreg',-value=>'$xreg')); $table2->setCell(1,4, hidden(-name=>'nc',-value=>'$nc')); $table2->setCell(2,1, "$font2 Subsector $font3"); $table2->setCell(2,2, popup_menu(-name=>'reg12',-override=>1, -values=>[($reg12,'Agricola','Pecuaria','Forestal','Multisector')]));

Page 100: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005100 de 141

$table2->setCell(2,3, "$font2 Campo Experimental $font3"); $table2->setCell(2,4, popup_menu(-name=>'reg11', -values=>[($reg11,@campos)])); $caja[25] = javacaja('Lugar de la Publicación','Lugar y País, separados por un punto.', '25'); $table2->setCell(3,1, "$font5 $caja[25] $font3"); $table2->setCell(3,2, textfield(-name=>'reg25',-value=>trim($reg25),-override=>1,-size=>20,-maxlength=>30)); $table2->setCell(3,3, "$font2 Institución Responsable $font3"); $table2->setCell(3,4, textfield(-name=>'reg26',-value=>trim($reg26),-override=>1,-size=>20,-maxlength=>30)); $table2->setBorder("0"); $table2->setWidth("100%"); $table2->setCellSpacing("7"); $table2->setCellPadding("0"); $table2->setCellAlign(1,1,"LEFT"); $table2->setCellAlign(1,2,"LEFT"); $table2->setCellAlign(1,3,"LEFT"); $table2->setCellAlign(1,4,"LEFT"); $table2->setCellAlign(2,1,"LEFT"); $table2->setCellAlign(2,2,"LEFT"); $table2->setCellAlign(2,3,"LEFT"); $table2->setCellAlign(2,4,"LEFT"); #----------------------------------------------------------------- $table3 = new HTML::Table(2,4); @sistema_prod = catalogo('sistema_producto','nombre'); $table3->setCell(1,1, "$font2 Sistema Producto $font3"); $table3->setCell(1,2, popup_menu(-name=>'reg13',-values=>[($reg13,@sistema_prod)])); $table3->setCell(1,3, "$font2 Usuario $font3"); $table3->setCell(1,4, popup_menu(-name=>'reg31',-values=>[($reg31,'Cientifico','Tecnico','Productor','Publico en General')])); @especialidad = catalogo ('especialidad','nombre'); $table3->setCell(2,1, "$font2 Especialidad $font3"); $table3->setCell(2,2, popup_menu(-name=>'reg14',-values=>[($reg14,@especialidad)])); $table3->setBorder("0"); $table3->setWidth("100%"); $table3->setCellSpacing("7"); $table3->setCellPadding("0"); $table3->setCellAlign(1,1,"LEFT"); $table3->setCellAlign(1,2,"LEFT"); #----------------------------------------------------------------- $table35 = new HTML::Table(1,3); $caja[0] =javacaja('Se Graba S/N', 'Marcar S si desea grabar en forma definitiva o N si desea grabar en forma temporal','0'); $table35->setCell(1,1, "$font5 $caja[0] $font3");

Page 101: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005101 de 141

$graba='N'; $table35->setCell(1,2, radio_group (-name => 'graba',-value => 'S')); $table35->setCell(1,3, radio_group (-name => 'graba',-value => 'N')); $table35->setBorder("1"); $table35->setWidth("35%"); $table35->setCellSpacing("0"); $table35->setCellPadding("0"); $table35->setCellAlign(1,1,"LEFT"); $table35->setCellAlign(1,3,"LEFT"); # Creamos la tabla que contiene los botones enviar y # o cancelar $table99 = new HTML::Table(1,3); $table99->setCellWidth(1, 1, "20%"); $table99->setCellWidth(1, 2, "20%"); $table99->setCellWidth(1, 3, "20%"); $table99->setBorder("0"); $table99->setWidth("100%"); $table99->setCellSpacing("0"); $table99->setCellPadding("0"); $table99->setCellAlign(1,1,"CENTER"); $table99->setCellAlign(1,2,"CENTER"); $table99->setCellAlign(1,3,"CENTER"); $table99->setCell(1,1, submit(-value=>'Insertar', -name=>'insertar')); $table99->setCell(1,3, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las tablas anteriores. $table0 = new HTML::Table(11,1); $table0->setCell(1,1,"$imgReg"); $table0->setCell(2,1,"$font2 $xreg <br> Artículos Científicos Y Técnicos $font3"); $table0->setCell(3,1,"$font1 . $font3"); $table0->setCell(4,1, $table1->getTable); $table0->setCell(5,1, $table13->getTable); $table0->setCell(6,1, $table15->getTable); $table0->setCell(7,1, $table2->getTable); $table0->setCell(8,1, $table3->getTable); $table0->setCell(9,1, $table14->getTable); $table0->setCell(10,1, $table35->getTable); $table0->setCell(11,1, $table99->getTable); $table0->setCellAlign(1,1,"CENTER"); $table0->setCellAlign(2,1,"CENTER"); $table0->setCellAlign(10,1,"CENTER"); $table0->setBorder("0"); $table0->setWidth("90%"); $table0->setCellSpacing("0"); $table0->setCellPadding("0");

Page 102: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005102 de 141

} sub inserta { # en esta funcion se realizan inserciones a la tabla publica2 my($usr); # Definimos la sentencia SQL para traer el numero de registro $num_registro1 = 0; $reg9 = 'Articulo'; if ($graba eq 'S') { $sql = " select MAX(num_registro) from publica2 where tpublicación = '$reg9'"; $sth = $dbh->prepare($sql); $sth->execute; $num_registro1 = $sth->fetchrow_array() + 1; } else { $num_registro1 = 0; } $sql = "DELETE FROM publica2 WHERE (ip='$ip' and num_registro=0 and tipo_reg='1')"; $sth = $dbh->prepare($sql); $sth->execute; $hoy = localtime(); $hoydia = $hoy->mday; $hoymes = $hoy->mon + 1; $hoyanio = $hoy->year + 1900; if ($xreg eq 'OFICINAS CENTRALES') { #$sql0 = "SELECT nom_region FROM campo_exp WHERE nombre = '$reg11'"; $sql0 = "SELECT nombre_reg FROM uaa WHERE nombre = '$reg11'"; $sth0 = $dbh1->prepare($sql0); $sth0->execute; $reg10 = $sth0->fetchrow_array(); } else { $reg10 = $xreg; } # ********* BUSCA EL USUARIO ********* $sql = " select usuario from logintemp where num_consec = $nc"; $sth = $dbh->prepare($sql); $sth->execute; $usr = $sth->fetchrow_array(); if (not($reg2)) { $reg2 = '.';

Page 103: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005103 de 141

} $reg5 = 'na'; $reg15 = '06/06/2001'; $reg17 = $ip; $reg18 = "$reg18/01/$reg3"; $reg19 = "$hoymes/$hoydia/$hoyanio"; $reg20 = 'na'; $reg21 = 'na'; $reg22 = 'na'; $reg23 = 'na'; $reg24 = 0; $reg27 = 'na'; $reg28 = '1'; $reg29 = 'ARTICULOS CIENTIFICOS Y TECNICOS'; $reg33 = $de->unformat_number($reg33); $reg34 = $de->unformat_number($reg34); $reg35 = $de->unformat_number($reg35); $reg36 = $entero->unformat_number($reg36); #$reg37 = 'na'; $sql = "SELECT nombre_comp from plantilla where rfc = '$reg37'"; $sth = $dbh1->prepare($sql) or die "No se ha preparado: $DBI::errstr"; $sth->execute or die "No se puede ejecutar: $DBI::errstr"; @resultado3 = $sth->fetchrow_array(); $nombrecomp = $resultado3[0];

$sql = "INSERT INTO publica2 VALUES ($num_registro1, '$reg1', '$reg2', '$reg3', '$reg4', '$reg5',

'$reg6', '$reg7', '$reg8', '$reg9', '$reg10', '$reg11', '$reg12', '$reg13', '$reg14', '$reg15', '$reg16', '$reg17', ’$reg18', '$reg19', $reg20','$reg21','$reg22','$reg23',$reg24,'$reg25','$reg26','$reg27', '$reg28','$reg29','$reg30', ''$reg31','$reg32',$reg33,$reg34,$reg35,$reg36,'$usr','','','','$reg37', '$nombrecomp')";

# Preparamos y ejecutamos la sentencia. $sth = $dbh->prepare($sql); $sth->execute; } sub imprime { #Generamos el interfaz de registro del usuario (HTML) print header(-expires=>'now'), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html(), -link=>'007777', -vlink=>'007777'), start_form(-action=>'act_articulos.cgi'); # Imprimimos el codigo java con el ancho de cuadro de 90 para este caso

Page 104: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005104 de 141

print java0('90'); # Imprimimos el resultado almacenado en la variable $table0 $table0->print; print end_form(); } # Fin de programa act_articulos.cgi

Page 105: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005105 de 141

act_tesis.cgi #!/usr/bin/perl -w BEGIN { # Declaramos la ruta de ubicacion del modulo 'comun'. @INC=(@INC,"/var/www/cgi-bin/comun"); } use infoteca_html; use strict; use vars qw($num_registro1 $graba $actualiza $hoy $hoydia $hoymes $hoyanio $reg0 $reg1 $reg2 $reg3 $reg4 $reg5 $reg6 $reg7 $reg8 $reg9 $reg10 $reg11 $reg12 $reg13 $reg14 $reg15 $reg16 $reg17 $reg18 $reg19 $reg20 $reg21 $reg22 $reg23 $reg24 $reg25 $reg26 $reg27 $reg28 $reg29 $reg30 $reg31 $reg37 $mes $ip $sql $sth $dbh $cabeza $error $quien_soy $dbh1 $sql0 $sth0 $table0 $nc $xreg $lista $indice @resultado_rfc @resultado_nom %etiquetas $tt $nombrecomp @resultado3); # ------------------------------------------------------- #conectamos a la bases de datos local $dbh = DBI->connect("dbi:Pg:dbname=infoteca","postgres","mysql") or die \ "Imposible conectar a la base de datos infoteca: $DBI::errstr"; $dbh1 = DBI->connect("dbi:Pg:dbname=nomina","postgres","mysql") or die \ "Imposible conectar a la base de datos nomina: $DBI::errstr"; # -------------------------------------------------------- $sql = "SET DATESTYLE TO 'SQL, EUROPEAN'"; $sql = $dbh->prepare($sql); $sql->execute; $nc = param('nc'); $xreg = param('xreg'); $ip = remote_host(); $num_registro1 = param('num_registro1'); $graba = param('graba') || 'N'; $actualiza = param('actualiza'); $tt = param('tt'); $reg0 = param('reg0'); $reg1 = param('reg1'); $reg2 = param('reg2'); $reg3 = param('reg3'); $reg4 = param('reg4'); $reg5 = param('reg5'); $reg6 = param('reg6'); $reg7 = param('reg7'); $reg8 = param('reg8'); $reg9 = param('reg9'); $reg10 = param('reg10'); $reg11 = param('reg11'); $reg12 = param('reg12');

Page 106: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005106 de 141

$reg13 = param('reg13'); $reg14 = param('reg14'); $reg15 = param('reg15'); $reg16 = param('reg16'); $reg18 = param('reg18'); $reg19 = param('reg19'); $reg20 = param('reg20'); $reg21 = param('reg21'); $reg22 = param('reg22'); $reg23 = param('reg23'); $reg24 = param('reg24'); $reg25 = param('reg25'); $reg26 = param('reg26'); $reg27 = param('reg27'); $reg28 = param('reg28'); $reg29 = param('reg29'); $reg30 = param('reg30'); $reg31 = param('reg31'); $reg37 = param('reg37'); $mes = param('mes'); $hoy = param('hoy'); $hoydia = param('hoydia'); $hoymes = param('hoymes'); $hoyanio = param('hoyanio'); #----------------------------------------------------------- if (($reg1) && ($reg3) && ($reg18)) { inserta(); &insert_ok; } form(); imprime(); #------------------------------------------------------------------ #DECLARACION DE FORMULARIO sub form { my (@caja, @resultado, @campos, @sistema_prod, @especialidad, $uaa, $region, $numcampo, $sth,

$table1, $table15, $table2, $table25, $table3, $table35, $table99, $font1, $font2, $font3, $font4, $font5); #Declaramos las variables para manipular las fuentes en HTML $font1='<font face="Arial,Helvetica"><font color="white">'; $font2='<font face="Arial,Helvetica" size ="-1"><font color="007777">'; $font4='<font face="Arial,Helvetica"><font color="007777"><font size="-1">'; $font5='<font face="Arial,Helvetica"><font color="007777">'; $font3='</font>'; $sql = "SELECT * FROM publica2 WHERE (ip='$ip' and num_registro=0 and tipo_reg='2')";

Page 107: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005107 de 141

$sth = $dbh->prepare($sql); $sth->execute; @resultado = $sth->fetchrow_array(); $graba='N'; $actualiza =\'N'; if (@resultado) { $actualiza =\'S'; $reg1 = $resultado[1]; $reg2 = $resultado[2]; $reg3 = $resultado[3]; $reg4 = $resultado[4]; $reg5 = $resultado[5]; $reg6 = $resultado[6]; $reg7 = $resultado[7]; $reg8 = $resultado[8]; $reg9 = $resultado[9]; $reg10 = trim($resultado[10]); $reg11 = trim($resultado[11]); $reg12 = trim($resultado[12]); $reg13 = $resultado[13]; $reg14 = $resultado[14]; $reg15 = $resultado[15]; $reg16 = $resultado[16]; $reg18 = $resultado[18]; $mes = substr($reg18,3,2); $reg19 = $resultado[19]; $reg20 = $resultado[20]; $reg21 = $resultado[21]; $reg22 = $resultado[22]; $reg23 = $resultado[23]; $reg24 = $resultado[24]; $reg25 = $resultado[25]; $reg26 = $resultado[26]; $reg27 = $resultado[27]; $reg28 = $resultado[28]; $reg29 = $resultado[29]; $reg30 = trim($resultado[30]); $reg31 = trim($resultado[31]); $reg37 = trim($resultado[41]); } #Creamos las tablas que contiene las areas de consulta $table1 = new HTML::Table(8,4); $caja[1] = javacaja('Autor','Indicar por el apellido paterno, separado del materno por un espacio y consignar el apellido materno por su inicial en mayúscula e igual que las iniciales en mayúsculas del nombre(s).','1'); $table1->setCell(1,1, "$font1 .... $font3"); $table1->setCell(1,2, "$font4 e.g. Beltrán L.,S. $font3");

Page 108: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005108 de 141

$table1->setCell(1,3, "$font1 .... $font3"); #$table1->setCell(1,4, "$font4 e.g. 4 $font3"); $table1->setCell(2,1, "$font5 $caja[1] $font3"); $table1->setCell(2,2, textfield(-name=>'reg1',-value=>trim($reg1),-override=>1,-size=>30,-maxlength=>30)); $indice = 0; $lista = ''; @resultado_nom = catalogo_selectivo('plantilla','nombre_comp','nombre_comp'); @resultado_rfc = catalogo_selectivo('plantilla','rfc','nombre_comp'); while ($resultado_nom[$indice]) { $etiquetas{$resultado_rfc[$indice]} = $resultado_nom[$indice]; $indice = $indice + 1; } $table1->setCell(2,3,"$font5 Seleccione Nombre Completo de Autor $font3"); $table1->setCell(2,4, popup_menu(-name=>'reg37',-values=>[('',@resultado_rfc)],-labels=>\%etiquetas)); $table1->setCell(3,1, "$font1 .... $font3"); $table1->setCell(3,2, "$font4 e.g. Beltrán L.,S.;Sosa P.P. $font3"); $table1->setCell(3,3, "$font1 .... $font3"); $caja[2] = javacaja('Coautor','El registro de este campo debera de ser igual que al de autor y solo

separado por un punto y coma por cada coautor','2'); $table1->setCell(4,1, "$font5 $caja[2] $font3"); $table1->setCell(4,2, textfield(-name=>'reg2',-value=>trim($reg2),-override=>1, -size=>30,-maxlength=>200)); $table1->setCell(5,1, "$font1 .... $font3"); $table1->setCell(5,2, "$font4 e.g. Influencía del manejo de cosecha en la dinámica de crecimiento del

pasto Buffel. $font3"); $table1->setCell(5,3, "$font1 .... $font3"); $table1->setCell(5,4, "$font4 e.g. 125 páginas $font3"); $caja[4] = javacaja('Título de la Tésis','Iniciar con mayúsculas y separar por dos puntos e l subtitulo y por un punto el final del texto','4'); $table1->setCell(6,1, "$font5 $caja[4] $font3"); $table1->setCell(6,2, textfield(-name=>'reg4',-value=>trim($reg4),-override=>1,-size=>30,-maxlength=>200)); $caja[8] = javacaja('Página','Numero de Páginas ó entre que paginas se encuentra la publicación','8'); $table1->setCell(6,3, "$font5 $caja[8] $font3"); $table1->setCell(6,4, textfield(-name=>'reg8',-value=>trim($reg8),-override=>1,-size=>10,-maxlength=>10)); $table1->setCell(7,1, "$font1 .... $font3"); $table1->setCell(7,2, "$font4 .... $font3");

Page 109: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005109 de 141

$table1->setCell(7,3, "$font4 e.g. 1998 $font3"); $table1->setCell(7,4, "$font1 .... $font3"); $table1->setCell(8,1, hidden(-name=>'reg37',-value=>'$reg37')); $table1->setBorder("0"); $table1->setWidth("75%"); $table1->setCellSpacing("7"); $table1->setCellPadding("0"); $table1->setCellAlign(1,1,"LEFT"); $table1->setCellAlign(1,2,"LEFT"); $table1->setCellAlign(1,3,"LEFT"); $table1->setCellAlign(1,4,"LEFT"); $table1->setCellAlign(2,1,"LEFT"); $table1->setCellAlign(2,2,"LEFT"); $table1->setCellAlign(2,3,"LEFT"); $table1->setCellAlign(2,4,"LEFT"); $table1->setCellAlign(3,1,"LEFT"); $table1->setCellAlign(3,2,"LEFT"); $table1->setCellAlign(3,3,"LEFT"); $table1->setCellAlign(3,4,"LEFT"); $table1->setCellAlign(4,1,"LEFT"); $table1->setCellAlign(4,2,"LEFT"); $table1->setCellAlign(4,3,"LEFT"); $table1->setCellAlign(4,4,"LEFT"); $table1->setCellAlign(7,3,"LEFT"); #------------------------------------------------------------- $table15 = new HTML::Table(3,6); $table15->setCell(1,1, "$font2 Grado obtenido$font3"); $table15->setCell(1,2, popup_menu(-name=>'reg20', values=>[($reg20,'Licencitura','Maestría','Doctorado')])); $table15->setCell(1,3, "$font2 Año de la Publicación $font3"); $table15->setCell(1,4, textfield(-name=>'reg3',-value=>trim($reg3),-override=>1,-size=>4,-maxlength=>4)); $table15->setCell(1,5, "$font2 Mes de la Publicación $font3"); $table15->setCell(1,6, popup_menu(-name=>'reg18', values=>[($mes,'01','02','03','04','05','06','07','08','09','10','11','12')])); $table15->setCell(3,1, "$font2 Universidad $font3"); $table15->setCell(3,2, textfield(-name=>'reg21',-value=>trim($reg21),-override=>1,-size=>15,-maxlength=>30)); $table15->setCell(2,1, "$font1 .... $font3"); $table15->setCell(2,2, "$font4 e.g. UNAM $font3"); $table15->setCell(2,3, "$font1 .... $font3"); $table15->setCell(2,4, "$font4 e.g. Veterinaría $font3"); $table15->setCell(3,3, "$font2 Facultad $font3"); $table15->setCell(3,4, textfield(-name=>'reg22',-value=>trim($reg22),-override=>1,-size=>15,-maxlength=>30)); $caja[25] = javacaja('Lugar de la Publicación','Lugar y País, separados por un

Page 110: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005110 de 141

punto.', '25'); $table15->setCell(3,5, "$font5 $caja[25] $font3"); $table15->setCell(3,6, textfield(-name=>'reg25',-value=>trim($reg25),-override=>1,-size=>10,-maxlength=>30)); $table15->setBorder("0"); $table15->setWidth("100%"); $table15->setCellSpacing("7"); $table15->setCellPadding("0"); $table15->setCellAlign(1,1,"LEFT"); $table15->setCellAlign(1,3,"LEFT"); $table15->setCellAlign(1,5,"LEFT"); $table15->setCellAlign(1,6,"LEFT"); $table15->setCellAlign(2,1,"LEFT"); $table15->setCellAlign(2,3,"LEFT"); $table15->setCellAlign(2,5,"LEFT"); #------------------------------------------------------------- $numcampo = 0; if ($xreg eq 'OFICINAS CENTRALES') { $sql0 = "SELECT nombre FROM uaa order by nombre"; } else { $sql0 = "SELECT nombre FROM uaa WHERE\ nombre_reg = '$xreg' order by nombre"; } $sth0 = $dbh1->prepare($sql0); $sth0->execute; while ( $campos[$numcampo] = $sth0->fetchrow_array) { $numcampo=$numcampo + 1; } $table2 = new HTML::Table(1,6); $table2->setCell(1,1, "$font2 Subsector $font3"); $table2->setCell(1,2, popup_menu(-name=>'reg12',-override=>1, -values=>[($reg12,'Agrícola','Pecuaria','Forestal','Multisector')])); $table2->setBorder("0"); $table2->setWidth("100%"); $table2->setCellSpacing("7"); $table2->setCellPadding("0"); $table2->setCellAlign(1,1,"LEFT"); $table2->setCellAlign(1,2,"LEFT"); $table2->setCellAlign(1,3,"LEFT"); $table2->setCellAlign(1,4,"LEFT"); $table2->setCellAlign(2,1,"LEFT");

Page 111: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005111 de 141

$table2->setCellAlign(2,2,"LEFT"); $table2->setCellAlign(2,3,"LEFT"); $table2->setCellAlign(2,4,"LEFT"); #----------------------------------------------------------------- $table25= new HTML::Table(1,4); $table25->setCell(1,1, hidden(-name=>'xreg',-value=>'$xreg')); $table25->setCell(1,2, hidden(-name=>'nc',-value=>'$nc')); $table25->setCell(1,3, "$font2 Campo Experimental $font3"); $table25->setCell(1,4, popup_menu(-name=>'reg11',-values=>[($reg11,@campos)])); $table25->setBorder("0"); $table25->setWidth("100%"); $table25->setCellSpacing("7"); $table25->setCellPadding("0"); $table25->setCellAlign(1,1,"LEFT"); $table25->setCellAlign(1,2,"LEFT"); $table25->setCellAlign(1,3,"LEFT"); $table25->setCellAlign(1,4,"LEFT"); #----------------------------------------------------------------- $table3 = new HTML::Table(2,2); @sistema_prod = catalogo('sistema_producto','nombre'); $table3->setCell(1,1, "$font2 Sistema Producto $font3"); $table3->setCell(1,2, popup_menu(-name=>'reg13',-values=>[($reg13,@sistema_prod)])); @especialidad = catalogo ('especialidad','nombre'); $table3->setCell(2,1, "$font2 Especialidad $font3"); $table3->setCell(2,2, popup_menu(-name=>'reg14',-values=>[($reg14,@especialidad)])); $table3->setBorder("0"); $table3->setWidth("100%"); $table3->setCellSpacing("7"); $table3->setCellPadding("0"); $table3->setCellAlign(1,1,"LEFT"); $table3->setCellAlign(1,2,"LEFT"); #----------------------------------------------------------------- @especialidad = catalogo ('especialidad','nombre'); $table35 = new HTML::Table(1,3); $caja[0] =javacaja('Se Graba S/N', 'Marcar S si desea registrar en forma definitiva o N si desea grabar en f

orma temporal','0'); $table35->setCell(1,1, "$font5 $caja[0] $font3"); $table35->setCell(1,2, radio_group (-name => 'graba',-value => 'S')); $table35->setCell(1,3, radio_group (-name => 'graba',-value => 'N')); $table35->setBorder("1"); $table35->setWidth("35%"); $table35->setCellSpacing("0"); $table35->setCellPadding("0"); $table35->setCellAlign(1,1,"LEFT"); $table35->setCellAlign(1,3,"LEFT");

Page 112: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005112 de 141

# Creamos la tabla que contiene los botones enviar y/o cancelar $table99 = new HTML::Table(1,3); $table99->setCellWidth(1, 1, "20%"); $table99->setCellWidth(1, 2, "20%"); $table99->setCellWidth(1, 3, "20%"); $table99->setBorder("0"); $table99->setWidth("100%"); $table99->setCellSpacing("0"); $table99->setCellPadding("0"); $table99->setCellAlign(1,1,"CENTER"); $table99->setCellAlign(1,2,"CENTER"); $table99->setCellAlign(1,3,"CENTER"); $table99->setCell(1,1, submit(-value=>'Insertar', -name=>'insertar')); $table99->setCell(1,3, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las tablas anteriores. $table0 = new HTML::Table(10,1); $table0->setCell(1,1,"$imgReg"); $table0->setCell(2,1,"$font2 $xreg <br> Tésis para la obtención de Grado $font3"); $table0->setCell(4,1, $table1->getTable); $table0->setCell(5,1, $table15->getTable); $table0->setCell(6,1, $table2->getTable); $table0->setCell(7,1, $table25->getTable); $table0->setCell(8,1, $table3->getTable); $table0->setCell(9,1, $table35->getTable); $table0->setCell(10,1, $table99->getTable); $table0->setCellAlign(1,1,"CENTER"); $table0->setCellAlign(2,1,"CENTER"); $table0->setCellAlign(9,1,"CENTER"); $table0->setBorder("0"); $table0->setWidth("90%"); $table0->setCellSpacing("0"); $table0->setCellPadding("0"); } #%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% sub inserta { # en esta funcion se realizan inserciones a la tabla publica my($usr); # Definimos la sentencia SQL para traer el numero de registro $num_registro1 = 0; $reg9 = 'Tesis'; if ($graba eq 'S') { $sql = " select MAX(num_registro) from publica2 where tpublicación = '$reg9'";

Page 113: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005113 de 141

$sth = $dbh->prepare($sql); $sth->execute; $num_registro1 = $sth->fetchrow_array() + 1; } else { $num_registro1 = 0; } $sql = "DELETE FROM publica2 WHERE (ip='$ip' and num_registro=0 and tipo_reg ='2')"; $sth = $dbh->prepare($sql); $sth->execute; $hoy = localtime(); $hoydia = $hoy->mday; $hoymes = $hoy->mon + 1; $hoyanio = $hoy->year + 1900; if ($hoydia < 10) { $hoydia = '0'.$hoydia; } if ($hoymes < 10) { $hoymes = '0'.$hoymes; } if ($xreg eq 'OFICINAS CENTRALES') { $sql0 = "SELECT nombre_reg FROM uaa WHERE nombre = '$reg11'"; $sth0 = $dbh1->prepare($sql0); $sth0->execute; $reg10 = $sth0->fetchrow_array(); } else { $reg10 = $xreg; } # ********* BUSCA EL USUARIO ********* $sql = " select usuario from logintemp where num_consec = $nc"; $sth = $dbh->prepare($sql); $sth->execute; $usr = $sth->fetchrow_array(); if (not($reg2)) { $reg2 = '.'; }

Page 114: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005114 de 141

$reg5 = 'na'; $reg6 = 'na'; $reg7 = 'na'; $reg15 = '06/06/2001'; $reg16 ='na'; $reg17 = $ip; $reg18 = "$reg18/01/$reg3"; $reg19 = "$hoydia/$hoymes/$hoyanio"; $reg23 = 'na'; $reg24 = 0; $reg26 = 'na'; $reg27 = 'na'; $reg28 = '2'; $reg29 = 'TESIS'; $reg30 = 'na'; $reg31 = 'na'; #Para encontrar el Nombre Completo del Autor1 $sql = "SELECT nombre_comp from plantilla where rfc = '$reg37'"; $sth = $dbh1->prepare($sql) or die "No se ha preparado: $DBI::errstr"; $sth->execute or die "No se puede ejecutar: $DBI::errstr"; @resultado3 = $sth->fetchrow_array(); $nombrecomp = $resultado3[0]; $tt = $sql = "INSERT INTO publica2 VALUES ($num_registro1, '$reg1', '$reg2', '$reg3', '$reg4','$reg5',

'$reg6', '$reg7', '$reg8', '$reg9', '$reg10', '$reg11', '$reg12', '$reg13', '$reg14', '$reg15', '$reg16', '$reg17', '$reg18','$reg19','$reg20','$reg21','$reg22','$reg23',$reg24,'$reg25','$reg26','$reg27','$reg28','$reg29','$reg30','$reg31','',0,0,0,0,'$usr','','','','$reg37','$nombrecomp')";

# Preparamos y ejecutamos la sentencia. $sth = $dbh->prepare($sql); $sth->execute; $reg0 =''; $reg1 =''; $reg2 =''; $reg3 =''; $reg4 =''; $reg5 =''; $reg6 =''; $reg7 =''; $reg8 =''; $reg9 =''; $reg10 =''; $reg11 =''; $reg12 =''; $reg13 ='';

Page 115: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005115 de 141

$reg14 =''; $reg15 =''; $reg16 =''; $reg17 =''; $reg18 =''; $reg19 =''; $reg20 =''; $reg21 =''; $reg22 =''; $reg23 =''; $reg24 =''; $reg25 =''; $reg26 =''; $reg27 =''; $reg28 =''; $reg29 =''; $reg30 =''; $reg31 =''; } sub imprime { #Generamos el interfaz de registro del usuario (HTML) print header(-expires=>'now'), start_html(-title=>'Infoteca INIFAP',-script=>'',-

background=>&cabeza_html(), -link=>'007777', -vlink=>'007777'), start_form(-action=>'act_tesis.cgi'); # Imprimimos el codigo java con el ancho de cuadro de 90 para este caso print java0('90'); # Imprimimos el resultado almacenado en la variable $table0 $table0->print; print end_form(); # Imprimimos los tags de fin de documento HTML. print cola_html(); } # Fin de act_tesis.cgi

Page 116: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005116 de 141

act_tesis_dir.cgi #!/usr/bin/perl -w BEGIN { # Declaramos la ruta de ubicacion del modulo 'comun'. @INC=(@INC,"/var/www/cgi-bin/comun"); } use infoteca_html; use strict; use vars qw($num_registro1 $graba $actualiza $hoy $hoydia $hoymes $hoyanio $reg0 $reg1 $reg2 $reg3 $reg4 $reg5 $reg6 $reg7 $reg8 $reg9 $reg10 $reg11 $reg12 $reg13 $reg14 $reg15 $reg16 $reg17 $reg18 $reg19 $reg20 $reg21 $reg22 $reg23 $reg24 $reg25 $reg26 $reg27 $reg28 $reg29 $reg30 $reg31 $reg37 $mes $ip $sql $sth $dbh $cabeza $error $quien_soy $dbh1 $sql0 $sth0 $table0 $nc $xreg $lista $indice @resultado_rfc @resultado_nom %etiquetas $tt $nombrecomp @resultado3); # ------------------------------------------------------- #conectamos a la bases de datos local $dbh = DBI->connect("dbi:Pg:dbname=infoteca","postgres","mysql") or die \ "Imposible conectar a la base de datos infoteca: $DBI::errstr"; $dbh1 = DBI->connect("dbi:Pg:dbname=nomina","postgres","mysql") or die \ "Imposible conectar a la base de datos nomina: $DBI::errstr"; # ------------------------------------------------------- $ip = remote_host(); $nc = param('nc'); $xreg = param('xreg'); $num_registro1 = param('num_registro1'); $graba = param('graba') || 'N'; $actualiza = param('actualiza'); $reg0 = param('reg0'); $reg1 = param('reg1'); $reg2 = param('reg2'); $reg3 = param('reg3'); $reg4 = param('reg4'); $reg5 = param('reg5'); $reg6 = param('reg6'); $reg7 = param('reg7'); $reg8 = param('reg8'); $reg9 = param('reg9'); $reg10 = param('reg10'); $reg11 = param('reg11'); $reg12 = param('reg12'); $reg13 = param('reg13'); $reg14 = param('reg14'); $reg15 = param('reg15'); $reg16 = param('reg16'); $reg18 = param('reg18');

Page 117: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005117 de 141

$reg19 = param('reg19'); $reg20 = param('reg20'); $reg21 = param('reg21'); $reg22 = param('reg22'); $reg23 = param('reg23'); $reg24 = param('reg24'); $reg25 = param('reg25'); $reg26 = param('reg26'); $reg27 = param('reg27'); $reg28 = param('reg28'); $reg29 = param('reg29'); $reg30 = param('reg30'); $reg31 = param('reg31'); $reg37 = param('reg37'); $mes = param('mes'); $hoy = param('hoy'); $hoydia = param('hoydia'); $hoymes = param('hoymes'); $hoyanio = param('hoyanio'); #----------------------------------------------------------- if (($reg1) && ($reg3) && ($reg18)) { inserta(); &insert_ok; } form(); imprime(); #------------------------------------------------------------------ #DECLARACION DE FORMULARIO sub form { my (@caja, @resultado, @campos, @sistema_prod, @especialidad, $uaa, $region, $numcampo, $sth, $table1, $table15, $table2, $table25, $table3, $table35, $table99, $font1, $font2, $font3, $font4, $font5); #Declaramos las variables para manipular las fuentes en HTML $font1='<font face="Arial,Helvetica"><font color="white">'; $font2='<font face="Arial,Helvetica" size ="-1"><font color="007777">'; $font4='<font face="Arial,Helvetica"><font color="007777"><font size="-1">'; $font5='<font face="Arial,Helvetica"><font color="007777">'; $font3='</font>'; $sql = "SELECT * FROM publica2 WHERE (ip='$ip' and num_registro=0 and tipo_reg='2')"; $sth = $dbh->prepare($sql); $sth->execute; @resultado = $sth->fetchrow_array(); $graba='N'; $actualiza =\'N';

Page 118: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005118 de 141

if (@resultado) { $actualiza =\'S'; $reg1 = $resultado[1]; $reg2 = $resultado[2]; $reg3 = $resultado[3]; $reg4 = $resultado[4]; $reg5 = $resultado[5]; $reg6 = $resultado[6]; $reg7 = $resultado[7]; $reg8 = $resultado[8]; $reg9 = $resultado[9]; $reg10 = trim($resultado[10]); $reg11 = trim($resultado[11]); $reg12 = trim($resultado[12]); $reg13 = $resultado[13]; $reg14 = $resultado[14]; $reg15 = $resultado[15]; $reg16 = $resultado[16]; $reg18 = $resultado[18]; $mes = substr($reg18,3,2); $reg19 = $resultado[19]; $reg20 = $resultado[20]; $reg21 = $resultado[21]; $reg22 = $resultado[22]; $reg23 = $resultado[23]; $reg24 = $resultado[24]; $reg25 = $resultado[25]; $reg26 = $resultado[26]; $reg27 = $resultado[27]; $reg28 = $resultado[28]; $reg29 = $resultado[29]; $reg30 = trim($resultado[30]); $reg31 = trim($resultado[31]); $reg37 = trim($resultado[41]); } #Creamos las tablas que contiene las areas de consulta $table1 = new HTML::Table(8,4); $caja[1] = javacaja('Director/Asesor','Indicar por el apellido paterno, separado del materno por un espacio y consignar el apellido materno por su inicial en mayúscula e igual que las iniciales en mayúsculas del nombre(s).','1'); $table1->setCell(1,1, "$font1 .... $font3"); $table1->setCell(1,2, "$font4 e.g. Beltrán L.,S. $font3"); $table1->setCell(1,3, "$font1 .... $font3"); $table1->setCell(2,1, "$font5 $caja[1] $font3"); $table1->setCell(2,2, textfield(-name=>'reg1',-value=>trim($reg1),-override=>1,-size=>30,-maxlength=>30));

Page 119: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005119 de 141

$indice = 0; $lista = ''; @resultado_nom = catalogo_selectivo('plantilla','nombre_comp','nombre_comp'); @resultado_rfc = catalogo_selectivo('plantilla','rfc','nombre_comp'); while ($resultado_nom[$indice]) { $etiquetas{$resultado_rfc[$indice]} = $resultado_nom[$indice]; $indice = $indice + 1; } $table1->setCell(2,3,"$font5 Seleccione Nombre Completo del Director/Asesor $font3"); $table1->setCell(2,4, popup_menu(-name=>'reg37',-values=>[('',@resultado_rfc)],-labels=>\%etiquetas)); $table1->setCell(3,1, "$font1 .... $font3"); $table1->setCell(3,2, "$font4 e.g. Beltrán L.,S.;Sosa P.P. $font3"); $table1->setCell(3,3, "$font1 .... $font3"); $caja[2] = javacaja('Tesista(s)','El registro de este campo debera de ser igual que al del Asesor y solo separado por un punto y coma por cada Tesista','2'); $table1->setCell(4,1, "$font5 $caja[2] $font3"); $table1->setCell(4,2, textfield(-name=>'reg2',-value=>trim($reg2),-override=>1, -size=>30,-maxlength=>200)); $table1->setCell(5,1, "$font1 .... $font3"); $table1->setCell(5,2, "$font4 e.g. Influencia del manejo de cosecha en la dinámica de crecimiento del

pasto Buffel. $font3"); $table1->setCell(5,3, "$font1 .... $font3"); $table1->setCell(5,4, "$font4 e.g. 125 páginas $font3"); $caja[4] = javacaja('Título de la Tésis','Iniciar con mayúsculas y separar por dos puntos el subtitulo y por un punto el final del texto','4'); $table1->setCell(6,1, "$font5 $caja[4] $font3"); $table1->setCell(6,2, textfield(-name=>'reg4',-value=>trim($reg4),-override=>1,-size=>30,-maxlength=>200)); $caja[8] = javacaja('Página','Numero de Páginas ó entre que paginas se encuentra la publicación','8'); $table1->setCell(6,3, "$font5 $caja[8] $font3"); $table1->setCell(6,4, textfield(-name=>'reg8',-value=>trim($reg8),-override=>1,-size=>10,-maxlength=>10)); $table1->setCell(7,1, "$font1 .... $font3"); $table1->setCell(7,2, "$font4 .... $font3"); $table1->setCell(7,3, "$font4 e.g. 1998 $font3"); $table1->setCell(7,4, "$font1 .... $font3"); $table1->setCell(8,1, hidden(-name=>'reg37',-value=>'$reg37')); $table1->setBorder("0"); $table1->setWidth("75%"); $table1->setCellSpacing("7"); $table1->setCellPadding("0");

Page 120: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005120 de 141

$table1->setCellAlign(1,1,"LEFT"); $table1->setCellAlign(1,2,"LEFT"); $table1->setCellAlign(1,3,"LEFT"); $table1->setCellAlign(1,4,"LEFT"); $table1->setCellAlign(2,1,"LEFT"); $table1->setCellAlign(2,2,"LEFT"); $table1->setCellAlign(2,3,"LEFT"); $table1->setCellAlign(2,4,"LEFT"); $table1->setCellAlign(3,1,"LEFT"); $table1->setCellAlign(3,2,"LEFT"); $table1->setCellAlign(3,3,"LEFT"); $table1->setCellAlign(3,4,"LEFT"); $table1->setCellAlign(4,1,"LEFT"); $table1->setCellAlign(4,2,"LEFT"); $table1->setCellAlign(4,3,"LEFT"); $table1->setCellAlign(4,4,"LEFT"); $table1->setCellAlign(7,3,"LEFT"); #------------------------------------------------------------- $table15 = new HTML::Table(3,6); $table15->setCell(1,1, "$font2 Grado obtenido$font3"); $table15->setCell(1,2, popup_menu(-name=>'reg20', values=>[($reg20,'Doctorado','Maestria','Licenciatura')])); $table15->setCell(1,3, "$font2 Año de la Publicación $font3"); $table15->setCell(1,4, textfield(-name=>'reg3',-value=>trim($reg3),-override=>1,-size=>4,-maxlength=>4)); $table15->setCell(1,5, "$font2 Mes de la Publicación $font3"); $table15->setCell(1,6, popup_menu(-name=>'reg18', values=>[($mes,'01','02','03','04','05','06','07','08','09','10','11','12')])); $table15->setCell(3,1, "$font2 Universidad $font3"); $table15->setCell(3,2, textfield(-name=>'reg21',-value=>trim($reg21),-override=>1,-size=>15,-

maxlength=>30)); $table15->setCell(2,1, "$font1 .... $font3"); $table15->setCell(2,2, "$font4 e.g. UNAM $font3"); $table15->setCell(2,3, "$font1 .... $font3"); $table15->setCell(2,4, "$font4 e.g. Veterinaría $font3"); $table15->setCell(3,3, "$font2 Facultad $font3"); $table15->setCell(3,4, textfield(-name=>'reg22',-value=>trim($reg22),-override=>1,-size=>15,-maxlength=>30)); $caja[25] = javacaja('Lugar de la Publicación','Lugar y País, separados por un punto.', '25'); $table15->setCell(3,5, "$font5 $caja[25] $font3"); $table15->setCell(3,6, textfield(-name=>'reg25',-value=>trim($reg25),-override=>1,-size=>10,-maxlength=>30)); $table15->setBorder("0"); $table15->setWidth("100%"); $table15->setCellSpacing("7"); $table15->setCellPadding("0"); $table15->setCellAlign(1,1,"LEFT");

Page 121: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005121 de 141

$table15->setCellAlign(1,3,"LEFT"); $table15->setCellAlign(1,5,"LEFT"); $table15->setCellAlign(1,6,"LEFT"); $table15->setCellAlign(2,1,"LEFT"); $table15->setCellAlign(2,3,"LEFT"); $table15->setCellAlign(2,5,"LEFT"); #------------------------------------------------------------- $numcampo = 0; if ($xreg eq 'OFICINAS CENTRALES') { $sql0 = "SELECT nombre FROM uaa order by nombre"; } else { $sql0 = "SELECT nombre FROM uaa WHERE\ nombre_reg = '$xreg' order by nombre"; } $sth0 = $dbh1->prepare($sql0); $sth0->execute; while ( $campos[$numcampo] = $sth0->fetchrow_array) { $numcampo=$numcampo + 1; } $table2 = new HTML::Table(1,6); $table2->setCell(1,1, "$font2 Subsector$font3"); $table2->setCell(1,2, popup_menu(-name=>'reg12',-override=>1, -values=>[($reg12,'Agrícola','Pecuaria','Forestal','Multisector')])); $table2->setBorder("0"); $table2->setWidth("100%"); $table2->setCellSpacing("7"); $table2->setCellPadding("0"); $table2->setCellAlign(1,1,"LEFT"); $table2->setCellAlign(1,2,"LEFT"); $table2->setCellAlign(1,3,"LEFT"); $table2->setCellAlign(1,4,"LEFT"); $table2->setCellAlign(2,1,"LEFT"); $table2->setCellAlign(2,2,"LEFT"); $table2->setCellAlign(2,3,"LEFT"); $table2->setCellAlign(2,4,"LEFT"); $table25= new HTML::Table(1,4); $table25->setCell(1,1, hidden(-name=>'xreg',-value=>'$xreg')); $table25->setCell(1,2, hidden(-name=>'nc',-value=>'$nc')); $table25->setCell(1,3, "$font2 Campo Experimental $font3"); $table25->setCell(1,4, popup_menu(-name=>'reg11', -values=>[($reg11,@campos)])); $table25->setBorder("0");

Page 122: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005122 de 141

$table25->setWidth("100%"); $table25->setCellSpacing("7"); $table25->setCellPadding("0"); $table25->setCellAlign(1,1,"LEFT"); $table25->setCellAlign(1,2,"LEFT"); $table25->setCellAlign(1,3,"LEFT"); $table25->setCellAlign(1,4,"LEFT"); #----------------------------------------------------------------- $table3 = new HTML::Table(1,2); @sistema_prod = catalogo('sistema_producto','nombre'); $table3->setCell(1,1, "$font2 Sistema Producto $font3"); $table3->setCell(1,2, popup_menu(-name=>'reg13', -values=>[($reg13,@sistema_prod)])); $table3->setBorder("0"); $table3->setWidth("100%"); $table3->setCellSpacing("7"); $table3->setCellPadding("0"); $table3->setCellAlign(1,1,"LEFT"); $table3->setCellAlign(1,2,"LEFT"); #----------------------------------------------------------------- @especialidad = catalogo ('especialidad','nombre'); $table35 = new HTML::Table(1,5); $table35->setCell(1,1, "$font2 Especialidad $font3"); $table35->setCell(1,2, popup_menu(-name=>'reg14', -values=>[($reg14,@especialidad)])); $caja[0] =javacaja('Se Graba S/N', 'Marcar S si desea registrar en forma definitiva o N si desea grabar en forma temporal','0'); $table35->setCell(1,3, "$font5 $caja[0] $font3"); $table35->setCell(1,4, radio_group (-name => 'graba', -value => 'S')); $table35->setCell(1,5, radio_group (-name => 'graba', -value => 'N')); $table35->setBorder("0"); $table35->setWidth("100%"); $table35->setCellSpacing("7"); $table35->setCellPadding("0"); $table35->setCellAlign(1,1,"LEFT"); $table35->setCellAlign(1,3,"LEFT"); # Creamos la tabla que contiene los botones enviar y/o cancelar $table99 = new HTML::Table(1,3); $table99->setCellWidth(1, 1, "20%"); $table99->setCellWidth(1, 2, "20%"); $table99->setCellWidth(1, 3, "20%"); $table99->setBorder("0"); $table99->setWidth("100%");

Page 123: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005123 de 141

$table99->setCellSpacing("0"); $table99->setCellPadding("0"); $table99->setCellAlign(1,1,"CENTER"); $table99->setCellAlign(1,2,"CENTER"); $table99->setCellAlign(1,3,"CENTER"); $table99->setCell(1,1, submit(-value=>'Insertar', -name=>'insertar')); $table99->setCell(1,3, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las tablas anteriores. $table0 = new HTML::Table(10,1); $table0->setCell(1,1,"$imgReg"); $table0->setCell(2,1,"$font2 $xreg $font3"); $table0->setCell(3,1,"$font1 &nbsp; $font3"); $table0->setCell(4,1, $table1->getTable); $table0->setCell(5,1, $table15->getTable); $table0->setCell(6,1, $table2->getTable); $table0->setCell(7,1, $table25->getTable); $table0->setCell(8,1, $table3->getTable); $table0->setCell(9,1, $table35->getTable); $table0->setCell(10,1, $table99->getTable); $table0->setCellAlign(1,1,"CENTER"); $table0->setCellAlign(2,1,"CENTER"); $table0->setBorder("0"); $table0->setWidth("90%"); $table0->setCellSpacing("0"); $table0->setCellPadding("0"); } sub inserta { # en esta funcion se realizan inserciones a la tabla publica my($sth, $table0, $sql, $font1, $font2, $font3, $font_f, $usr); # Definimos la sentencia SQL para traer el numero de registro $num_registro1 = 0; $reg9 = 'Tesis_dirigida'; if ($graba eq 'S') { $sql = " select MAX(num_registro) from publica2 where tpublicación = '$reg9'"; $sth = $dbh->prepare($sql); $sth->execute; $num_registro1 = $sth->fetchrow_array() + 1; } else { $num_registro1 = 0; }

Page 124: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005124 de 141

$sql = "DELETE FROM publica2 WHERE (ip='$ip' and num_registro=0 and tipo_reg ='2')"; $sth = $dbh->prepare($sql); $sth->execute; $hoy = localtime(); $hoydia = $hoy->mday; $hoymes = $hoy->mon + 1; $hoyanio = $hoy->year + 1900; if ($xreg eq 'OFICINAS CENTRALES') { #$sql0 = "SELECT nom_region FROM campo_exp WHERE nombre = '$reg11'"; $sql0 = "SELECT nombre_reg FROM uaa WHERE nombre = '$reg11'"; $sth0 = $dbh1->prepare($sql0); $sth0->execute; $reg10 = $sth0->fetchrow_array(); } else { $reg10 = $xreg; } # ********* BUSCA EL USUARIO ********* $sql = " select usuario from logintemp where num_consec = $nc"; $sth = $dbh->prepare($sql); $sth->execute; $usr = $sth->fetchrow_array(); if (not($reg2)) { $reg2 = '.'; } $reg5 = 'na'; $reg6 = 'na'; $reg7 = 'na'; $reg15 = '06/06/2001'; $reg16 = 'na'; $reg17 = $ip; $reg18 = "$reg18/01/$reg3"; $reg19 = "$hoymes/$hoydia/$hoyanio"; $reg23 = 'na'; $reg24 = 0; $reg26 = 'na'; $reg27 = 'na'; $reg28 = '4'; $reg29 = 'Tesis_dirigida'; $reg30 = 'na'; $reg31 = 'na';

Page 125: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005125 de 141

#para insertar el nombre completo del autor1 $sql = "SELECT nombre_comp from plantilla where rfc = '$reg37'"; $sth = $dbh1->prepare($sql) or die "No se ha preparado: $DBI::errstr"; $sth->execute or die "No se puede ejecutar: $DBI::errstr"; @resultado3 = $sth->fetchrow_array(); $nombrecomp = $resultado3[0];

$sql = "INSERT INTO publica2 VALUES ($num_registro1, '$reg1', '$reg2', '$reg3', '$reg4', '$reg5', '$reg6', '$reg7', '$reg8', '$reg9', '$reg10', '$reg11', '$reg12', '$reg13', '$reg14', '$reg15', '$reg16', '$reg17', '$reg18','$reg19','$reg20','$reg21','$reg22','$reg23',$reg24,'$reg25', '$reg26','$reg27','$reg28','$reg29','$reg30','$reg31','',0,0,0,0,'$usr','','','','$reg37','$nombrecomp')";

# Preparamos y ejecutamos la sentencia. $sth = $dbh->prepare($sql); $sth->execute; $reg0 =''; $reg1 =''; $reg2 =''; $reg3 =''; $reg4 =''; $reg5 =''; $reg6 =''; $reg7 =''; $reg8 =''; $reg9 =''; $reg10 =''; $reg11 =''; $reg12 =''; $reg13 =''; $reg14 =''; $reg15 =''; $reg16 =''; $reg17 =''; $reg18 =''; $reg19 =''; $reg20 =''; $reg21 =''; $reg22 =''; $reg23 =''; $reg24 =''; $reg25 =''; $reg26 =''; $reg27 =''; $reg28 =''; $reg29 =''; $reg30 ='';

Page 126: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005126 de 141

$reg31 =''; } sub imprime { #Generamos el interfaz de registro del usuario (HTML) print header(-expires=>'now'), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html(), -link=>'007777', -vlink=>'007777'), start_form(-action=>'act_tesis_dir.cgi'); # Imprimimos el codigo java con el ancho de cuadro de 90 para este caso print java0('90'); # Imprimimos el resultado almacenado en la variable $table0 $table0->print; print end_form(); }# Fin de act_tesis_dir.cgi

Page 127: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005127 de 141

act_libros.cgi #!/usr/bin/perl -w # FUNCIONES DE FORMATO DE NUMEROS # THOUSANDS_SEP - character inserted between groups of 3 digits # DECIMAL_POINT - character separating integer and fractional parts # MON_THOUSANDS_SEP - like THOUSANDS_SEP, but used for format_price # MON_DECIMAL_POINT - like DECIMAL_POINT, but used for format_price # INT_CURR_SYMBOL - character(s) denoting currency (see format_price()) # DECIMAL_DIGITS - number of digits to the right of dec point (def 2) # DECIMAL_FILL - boolean; whether to add zeroes to fill out decimal # NEG_FORMAT - format to display negative numbers (def ``-x'') # KILO_SUFFIX - suffix to add when format_bytes formats kilobytes # MEGA_SUFFIX - suffix to add when format_bytes formats megabytes BEGIN { # Declaramos la ruta de ubicacion del modulo 'comun'. @INC=(@INC,"/var/www/cgi-bin/comun"); } use infoteca_html; use strict; use vars qw($num_registro1 $graba $actualiza $hoy $hoydia $hoymes $hoyanio $reg0 $reg1 $reg2 $reg3 $reg4 $reg5 $reg6 $reg7 $reg8 $reg9 $reg10 $reg11 $reg12 $reg13 $reg14 $reg15 $reg16 $reg17 $reg18 $reg19 $reg20 $reg21 $reg22 $reg23 $reg24 $reg25 $reg26 $reg27 $reg28 $reg29 $reg30 $reg31 $reg32 $reg33 $reg34 $reg35 $reg36 $reg37 $mes $ip $sql $sth $dbh $cabeza $error $quien_soy $sql0 $sth0 $dbh1 $de $entero $table0 $xreg $nc $tp $lista @resultado_nom @resultado_rfc %etiquetas $indice $tt $nombrecomp @resultado3); my $de = new Number::Format(-mon_thousands_sep => ',', -mon_decimal_point => '.', -int_curr_symbol => '$'); my $entero = new Number::Format(-thousands_sep => ','); # ------------------------------------------------------- #conectamos a la bases de datos local $dbh = DBI->connect("dbi:Pg:dbname=infoteca","postgres","mysql") or die \ "Imposible conectar a la base de datos infoteca: $DBI::errstr"; $dbh1 = DBI->connect("dbi:Pg:dbname=nomina","postgres","mysql") or die \ "Imposible conectar a la base de datos nomina: $DBI::errstr"; # ------------------------------------------------------- $tp = param('tp'); $nc = param('nc'); $xreg = param('xreg');

Page 128: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005128 de 141

$ip = remote_host(); $num_registro1 = param('num_registro1'); $graba = param('graba') || 'N'; $actualiza = param('actualiza'); $reg0 = param('reg0'); $reg1 = param('reg1'); $reg2 = param('reg2'); $reg3 = param('reg3'); $reg4 = param('reg4'); $reg5 = param('reg5'); $reg6 = param('reg6'); $reg7 = param('reg7'); $reg8 = param('reg8'); $reg9 = param('reg9'); $reg10 = param('reg10'); $reg11 = param('reg11'); $reg12 = param('reg12'); $reg13 = param('reg13'); $reg14 = param('reg14'); $reg15 = param('reg15'); $reg16 = param('reg16'); $reg18 = param('reg18'); $reg19 = param('reg19'); $reg20 = param('reg20'); $reg21 = param('reg21'); $reg22 = param('reg22'); $reg23 = param('reg23'); $reg24 = param('reg24'); $reg25 = param('reg25'); $reg26 = param('reg26'); $reg27 = param('reg27'); $reg28 = param('reg28'); $reg29 = param('reg29'); $reg30 = param('reg30'); $reg31 = param('reg31'); $reg32 = param('reg32'); $reg33 = param('reg33'); $reg34 = param('reg34'); $reg35 = param('reg35'); $reg36 = param('reg36'); $reg37 = param('reg37'); $mes = param('mes'); $hoy = param('hoy'); $hoydia = param('hoydia'); $hoymes = param('hoymes'); $hoyanio = param('hoyanio'); $tt = param('tt'); #-----------------------------------------------------------

Page 129: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005129 de 141

if (($reg1) && ($reg3) && ($reg18)) { inserta(); &insert_ok; } form(); imprime(); #------------------------------------------------------------------ #DECLARACION DE FORMULARIO sub form { my (@caja, @resultado, @campos, @sistema_prod, @especialidad, $uaa, $region, $numcampo, $sth, $table1, $table13, $table14, $table15, $table2, $table3, $table35, $table99, $font1, $font2, $font3, $font4, $font5); #Declaramos las variables para manipular las fuentes en HTML $font1='<font face="Arial,Helvetica"><font color="white">'; $font2='<font face="Arial,Helvetica" size ="-1"><font color="007777">'; $font4='<font face="Arial,Helvetica"><font color="007777"><font size="-1">'; $font5='<font face="Arial,Helvetica"><font color="007777">'; $font3='</font>'; $sql = "SELECT * FROM publica2 WHERE (ip='$ip' and num_registro=0 and tipo_reg = '3')"; $sth = $dbh->prepare($sql); $sth->execute; @resultado = $sth->fetchrow_array(); $graba='N'; $actualiza =\'N'; if (@resultado) { $actualiza =\'S'; $reg1 = $resultado[1]; $reg2 = $resultado[2]; $reg3 = $resultado[3]; $reg4 = $resultado[4]; $reg5 = $resultado[5]; $reg6 = $resultado[6]; $reg7 = $resultado[7]; $reg8 = $resultado[8]; $reg9 = trim($resultado[9]); $reg10 = $resultado[10]; $reg11 = $resultado[11]; $reg12 = trim($resultado[12]); $reg13 = trim($resultado[13]); $reg14 = trim($resultado[14]); $reg15 = $resultado[15]; $reg16 = $resultado[16];

Page 130: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005130 de 141

$reg18 = $resultado[18]; $mes = substr($reg18,5,2); $reg19 = $resultado[19]; $reg20 = $resultado[20]; $reg21 = $resultado[21]; $reg22 = $resultado[22]; $reg23 = $resultado[23]; $reg24 = $resultado[24]; $reg25 = $resultado[25]; $reg26 = $resultado[26]; $reg27 = $resultado[27]; $reg28 = $resultado[28]; $reg29 = $resultado[29]; $reg30 = trim($resultado[30]); $reg31 = trim($resultado[31]); $reg32 = $resultado[32]; $reg33 = $resultado[33]; $reg34 = $resultado[34]; $reg35 = $resultado[35]; $reg36 = $resultado[36]; $reg37 = $resultado[37]; } else { $reg0 =''; $reg1 =''; $reg2 =''; $reg3 =''; $reg4 =''; $reg5 =''; $reg6 =''; $reg7 =''; $reg8 =''; $reg9 =''; $reg10 =''; $reg11 =''; $reg12 =''; $reg13 =''; $reg14 =''; $reg15 =''; $reg16 =''; $reg17 =''; $reg18 =' '; $reg19 =''; $reg20 =''; $reg21 =''; $reg22 =''; $reg23 =''; $reg24 =0 ;

Page 131: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005131 de 141

$reg25 =''; $reg26 =''; $reg27 =''; $reg28 =''; $reg29 =''; $reg30 =''; $reg31 =''; $reg32 =''; $reg33 =0; $reg34 =0; $reg35 =0; $reg36 =0; $reg37 =''; } #Creamos las tablas que contiene las areas de consulta $table1 = new HTML::Table(6,4); $caja[1] = javacaja('Autor','Indicar por el apellido paterno, separado del materno por un espacio y consignar el apellido materno por su inicial en mayúscula e igual que las iniciales en mayúsculas del nombre(s).','1'); $table1->setCell(1,1, "$font4 &nbsp; $font3"); $table1->setCell(1,2, "$font4 e.g. Patiño V.,F. $font3"); $table1->setCell(1,3, "$font4 &nbsp; $font3"); $table1->setCell(2,1, "$font5 $caja[1] $font3"); $table1->setCell(2,2, textfield(-name=>'reg1',-value=>trim($reg1),-override=>1,-size=>30,-maxlength=>30)); $indice = 0; $lista = ''; @resultado_nom = catalogo_selectivo('plantilla','nombre_comp','nombre_comp'); @resultado_rfc = catalogo_selectivo('plantilla','rfc','nombre_comp'); while ($resultado_nom[$indice]) { $etiquetas{$resultado_rfc[$indice]} = $resultado_nom[$indice]; $indice = $indice + 1; } $table1->setCell(2,3,"$font2<b>Nombre Completo Autor $tt <b>$font3"); $table1->setCell(2,4, popup_menu(-name=>'reg37',-values=>[($reg37,@resultado_rfc)],-l

abels=>\%etiquetas)); $table1->setCell(3,1, "$font4 &nbsp; $font3"); $table1->setCell(3,2, "$font4 e.g. Patiño V.,F.;Sosa P.,P. $font3"); $table1->setCell(3,3, "$font4 &nbsp; $font3"); $table1->setCell(3,4, "$font4 e.g. 4 $font3"); $caja[2] = javacaja('Coautor','El registro de este campo debera de ser igual que al de autor y solo separado por un punto y coma por cada coautor','2'); $table1->setCell(4,1, "$font5 $caja[2] $font3"); $table1->setCell(4,2, textfield(-name=>'reg2',-value=>trim($reg2),-override=>1, -size=>30,-maxlength=>200)); $caja[7] = javacaja('Número de Publicación','Número de la publicación','7');

Page 132: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005132 de 141

$table1->setCell(4,3, "$font5 $caja[7] $font3"); $table1->setCell(4,4, textfield(-name=>'reg7',-value=>trim($reg7),-override=>1, -size=>10,-maxlength=>10)); $table1->setCell(5,1, "$font4 &nbsp; $font3"); $table1->setCell(5,2, "$font4 e.g. Viveros forestales:llenado, establecimiento y producción de plantas.

$font3"); $table1->setCell(5,3, "$font4 &nbsp; $font3"); $table1->setCell(5,4, "$font4 e.g. 4-8 o 125 páginas $font3"); $caja[4] = javacaja('Título','Iniciar con mayúsculas y separar por dos puntos el subtitulo y por un punto el f

inal del texto','4'); $table1->setCell(6,1, "$font5 $caja[4] $font3"); $table1->setCell(6,2, textfield(-name=>'reg4',-value=>trim($reg4),-override=>1,-size=>30,-maxlength=>200)); $caja[8] = javacaja('Páginas','Número de Páginas ó entre que páginas se encuentra la publicación','8');

$table1->setCell(6,3, "$font5 $caja[8] $font3"); $table1->setCell(6,4, textfield(-name=>'reg8',-value=>trim($reg8),-override=>1,-size=>10,-maxlength=>10)); $table1->setBorder("0"); $table1->setWidth("80%"); $table1->setCellSpacing("7"); $table1->setCellPadding("0"); $table1->setRowAlign(1,"LEFT"); $table1->setRowAlign(2,"LEFT"); $table1->setRowAlign(3,"LEFT"); $table1->setRowAlign(4,"LEFT"); #------------------------------------------------------------- $table13 = new HTML::Table(1,4); $table13->setCell(1,1, "$font1 .... $font3"); $table13->setCell(1,2, "$font4 e.g. Annals of Entomological Society. $font3"); $table13->setCell(1,3, "$font1 .... $font3"); $table13->setCell(1,4, "$font4 e.g. 1998 $font3"); $table13->setBorder("0"); $table13->setWidth("80%"); $table13->setCellSpacing("7"); $table13->setCellPadding("0"); #------------------------------------------------------------- $table14 = new HTML::Table(5,3); $caja[32] = javacaja('Otra Fuente especifique','En caso de existir otra fuente de financiamineto para la publicación, especifique el nombre de la misma a demas del importe que aporto, los importes seran a pesos.','32'); $caja[33] = javacaja('INIFAP','Registre el importe que aporto el INIFAP al tiraje de esta publicación, los importes seran a pesos.','33');

Page 133: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005133 de 141

$caja[34] = javacaja('Otros','En caso de existir otras fuentes de aportación a este tiraje sume todas estas sin incluir las ya registradas, los importes seran a pesos.','34'); $caja[36] = javacaja('Tiraje','El tiraje es el número de ejemplares que se imprimieron.','36'); $table14->setCell(1,1, "$font1 .... $font3"); $table14->setCell(1,2, "$font4 FUENTE $font3"); $table14->setCell(1,3, "$font4 IMPORTE $font3"); $table14->setCell(2,1, "$font4 . $font3"); $table14->setCell(2,2, "$font5 $caja[33] $font3"); $table14->setCell(2,3, textfield(-name=>'reg33',-value=>$de->format_price($reg33),-override=>1, -size=>11,-maxlength=>11)); $table14->setCell(3,1, "$font5 $caja[32] $font3"); $table14->setCell(3,2, textfield(-name=>'reg32',-value=>$reg32,-override=>1, -size=>10,-maxlength=>20)); $table14->setCell(3,3, textfield(-name=>'reg35',-value=>$de->format_price($reg35),-override=>1, -size=>11,-maxlength=>11)); $table14->setCell(4,1, "$font4 . $font3"); $table14->setCell(4,2, "$font5 $caja[34] $font3"); $table14->setCell(4,3, textfield(-name=>'reg34',-value=>$de->format_price($reg34),-override=>1, -size=>11,-maxlength=>11)); $table14->setCell(5,1, "$font4 . $font3"); $table14->setCell(5,2, "$font5 $caja[36] $font3"); $table14->setCell(5,3, textfield(-name=>'reg36',-value=>$entero->format_number($reg36),-override=>1, -size=>11,-maxlength=>11)); $table14->setBorder("0"); $table14->setWidth("70%"); $table14->setCellSpacing("7"); $table14->setCellPadding("0"); $table14->setCellAlign(1,1,"LEFT"); $table14->setCellAlign(1,2,"LEFT"); $table14->setCellAlign(1,3,"RIGHT"); $table14->setCellAlign(2,1,"LEFT"); $table14->setCellAlign(2,2,"LEFT"); $table14->setCellAlign(2,3,"RIGHT"); $table14->setCellAlign(3,1,"LEFT"); $table14->setCellAlign(3,2,"LEFT"); $table14->setCellAlign(3,3,"RIGHT"); $table14->setCellAlign(4,1,"LEFT"); $table14->setCellAlign(4,2,"RIGHT"); $table14->setCellAlign(4,3,"RIGHT"); #------------------------------------------------------------- $table15 = new HTML::Table(2,6); $caja[27] = javacaja('Nombre de la Serie','Nombre de la Serie o Colección, separada por un punto.','27'); $table15->setCell(1,1, "$font5 $caja[27] $font3"); $table15->setCell(1,2, textfield(-name=>'reg27',-value=>trim($reg27),-override=>1,-size=>25,-maxlength=>50)); $table15->setCell(1,3, "$font2 Año $font3"); $table15->setCell(1,4, textfield(-name=>'reg3',-value=>trim($reg3),-override=>1,-size=>4,-maxlength=>4)); $table15->setCell(1,5, "$font2 Mes $font3"); $table15->setCell(1,6, popup_menu(-name=>'reg18',-override=>1,

Page 134: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005134 de 141

-values=>[($mes,'01','02','03','04','05','06','07' ,'08','09','10','11','12')])); $caja[24] = javacaja('No de Edición','Digite el número de la edición que lleva por ejemplo 1 ','24'); $table15->setCell(2,1, "$font5 $caja[24] $font3"); $table15->setCell(2,2, textfield(-name=>'reg24',-value=>$reg24,-override=>1,-size=>2,-maxlength=>2)); $table15->setCell(2,3, "$font2 Arbitraje $font3"); $table15->setCell(2,4, popup_menu(-name=>'reg30',-override=>1,-values=>[($reg30,'No','SI')])); $table15->setCell(2,5, "$font2 Editorial $font3"); $table15->setCell(2,6, textfield(-name=>'reg23',-value=>trim($reg23),-override=>1,-size=>10,-maxlength=>30)); $table15->setBorder("0"); $table15->setWidth("100%"); $table15->setCellSpacing("7"); $table15->setCellPadding("0"); $table15->setCellAlign(1,1,"LEFT"); $table15->setCellAlign(1,3,"LEFT"); $table15->setCellAlign(1,5,"LEFT"); #------------------------------------------------------------- $numcampo = 0; if ($xreg eq 'OFICINAS CENTRALES') { #$sql0 = "SELECT nombre FROM campo_exp order by nombre"; $sql0 = "SELECT nombre FROM area order by nombre"; } else { $sql0 = "SELECT nombre FROM uaa WHERE\ nombre_reg = '$xreg ' order by nombre"; } $sth0 = $dbh1->prepare($sql0); $sth0->execute; while ( $campos[$numcampo] = $sth0->fetchrow_array) { $numcampo = $numcampo + 1; } $table2 = new HTML::Table(3,4); $table2->setCell(1,1, "$font2 Subsector$font3"); $table2->setCell(1,2, popup_menu(-name=>'reg12',-override=>1, -values=>[($reg12,'Agricola','Pecuaria','Forestal','Multisector')])); $table2->setCell(1,3, hidden(-name=>'xreg',-value=>$xreg)); $table2->setCell(1,4, hidden(-name=>'nc',-value=>$nc)); $table2->setCell(2,1, hidden(-name=>'reg9',-value=>$tp)); $caja[25] = javacaja('Lugar de la Publicación','Lugar y País, separados por un punto.', '25'); $table2->setCell(2,3, "$font5 $caja[25] $font3"); $table2->setCell(2,4, textfield(-name=>'reg25',-value=>trim($reg25),-override=>1,-size=>25,-maxlength=>30));

Page 135: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005135 de 141

$table2->setCell(3,1, "$font2 Tipo de Usuario $font3"); $table2->setCell(3,2, popup_menu(-name=>'reg31',-override=>1, -values=>[($reg31,'Cientifico','Tecnico','Productor','Publico en General')])); $table2->setCell(3,3, "$font2 Campo Experimental $font3"); $table2->setCell(3,4, popup_menu(-name=>'reg11',-override=>1, -values=>[($reg11,@campos)])); $table2->setBorder("0"); $table2->setWidth("100%"); $table2->setCellSpacing("7"); $table2->setCellPadding("0"); $table2->setCellAlign(1,1,"LEFT"); $table2->setCellAlign(1,2,"LEFT"); $table2->setCellAlign(1,3,"LEFT"); $table2->setCellAlign(1,4,"LEFT"); $table2->setCellAlign(2,1,"LEFT"); $table2->setCellAlign(2,2,"LEFT"); $table2->setCellAlign(2,3,"LEFT"); $table2->setCellAlign(2,4,"LEFT"); #----------------------------------------------------------------- $table3 = new HTML::Table(2,2); @sistema_prod = catalogo('sistema_producto','nombre'); $table3->setCell(1,1, "$font2 Sistema Producto $font3"); $table3->setCell(1,2, popup_menu(-name=>'reg13',-override=>1,-values=>[($reg13,@sistema_prod)])); @especialidad = catalogo ('especialidad','nombre'); $table3->setCell(2,1, "$font2 Especialidad $font3"); $table3->setCell(2,2, popup_menu(-name=>'reg14',-override=>1,-values=>[($reg14,@especialidad)])); $table3->setBorder("0"); $table3->setWidth("100%"); $table3->setCellSpacing("7"); $table3->setCellPadding("0"); $table3->setCellAlign(1,1,"LEFT"); $table3->setCellAlign(1,2,"LEFT"); #----------------------------------------------------------------- @especialidad = catalogo ('especialidad','nombre'); $table35 = new HTML::Table(1,3); $caja[0] =javacaja('Se Graba S/N', 'Marcar S si desea grabar en forma definitiva o N si desea grabar en forma temporal','0'); $table35->setCell(1,1, "$font5 $caja[0] $font3"); $table35->setCell(1,2, radio_group (-name => 'graba',-value => 'S')); $table35->setCell(1,3, radio_group (-name => 'graba',-value => 'N')); $table35->setBorder("1"); $table35->setWidth("35%"); $table35->setCellSpacing("0"); $table35->setCellPadding("0"); $table35->setCellAlign(1,1,"LEFT"); $table35->setCellAlign(1,3,"LEFT");

Page 136: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005136 de 141

# Creamos la tabla que contiene los botones enviar y # o cancelar $table99 = new HTML::Table(1,3); $table99->setCellWidth(1, 1, "20%"); $table99->setCellWidth(1, 2, "20%"); $table99->setCellWidth(1, 3, "20%"); $table99->setBorder("0"); $table99->setWidth("100%"); $table99->setCellSpacing("0"); $table99->setCellPadding("0"); $table99->setCellAlign(1,1,"CENTER"); $table99->setCellAlign(1,2,"CENTER"); $table99->setCellAlign(1,3,"CENTER"); $table99->setCell(1,1, submit(-value=>'Insertar', -name=>'insertar')); $table99->setCell(1,3, reset(-value=>'Limpiar')); #Creamos la tabla que contiene las tablas anteriores. $xreg = trim($xreg); $table0 = new HTML::Table(11,1); $table0->setCell(1,1,"$imgReg"); $table0->setCell(2,1,"$font2 $xreg <br> $tp $font3"); $table0->setCell(3,1,"$font1 &nbsp; $font3"); $table0->setCell(4,1, $table1->getTable); $table0->setCell(5,1, $table13->getTable); $table0->setCell(6,1, $table15->getTable); $table0->setCell(7,1, $table2->getTable); $table0->setCell(8,1, $table3->getTable); $table0->setCell(9,1, $table14->getTable); $table0->setCell(10,1, $table35->getTable); $table0->setCell(11,1, $table99->getTable); $table0->setCellAlign(1,1,"CENTER"); $table0->setCellAlign(2,1,"CENTER"); $table0->setCellAlign(10,1,"CENTER"); $table0->setBorder("0"); $table0->setWidth("100%"); $table0->setCellSpacing("0"); $table0->setCellPadding("0"); }

sub inserta { # en esta funcion se realizan inserciones a la tabla publica my($sth, $table0, $sql, $usr ); # Definimos la sentencia SQL para traer el numero de registro if ($graba eq 'S') { $sql = " select MAX(num_registro) from publica2 where tpublicación = '$reg9'"; $sth = $dbh->prepare($sql);

Page 137: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005137 de 141

$sth->execute; $num_registro1 = $sth->fetchrow_array() + 1; } else { $num_registro1 = 0; } $sql = "DELETE FROM publica2 WHERE ip='$ip' and num_registro=0 and tipo_reg ='3'"; $sth = $dbh->prepare($sql); $sth->execute; $hoy = localtime(); $hoydia = $hoy->mday; $hoymes = $hoy->mon + 1; $hoyanio = $hoy->year + 1900; $reg11 = trim($reg11); if ($xreg eq 'OFICINAS CENTRALES') { #$sql0 = "SELECT nom_region FROM campo_exp WHERE nombre = '$reg11'"; $sql0 = "SELECT nombre_reg FROM uaa WHERE nombre = '$reg11'"; $sth0 = $dbh1->prepare($sql0); $sth0->execute; $reg10 = $sth0->fetchrow_array(); } else { $reg10 = $xreg; } # ********* BUSCA EL USUARIO ********* $sql = "select usuario from logintemp where num_consec = $nc"; $sth = $dbh->prepare($sql); $sth->execute; $usr = $sth->fetchrow_array(); if (not($reg2)) { $reg2 = '.'; } $reg5 = 'na'; $reg6 = 'na'; $reg15 = '06/06/2001'; $reg16 = 'na'; $reg17 = $ip; $reg18 = "$reg18/01/$reg3"; $reg19 = "$hoymes/$hoydia/$hoyanio"; $reg20 = 'na'; $reg21 = 'na'; $reg22 = 'na';

Page 138: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005138 de 141

$reg26 = 'na'; $reg28 = '3'; $reg29 = 'Libros, Boletines y Folletos'; $reg33 = $de->unformat_number($reg33); $reg34 = $de->unformat_number($reg34); $reg35 = $de->unformat_number($reg35); $reg36 = $entero->unformat_number($reg36); $sql = "SELECT nombre_comp from plantilla where rfc = '$reg37'"; $sth = $dbh1->prepare($sql) or die "No se ha preparado: $DBI::errstr"; $sth->execute or die "No se puede ejecutar: $DBI::errstr"; @resultado3 = $sth->fetchrow_array(); $nombrecomp = $resultado3[0]; $tt=$sql = "INSERT INTO publica2 VALUES ($num_registro1, '$reg1', '$reg2', '$reg3', '$reg4', '$reg5', '$reg6', '$reg7', '$reg8', '$reg9', '$reg10', '$reg11', '$reg12', '$reg13', '$reg14', '$reg15', '$reg16', '$reg17', '$reg18','$reg19','$reg20','$reg21','$reg22','$reg23',$reg24,'$reg25','$reg26','$reg27','$reg28','$reg29','$reg30','$reg31','$reg32',$reg33, $reg34, $reg35, $reg36,'$usr','','','','$reg37','$nombrecomp')"; # Preparamos y ejecutamos la sentencia. $sth = $dbh->prepare($sql); $sth->execute; $reg0 =''; $reg1 =''; $reg2 =''; $reg3 =''; $reg4 =''; $reg5 =''; $reg6 =''; $reg7 =''; $reg8 =''; $reg9 =''; $reg10 =''; $reg11 =''; $reg12 =''; $reg13 =''; $reg14 =''; $reg15 =''; $reg16 =''; $reg17 =''; $reg18 =''; $reg19 =''; $reg20 =''; $reg21 =''; $reg22 =''; $reg23 =''; $reg24 =''; $reg25 =''; $reg26 ='';

Page 139: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005139 de 141

$reg27 =''; $reg28 =''; $reg29 =''; $reg30 =''; $reg31 =''; } sub imprime { #Generamos el interfaz de registro del usuario (HTML) print header(-expires=>'now'), start_html(-title=>'Infoteca INIFAP',-script=>'',-background=>&cabeza_html(), -link=>'007777', -vlink=>'007777'), start_form(-action=>'act_libros.cgi'); # Imprimimos el codigo java con el ancho de cuadro de 90 para este caso print java0('90'); # Imprimimos el resultado almacenado en la variable $table0 $table0->print; print end_form(); }# Fin act_libros.cgi

Page 140: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005140 de 141

ANEXO C

Page 141: Proyecto de titulacion psc - 148.206.53.84148.206.53.84/tesiuami/UAMI12023.pdf · COMPUTACION ELABORACION ... limitados y su distribución o comercialización son ferias agropecuarias,

INGENIERIA ELECTRONICA EN COMPUTACION

ELABORACION PÁGINA

DIA MES AÑO

SISTEMA DE REGISTRO Y CONSULTA DE

PUBLICACIONES PARA EL INSTITUTO NACIONAL DE

INVESTIGACIONES FORESTALES, AGRICOLAS

Y PECUARIAS (INIFAP) 30 01 2005141 de 141

Contenido de CDs Discos del Sistema Operativo (3) Disco A: Texto del proyecto.

Programas. Modulos de Perl requeridos.