PHP - Acceso a ciertos campos del ComboBox PHP

 
Vista:

Acceso a ciertos campos del ComboBox PHP

Publicado por Carlos Castro (2 intervenciones) el 18/02/2010 18:35:05
Script de la BD llamada "tribux"

CREATE TABLE `acceso` (
`IDusuario` int(4) NOT NULL,
`IDcompañia` int(4) NOT NULL,
`IDsede` int(4) NOT NULL,
`IDservidor` int(4) NOT NULL,
`IDcategoria` int(4) NOT NULL,
`IDsubcategoria` int(4) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `acceso` (`IDusuario`, `IDcompañia`, `IDsede`, `IDservidor`, `IDcategoria`, `IDsubcategoria`) VALUES
(1, 1, 1, 1, 1, 1),
(1, 1, 1, 1, 1, 2),
(1, 1, 1, 1, 2, 6),
(1, 1, 1, 1, 3, 10),
(1, 1, 1, 5, 2, 5),
(1, 1, 1, 5, 2, 6),
(1, 1, 1, 5, 2, 7),
(1, 1, 1, 5, 2, 8),
(1, 1, 1, 6, 5, 17),
(1, 1, 1, 6, 5, 18),
(1, 1, 1, 6, 5, 19),
(1, 1, 1, 6, 5, 20),
(1, 1, 2, 2, 3, 9),
(1, 1, 3, 3, 2, 6),
(2, 1, 2, 2, 1, 1),
(2, 1, 2, 2, 1, 2),
(2, 1, 2, 2, 1, 3),
(2, 1, 2, 2, 1, 4),
(2, 1, 2, 2, 2, 5),
(2, 1, 2, 2, 2, 6),
(2, 1, 2, 2, 2, 7),
(2, 1, 2, 2, 2, 8),
(2, 1, 2, 2, 3, 9),
(2, 1, 2, 2, 3, 10),
(2, 1, 2, 2, 3, 11),
(2, 1, 2, 2, 3, 12);

CREATE TABLE `categoria` (
`IDcategoria` int(4) NOT NULL auto_increment,
`nomcategoria` char(20) NOT NULL,
PRIMARY KEY (`IDcategoria`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

INSERT INTO `categoria` (`IDcategoria`, `nomcategoria`) VALUES
(1, 'Firewall'),
(2, 'Proxy'),
(3, 'VPN'),
(4, 'Correo'),
(5, 'Archivos'),
(6, 'Web');

CREATE TABLE `compañia` (
`IDcompañia` int(4) NOT NULL auto_increment,
`nomcompañia` char(20) NOT NULL,
`ruc` int(12) NOT NULL,
`rubro` char(50) NOT NULL,
PRIMARY KEY (`IDcompañia`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=2 ;

INSERT INTO `compañia` (`IDcompañia`, `nomcompañia`, `ruc`, `rubro`) VALUES
(1, 'Llamagas', 2147483647, 'Venta al por mayor de combustibles');

CREATE TABLE `sede` (
`IDsede` int(4) NOT NULL auto_increment,
`IDcompañia` int(4) NOT NULL,
`nomsede` char(40) NOT NULL,
`direccionsede` char(50) NOT NULL,
`telefonosede` int(12) NOT NULL,
PRIMARY KEY (`IDsede`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

INSERT INTO `sede` (`IDsede`, `IDcompañia`, `nomsede`, `direccionsede`, `telefonosede`) VALUES
(1, 1, 'Primavera', 'Av. Avenida Primavera # 1290', 6171762),
(2, 1, 'Naranjal', 'Av. Gerardo Unger # 4875', 4966452),
(3, 1, 'Lurin', 'Av. Lurin #1014', 5562321),
(4, 1, 'Arequipa', 'Av. Arequipa #1451', 6648523);

CREATE TABLE `servidor` (
`IDservidor` int(4) NOT NULL auto_increment,
`IDsede` int(4) NOT NULL,
`IDcompañia` int(4) NOT NULL,
`ipservidor` char(16) NOT NULL,
`nomservidor` char(40) NOT NULL,
`descservidor` char(50) NOT NULL,
PRIMARY KEY (`IDservidor`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=7 ;

INSERT INTO `servidor` (`IDservidor`, `IDsede`, `IDcompañia`, `ipservidor`, `nomservidor`, `descservidor`) VALUES
(1, 1, 1, '192.168.200.253', 'Servidor Principal Primavera', 'Servidor principal de Llamagas sede Primavera'),
(2, 2, 1, '192.168.2.0', 'Servidor Principal Naranjal', 'Servidor de Llamagas sede Naranjal'),
(3, 3, 1, '192.168.3.0', 'Servidor Principal Lurin', 'Servidor de Llamagas sede Lurin'),
(4, 4, 1, '192.168.4.0', 'Servidor Principal Arequipa', 'Servidor de Llamagas sede Arequipa'),
(5, 1, 1, '10.10.10.13', 'Servidor Proxy', 'Servidor Proxy Llamagas sede Primavera'),
(6, 1, 1, '10.10.10.253', 'Servidor de Archivos', 'Servidor de Archivos Llamagas sede Primavera');

CREATE TABLE `subcategoria` (
`IDsubcategoria` int(4) NOT NULL auto_increment,
`IDcategoria` int(4) NOT NULL,
`descsubcategoria` char(80) NOT NULL,
PRIMARY KEY (`IDsubcategoria`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=25 ;

INSERT INTO `subcategoria` (`IDsubcategoria`, `IDcategoria`, `descsubcategoria`) VALUES
(1, 1, 'Descripción SubCategoria 1 Firewall'),
(2, 1, 'Descripción SubCategoria 2 Firewall'),
(3, 1, 'Descripción SubCategoria 3 Firewall'),
(4, 1, 'Descripción SubCategoria 4 Firewall'),
(5, 2, 'Descripción SubCategoria 1 Proxy'),
(6, 2, 'Descripción SubCategoria 2 Proxy'),
(7, 2, 'Descripción SubCategoria 3 Proxy'),
(8, 2, 'Descripción SubCategoria 4 Proxy'),
(9, 3, 'Descripción SubCategoria 1 VPN'),
(10, 3, 'Descripción SubCategoria 2 VPN'),
(11, 3, 'Descripción SubCategoria 3 VPN'),
(12, 3, 'Descripción SubCategoria 4 VPN'),
(13, 4, 'Descripción SubCategoria 1 Correo'),
(14, 4, 'Descripción SubCategoria 2 Correo'),
(15, 4, 'Descripción SubCategoria 3 Correo'),
(16, 4, 'Descripción SubCategoria 4 Correo'),
(17, 5, 'Descripción SubCategoria 1 Archivos'),
(18, 5, 'Descripción SubCategoria 2 Archivos'),
(19, 5, 'Descripción SubCategoria 3 Archivos'),
(20, 5, 'Descripción SubCategoria 4 Archivos'),
(21, 6, 'Descripción SubCategoria 1 Web'),
(22, 6, 'Descripción SubCategoria 2 Web'),
(23, 6, 'Descripción SubCategoria 3 Web'),
(24, 6, 'Descripción SubCategoria 4 Web');

CREATE TABLE `subcatservidor` (
`IDservidor` int(4) NOT NULL,
`IDcategoria` int(4) NOT NULL,
`IDsubcategoria` int(4) NOT NULL,
`IDsede` int(4) NOT NULL,
`IDcompañia` int(4) NOT NULL,
`URL` char(80) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

INSERT INTO `subcatservidor` (`IDservidor`, `IDcategoria`, `IDsubcategoria`, `IDsede`, `IDcompañia`, `URL`) VALUES
(1, 1, 1, 1, 1, 'http://192.168.200.253:1'),
(1, 1, 2, 1, 1, 'http.//192.168.200.253:2'),
(1, 1, 3, 1, 1, 'http.//192.168.200.253:3'),
(1, 1, 4, 1, 1, 'http.//192.168.200.253:4'),
(1, 2, 5, 1, 1, 'http.//192.168.200.253:5'),
(1, 2, 6, 1, 1, 'http.//192.168.200.253:6'),
(1, 2, 7, 1, 1, 'http.//192.168.200.253:7'),
(1, 2, 8, 1, 1, 'http://192.168.200.253:8'),
(1, 3, 9, 1, 1, 'http://192.168.200.253:9'),
(1, 3, 10, 1, 1, 'http://192.168.200.253:10'),
(1, 3, 11, 1, 1, 'http://192.168.200.253:11'),
(1, 3, 12, 1, 1, 'http://192.168.200.253:12'),
(1, 4, 13, 1, 1, 'http://192.168.200.253:13'),
(1, 4, 14, 1, 1, 'http.//192.168.200.253:14'),
(1, 4, 15, 1, 1, 'http.//192.168.200.253:15'),
(1, 4, 16, 1, 1, 'http.//192.168.200.253:16'),
(2, 1, 1, 2, 1, 'http.//192.168.2.0:1'),
(2, 1, 2, 2, 1, 'http.//192.168.2.0:2'),
(2, 1, 3, 2, 1, 'http.//192.168.2.0:3'),
(2, 1, 4, 2, 1, 'http.//192.168.2.0:4'),
(2, 2, 5, 2, 1, 'http.//192.168.2.0:5'),
(2, 2, 6, 2, 1, 'http.//192.168.2.0:6'),
(2, 2, 7, 2, 1, 'http.//192.168.2.0:7'),
(2, 2, 8, 2, 1, 'http.//192.168.2.0:8'),
(2, 3, 9, 2, 1, 'http.//192.168.2.0:9'),
(2, 3, 10, 2, 1, 'http.//192.168.2.0:10'),
(2, 3, 11, 2, 1, 'http.//192.168.2.0:11'),
(2, 3, 12, 2, 1, 'http.//192.168.2.0:12'),
(3, 1, 1, 3, 1, 'http.//192.168.3.0:1'),
(3, 1, 2, 3, 1, 'http.//192.168.3.0:2'),
(3, 1, 3, 3, 1, 'http.//192.168.3.0:3'),
(3, 1, 4, 3, 1, 'http.//192.168.3.0:4'),
(3, 2, 5, 3, 1, 'http.//192.168.3.0:5'),
(3, 2, 6, 3, 1, 'http.//192.168.3.0:6'),
(3, 2, 7, 3, 1, 'http.//192.168.3.0:7'),
(3, 2, 8, 3, 1, 'http.//192.168.3.0:8'),
(3, 3, 9, 3, 1, 'http.//192.168.3.0:9'),
(3, 3, 10, 3, 1, 'http.//192.168.3.0:10'),
(3, 3, 11, 3, 1, 'http.//192.168.3.0:11'),
(3, 3, 12, 3, 1, 'http.//192.168.3.0:12'),
(4, 6, 21, 4, 1, 'http.//192.168.4.0:21'),
(4, 6, 22, 4, 1, 'http.//192.168.4.0:22'),
(4, 6, 23, 4, 1, 'http.//192.168.4.0:23'),
(4, 6, 24, 4, 1, 'http.//192.168.4.0:24'),
(5, 2, 5, 1, 1, 'http.//10.10.10.13:5'),
(5, 2, 6, 1, 1, 'http.//10.10.10.13:6'),
(5, 2, 7, 1, 1, 'http.//10.10.10.13:7'),
(5, 2, 8, 1, 1, 'http.//10.10.10.13:8'),
(6, 5, 17, 1, 1, 'http.//10.10.10.251:17'),
(6, 5, 18, 1, 1, 'http.//10.10.10.251:18'),
(6, 5, 19, 1, 1, 'http.//10.10.10.251:19'),
(6, 5, 20, 1, 1, 'http.//10.10.10.251:20');

CREATE TABLE `usuario` (
`IDusuario` int(4) NOT NULL auto_increment,
`login` char(20) NOT NULL,
`nomusuario` char(20) NOT NULL,
`passusuario` char(20) NOT NULL,
`correousuario` char(50) NOT NULL,
`telefonousuario` int(12) NOT NULL,
PRIMARY KEY (`IDusuario`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=5 ;

INSERT INTO `usuario` (`IDusuario`, `login`, `nomusuario`, `passusuario`, `correousuario`, `telefonousuario`) VALUES
(1, 'ccastro', 'Carlos Castro', 'ccastro', '[email protected]', 945290048),
(2, 'fcano', 'Franz Cano', 'fcano', '[email protected]', 7208500),
(3, 'mrengifo', 'Manuel Rengifo', 'mrengifo', '[email protected]', 5551234),
(4, 'episco', 'Erwin Pisco', 'episco', '[email protected]', 968547897);
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder