git-svn-id: https://opengnsys.es/svn/trunk@1313 a21b9725-9963-47de-94b9-378ad31fedc9
parent
5f11948f55
commit
550b680d17
|
@ -1,8 +0,0 @@
|
|||
-- Cambios para gestión de Multicast
|
||||
|
||||
ALTER TABLE `ordenadores`
|
||||
ADD COLUMN `modomul` TINYINT(4) NOT NULL,
|
||||
ADD COLUMN `ipmul` VARCHAR(16) NOT NULL,
|
||||
ADD COLUMN `pormul` INT(11) NOT NULL,
|
||||
ADD COLUMN `velmul` SMALLINT(6) NOT NULL;
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -1,197 +0,0 @@
|
|||
// ******************************************************************************************************
|
||||
// Aplicación HIDRA
|
||||
// Copyright 2004 Jos<6F>Manuel Alonso. Todos los derechos reservados.
|
||||
// Fichero: Database.cpp
|
||||
// Descripción:
|
||||
// Fichero de implementaci<63> de la clase Database para funciones de manipulaci<63>
|
||||
// de bases de datos sobre un Servidor Mysql
|
||||
// ******************************************************************************************************
|
||||
#include "Database.h"
|
||||
// __________________________________________________________________________
|
||||
void ErrorHandler(Herror hr, char* ErrStr)
|
||||
{
|
||||
sprintf(ErrStr,"Error:\n");
|
||||
sprintf(ErrStr,"%sCode = %d\n",ErrStr ,hr.nError);
|
||||
sprintf(ErrStr,"%sDescription = %s",ErrStr, (char*) hr.dError);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
Database::Database()
|
||||
{
|
||||
m_Cnn=NULL;
|
||||
sprintf(m_ErrStr,"NULL POINTER");
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
void Database::GetErrorErrStr(char* ErrStr)
|
||||
{
|
||||
sprintf(ErrStr,"%s",m_ErrStr);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
void Table::GetErrorErrStr(char* ErrStr)
|
||||
{
|
||||
sprintf(ErrStr,"%s",m_ErrStr);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Database::Open(char* UserName, char* Pwd,char* server,char*Bd)
|
||||
{
|
||||
Herror hr;
|
||||
m_Cnn=mysql_init(NULL);
|
||||
if(m_Cnn==NULL){
|
||||
hr.nError=0;
|
||||
strcpy(hr.dError,"Error en la Creación del objeto MYSQL");
|
||||
ErrorHandler(hr,m_ErrStr);
|
||||
return(false); // Fallo de inicializaci<63>
|
||||
}
|
||||
|
||||
if(!mysql_real_connect(m_Cnn, server,UserName,Pwd,Bd, MYSQL_PORT,NULL,0)){
|
||||
mysql_error(m_Cnn);
|
||||
hr.nError=mysql_errno(m_Cnn);
|
||||
strcpy(hr.dError,mysql_error(m_Cnn));
|
||||
ErrorHandler(hr,m_ErrStr);
|
||||
return(false); // Fallo de conexi<78>
|
||||
}
|
||||
hr.nError=0;
|
||||
strcpy(hr.dError,"Success");
|
||||
ErrorHandler(hr,m_ErrStr);
|
||||
return (true);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Database::Close()
|
||||
{
|
||||
mysql_close(m_Cnn);
|
||||
return(true);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Database::Execute(char* CmdStr)
|
||||
{
|
||||
Herror hr;
|
||||
if (mysql_query(m_Cnn,CmdStr)){ // Ejecuta la consulta
|
||||
mysql_error(m_Cnn);
|
||||
hr.nError=mysql_errno(m_Cnn);
|
||||
strcpy(hr.dError,mysql_error(m_Cnn));
|
||||
ErrorHandler(hr,m_ErrStr);
|
||||
mysql_close(m_Cnn);
|
||||
return(false); // Fallo de conexión
|
||||
}
|
||||
hr.nError=0;
|
||||
strcpy(hr.dError,"Success");
|
||||
ErrorHandler(hr,m_ErrStr);
|
||||
return (true);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Database::Execute(char* CmdStr, Table& Tbl)
|
||||
{
|
||||
Herror hr;
|
||||
if (mysql_query(m_Cnn,CmdStr)) { // Ejecuta la consulta
|
||||
mysql_error(m_Cnn);
|
||||
hr.nError=mysql_errno(m_Cnn);
|
||||
strcpy(hr.dError,mysql_error(m_Cnn));
|
||||
ErrorHandler(hr,m_ErrStr);
|
||||
mysql_close(m_Cnn);
|
||||
return(false); // Fallo de conexi<78>
|
||||
}
|
||||
|
||||
hr.nError=0;
|
||||
strcpy(hr.dError,"Success");
|
||||
ErrorHandler(hr,m_ErrStr);
|
||||
|
||||
Tbl.m_Rec = mysql_store_result(m_Cnn) ; // Toma el recordset
|
||||
if(Tbl.m_Rec){
|
||||
Tbl.row=mysql_fetch_row(Tbl.m_Rec);
|
||||
Tbl.fields = mysql_fetch_fields(Tbl.m_Rec);
|
||||
Tbl.num_fields = mysql_num_fields(Tbl.m_Rec);
|
||||
Tbl.numreg=mysql_num_rows(Tbl.m_Rec);
|
||||
Tbl.eof=Tbl.numreg==0; // Consulta vacia
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
Table::Table()
|
||||
{
|
||||
m_Rec=NULL;
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Table::ISEOF()
|
||||
{
|
||||
return(eof);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Table::Get(const char* FieldName, char *FieldValue)
|
||||
{
|
||||
char * aux;
|
||||
aux=tomadato(FieldName);
|
||||
if(aux)
|
||||
strcpy(FieldValue,aux);
|
||||
else
|
||||
strcpy(FieldValue,"");
|
||||
return(true);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Table::Get(const char* FieldName,int &FieldValue)
|
||||
{
|
||||
char *aux;
|
||||
aux=tomadato(FieldName);
|
||||
if(aux)
|
||||
FieldValue=atoi(aux);
|
||||
else
|
||||
FieldValue=0;
|
||||
return(true);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Table::Get(const char* FieldName,char &FieldValue)
|
||||
{
|
||||
char *aux;
|
||||
aux=tomadato(FieldName);
|
||||
FieldValue=aux[0];
|
||||
return(true);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
char* Table::tomadato(const char* FieldName)
|
||||
{
|
||||
Herror hr;
|
||||
unsigned int i;
|
||||
|
||||
for(i = 0; i < num_fields; i++){
|
||||
if(strcmp((char*)fields[i].name,FieldName)==0){
|
||||
sprintf(m_ErrStr,"Success");
|
||||
return((char*)row[i]);
|
||||
}
|
||||
}
|
||||
hr.nError=-1;
|
||||
strcpy(hr.dError,"El nombre del campo no existe");
|
||||
ErrorHandler(hr,m_ErrStr);
|
||||
return(NULL); // No existe el nombre del campo en la tabla
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
|
||||
bool Table::MoveNext()
|
||||
{
|
||||
eof=false;
|
||||
row=mysql_fetch_row(m_Rec);
|
||||
if(row==NULL){
|
||||
if(!mysql_eof(m_Rec))
|
||||
return(false); // Fallo de lectura
|
||||
else
|
||||
eof=true; // Fin de fichero
|
||||
}
|
||||
return (true);
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Table::MoveFirst()
|
||||
{
|
||||
my_ulonglong auxnumreg;
|
||||
|
||||
auxnumreg=0;
|
||||
mysql_data_seek(m_Rec,auxnumreg);
|
||||
return (MoveNext());
|
||||
}
|
||||
// __________________________________________________________________________
|
||||
bool Table::MoveLast()
|
||||
{
|
||||
my_ulonglong auxnumreg;
|
||||
auxnumreg=numreg;
|
||||
auxnumreg--;
|
||||
if(auxnumreg<0) auxnumreg=0; // Principio de fichero
|
||||
mysql_data_seek(m_Rec,auxnumreg);
|
||||
return (MoveNext());
|
||||
return (true);
|
||||
}
|
|
@ -1,60 +0,0 @@
|
|||
// ******************************************************************************************************
|
||||
// Aplicación HIDRA
|
||||
// Copyright 2004 Jos<6F>Manuel Alonso. Todos los derechos reservados.
|
||||
// Fichero: Database.h
|
||||
// Descripción:
|
||||
// Fichero de cabecera de la clase Database para implementar funciones de manipulaci<63>
|
||||
// de bases de datos sobre un Servidor Mysql
|
||||
// ******************************************************************************************************
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include </usr/include/mysql/mysql.h>
|
||||
// __________________________________________________________________________
|
||||
class Database;
|
||||
class Table;
|
||||
// __________________________________________________________________________
|
||||
class Database
|
||||
{
|
||||
public:
|
||||
MYSQL *m_Cnn;
|
||||
char m_ErrStr[500];
|
||||
Database();
|
||||
bool Open(char* UserName, char* Pwd,char* server,char*Database);
|
||||
bool OpenTbl(int Mode, char* CmdStr, Table& Tbl);
|
||||
bool Close(void);
|
||||
bool Execute(char* CmdStr);
|
||||
bool Execute(char* CmdStr, Table& Tbl);
|
||||
void GetErrorErrStr(char* ErrStr);
|
||||
};
|
||||
// __________________________________________________________________________
|
||||
class Table{
|
||||
char* tomadato(const char* FieldName);
|
||||
public:
|
||||
bool eof,bof;
|
||||
MYSQL_RES * m_Rec ;
|
||||
MYSQL_FIELD *fields;
|
||||
unsigned int num_fields;
|
||||
MYSQL_ROW row ;
|
||||
MYSQL_ROW_OFFSET ptr;
|
||||
my_ulonglong numreg;
|
||||
char m_ErrStr[500];
|
||||
Table();
|
||||
void GetErrorErrStr(char* ErrStr);
|
||||
bool ISEOF();
|
||||
bool MoveNext();
|
||||
bool MovePrevious();
|
||||
bool MoveFirst();
|
||||
bool MoveLast();
|
||||
|
||||
bool Get(const char* FieldName, char* FieldValue);
|
||||
bool Get(const char* FieldName,int &FieldValue);
|
||||
bool Get(const char* FieldName,char &FieldValue);
|
||||
};
|
||||
// __________________________________________________________________________
|
||||
class Herror
|
||||
{
|
||||
public:
|
||||
int nError; // C<>igo del error
|
||||
char dError[500]; // Descripción del error
|
||||
};
|
|
@ -1,322 +0,0 @@
|
|||
// ________________________________________________________________________________________________________
|
||||
// Función: INTROaFINCAD
|
||||
//
|
||||
// Descripción:
|
||||
// Cambia INTROS por caracteres fin de cadena ('\0') en una cadena
|
||||
// Parametros:
|
||||
// - parametros : La cadena a explorar
|
||||
// ________________________________________________________________________________________________________
|
||||
void INTROaFINCAD(char* parametros) {
|
||||
int lon, i;
|
||||
lon = strlen(parametros);
|
||||
for (i = 0; i < lon; i++) {
|
||||
if (parametros[i] == '\r')
|
||||
parametros[i] = '\0';
|
||||
}
|
||||
}
|
||||
// ________________________________________________________________________________________________________
|
||||
// Funciónn: FINCADaINTRO
|
||||
//
|
||||
// Descripciónn?:
|
||||
// Cambia caracteres fin de cadena ('\0') por INTROS en una cadena
|
||||
// Parametros:
|
||||
// - parametros : La cadena a explorar
|
||||
// ________________________________________________________________________________________________________
|
||||
void FINCADaINTRO(char* a, char *b) {
|
||||
char *i;
|
||||
for (i = a; i < b; i++) { // Cambia los NULOS por INTROS
|
||||
if (*i == '\0')
|
||||
*i = '\r';
|
||||
}
|
||||
}
|
||||
|
||||
// ________________________________________________________________________________________________________
|
||||
// Función: AbreConexion
|
||||
//
|
||||
// Descripción:
|
||||
// Crea un socket y lo conecta a una interface de red. Devuelve el socket
|
||||
// Parámetros:
|
||||
// - ips : La direccin IP con la que se comunicarnel socket
|
||||
// - port : Puerto para la comunicacin
|
||||
// ________________________________________________________________________________________________________
|
||||
SOCKET AbreConexion(char *ips, int port) {
|
||||
struct sockaddr_in server;
|
||||
SOCKET s;
|
||||
|
||||
// Crea el socket y se intenta conectar
|
||||
s = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (s == SOCKET_ERROR) {
|
||||
RegistraLog("Error en la creacin del socket. Modulo: AbreConexion()",
|
||||
true);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
|
||||
server.sin_family = AF_INET;
|
||||
server.sin_port = htons((short) port);
|
||||
server.sin_addr.s_addr = inet_addr(ips);
|
||||
|
||||
if (connect(s, (struct sockaddr *) &server, sizeof(server)) == SOCKET_ERROR) {
|
||||
RegistraLog("connect() fallo", true);
|
||||
return INVALID_SOCKET;
|
||||
}
|
||||
return (s);
|
||||
|
||||
}
|
||||
|
||||
|
||||
// ________________________________________________________________________________________________________
|
||||
// Función: cuenta_ipes
|
||||
//
|
||||
// Descripción:
|
||||
// Cuenta las comas (caracter de separacion) de las cadenas de ipes
|
||||
// Parámetros:
|
||||
// - parametros : La cadena a explorar
|
||||
// ________________________________________________________________________________________________________
|
||||
int cuenta_ipes(char* iph) {
|
||||
int lon, i, cont = 1;
|
||||
lon = strlen(iph);
|
||||
for (i = 0; i < lon; i++) {
|
||||
if (iph[i] == ';')
|
||||
cont++;
|
||||
}
|
||||
return (cont);
|
||||
}
|
||||
|
||||
// ________________________________________________________________________________________________________
|
||||
// Función: IgualIP
|
||||
//
|
||||
// Descripción:
|
||||
// Comprueba si una cadena con una ipe estnincluidad en otra que contienen varias direcciones ipes separas por punto y coma
|
||||
// Parámetros:
|
||||
// - cadenaiph: Cadena de IPes
|
||||
// - ipcliente: Cadena de la ip a buscar
|
||||
// ________________________________________________________________________________________________________
|
||||
BOOLEAN IgualIP(char *cadenaiph, char *ipcliente) {
|
||||
char *posa, *posb;
|
||||
int lon;
|
||||
|
||||
posa = strstr(cadenaiph, ipcliente);
|
||||
if (posa == NULL)
|
||||
return (FALSE); // No existe la IP en la cadena
|
||||
posb = posa; // Iguala direcciones
|
||||
while (TRUE) {
|
||||
posb++;
|
||||
if (*posb == ';')
|
||||
break;
|
||||
if (*posb == '\0')
|
||||
break;
|
||||
if (*posb == '\r')
|
||||
break;
|
||||
}
|
||||
lon = strlen(ipcliente);
|
||||
if ((posb - posa) == lon)
|
||||
return (TRUE); // IP encontrada !!!!
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
// ________________________________________________________________________________________________________
|
||||
// Función: RegistraLog
|
||||
//
|
||||
// Descripción:
|
||||
// Esta funcin registra los evento de errores en un fichero log
|
||||
// Parametros:
|
||||
// - msg : Mensage de error
|
||||
// - swerrno: Switch que indica que recupere literal de error del sistema
|
||||
// ________________________________________________________________________________________________________
|
||||
void RegistraLog(const char *msg, int swerrno) {
|
||||
struct tm * timeinfo;
|
||||
timeinfo = TomaHora();
|
||||
FILE *FLog;
|
||||
|
||||
FLog = fopen(szPathFileLog, "at");
|
||||
if (swerrno)
|
||||
fprintf(FLog, "%02d/%02d/%d %02d:%02d ***%s:%s\n", timeinfo->tm_mday,
|
||||
timeinfo->tm_mon + 1, timeinfo->tm_year + 1900,
|
||||
timeinfo->tm_hour, timeinfo->tm_min, msg, strerror(errno));
|
||||
else
|
||||
fprintf(FLog, "%02d/%02d/%d %02d:%02d ***%s\n", timeinfo->tm_mday,
|
||||
timeinfo->tm_mon + 1, timeinfo->tm_year + 1900,
|
||||
timeinfo->tm_hour, timeinfo->tm_min, msg);
|
||||
fclose(FLog);
|
||||
|
||||
// Lo muestra por consola
|
||||
/*printf("%02d/%02d/%d %02d:%02d ***%s\n", timeinfo->tm_mday,
|
||||
timeinfo->tm_mon + 1,
|
||||
timeinfo->tm_year + 1900,
|
||||
timeinfo->tm_hour,
|
||||
timeinfo->tm_min,
|
||||
msg);
|
||||
*/
|
||||
}
|
||||
// ________________________________________________________________________________________________________
|
||||
// Función: TomaHora
|
||||
//
|
||||
// Descripción:
|
||||
// Esta función toma la hora actual del sistema y devuelve una estructura conlos datos
|
||||
// ________________________________________________________________________________________________________
|
||||
struct tm * TomaHora() {
|
||||
time_t rawtime;
|
||||
time(&rawtime);
|
||||
return (localtime(&rawtime));
|
||||
}
|
||||
|
||||
|
||||
// ________________________________________________________________________________________________________
|
||||
// Funcinn: toma_parametro
|
||||
//
|
||||
// Descripcinn?:
|
||||
// Esta funci? devuelve el valor de un parametro incluido en la trmInfo.
|
||||
// El formato del protocolo es: "nombre_parametro=valor_parametro"
|
||||
// Par?etros:
|
||||
// - nombre_parametro: Es el nombre del par?etro a recuperar
|
||||
// - parametros: Es la matriz que contiene todos los par?etros
|
||||
// ________________________________________________________________________________________________________
|
||||
char * toma_parametro(const char* nombre_parametro,char *parametros)
|
||||
{
|
||||
int i=0;
|
||||
char* pos;
|
||||
|
||||
for(i=0;i<LONGITUD_PARAMETROS-4;i++){
|
||||
if(parametros[i]==nombre_parametro[0]){
|
||||
if(parametros[i+1]==nombre_parametro[1]){
|
||||
if(parametros[i+2]==nombre_parametro[2]){
|
||||
if(parametros[i+3]=='='){
|
||||
pos=¶metros[i+4];
|
||||
return(pos);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(NULL);
|
||||
}
|
||||
//______________________________________________________________________________________________________
|
||||
// Función: copiaParametro
|
||||
//
|
||||
// Descripción:
|
||||
// Devuelve una copia del valor de un parámetro
|
||||
// Parámetros:
|
||||
// - ptrTrama: contenido del mensaje
|
||||
// - parametro: Nombre del parámetro
|
||||
// Devuelve:
|
||||
// Un puntero a la cadena que contiene el valor del parámetro
|
||||
// ________________________________________________________________________________________________________
|
||||
char* copia_parametro(const char*nombre,char *parametros)
|
||||
{
|
||||
int lon;
|
||||
char *prm,*buffer;
|
||||
|
||||
prm=toma_parametro(nombre,parametros); // Toma parámetro
|
||||
if(prm)
|
||||
lon=strlen(prm);
|
||||
else
|
||||
return(NULL);
|
||||
|
||||
buffer = (char*) malloc(lon); // Toma memoria
|
||||
if (buffer == NULL) { // No hay memoria suficiente para el buffer
|
||||
return (NULL);
|
||||
}
|
||||
strcpy(buffer,prm);
|
||||
return(buffer);
|
||||
}
|
||||
// ________________________________________________________________________________________________________
|
||||
// Función: split_parametros
|
||||
//
|
||||
// Descripción:
|
||||
// Trocea una cadena según un carácter delimitador
|
||||
// Parámetros:
|
||||
// - trozos: Array de punteros a cadenas
|
||||
// - cadena: Cadena a trocear
|
||||
// - chd: Carácter delimitador
|
||||
// Devuelve:
|
||||
// Número de trozos en que se divide la cadena
|
||||
// ________________________________________________________________________________________________________
|
||||
int split_parametros(char **trozos, char *cadena, char *ch)
|
||||
{
|
||||
int w = 0;
|
||||
|
||||
char chd = ch[0];
|
||||
trozos[w++] = cadena;
|
||||
if(cadena!=NULL){
|
||||
while (*cadena != '\0') {
|
||||
if (*cadena == chd) {
|
||||
*cadena = '\0';
|
||||
if (*(cadena + 1) != '\0')
|
||||
trozos[w++] = cadena + 1;
|
||||
}
|
||||
cadena++;
|
||||
}
|
||||
}
|
||||
return (w); // Devuelve el número de trozos
|
||||
}
|
||||
|
||||
//______________________________________________________________________________________________________
|
||||
// Función: recibe_tramas
|
||||
//
|
||||
// Descripción:
|
||||
// Recibe una trama por la red (TCP)
|
||||
// Parámetros:
|
||||
// s: socket TCP
|
||||
// trama: contenido a enviar
|
||||
// Devuelve:
|
||||
// true si el envío ha sido correcto o false en caso contrario
|
||||
//______________________________________________________________________________________________________
|
||||
int recibe_tramas(SOCKET s,TRAMA *trama)
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = recv(s,(char*)trama,LONGITUD_TRAMA,0);
|
||||
if (ret == 0) // Conexin cerrada por parte del cliente (Graceful close)
|
||||
return (false);
|
||||
else{
|
||||
if (ret == SOCKET_ERROR){
|
||||
return (false);
|
||||
}
|
||||
else{ // Datos recibidos
|
||||
Desencriptar((char*)trama);
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
//__________________________________________________________________________________________________________
|
||||
//
|
||||
// Función: Encripta
|
||||
//
|
||||
// Descripción:
|
||||
// Esta función encripta una cadena y la devuelve como parametro
|
||||
//__________________________________________________________________________________________________________
|
||||
char * Encriptar(char *cadena)
|
||||
{
|
||||
return(cadena); // vuelve sin encriptar
|
||||
|
||||
int i,lon;
|
||||
char clave;
|
||||
|
||||
clave = 12 & 0xFFU; // La clave elegida entre 0-255, en este caso 12
|
||||
lon=strlen(cadena);
|
||||
for(i=0;i<lon;i++)
|
||||
cadena[i]=((char)cadena[i] ^ clave) & 0xFF;
|
||||
return(cadena);
|
||||
}
|
||||
//__________________________________________________________________________________________________________
|
||||
//
|
||||
// Funci<63>: Desencripta
|
||||
//
|
||||
// Descripción:
|
||||
// Esta funci<63> desencripta una cadena y la devuelve como parametro
|
||||
//__________________________________________________________________________________________________________
|
||||
char * Desencriptar(char *cadena)
|
||||
{
|
||||
return(cadena);
|
||||
|
||||
int i,lon;
|
||||
char clave;
|
||||
|
||||
clave = 12 & 0xFFU; // La clave elegida entre 0-255, en este caso 12
|
||||
lon=strlen(cadena);
|
||||
for(i=0;i<lon;i++)
|
||||
cadena[i]=((char)cadena[i] ^ clave) & 0xFF;
|
||||
return(cadena);
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
|
||||
#define LONPRM 512
|
||||
#define LONGITUD_PARAMETROS 4000 // Longitud mínima de la información de la trama (parametros)
|
||||
#define LONGITUD_CABECERATRAMA 11 // Longitud mínima de la trama completa
|
||||
#define LONGITUD_TRAMA LONGITUD_PARAMETROS+LONGITUD_CABECERATRAMA // Longitud mínima de la trama completa
|
||||
|
||||
#define LEER 0
|
||||
#define ESCRIBIR 1
|
||||
|
||||
#define TRUE 1
|
||||
#define FALSE 0
|
||||
|
||||
#define true 1
|
||||
#define false 0
|
||||
|
||||
#define ACCION_EXITOSA "1" // Finalizada con éxito
|
||||
#define ACCION_FALLIDA "2" // Finalizada con errores
|
||||
#define ACCION_TERMINADA "3" // Finalizada manualmente con indicación de éxito
|
||||
#define ACCION_ABORTADA "4" // Finalizada manualmente con indicación de errores
|
||||
#define ACCION_SINERRORES "5" // Activa y sin ningn error
|
||||
#define ACCION_CONERRORES "6" // Activa y con algn error
|
||||
|
||||
#define ACCION_DETENIDA "0" // Acción momentanemente parada
|
||||
#define ACCION_INICIADA "1" // Acción activa
|
||||
#define ACCION_FINALIZADA "2" // Acción finalizada
|
||||
|
||||
#define SOCKET_ERROR (-1)
|
||||
#define INVALID_SOCKET (SOCKET)(~0)
|
||||
#define MAXCNX 5 // Mximos intentos de conexin al servidor HIDRA
|
||||
|
||||
#define PUERTOMINUSER 40000
|
||||
#define PUERTOMAXUSER 60000
|
||||
|
||||
#define MAX_NUM_CSADDRS 20
|
||||
#define MAX_INTERFACE_LIST 20
|
||||
|
||||
#define COMILLAS_SIMPES 0x27
|
||||
#define DOBLES_COMILLAS 0x22
|
||||
#define BARRA_INVERTIDA 0x5c
|
||||
|
||||
#define LITAMBITO_CENTROS "centros"
|
||||
#define LITAMBITO_GRUPOSAULAS "gruposaulas"
|
||||
#define LITAMBITO_AULAS "aulas"
|
||||
#define LITAMBITO_GRUPOSORDENADORES "gruposordenadores"
|
||||
#define LITAMBITO_ORDENADORES "ordenadores"
|
||||
|
||||
#define MAXCMD_PARAMETROS 200 // Máximo número de parámetros de una trama de comandos
|
||||
#define MAXIMOS_SOCKETS 4000 // Máximo número de conexiones con ordenadores clientes
|
||||
#define MAXIMOS_SRVRMB 200 // Máximo número de servidores rembo
|
||||
#define MAXLON_PARAMETROSIPH 3000 // Máxima longitud de un parametro iph
|
||||
|
||||
#define MAXHARDWARE 128 // MÁXIMOS ELEMENTOS HARDSWARE A DETECTAR
|
||||
#define MAXSOFTWARE 2048 // MÁXIMOS ELEMENTOS SOFTWARE A DETECTAR
|
||||
|
||||
#define PROCESOS 0x01
|
||||
|
||||
#define EJECUCION_PROCEDIMIENTO 0x0000 // Acción Procedimiento
|
||||
#define EJECUCION_COMANDO 0x0001 // Acción Comando
|
||||
#define EJECUCION_TAREA 0x0002 // Acción Tarea
|
||||
#define EJECUCION_TRABAJO 0x0003 // Acción Trabajo
|
||||
#define EJECUCION_RESERVA 0x0004//Acción Reserva
|
||||
|
||||
#define EJECUTOR_servidorHIDRA 0x0001 // Ejecutor Servidor hidra
|
||||
#define EJECUTOR_clienteREMBO 0x0002 // Ejecutor cliente rembo
|
||||
#define EJECUTOR_servidorREMBO 0x0003 // Ejecutor Servidor rembo
|
||||
|
||||
#define CLIENTE_REMBO "RMB" // Sistema operativo Rembo
|
||||
#define CLIENTE_OCUPADO "BSY" // Cliente ocupado
|
||||
#define CLIENTE_APAGADO "OFF" // Cliente apagado
|
||||
#define CLIENTE_INICIANDO "INI" // Cliente iniciando
|
||||
|
||||
// Variables y estructuras
|
||||
|
||||
typedef struct{ // EstructUra de la trama recibida
|
||||
char arroba; // cabecera de la trama
|
||||
char identificador[9]; // identificador de la trama
|
||||
char ejecutor; // ejecutor de la trama 1=el servidor rembo 2=el cliente rembo
|
||||
char parametros[LONGITUD_PARAMETROS]; // Contenido de la trama (par?etros)
|
||||
}TRAMA;
|
||||
|
||||
char szPathFileCfg[512];
|
||||
char szPathFileLog[512];
|
||||
|
||||
typedef unsigned long DWORD;
|
||||
typedef unsigned short WORD;
|
||||
typedef int BOOLEAN;
|
||||
typedef char BYTE;
|
||||
typedef int SOCKET;
|
||||
|
||||
// Prototipos de funciones
|
||||
|
||||
void INTROaFINCAD(char* );
|
||||
void FINCADaINTRO(char*,char*);
|
||||
SOCKET AbreConexion(char *,int);
|
||||
int cuenta_ipes(char*);
|
||||
int IgualIP(char *,char *);
|
||||
void RegistraLog(const char *,int);
|
||||
struct tm * TomaHora();
|
||||
char * toma_parametro(const char* ,char *);
|
||||
char* copia_parametro(const char*,char *);
|
||||
int SplitParametros(char**,char*, char*);
|
||||
int recibe_trama(SOCKET sock,TRAMA* trama);
|
||||
char* Encriptar(char *);
|
||||
char * Desencriptar(char *);
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# makefile
|
||||
|
||||
# Nombre del proyecto
|
||||
PROYECTO := ogAdmAgent
|
||||
|
||||
# Directorio de instalación
|
||||
INSTALL_DIR := /opt/opengnsys
|
||||
|
||||
# Opciones de compilacion
|
||||
CFLAGS := -O0 -g -Wall -I../includes # Depuracion
|
||||
#CFLAGS := -O3 -Wall # Optimizacion
|
||||
CPPFLAGS := $(CFLAGS)
|
||||
|
||||
# Opciones de linkado
|
||||
LDFLAGS := -L/usr/lib -L/usr/lib/mysql -lpthread -lmysqlclient
|
||||
|
||||
# Ficheros objetos
|
||||
OBJS := ../includes/Database.o sources/ogAdmAgent.o
|
||||
|
||||
|
||||
all: $(PROYECTO)
|
||||
|
||||
$(PROYECTO): $(OBJS)
|
||||
g++ $(LDFLAGS) $(OBJS) -o $(PROYECTO)
|
||||
# strip $(PROYECTO) # Optimizacion
|
||||
|
||||
install: $(PROYECTO)
|
||||
cp $(PROYECTO) $(INSTALL_DIR)/sbin
|
||||
cp $(PROYECTO).cfg $(INSTALL_DIR)/etc
|
||||
|
||||
clean:
|
||||
rm -f $(PROYECTO) $(OBJS)
|
||||
|
||||
uninstall: clean
|
||||
rm -f /usr/local/sbin/$(PROYECTO) /usr/local/etc/$(PROYECTO).cfg
|
||||
|
||||
sources/%.o: sources/%.cpp
|
||||
g++ $(CPPFLAGS) -I ../includes -c -o"$@" "$<"
|
||||
|
||||
sources/%.o: sources/%.c
|
||||
gcc $(CFLAGS) -I ../includes -c -o"$@" "$<"
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
IPhidra=SERVERIP
|
||||
Puerto=2008
|
||||
Usuario=usuog
|
||||
PassWord=passusuog
|
||||
DataSource=localhost
|
||||
Catalog=ogBDAdmin
|
||||
|
|
@ -1,761 +0,0 @@
|
|||
// *************************************************************************
|
||||
// Aplicación: OPENGNSYS
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2006
|
||||
// Nombre del fichero: ogAdmAgent.cpp
|
||||
// Descripción :
|
||||
//
|
||||
// ****************************************************************************
|
||||
#include "ogAdmAgent.h"
|
||||
#include "ogAdmLib.c"
|
||||
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Función: TomaConfiguracion
|
||||
//
|
||||
// Descripción:
|
||||
// Esta función lee el fichero de configuración del programa hidralinuxcli y toma los parámetros
|
||||
// Parámetros:
|
||||
// - pathfilecfg : Ruta al fichero de configuración
|
||||
//________________________________________________________________________________________________________
|
||||
int TomaConfiguracion(char* pathfilecfg) {
|
||||
long lSize;
|
||||
char * buffer, *lineas[100], *dualparametro[2];
|
||||
char ch[2];
|
||||
int i, numlin, resul;
|
||||
|
||||
if (pathfilecfg == NULL)
|
||||
return (FALSE); // Nombre del fichero en blanco
|
||||
|
||||
Fconfig = fopen(pathfilecfg, "rb");
|
||||
if (Fconfig == NULL)
|
||||
return (FALSE);
|
||||
fseek(Fconfig, 0, SEEK_END); // Obtiene tamaño del fichero.
|
||||
lSize = ftell(Fconfig);
|
||||
rewind(Fconfig);
|
||||
buffer = (char*) malloc(lSize); // Toma memoria para el buffer de lectura.
|
||||
if (buffer == NULL)
|
||||
return (FALSE);
|
||||
fread(buffer, 1, lSize, Fconfig); // Lee contenido del fichero
|
||||
fclose(Fconfig);
|
||||
|
||||
//inicializar
|
||||
IPlocal[0] = (char) NULL;
|
||||
servidorhidra[0] = (char) NULL;
|
||||
Puerto[0] = (char) NULL;
|
||||
|
||||
usuario[0] = (char) NULL;
|
||||
pasguor[0] = (char) NULL;
|
||||
datasource[0] = (char) NULL;
|
||||
catalog[0] = (char) NULL;
|
||||
|
||||
strcpy(ch, "\n");// caracter delimitador (salto de linea)
|
||||
numlin = split_parametros(lineas, buffer, ch);
|
||||
for (i = 0; i < numlin; i++) {
|
||||
strcpy(ch, "=");// caracter delimitador
|
||||
split_parametros(dualparametro, lineas[i], ch); // Toma primer nombre del parametro
|
||||
|
||||
resul = strcmp(dualparametro[0], "IPhidra");
|
||||
if (resul == 0)
|
||||
strcpy(IPlocal, dualparametro[1]);
|
||||
|
||||
resul = strcmp(dualparametro[0], "IPhidra");
|
||||
if (resul == 0)
|
||||
strcpy(servidorhidra, dualparametro[1]);
|
||||
|
||||
resul = strcmp(dualparametro[0], "Puerto");
|
||||
if (resul == 0)
|
||||
strcpy(Puerto, dualparametro[1]);
|
||||
|
||||
resul = strcmp(dualparametro[0], "Usuario");
|
||||
if (resul == 0)
|
||||
strcpy(usuario, dualparametro[1]);
|
||||
|
||||
resul = strcmp(dualparametro[0], "PassWord");
|
||||
if (resul == 0)
|
||||
strcpy(pasguor, dualparametro[1]);
|
||||
|
||||
resul = strcmp(dualparametro[0], "DataSource");
|
||||
if (resul == 0)
|
||||
strcpy(datasource, dualparametro[1]);
|
||||
|
||||
resul = strcmp(dualparametro[0], "Catalog");
|
||||
if (resul == 0)
|
||||
strcpy(catalog, dualparametro[1]);
|
||||
}
|
||||
if (IPlocal[0] == (char) NULL) {
|
||||
RegistraLog("IPlocal, NO se ha definido este parámetro", false);
|
||||
return (FALSE);
|
||||
}
|
||||
if (servidorhidra[0] == (char) NULL) {
|
||||
RegistraLog("IPhidra, NO se ha definido este parámetro", false);
|
||||
return (FALSE);
|
||||
}
|
||||
if (Puerto[0] == (char) NULL) {
|
||||
RegistraLog("Puerto, NO se ha definido este parámetro", false);
|
||||
return (FALSE);
|
||||
}
|
||||
puerto = atoi(Puerto);
|
||||
|
||||
if (usuario[0] == (char) NULL) {
|
||||
RegistraLog("Usuario, NO se ha definido este parámetro", false);
|
||||
return (FALSE);
|
||||
}
|
||||
if (pasguor[0] == (char) NULL) {
|
||||
RegistraLog("PassWord, NO se ha definido este parámetro", false);
|
||||
return (FALSE);
|
||||
}
|
||||
if (datasource[0] == (char) NULL) {
|
||||
RegistraLog("DataSource, NO se ha definido este parámetro", false);
|
||||
return (FALSE);
|
||||
}
|
||||
if (catalog[0] == (char) NULL) {
|
||||
RegistraLog("Catalog, NO se ha definido este parámetro", false);
|
||||
return (FALSE);
|
||||
}
|
||||
return (TRUE);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: busca_accion
|
||||
//
|
||||
// Descripción:
|
||||
// Esta Función busca en la base de datos, acciones programadas
|
||||
// Parametros:
|
||||
// - dia : Día actual del mes
|
||||
// - mes : mes en curso
|
||||
// - anno : Año en curso
|
||||
// - hora : Hora actual
|
||||
// - minutos : Minutos actuales
|
||||
// - diasemana : Dia de la semana 1=lunes,2=martes ... ( 0 Domingo)
|
||||
// _____________________________________________________________________________________________________________
|
||||
int busca_accion(WORD dia,WORD mes,WORD anno,WORD hora,WORD minutos,WORD diasemana)
|
||||
{
|
||||
char sqlstr[1000],ErrStr[200];
|
||||
Database db,wdb;
|
||||
Table tbl;
|
||||
char parametros[LONGITUD_PARAMETROS];
|
||||
BYTE swampm,bitsemana;
|
||||
int tipoaccion,identificador;
|
||||
int ordsem,ordulsem,ordiasem_1,maxdias;
|
||||
anno=anno-2009; // Año de comienzo es 2004
|
||||
if(hora>11){
|
||||
hora-=12;
|
||||
swampm=1; // Es pm
|
||||
}
|
||||
else
|
||||
swampm=0; // Es am
|
||||
|
||||
if(diasemana==0) diasemana=7; // El domingo
|
||||
|
||||
// Cuestión semanas
|
||||
ordiasem_1=DiadelaSemana(1,mes,anno+2009);
|
||||
ordsem=SemanadelMes(ordiasem_1,dia); // Calcula el número de la semana
|
||||
if (mes!=2) // Toma el último día de ese mes
|
||||
maxdias=dias_meses[mes];
|
||||
else{
|
||||
if (bisiesto(anno+2009))
|
||||
maxdias=29;
|
||||
else
|
||||
maxdias=28;
|
||||
}
|
||||
ordulsem=SemanadelMes(ordiasem_1,maxdias); // Calcula el número de última semana
|
||||
|
||||
bitsemana=HEX_semanas[ordsem];
|
||||
if(ordsem==ordulsem) // Si es la última semana del mes
|
||||
bitsemana|=HEX_semanas[6];
|
||||
|
||||
if (!db.Open(usuario, pasguor, datasource, catalog)) { // error de conexion
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return (false);
|
||||
}
|
||||
sprintf(sqlstr,"SELECT DISTINCT tipoaccion,identificador FROM programaciones WHERE "\
|
||||
" suspendida=0 "\
|
||||
" AND (annos & %d <> 0) "\
|
||||
" AND (meses & %d<>0) "\
|
||||
" AND ((diario & %d<>0) OR (dias & %d<>0) OR (semanas & %d<>0))"\
|
||||
" AND (horas & %d<>0) AND ampm=%d AND minutos=%d",\
|
||||
HEX_annos[anno],\
|
||||
HEX_meses[mes],\
|
||||
HEX_dias[dia],\
|
||||
HEX_diasemana[diasemana],
|
||||
bitsemana,\
|
||||
HEX_horas[hora],\
|
||||
swampm,minutos);
|
||||
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
if(tbl.ISEOF()){
|
||||
db.Close();
|
||||
return(true); // No hay acciones programadas
|
||||
}
|
||||
if (!wdb.Open(usuario, pasguor, datasource, catalog)) { // error de conexion
|
||||
db.Close();
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return (false);
|
||||
}
|
||||
while(!tbl.ISEOF()){ // Busca entre todas las programaciones
|
||||
if(!tbl.Get("tipoaccion",tipoaccion)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
if(!tbl.Get("identificador",identificador)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
if(tipoaccion==EJECUCION_TAREA){ // Es una programación de una tarea
|
||||
EjecutarTarea(identificador,0,0,0,wdb,parametros);
|
||||
}
|
||||
else{
|
||||
if(tipoaccion==EJECUCION_TRABAJO){
|
||||
EjecutarTrabajo(identificador,wdb,parametros); // Es una programación de un trabajo
|
||||
}
|
||||
else{
|
||||
if(tipoaccion==EJECUCION_RESERVA){
|
||||
EjecutarReserva(identificador,wdb,parametros); // Es una programación de un trabajo
|
||||
}
|
||||
}
|
||||
}
|
||||
tbl.MoveNext();
|
||||
}
|
||||
wdb.Close();
|
||||
db.Close();
|
||||
return(true);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: bisiesto
|
||||
//
|
||||
// Descripción:
|
||||
// Esta Función devuelve true si el año pasado como parámetro es bisiesto y false si no lo es
|
||||
// Parametros:
|
||||
// - anob : un año en formato aaaa
|
||||
// _____________________________________________________________________________________________________________
|
||||
bool bisiesto(WORD anob){
|
||||
return(anob%4==0);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: DiadelaSemana
|
||||
//
|
||||
// Descripción:
|
||||
// Esta Función devuelve el número del día de la semana: 1=Lunes, 2=martes ... 6=sábado 7=domingo de una fecha determinada
|
||||
// Parametros:
|
||||
// - dia : Un día
|
||||
// - mes : Un mes
|
||||
// - anno : Un año
|
||||
// _____________________________________________________________________________________________________________
|
||||
int DiadelaSemana(WORD dia,WORD mes,WORD anno)
|
||||
{
|
||||
int i,cont,dias_anuales;
|
||||
int desplazamiento_dias=6;
|
||||
int orddiasem;
|
||||
|
||||
cont =0;
|
||||
for (i=1900;i<anno;i++){
|
||||
if (bisiesto(i)) dias_anuales=366; else dias_anuales=365;
|
||||
cont+=dias_anuales;
|
||||
}
|
||||
for (i=1;i<mes;i++){
|
||||
if (i!=2)
|
||||
cont+=dias_meses[i];
|
||||
else{
|
||||
if (bisiesto(anno))
|
||||
cont+=29;
|
||||
else
|
||||
cont+=28;
|
||||
}
|
||||
}
|
||||
cont+=dia+desplazamiento_dias;
|
||||
orddiasem=(cont%7);
|
||||
if(orddiasem==0) orddiasem=7;
|
||||
return(orddiasem);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: SemanadelMes
|
||||
//
|
||||
// Descripción:
|
||||
// Esta Función devuelve el número de semana perteneciente a un día de ese mes
|
||||
// Parámetros:
|
||||
// - ordiasem_1 : Orden semenal (1,2...) del dia del primer dia del mes que se pasa como parámetro
|
||||
// - diames : El mes concreto
|
||||
// _____________________________________________________________________________________________________________
|
||||
int SemanadelMes(int ordiasem_1,int diames)
|
||||
{
|
||||
int nwdia,resto,cociente;
|
||||
|
||||
nwdia=diames+ordiasem_1-1;
|
||||
cociente=nwdia/7;
|
||||
resto=nwdia%7;
|
||||
if(resto>0) cociente++;
|
||||
return(cociente);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: Pausa
|
||||
//
|
||||
// Descripción:
|
||||
// Hace una pausa en segundos
|
||||
// Parametros:
|
||||
// - s : Segundos de pausa
|
||||
// _____________________________________________________________________________________________________________
|
||||
void Pausa(int s)
|
||||
{
|
||||
int seg=0;
|
||||
clock_t comienzo;
|
||||
|
||||
comienzo = clock();
|
||||
do{
|
||||
seg=(clock()-comienzo)/CLOCKS_PER_SEC;
|
||||
}while(seg<s);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: EjecutarTrabajo
|
||||
//
|
||||
// Descripción:
|
||||
// Registra una acción (Trabajo y la envía para su ejecución
|
||||
// Parámetros:
|
||||
// - idtrabajo : Identificador del trabajo
|
||||
// - db: una conexion ADO operativa
|
||||
// - parametros: Parámetros de la acción
|
||||
// _____________________________________________________________________________________________________________
|
||||
int EjecutarTrabajo(int idtrabajo,Database db,char*parametros )
|
||||
{
|
||||
char sqlstr[1000],ErrStr[200];
|
||||
Table tbl;
|
||||
int cont_tareas=0,lon;
|
||||
int idtarea,idtrabajotarea,idcentro;
|
||||
char wambitrabajo[500],ambitrabajo[4000];
|
||||
char wparamtrabajo[20],paramtrabajo[1000];
|
||||
int tbTareasidtarea[100],tbTareasidnotificador[100];
|
||||
char *tbTareasparametros[100],*tbTareasambitoambitskwrk[100];
|
||||
char ambitskwrk[500];
|
||||
|
||||
ambitrabajo[0]=(char)NULL; // Inicialización
|
||||
strcpy(paramtrabajo,"tsk="); // Inicialización
|
||||
|
||||
// recupera el identificador del Centro propietario de la tarea
|
||||
sprintf(sqlstr,"SELECT idcentro FROM trabajos WHERE idtrabajo=%d",idtrabajo);
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
if(tbl.ISEOF()) return(true);
|
||||
if(!tbl.Get("idcentro",idcentro)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
// Recupera las tareas que forman parte del trabajo
|
||||
sprintf(sqlstr,"SELECT * FROM trabajos_tareas WHERE idtrabajo=%d ORDER by orden",idtrabajo);
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
if(tbl.ISEOF()) return(true);
|
||||
// Recorre trabajos-tareas
|
||||
while(!tbl.ISEOF()){
|
||||
if(!tbl.Get("idtrabajotarea",idtrabajotarea)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
tbTareasidnotificador[cont_tareas]=idtrabajotarea;
|
||||
|
||||
if(!tbl.Get("idtarea",idtarea)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
tbTareasidtarea[cont_tareas]=idtarea;
|
||||
|
||||
if(!tbl.Get("parametros",parametros)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
lon=strlen(parametros);
|
||||
tbTareasparametros[cont_tareas]=(char*)malloc(lon);
|
||||
if(tbTareasparametros[cont_tareas]==NULL)
|
||||
return(false); // No hay memoria bastante
|
||||
strcpy(tbTareasparametros[cont_tareas],parametros);
|
||||
|
||||
if(!tbl.Get("ambitskwrk",ambitskwrk)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
lon=strlen(ambitskwrk);
|
||||
tbTareasambitoambitskwrk[cont_tareas]=(char*)malloc(lon);
|
||||
strcpy(tbTareasambitoambitskwrk[cont_tareas],ambitskwrk);
|
||||
|
||||
sprintf(wambitrabajo,"%s;",ambitskwrk);
|
||||
strcat(ambitrabajo,wambitrabajo);
|
||||
|
||||
sprintf(wparamtrabajo,"%d;",idtrabajotarea);
|
||||
strcat(paramtrabajo,wparamtrabajo);
|
||||
|
||||
cont_tareas++;
|
||||
tbl.MoveNext();
|
||||
}
|
||||
lon=strlen(ambitrabajo);
|
||||
ambitrabajo[lon-1]=(char)NULL; // Quita la coma final
|
||||
|
||||
lon=strlen(paramtrabajo);
|
||||
paramtrabajo[lon-1]=(char)NULL; // Quita la coma final
|
||||
|
||||
char fechareg[100];
|
||||
|
||||
|
||||
struct tm* st;
|
||||
st = TomaHora();
|
||||
sprintf(fechareg, "%d/%d/%d %d:%d:%d", st->tm_year + 1900, st->tm_mon + 1,
|
||||
st->tm_mday, st->tm_hour, st->tm_min, st->tm_sec);
|
||||
|
||||
sprintf(sqlstr,"INSERT INTO acciones (tipoaccion,idtipoaccion,cateaccion,ambito,idambito,ambitskwrk,fechahorareg,estado,resultado,idcentro,parametros,accionid,idnotificador) VALUES (%d,%d,%d,0,0,'%s','%s','%s','%s',%d,'%s',0,0)",EJECUCION_TRABAJO,idtrabajo,PROCESOS,ambitrabajo,fechareg,ACCION_INICIADA,ACCION_SINERRORES,idcentro,paramtrabajo);
|
||||
if(!db.Execute(sqlstr)){ // Error al insertar
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
int accionid=0;
|
||||
// Toma identificador de la acción
|
||||
sprintf(sqlstr,"SELECT @@identity as identificador");
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
if(!tbl.ISEOF()){ // Si existe registro
|
||||
if(!tbl.Get("identificador",accionid)){
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
int i;
|
||||
// Insertar acciones:tareas
|
||||
for (i=0;i<cont_tareas;i++){
|
||||
if(!EjecutarTarea(tbTareasidtarea[i],accionid,tbTareasidnotificador[i],idcentro,db,parametros)){
|
||||
free(tbTareasparametros[i]);
|
||||
free(tbTareasambitoambitskwrk[i]);
|
||||
return(false);
|
||||
}
|
||||
free(tbTareasparametros[i]);
|
||||
free(tbTareasambitoambitskwrk[i]);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: EjecutarTarea
|
||||
//
|
||||
// Descripción:
|
||||
// Registra una acción (Tarea) y la envía para su ejecución
|
||||
// Parámetros:
|
||||
// - idtarea : Identificador de la tarea
|
||||
// - accionid: identificador del trabajo padre (si existe)
|
||||
// - idnotificador: identificador del trabajo_tarea incluido en trabajo padre (si existe)
|
||||
// - idcentro: Centro propietario del trabjo padre (si existe este trabajo)
|
||||
// - db: una conexion ADO operativa
|
||||
// - parametros: Parámetros de la acción
|
||||
// _____________________________________________________________________________________________________________
|
||||
int EjecutarTarea(int idtarea,int accionid,int idnotificador,int idcentro,Database db,char *parametros )
|
||||
{
|
||||
char sqlstr[1000],ErrStr[200],ambito;
|
||||
Table tbl;
|
||||
int cont_comandos=0,lon;
|
||||
int idcomando,idambito,idtareacomando,accionidcmd;
|
||||
char wambitarea[20],ambitarea[4000];
|
||||
char wparamtarea[20],paramtarea[1000],pids[20];
|
||||
int tbComandosidcomando[100],tbComandosambito[100],tbComandosidnotificador[100],tbComandosidambito[100];
|
||||
char *tbComandosparametros[100];
|
||||
|
||||
ambitarea[0]=(char)NULL; // Inicialización
|
||||
strcpy(paramtarea,"cmd="); // Inicialización
|
||||
if(idcentro==0){
|
||||
// recupera el identificador del Centro propietario de la tarea
|
||||
sprintf(sqlstr,"SELECT idcentro FROM tareas WHERE idtarea=%d",idtarea);
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
if(tbl.ISEOF()) return(true);
|
||||
if(!tbl.Get("idcentro",idcentro)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
// Recupera los comandos que forman parte de la tarea
|
||||
sprintf(sqlstr,"SELECT * FROM tareas_comandos WHERE idtarea=%d ORDER by orden",idtarea);
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
if(tbl.ISEOF()) return(true);
|
||||
|
||||
// Recorre tareas-comandos
|
||||
while(!tbl.ISEOF()){
|
||||
if(!tbl.Get("idcomando",idcomando)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
tbComandosidcomando[cont_comandos]=idcomando;
|
||||
|
||||
if(!tbl.Get("ambito",ambito)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
tbComandosambito[cont_comandos]=ambito;
|
||||
|
||||
if(!tbl.Get("idambito",idambito)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
tbComandosidambito[cont_comandos]=idambito;
|
||||
|
||||
|
||||
if(!tbl.Get("parametros",parametros)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
|
||||
lon=strlen(parametros);
|
||||
tbComandosparametros[cont_comandos]=(char*)malloc(lon+20);
|
||||
if(tbComandosparametros[cont_comandos]==NULL)
|
||||
return(false); // No hay memoria bastante
|
||||
|
||||
strcpy(tbComandosparametros[cont_comandos],parametros);
|
||||
|
||||
if(!tbl.Get("idtareacomando",idtareacomando)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
tbComandosidnotificador[cont_comandos]=idtareacomando;
|
||||
|
||||
sprintf(wambitarea,"%d:%d;",ambito,idambito);
|
||||
strcat(ambitarea,wambitarea);
|
||||
|
||||
sprintf(wparamtarea,"%d;",idtareacomando);
|
||||
strcat(paramtarea,wparamtarea);
|
||||
|
||||
cont_comandos++;
|
||||
tbl.MoveNext();
|
||||
}
|
||||
lon=strlen(ambitarea);
|
||||
ambitarea[lon-1]=(char)NULL; // Quita la coma final
|
||||
|
||||
lon=strlen(paramtarea);
|
||||
paramtarea[lon-1]=(char)NULL; // Quita la coma final
|
||||
|
||||
char fechareg[100];
|
||||
|
||||
|
||||
struct tm* st;
|
||||
st = TomaHora();
|
||||
sprintf(fechareg, "%d/%d/%d %d:%d:%d", st->tm_year + 1900, st->tm_mon + 1,
|
||||
st->tm_mday, st->tm_hour, st->tm_min, st->tm_sec);
|
||||
|
||||
sprintf(sqlstr,"INSERT INTO acciones (tipoaccion,idtipoaccion,cateaccion,ambito,idambito,ambitskwrk,fechahorareg,estado,resultado,idcentro,parametros,accionid,idnotificador) VALUES (%d,%d,%d,0,0,'%s','%s','%s','%s',%d,'%s',%d,%d)",EJECUCION_TAREA,idtarea,PROCESOS,ambitarea,fechareg,ACCION_INICIADA,ACCION_SINERRORES,idcentro,paramtarea,accionid,idnotificador);
|
||||
if(!db.Execute(sqlstr)){ // Error al insertar
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
accionid=0;
|
||||
// Toma identificador de la acción
|
||||
sprintf(sqlstr,"SELECT @@identity as identificador");
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
if(!tbl.ISEOF()){ // Si existe registro
|
||||
if(!tbl.Get("identificador",accionid)){
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
int i;
|
||||
// Insertar acciones:comandos
|
||||
for (i=0;i<cont_comandos;i++){
|
||||
st = TomaHora();
|
||||
sprintf(fechareg, "%d/%d/%d %d:%d:%d", st->tm_year + 1900, st->tm_mon
|
||||
+ 1, st->tm_mday, st->tm_hour, st->tm_min, st->tm_sec);
|
||||
|
||||
sprintf(sqlstr,"INSERT INTO acciones (tipoaccion,idtipoaccion,cateaccion,ambito,idambito,fechahorareg,estado,resultado,idcentro,parametros,accionid,idnotificador) VALUES (%d,%d,%d,%d,%d,'%s','%s','%s',%d,'%s',%d,%d)",EJECUCION_COMANDO,tbComandosidcomando[i],PROCESOS,tbComandosambito[i],tbComandosidambito[i],fechareg,ACCION_EXITOSA,ACCION_SINERRORES,idcentro,tbComandosparametros[i],accionid,tbComandosidnotificador[i]);
|
||||
if(!db.Execute(sqlstr)){ // Error al insertar
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
free(tbComandosparametros[i]);
|
||||
return(false);
|
||||
}
|
||||
|
||||
// Toma identificador dela acción
|
||||
sprintf(sqlstr,"SELECT @@identity as identificador");
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
|
||||
if(!tbl.ISEOF()){ // Si existe registro
|
||||
if(!tbl.Get("identificador",accionidcmd)){
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
sprintf(pids,"ids=%d\r",accionidcmd);
|
||||
strcat(tbComandosparametros[i],pids); // Le añade el identificador de la acción
|
||||
envia_comando(tbComandosparametros[i]);
|
||||
free(tbComandosparametros[i]);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: EjecutarReserva
|
||||
//
|
||||
// Descripción:
|
||||
// Registra una acción (Tarea) y la envía para su ejecución
|
||||
// Parámetros:
|
||||
// - idreserva : Identificador de la reserva
|
||||
// - db: una conexion ADO operativa
|
||||
// - parametros: Parámetros de la acción
|
||||
// _____________________________________________________________________________________________________________
|
||||
int EjecutarReserva(int idreserva,Database db,char*parametros )
|
||||
{
|
||||
char sqlstr[1000],ErrStr[200];
|
||||
Table tbl;
|
||||
int idaccion;
|
||||
|
||||
sprintf(sqlstr,"SELECT idtarea,idtrabajo FROM reservas WHERE idreserva=%d",idreserva);
|
||||
if(!db.Execute(sqlstr,tbl)){ // Error al leer
|
||||
db.GetErrorErrStr(ErrStr);
|
||||
return(false);
|
||||
}
|
||||
if(tbl.ISEOF()){
|
||||
return(false); // No hay acciones previas en la reserva
|
||||
}
|
||||
|
||||
if(!tbl.Get("idtarea",idaccion)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
if(idaccion>0)
|
||||
EjecutarTarea(idaccion,0,0,0,db,parametros); // Es una reserva con tarea previa
|
||||
|
||||
if(!tbl.Get("idtrabajo",idaccion)){ // Toma dato
|
||||
tbl.GetErrorErrStr(ErrStr); // error al acceder al registro
|
||||
return(false);
|
||||
}
|
||||
if(idaccion>0)
|
||||
EjecutarTrabajo(idaccion,db,parametros); // Es una reserva con trabajo previo
|
||||
|
||||
return(true);
|
||||
}
|
||||
// _____________________________________________________________________________________________________________
|
||||
// Función: envia_comando
|
||||
//
|
||||
// Descripción:
|
||||
// Envía un comando a la red. Para ello es necesario tener iniciado el servicio hidra.
|
||||
// Parámetros:
|
||||
// - parametros: Parámetros del comando
|
||||
// _____________________________________________________________________________________________________________
|
||||
int envia_comando(char* parametros)
|
||||
{
|
||||
SOCKET sClient;
|
||||
TRAMA trama;
|
||||
|
||||
sClient = AbreConexion(servidorhidra,puerto);
|
||||
if (sClient == (SOCKET)NULL)
|
||||
return(FALSE);
|
||||
|
||||
trama.arroba='@';
|
||||
strncpy(trama.identificador,"JMMLCAMDJ",9);
|
||||
trama.ejecutor=parametros[0];
|
||||
strcpy(trama.parametros,(char*)¶metros[1]);
|
||||
return(manda_trama(sClient,&trama));
|
||||
}
|
||||
|
||||
/// _____________________________________________________________________________________________________________
|
||||
// Función: manda_trama
|
||||
//
|
||||
// Descripción:
|
||||
// Esta Función envía una trama por la red (TCP)
|
||||
// Parámetros:
|
||||
// - sock : El socket del host al que se dirige la trama
|
||||
// - trama: El contenido de la trama
|
||||
/// _____________________________________________________________________________________________________________
|
||||
int manda_trama(SOCKET sock,TRAMA* trama)
|
||||
{
|
||||
int nLeft,idx,ret;
|
||||
|
||||
Encriptar((char*)trama);
|
||||
nLeft = strlen((char*)trama);
|
||||
idx = 0;
|
||||
while(nLeft > 0){
|
||||
ret = send(sock,(char*)&trama[idx], nLeft, 0);
|
||||
if (ret == 0)
|
||||
break;
|
||||
else
|
||||
if (ret == SOCKET_ERROR){
|
||||
RegistraLog("***AGENT***send() fallo al enviar trama:",true);
|
||||
return(FALSE);
|
||||
}
|
||||
nLeft -= ret;
|
||||
idx += ret;
|
||||
}
|
||||
return(TRUE);
|
||||
}
|
||||
//******************************************************************************************************************************************
|
||||
// PROGRAMA PRINCIPAL
|
||||
//******************************************************************************************************************************************
|
||||
int main(int argc, char *argv[]) {
|
||||
|
||||
struct tm* st;
|
||||
|
||||
strcpy(szPathFileCfg, "ogAdmAgent.cfg");
|
||||
strcpy(szPathFileLog, "ogAdmAgent.log");
|
||||
int i;
|
||||
for (i = 1; (i + 1) < argc; i += 2) {
|
||||
if (argv[i][0] == '-') {
|
||||
switch (tolower(argv[i][1])) {
|
||||
case 'f':
|
||||
if (argv[i + 1] != NULL)
|
||||
strcpy(szPathFileCfg, argv[i + 1]);
|
||||
else {
|
||||
RegistraLog(
|
||||
"Fallo en los parámetros: Debe especificar el fichero de configuración del servicio",
|
||||
false);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
if (argv[i + 1] != NULL)
|
||||
strcpy(szPathFileLog, argv[i + 1]);
|
||||
else {
|
||||
RegistraLog(
|
||||
"Fallo en los parámetros: Debe especificar el fichero de log para el servicio",
|
||||
false);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
RegistraLog(
|
||||
"Fallo de sintaxis en los parámetros: Debe especificar -f nombre_del_fichero_de_configuración_del_servicio",
|
||||
false);
|
||||
exit(EXIT_FAILURE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (szPathFileCfg == NULL) {
|
||||
printf("***Error. No se ha especificado fichero de configuración\n");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
if (!TomaConfiguracion(szPathFileCfg)) { // Toma parametros de configuración
|
||||
RegistraLog(
|
||||
"El fichero de configuración contiene un error de sintaxis",
|
||||
false);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
int pseg;
|
||||
while (TRUE){
|
||||
st = TomaHora();
|
||||
//pseg=1000*(65-st->tm_sec); // Calcula milisegundos de inactividad de la hebra
|
||||
pseg=65-st->tm_sec; // Calcula segundos de inactividad de la hebra
|
||||
sleep(pseg);
|
||||
|
||||
// Toma la hora
|
||||
st = TomaHora();
|
||||
busca_accion(st->tm_mday,st->tm_mon+1,st->tm_year+1900,st->tm_hour,st->tm_min,st->tm_wday );
|
||||
}
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
//*****************************************************************************
|
||||
// Aplicación OpenGNSys
|
||||
// Autor: José Manuel Alonso.
|
||||
// Licencia: Open Source
|
||||
// Fichero: ogAdmAgent.h
|
||||
// Descripción:
|
||||
// Fichero de cabebera del módulo de la aplicación OpenGNSys que implementa
|
||||
// las comunicaciones con el Servidor.
|
||||
// ****************************************************************************
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
#include </usr/include/mysql/mysql.h>
|
||||
#include <pthread.h>
|
||||
#include "Database.h"
|
||||
#include "ogAdmLib.h"
|
||||
|
||||
|
||||
FILE *FLog,*Fconfig;
|
||||
|
||||
char IPlocal[20]; // Ip local
|
||||
char servidorhidra[20]; // IP servidor HIDRA
|
||||
char Puerto[20]; // Puerto Unicode
|
||||
int puerto; // Puerto
|
||||
char usuario[20];
|
||||
char pasguor[20];
|
||||
char datasource[20];
|
||||
char catalog[50];
|
||||
|
||||
BYTE HEX_annos[]={0,0x01,0x02,0x04,0x08,0x10,0x20,0x40,0x80};
|
||||
|
||||
WORD HEX_meses[]={0,0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800};
|
||||
|
||||
int HEX_dias[]={0,0x00000001,0x00000002,0x00000004,0x00000008,0x00000010,0x00000020,0x00000040,0x00000080,0x00000100,0x00000200,
|
||||
0x00000400,0x00000800,0x00001000,0x00002000,0x00004000,0x00008000,0x00010000,0x00020000,0x00040000,0x00080000,
|
||||
0x00100000,0x00200000,0x00400000,0x00800000,0x01000000,0x02000000,0x04000000,0x08000000,0x10000000,0x20000000,0x40000000};
|
||||
|
||||
WORD HEX_horas[]={0x0001,0x0002,0x0004,0x0008,0x0010,0x0020,0x0040,0x0080,0x0100,0x0200,0x0400,0x0800 };
|
||||
|
||||
BYTE HEX_diasemana[]={0,0x01,0x02,0x04,0x08,0x10,0x20,0x40};
|
||||
|
||||
BYTE HEX_semanas[]={0,0x01,0x02,0x04,0x08,0x10,0x20};
|
||||
|
||||
WORD dias_meses[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
|
||||
|
||||
|
||||
// Prototipo de funciones
|
||||
void inicializa(void);
|
||||
void Pausa(int);
|
||||
|
||||
int busca_accion(WORD ,WORD ,WORD ,WORD ,WORD,WORD );
|
||||
int busca_reserva(WORD ,WORD ,WORD ,WORD ,WORD,WORD );
|
||||
|
||||
int DiadelaSemana(WORD ,WORD ,WORD );
|
||||
bool bisiesto(WORD );
|
||||
int SemanadelMes(int ,int );
|
||||
int EjecutarTrabajo(int ,Database,char* );
|
||||
int EjecutarTarea(int ,int ,int ,int ,Database,char* );
|
||||
int EjecutarReserva(int,Database,char*);
|
||||
|
||||
int envia_comando(char*);
|
||||
SOCKET AbreConexion(char*,int);
|
||||
int TomaConfiguracion(void);
|
||||
int manda_trama(SOCKET ,TRAMA* );
|
|
@ -1,32 +0,0 @@
|
|||
# makefile
|
||||
|
||||
# Nombre del proyecto
|
||||
PROYECTO := ogAdmClient
|
||||
|
||||
# Directorios y librerias
|
||||
DIRS :=
|
||||
LIBS := -static
|
||||
|
||||
# Opciones de compilacion
|
||||
OPCS := -O0 -g -Wall # Depuracion
|
||||
#OPCS := -O3 -Wall # Optimizacion
|
||||
|
||||
# Ficheros objetos
|
||||
OBJS := sources/ogAdmClient.o
|
||||
|
||||
all: $(PROYECTO)
|
||||
|
||||
$(PROYECTO): $(OBJS)
|
||||
g++ $(DIRS) $(LIBS) $(OBJS) -o $(PROYECTO)
|
||||
# strip $(PROYECTO) # Optimizacion
|
||||
|
||||
clean:
|
||||
rm $(PROYECTO) $(OBJS)
|
||||
|
||||
sources/%.o: sources/%.cpp
|
||||
g++ $(OPCS) -c -o"$@" "$<"
|
||||
|
||||
sources/%.o: sources/%.c
|
||||
gcc $(OPCS) -I ../includes -c -o"$@" "$<"
|
||||
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
ServerIP=SERVERIP
|
||||
Puerto=2008
|
||||
ClientScripts=/opt/opengnsys/scripts
|
||||
UrlMenu=OPENGNSYSURL/varios/menubrowser.php
|
||||
UrlMsg=OPENGNSYSURL/varios/msgbrowser.php
|
File diff suppressed because it is too large
Load Diff
|
@ -1,306 +0,0 @@
|
|||
//****************************************************************************************************************************************************
|
||||
// Aplicación OpenGNSys
|
||||
// Autor: José Manuel Alonso.
|
||||
// Licencia: Open Source
|
||||
// Fichero: ogAdmClient.cpp
|
||||
// Descripción:
|
||||
// Este módulo de la aplicación OpenGNSys implementa las comunicaciones con el Cliente.
|
||||
// ****************************************************************************************************************************************************
|
||||
#include <sys/types.h>
|
||||
#include <sys/wait.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include <signal.h>
|
||||
#include "ogAdmLib.h"
|
||||
|
||||
|
||||
#define LONGITUD_SCRIPTSALIDA 4064 // Longitud máxima de la informacin devuelta por un script
|
||||
#define LONGITUD_PARAMETROS_TRAMA 4024 // Longitud máxima de la información de la trama (parametros)
|
||||
|
||||
#define LONGITUD_CONFIGURACION 1024 // Longitud máxima de las configuraciones de partición
|
||||
|
||||
|
||||
#define MAXITEMS 100
|
||||
#define MAXHTMLMNU 4000
|
||||
#define MAXPARTICIONES 24
|
||||
#define MAXINFOSO 5 // Numero máximo de nemónicos enla inforamción del S.O. de una partición
|
||||
#define MAXARGS 16 // Numero máximo de argumentos enviados a un scripts
|
||||
#define LONSTD 512 // Longitud de memoria estandar
|
||||
#define LONSTDC 256 // Longitud de memoria estandar corta
|
||||
|
||||
|
||||
|
||||
TRAMA trama[1];
|
||||
|
||||
char IPlocal[20]; // Ip local
|
||||
char Servidorhidra[20]; // IP servidor de Administración
|
||||
char Puerto[20]; // Puerto Unicode
|
||||
|
||||
|
||||
|
||||
//___________________________________________________________________________________________________
|
||||
// Variables y estructuras
|
||||
//___________________________________________________________________________________________________
|
||||
|
||||
char cmdshell[LONSTD];
|
||||
char parametros[LONSTD];
|
||||
char* argumentos[MAXARGS];
|
||||
char msglog[LONSTD];
|
||||
char msgcon[LONSTD];
|
||||
char filecmdshell[LONSTDC];
|
||||
char urlpag[LONSTDC];
|
||||
char fileini[LONSTDC];
|
||||
char filecmd[LONSTDC];
|
||||
|
||||
struct excepcion {
|
||||
int herror;
|
||||
char msg[LONSTDC];
|
||||
char modulo[LONSTDC];
|
||||
};
|
||||
struct excepcion e;
|
||||
|
||||
int ndebug=1; // Nivel de debuger por defecto
|
||||
|
||||
// Nemónicos
|
||||
int MsDos=1;
|
||||
int Win98=2;
|
||||
int Win2K=3;
|
||||
int WinXP=4;
|
||||
int Linux=5;
|
||||
|
||||
BOOLEAN PROCESO=true; // Indicador de la actividad del proceso principal
|
||||
BOOLEAN CACHEEXISTS; // Indica si existe cache
|
||||
|
||||
char HIDRACHEIMAGENES[LONSTDC]; // Path al directorio donde están las imágenes (en la caché)
|
||||
char HIDRASRVIMAGENES[LONSTDC]; // Path al directorio donde están las imágenes (en el repositorio)
|
||||
char HIDRASRVCMD[LONSTDC]; // Path del directorio del repositorio donde se depositan los comandos para el cliente
|
||||
char HIDRASCRIPTS[LONSTDC]; // Path al directorio donde están los scripts de la interface con la APi de funciones de OpenGnsys (en el cliente )
|
||||
char URLMENU[LONSTDC]; // Url de la pagina de menu para el browser
|
||||
char URLMSG[LONSTDC]; // Url de la página de mensajed para el browser
|
||||
|
||||
|
||||
int HIDRAVER; // Versión de la apliación de Administración
|
||||
int TPAR ; // Tamaño de la partición
|
||||
|
||||
SOCKET sock; // Socket
|
||||
|
||||
struct s_CabMnu {
|
||||
char resolucion[2]; // Resolución de pantalla
|
||||
char titulo[LONSTDC]; // Título del menú
|
||||
char coorx[4]; // Coordenada x
|
||||
char coory[4]; // Coordenada y
|
||||
char modalidad[2]; // modalidad ( número de items por línea )
|
||||
char scoorx[4]; // Coordenada x // Menú privado
|
||||
char scoory[4]; // Coordenada y
|
||||
char smodalidad[LONSTDC]; // modalidad ( número de items por línea )
|
||||
char htmmenupub[64]; // Nombre del fichero que contiene el html del menú (público)
|
||||
char htmmenupri[64]; // Nombre del fichero que contiene el html del menú (privado)
|
||||
} CabMnu; // Estructura con los datos de los menús
|
||||
|
||||
BOOLEAN swmnu=false; // Indicador de menú asignado
|
||||
|
||||
struct s_Item{
|
||||
char idaccionmenu[16]; // Identificador del item a ejecutar
|
||||
char urlimg[64]; // Nombre de la imagen de fondo del botón
|
||||
char literal[LONSTDC]; // Literal del item
|
||||
char tipoitem[2]; // Tipo de item ( público o privado)
|
||||
char tipoaccion[2]; // Tipo de acción que ejecuta el item
|
||||
} ;
|
||||
|
||||
struct s_Propiedades {
|
||||
char idordenador[16]; // Identificador del ordenador
|
||||
char nombreordenador[64]; // Nombre del ordenador
|
||||
char idaula[16]; // Identificador del aula
|
||||
char servidorhidra[16]; // IP del servidor Opengnsys
|
||||
char puerto[16]; // Puerto
|
||||
char iprepo[16]; // Dirección IP repositorio
|
||||
char puertorepo[16]; // Puerto
|
||||
char idperfilhard[16]; // Identificador del perfil hardware
|
||||
char IPlocal[16]; // Dirección IP del cliente
|
||||
char cache[16]; // Tamaño de la cache
|
||||
char ipmulticast[16]; // Dirección IP multicast
|
||||
char pormulticast[16]; // Puerto multicast
|
||||
char modmulticast[16]; // Modo de transmisión multicast
|
||||
char velmulticast[16]; // Velocidad de transmisión multicast
|
||||
|
||||
} Propiedades; // Estructura con los datos del odenador
|
||||
|
||||
struct s_Particiones{
|
||||
char tiposo[64]; // Tipo de sistema operativo
|
||||
char tipopart[16]; // Tipo de partición
|
||||
char tamapart[16]; // Tamao de la partición
|
||||
char numpart[5]; // Nmero de la partición
|
||||
char nombreso[64]; // Nombre del S.O.
|
||||
};
|
||||
|
||||
struct s_Hardware{
|
||||
char nemonico[4]; // Tipo de sistema operativo
|
||||
char tipo[45]; // Tipo de hardware
|
||||
char codigovalor[256]; // Código o descripción
|
||||
}
|
||||
;
|
||||
struct tiposo {
|
||||
char *tipopart;
|
||||
char *tiposo;
|
||||
char *nombreso;
|
||||
};
|
||||
|
||||
char* tbPathImg[]={"CLIEN","CACHE","REPO"};
|
||||
char* tbmodmul[]={"","half-duplex","full-duplex"};
|
||||
|
||||
struct tiposo tiposos[] = {
|
||||
{"NTFS","Windows NT Platafom","Windows 2000,XP,2003"},
|
||||
{"HNTFS","Windows NT Platafom","Windows 2000,XP,2003"},
|
||||
{"FAT16","Windows","Windos 98,SE,Millenium"},
|
||||
{"HFAT16","Windows","Windos 98,SE,Millenium"},
|
||||
{"FAT32","Windows","Windos 98,SE,Millenium"},
|
||||
{"HFAT32","Windows","Windos 98,SE,Millenium"},
|
||||
{"EXT","Extendida","Extendida"},
|
||||
{"EXT4","Linux","Linux"},
|
||||
{"EXT3","Linux","Linux"},
|
||||
{"EXT2","Linux","Linux"},
|
||||
{"REISERFS","Linux","Linux"},
|
||||
{"JFS","Linux","Linux"},
|
||||
{"XFS","Linux","Linux"},
|
||||
{"CACHE","CACHE","CACHE"},
|
||||
{"UNKNOWN","UNKNOWN","UNKNOWN"},
|
||||
{"EMPTY","Libre","Libre"},
|
||||
{"LINUX-SWAP","","Linux-swap"}};
|
||||
|
||||
int ntiposo = sizeof (tiposos) / sizeof (struct tiposo);
|
||||
|
||||
struct s_Item tbMenu[MAXITEMS]; // Tabla con los items del menu
|
||||
int contitems; // Contador items del menu
|
||||
|
||||
BOOLEAN PRCCMD; // Indicador de comandos interactivos
|
||||
BOOLEAN CMDPTES; // Indicador de comandos pendientes
|
||||
|
||||
//char modulo[64]; // Nombre de la función donde se produce el error
|
||||
|
||||
BOOLEAN aut = false; // Variable para controlar el acceso al menú de administración
|
||||
|
||||
pid_t pidmenu;
|
||||
|
||||
char* tbErrores[]={"000-Se han generado errores. No se puede continuar la ejecución de este módulo",\
|
||||
"001-No hay memoria suficiente para el buffer",\
|
||||
"002-No se puede establecer conexión con el servidor de administración",\
|
||||
"003-El fichero especificado no existe o bien no puede crearse o abrirse",\
|
||||
"004-Comando Error",\
|
||||
"005-El fichero est vacio",\
|
||||
"006-Error en la ejecución del fichero autoexec",\
|
||||
"007-Error en la recuperacion del Menu principal",\
|
||||
"008-No hay espacio reservado para la cache en este disco",\
|
||||
"009-Ha ocurrido algún error generando el perfil software",\
|
||||
"010-IPlocal, NO se ha definido este parámetro",\
|
||||
"011-IPhidra, NO se ha definido este parámetro",\
|
||||
"012-Puerto, NO se ha definido este parámetro",\
|
||||
"013-NO existe fichero de configuración o contiene un error de sintaxis",\
|
||||
"014-Fallo de sintaxis en los parámetros: Debe especificar -f nombre_del_fichero_de_configuración",\
|
||||
"015-No se ha podido crear socket para comunicación con el repositorio",\
|
||||
"016-No se ha podido comunicar con el repositorio",\
|
||||
"017-No existe Menu principal",\
|
||||
"018-No se ha podido recuperar la configuración hardware del ordenador",\
|
||||
"019-El cliente no se ha podido incluir en el sistema por un fallo en la conexión con el Servidor de Administración",\
|
||||
"020-No se ha podido crear la carpeta en el repositorio",\
|
||||
"021-Error en el envío de tramas al Servidor de Administración",\
|
||||
"022-Error en la recepción de tramas desde el Servidor de Administración",\
|
||||
"023-Error al crear Proceso Hijo para mostrar Menú",\
|
||||
"024-Error desconocido",\
|
||||
};
|
||||
#define MAXERROR 24 // Error máximo cometido
|
||||
|
||||
char* tbErroresScripts[]={"000-Se han generado errores. No se puede continuar la ejecución de este módulo",\
|
||||
"001-Formato de ejecución incorrecto.",\
|
||||
"002-Fichero o dispositivo no encontrado",\
|
||||
"003-Error en partición de disco",\
|
||||
"004- Partición o fichero bloqueado",\
|
||||
"005-Error al crear o restaurar una imagen",\
|
||||
"006-Sin sistema operativo",\
|
||||
"007-Programa o función no ejecutable",\
|
||||
"008-Error en la eliminación del archivo temporal de intercambio",\
|
||||
"009-Error en la lectura del archivo temporal de intercambio",\
|
||||
"010-Error al ejecutar código de la shell",\
|
||||
"011-Error desconocido",
|
||||
};
|
||||
#define MAXERRORSCRIPT 11 // Error máximo cometido
|
||||
|
||||
// Prototipos de funciones
|
||||
char* Desencriptar(char *);
|
||||
char* Encriptar(char *);
|
||||
int ValidacionParametros(int,char**);
|
||||
int CrearArchivoLog(char*);
|
||||
int LeeFileConfiguracion();
|
||||
void Log(char*);
|
||||
void UltimoError(int,char*);
|
||||
void UltimoErrorScript(int,char*);
|
||||
|
||||
int EjecutarScript (char*,char* ,char*,int);
|
||||
char* ReservaMemoria(int);
|
||||
int EjecutarCodigo (char*,char* ,char*,int);
|
||||
|
||||
SOCKET TCPConnect(char *,char* );
|
||||
void TCPClose(SOCKET);
|
||||
int AbreConexionTCP(void);
|
||||
void CierraConexionTCP(void);
|
||||
int EnviaTramasHidra(SOCKET,TRAMA*);
|
||||
|
||||
int TCPWrite(SOCKET ,TRAMA*);
|
||||
|
||||
SOCKET UDPConnect();
|
||||
int EnviaTramaRepo(SOCKET,TRAMA*,char*,char*);
|
||||
int RecibeTramaRepo(SOCKET,int);
|
||||
|
||||
long CreateTextFile(char*,char*);
|
||||
int ExisteFichero(char*);
|
||||
int RemoveFile(char *);
|
||||
int LoadTextFile(char *);
|
||||
|
||||
int ProcesaComandos();
|
||||
int DisponibilidadComandos(int);
|
||||
int GestionTramas(TRAMA *);
|
||||
|
||||
int Cortesia();
|
||||
int NoComandosPtes();
|
||||
int TomaIPlocal();
|
||||
int InclusionCliente();
|
||||
int RESPUESTA_InclusionCliente(TRAMA*);
|
||||
int ComandosPendientes(void);
|
||||
int Arrancar(TRAMA *,TRAMA *);
|
||||
int Apagar(TRAMA*,TRAMA*);
|
||||
int Reiniciar(TRAMA*,TRAMA*);
|
||||
int IniciarSesion(TRAMA*,TRAMA*);
|
||||
int Actualizar();
|
||||
int Sondeo();
|
||||
int CrearPerfilSoftware(TRAMA*,TRAMA*);
|
||||
int CrearPerfil(char*,char*,char*,char*,char*);
|
||||
int Nemonico(char*);
|
||||
int RestaurarImagen(TRAMA*,TRAMA*);
|
||||
int RestaurandoImagen(char* ,char *,char* ,char *,char *,char *,char *);
|
||||
|
||||
int ParticionaryFormatear(TRAMA*,TRAMA*);
|
||||
int Particionar(char*,char*,char* );
|
||||
int Particionando(char*,char*,char*);
|
||||
int Formatear(char*,char*);
|
||||
int SetCachePartitionSize(int);
|
||||
int AutoexecClienteHidra(void);
|
||||
char* LeeConfiguracion(char*);
|
||||
char* TomaNomSO(char*,int);
|
||||
int InventarioHardware(TRAMA *,TRAMA *);
|
||||
int InventarioSoftware(TRAMA *,TRAMA *);
|
||||
int TomaConfiguracion(TRAMA *,TRAMA *);
|
||||
int RespuestaEjecucionComando(TRAMA* , TRAMA *, int);
|
||||
int ExecShell(TRAMA *,TRAMA *);
|
||||
int ConsolaRemota(TRAMA *,TRAMA *);
|
||||
int ExecBash(char*);
|
||||
char* URLDecode(char*);
|
||||
char* URLEncode(char *);
|
||||
int MuestraMenu(char*);
|
||||
void MuestraMensaje(int,char*);
|
||||
int cuestionCache(char*);
|
||||
int sesionMulticast(char *,char *,char *);
|
|
@ -1,43 +0,0 @@
|
|||
# makefile
|
||||
|
||||
# Nombre del proyecto
|
||||
PROYECTO := ogAdmRepo
|
||||
|
||||
#Directorio de instalación
|
||||
INSTALL_DIR := /opt/opengnsys
|
||||
|
||||
# Opciones de compilacion
|
||||
CFLAGS := -O0 -g -Wall -I../includes # Depuracion
|
||||
#CFLAGS := -O3 -Wall # Optimizacion
|
||||
CPPFLAGS := $(CFLAGS)
|
||||
|
||||
# Opciones de linkado
|
||||
LDFLAGS := -L/usr/lib -L/usr/lib/mysql -lpthread -lmysqlclient
|
||||
|
||||
# Ficheros objetos
|
||||
OBJS := ../includes/Database.o sources/ogAdmRepo.o
|
||||
|
||||
|
||||
all: $(PROYECTO)
|
||||
|
||||
$(PROYECTO): $(OBJS)
|
||||
g++ $(LDFLAGS) $(OBJS) -o $(PROYECTO)
|
||||
# strip $(PROYECTO) # Optimizacion
|
||||
|
||||
install: $(PROYECTO)
|
||||
cp $(PROYECTO) $(INSTALL_DIR)/sbin
|
||||
cp $(PROYECTO).cfg $(INSTALL_DIR)/etc
|
||||
|
||||
clean:
|
||||
rm -f $(PROYECTO) $(OBJS)
|
||||
|
||||
uninstall: clean
|
||||
rm -f /usr/local/sbin/$(PROYECTO) /usr/local/etc/$(PROYECTO).cfg
|
||||
|
||||
sources/%.o: sources/%.cpp
|
||||
g++ $(CPPFLAGS) -I ../includes -c -o"$@" "$<"
|
||||
|
||||
sources/%.o: sources/%.c
|
||||
gcc $(CFLAGS) -I ../includes -c -o"$@" "$<"
|
||||
|
||||
|
|
@ -1,4 +0,0 @@
|
|||
IPlocal=SERVERIP
|
||||
IPhidra=SERVERIP
|
||||
Puerto=2008
|
||||
RepoScripts=/opt/opengnsys/bin
|
File diff suppressed because it is too large
Load Diff
|
@ -1,117 +0,0 @@
|
|||
//****************************************************************************************************************************************************
|
||||
// Aplicación OpenGNSys
|
||||
// Autor: José Manuel Alonso.
|
||||
// Licencia: Open Source
|
||||
// Fichero: ogAdmRepo.h
|
||||
// Descripción:
|
||||
// Este módulo de la aplicación OpenGNSys implementa las comunicaciones con el Repositorio.
|
||||
// ****************************************************************************************************************************************************
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <ctype.h>
|
||||
#include <time.h>
|
||||
#include </usr/include/mysql/mysql.h>
|
||||
#include <pthread.h>
|
||||
#include <signal.h>
|
||||
#include "Database.h"
|
||||
#include "ogAdmLib.h"
|
||||
|
||||
|
||||
#define MAXIMOS_CLIENTES 4000 // Máximo número de clientes rembo controlados por el servidor rembo
|
||||
#define MAXIMAS_MULSESIONES 1000 // Máximo numero de sesiones multicast activas simultaneamente
|
||||
#define PUERTO_WAKEUP 9 // Puerto por defecto del wake up
|
||||
|
||||
|
||||
|
||||
typedef void* LPVOID;
|
||||
|
||||
|
||||
|
||||
// Estructura para trabajar en cada hebra con el cliente en cuestión
|
||||
struct TramaRepos{
|
||||
SOCKET sck;
|
||||
struct sockaddr_in cliente;
|
||||
socklen_t sockaddrsize;
|
||||
TRAMA trama;
|
||||
};
|
||||
|
||||
FILE *FLog,*Fconfig;
|
||||
SOCKET sClient;
|
||||
|
||||
char IPlocal[20]; // Ip local
|
||||
char servidorhidra[20]; // IP servidor HIDRA
|
||||
char Puerto[20]; // Puerto Unicode
|
||||
int puerto; // Puerto
|
||||
char reposcripts[512]; // Path al directorio donde están los scripts
|
||||
|
||||
char filecmdshell[250];
|
||||
char cmdshell[512];
|
||||
|
||||
char msglog[250];
|
||||
|
||||
char usuario[20];
|
||||
char pasguor[20];
|
||||
char datasource[20];
|
||||
char catalog[50];
|
||||
int puertorepo; // Puerto
|
||||
|
||||
struct s_inisesionMulticast{ // Estructura usada para guardar información sesiones multicast
|
||||
char ides[32]; // Identificador sesión multicast
|
||||
char *ipes; // Ipes de los clientes necesarios para la sesión
|
||||
};
|
||||
struct s_inisesionMulticast tbsmul[MAXIMAS_MULSESIONES];
|
||||
//______________________________________________________
|
||||
static pthread_mutex_t guardia; // Controla acceso exclusivo de hebras
|
||||
//______________________________________________________
|
||||
|
||||
char PathHidra[250]; // path al directorio base de Hidra
|
||||
char PathPXE[250]; // path al directorio PXE
|
||||
|
||||
char PathComandos[250]; // path al directorio donde se depositan los comandos para los clientes
|
||||
char PathUsuarios[250]; // path al directorio donde se depositan los ficheros de login de los operadores
|
||||
char PathIconos[250]; // path al directorio donde se depositan los iconos de los items de los menús
|
||||
|
||||
// Prototipos de funciones
|
||||
|
||||
|
||||
int TomaConfiguracion(char* );
|
||||
|
||||
|
||||
int ClienteExistente(TramaRepos *);
|
||||
LPVOID GestionaServicioRepositorio(LPVOID);
|
||||
int Actualizar(TramaRepos*);
|
||||
int Arrancar(TramaRepos *);
|
||||
int Wake_Up(SOCKET,char *);
|
||||
void PasaHexBin( char *,char *);
|
||||
int levanta(char *);
|
||||
int FicheroOperador(TramaRepos *);
|
||||
int IconoItem(TramaRepos *);
|
||||
|
||||
BOOLEAN ExisteFichero(TramaRepos *);
|
||||
BOOLEAN EliminaFichero(TramaRepos *);
|
||||
BOOLEAN LeeFicheroTexto(TramaRepos *);
|
||||
BOOLEAN mandaFichero(TramaRepos *);
|
||||
int gestiona_comando(TramaRepos *);
|
||||
BOOLEAN respuesta_peticion(TramaRepos *,const char*,char*,char*);
|
||||
|
||||
int envia_tramas(SOCKET,TRAMA *);
|
||||
int recibe_tramas(SOCKET ,TRAMA *);
|
||||
int inclusion_REPO();
|
||||
int RESPUESTA_inclusionREPO(TRAMA *);
|
||||
int TomaRestoConfiguracion(TRAMA *);
|
||||
int RegistraComando(TramaRepos *);
|
||||
int Apagar(TramaRepos *);
|
||||
char * Buffer(int );
|
||||
int TomaPuertoLibre(int *);
|
||||
void NwGestionaServicioRepositorio(TramaRepos *);
|
||||
BOOLEAN sesionMulticast(TramaRepos *);
|
||||
BOOLEAN iniSesionMulticast(char *,char *,char *);
|
||||
int hay_hueco(int *idx);
|
||||
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
# makefile
|
||||
|
||||
# Nombre del proyecto
|
||||
PROYECTO := ogAdmServer
|
||||
|
||||
# Directorio de instalación
|
||||
INSTALL_DIR := /opt/opengnsys
|
||||
|
||||
# Opciones de compilacion
|
||||
CFLAGS := -O0 -g -Wall -I../includes # Depuracion
|
||||
#CFLAGS := -O3 -Wall # Optimizacion
|
||||
CPPFLAGS := $(CFLAGS)
|
||||
|
||||
# Opciones de linkado
|
||||
LDFLAGS := -L/usr/lib -L/usr/lib/mysql -lpthread -lmysqlclient
|
||||
|
||||
# Ficheros objetos
|
||||
OBJS := ../includes/Database.o sources/ogAdmServer.o
|
||||
|
||||
|
||||
all: $(PROYECTO)
|
||||
|
||||
$(PROYECTO): $(OBJS)
|
||||
g++ $(LDFLAGS) $(OBJS) -o $(PROYECTO)
|
||||
# strip $(PROYECTO) # Optimizacion
|
||||
|
||||
install: $(PROYECTO)
|
||||
cp $(PROYECTO) $(INSTALL_DIR)/sbin
|
||||
cp $(PROYECTO).cfg $(INSTALL_DIR)/etc
|
||||
|
||||
clean:
|
||||
rm -f $(PROYECTO) $(OBJS)
|
||||
|
||||
uninstall: clean
|
||||
rm -f /usr/local/sbin/$(PROYECTO) /usr/local/etc/$(PROYECTO).cfg
|
||||
|
||||
sources/%.o: sources/%.cpp
|
||||
g++ $(CPPFLAGS) -I ../includes -c -o"$@" "$<"
|
||||
|
||||
sources/%.o: sources/%.c
|
||||
gcc $(CFLAGS) -I ../includes -c -o"$@" "$<"
|
||||
|
||||
|
|
@ -1,7 +0,0 @@
|
|||
IPhidra=SERVERIP
|
||||
Puerto=2008
|
||||
AulaUp=0
|
||||
Usuario=usuog
|
||||
PassWord=passusuog
|
||||
DataSource=localhost
|
||||
Catalog=ogBDAdmin
|
File diff suppressed because it is too large
Load Diff
|
@ -1,162 +0,0 @@
|
|||
//****************************************************************************************************************************************************
|
||||
// Aplicación OpenGNSys
|
||||
// Autor: José Manuel Alonso.
|
||||
// Licencia: Open Source
|
||||
// Fichero: ogAdmServer.h
|
||||
// Descripción:
|
||||
// Este módulo de la aplicación OpenGNSys implementa las comunicaciones con el Servidor.
|
||||
// ****************************************************************************************************************************************************
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <errno.h>
|
||||
#include <unistd.h>
|
||||
#include <time.h>
|
||||
#include <ctype.h>
|
||||
#include </usr/include/mysql/mysql.h>
|
||||
#include <pthread.h>
|
||||
#include "Database.h"
|
||||
#include "ogAdmLib.h"
|
||||
|
||||
#define AUTOINCORPORACION_OFF 0x0000 // Los ordenadores no se pueden dar de alta autmáticamente
|
||||
#define AUTOINCORPORACION_ONA 0x0001 // Los ordenadores se pueden dar de alta automáticamente si existe el aula
|
||||
#define AUTOINCORPORACION_ONX 0x0002 // Los ordenadores se pueden dar de alta automáticamente y si no existe el aula la crea
|
||||
|
||||
char ecofile[512],msglog[512];
|
||||
FILE *FLog,*Fconfig;
|
||||
char AulaUp[2];
|
||||
int aulaup; // Switch para permitir que un ordenador se de de alta automáticamente en un aula existenta
|
||||
// Valores:
|
||||
// 0: El ordenador No se da de alta automáticamente en un aula
|
||||
// 1: El ordenador se da de alta en un aula si existe
|
||||
// 2: El ordenador se da de alta en un aula si existe y si no existe la crea para darse de alta
|
||||
|
||||
char IPlocal[20]; // Ip local
|
||||
char servidorhidra[20]; // IP servidor HIDRA
|
||||
char Puerto[20]; // Puerto Unicode
|
||||
int puerto; // Puerto
|
||||
char usuario[20];
|
||||
char pasguor[20];
|
||||
char datasource[20];
|
||||
char catalog[50];
|
||||
|
||||
int swcSocket;
|
||||
|
||||
struct s_socketCLRMB{ // Estructura usada para guardar información de los clientes
|
||||
char ip[16]; // IP del cliente
|
||||
char estado[4]; // Tipo de sistema Operativo del cliente "RMB"=rembo,"W98"=windows98,"W2K"=windows 2000, etc
|
||||
SOCKET sock; // Socket por el que se comunica
|
||||
char ipsrvdhcp[16]; // IP del servidor dhcp
|
||||
char ipsrvrmb[16]; // IP del servidor rembo
|
||||
};
|
||||
struct s_socketCLRMB tbsockets[MAXIMOS_SOCKETS];
|
||||
|
||||
struct s_socketSRVRMB{ // Estructura usada para guardar información de los servidores REMBO
|
||||
char ip[16]; // IP del servidor rembo
|
||||
int puertorepo;
|
||||
char ipes[MAXLON_PARAMETROSIPH]; // IP de los clientes rembo
|
||||
int swenv; // Switch de envio
|
||||
|
||||
};
|
||||
struct s_socketSRVRMB tbsocketsSRVRMB[MAXIMOS_SRVRMB];
|
||||
|
||||
static pthread_mutex_t guardia; // Controla acceso exclusivo de hebras
|
||||
|
||||
// Prototipo de funciones
|
||||
void* GestionaConexion(void*);
|
||||
void gestiona_comando(SOCKET s,TRAMA trama);
|
||||
int manda_comando(SOCKET sock,char* parametros);
|
||||
int manda_trama(SOCKET sock,TRAMA* trama);
|
||||
int manda_trama_servidorrembo(char* ,char *,int);
|
||||
SOCKET UDPConnect(char *);
|
||||
int envia_comandos(SOCKET ,TRAMA* , char* ,int);
|
||||
int hay_hueco(int *);
|
||||
BOOLEAN cliente_existente(char *,int*);
|
||||
int hay_huecoservidorrembo(int *);
|
||||
BOOLEAN servidorrembo_existente(char *,int*);
|
||||
char * corte_iph(char *);
|
||||
char * escaparComillas(char*);
|
||||
int respuesta_cortesia(SOCKET );
|
||||
int NoComandosPendientes(SOCKET);
|
||||
int Coloca_estado(char *,const char *,SOCKET);
|
||||
int actualiza_configuracion(Database , Table ,char* ,int,int ,char* );
|
||||
int actualiza_hardware(Database , Table ,char* ,char* ,char*);
|
||||
int actualiza_software(Database , Table ,char* ,char*,char*,char* ,char*);
|
||||
int CuestionPerfilHardware(Database , Table ,int ,char* ,int *,int ,char*);
|
||||
int CuestionPerfilSoftware(Database, Table ,int ,char* ,int *,int,char *,char*);
|
||||
|
||||
void TomaParticiones(char*, char* ,int );
|
||||
int Toma_menu(Database,Table,char*,int,int);
|
||||
int RecuperaItem(SOCKET,char *);
|
||||
int ComandosPendientes(SOCKET ,char *);
|
||||
int procesaCOMANDOS(SOCKET ,char *);
|
||||
int DisponibilidadComandos(SOCKET ,char *);
|
||||
|
||||
int InclusionCliente(SOCKET,char *);
|
||||
int inclusion_srvRMB(char *,int);
|
||||
int inclusion_REPO(SOCKET,char *);
|
||||
int inclusion_cliWINLNX(SOCKET ,char *);
|
||||
|
||||
int Sondeo(SOCKET ,char *);
|
||||
int Sondear(char *,int);
|
||||
int EcoConsola(SOCKET ,char *);
|
||||
int enviaEcoConsola(SOCKET ,const char *);
|
||||
int Arrancar(char *);
|
||||
int Actualizar(char *);
|
||||
int FicheroOperador(char *);
|
||||
int IconoItem(TRAMA*);
|
||||
int Conmutar(char *);
|
||||
int ConsolaRemota(char *);
|
||||
int EliminaFicheroRemoto(char*,char*,char*);
|
||||
int RenovarItems(char *);
|
||||
|
||||
void PurgarTablaSockets(char *);
|
||||
int borra_entrada(int);
|
||||
int RESPUESTA_Arrancar(SOCKET ,char *);
|
||||
int RESPUESTA_Apagar(SOCKET ,char *);
|
||||
int RESPUESTA_Reiniciar(SOCKET ,char *);
|
||||
int RESPUESTA_IniciarSesion(SOCKET ,char *);
|
||||
int RESPUESTA_Actualizar(SOCKET,char *);
|
||||
int RESPUESTA_ExecShell(SOCKET ,char *);
|
||||
int RespuestaEstandar(char *,char *,char *,char*,Database, Table);
|
||||
int RESPUESTA_CrearPerfilSoftware(SOCKET ,char *);
|
||||
int RESPUESTA_CrearSoftwareIncremental(SOCKET,char *);
|
||||
int RESPUESTA_RestaurarImagen(SOCKET,char *);
|
||||
int RESPUESTA_ParticionaryFormatear(SOCKET ,char *);
|
||||
int RESPUESTA_Configurar(SOCKET ,char *);
|
||||
int RESPUESTA_TomaConfiguracion(SOCKET ,char *);
|
||||
int RESPUESTA_TomaHardware(SOCKET ,char *);
|
||||
int RESPUESTA_TomaSoftware(SOCKET ,char *);
|
||||
|
||||
int RESPUESTA_inclusionREPO(TRAMA*);
|
||||
|
||||
int Actualiza_ordenador_imagen(char *,const char *,char *,Database);
|
||||
int Actualiza_ordenador_perfil(char *,char *, char*, Database);
|
||||
int busca_comandos(char* ,char*,char *,int *);
|
||||
int InsertaNotificaciones(int,int,int,char *,Database);
|
||||
int comprueba_resultados(int ,Database );
|
||||
int comprueba_finalizada(int ,char *,Database );
|
||||
|
||||
void EnviaServidoresRembo(char*,int);
|
||||
void DesmarcaServidoresRembo(void);
|
||||
void MarcaServidoresRembo(char*,char*);
|
||||
|
||||
int EjecutarItem(SOCKET,char *);
|
||||
BOOLEAN TomaIPServidorRembo(char*,int*);
|
||||
|
||||
void envia_tarea(char* );
|
||||
int EjecutarTarea(int ,int ,int ,int , Database,char * );
|
||||
int EjecutarTrabajo(int ,Database,char * );
|
||||
int cuestion_nuevoordenador(Database,Table ,int*,char *,char *,char *,char *,char*,char*,char*);
|
||||
int alta_ordenador(Database db,Table tbl,int*,char *,char *,char*,int,int,int);
|
||||
int Toma_idservidorres(Database ,Table ,char*,char*,int*,int*);
|
||||
int tomaIpRepoPort(char *,char *,char *);
|
||||
void cambiacarac(char *,char , char );
|
||||
int TomaConfiguracion(char* );
|
||||
|
||||
unsigned int TomaEnvio();
|
||||
int recibeFichero(char *,char *,char *,char *);
|
|
@ -1,10 +0,0 @@
|
|||
# RUN_OGADMSERVER run OpenGNSys Admin service.
|
||||
# RUN_OGADMREPO run OpenGNSys Repository Manager service.
|
||||
# RUN_OGADMAGENT run OpenGNSys Agent service.
|
||||
# RUN_BTTRACKER run Bittorrent Tracker
|
||||
# RUN_BTSEEDER starts seeding of selected torrent files
|
||||
RUN_OGADMSERVER="yes"
|
||||
RUN_OGADMREPO="yes"
|
||||
RUN_OGADMAGENT="yes"
|
||||
RUN_BTTRACKER="yes"
|
||||
RUN_BTSEEDER="yes"
|
|
@ -1,165 +0,0 @@
|
|||
#! /bin/sh
|
||||
|
||||
##################################################################################################################
|
||||
####### Script de arranque de los servicios OpenGnSys:
|
||||
####### Servidor ogAdmServer,
|
||||
####### Servidor de repositorio ogAdmRepo,
|
||||
####### Servidor ogAdmAgent, para tareas programadas
|
||||
#######
|
||||
####### Tracker Bittorrent y seeder de imagenes por Bittorrent
|
||||
####### autor: jcxifre <jcxifre@unizar.es>
|
||||
####### basado en http://www.epilogue.org/~xef4/start-stop-example
|
||||
##################################################################################################################
|
||||
|
||||
|
||||
### BEGIN INIT INFO
|
||||
# Provides: opengnsys
|
||||
# Required-Start:
|
||||
# Required-Stop:
|
||||
# Default-Start: 2 3 4 5
|
||||
# Default-Stop: 1
|
||||
# Short-Description: Servicios del sistema OpenGnSys
|
||||
# Description: Servicios del sistema OpenGnSys:
|
||||
### END INIT INFO
|
||||
|
||||
#
|
||||
# Definiciones globales
|
||||
#
|
||||
BASEDIR=/opt/opengnsys
|
||||
|
||||
#
|
||||
# Servidor de OpenGnSys
|
||||
#
|
||||
SERVERNAME=ogAdmServer
|
||||
SERVERDAEMON=$BASEDIR/sbin/$SERVERNAME
|
||||
SERVERCFG=$BASEDIR/etc/$SERVERNAME.cfg
|
||||
SERVERLOG=$BASEDIR/log/$SERVERNAME.log
|
||||
SERVERDAEMON_OPTIONS="-f $SERVERCFG -l $SERVERLOG"
|
||||
|
||||
#
|
||||
# Servidor de Repositorio
|
||||
#
|
||||
REPONAME=ogAdmRepo
|
||||
REPODAEMON=$BASEDIR/sbin/$REPONAME
|
||||
REPOCFG=$BASEDIR/etc/$REPONAME.cfg
|
||||
REPOLOG=$BASEDIR/log/$REPONAME.log
|
||||
REPODAEMON_OPTIONS="-f $REPOCFG -l $REPOLOG"
|
||||
|
||||
#
|
||||
# Servidor ogAdmAgent
|
||||
#
|
||||
AGENTNAME=ogAdmAgent
|
||||
AGENTDAEMON=$BASEDIR/sbin/$AGENTNAME
|
||||
AGENTCFG=$BASEDIR/etc/$AGENTNAME.cfg
|
||||
AGENTLOG=$BASEDIR/log/$AGENTNAME.log
|
||||
AGENTDAEMON_OPTIONS="-f $AGENTCFG -l $AGENTLOG"
|
||||
|
||||
#
|
||||
# Opciones Bittorrent
|
||||
#
|
||||
|
||||
BTTRACK=/usr/bin/bttrack.bittorrent
|
||||
BTSEEDER=/usr/bin/btlaunchmany.bittornado
|
||||
BTTRACKPORT=6969
|
||||
BTTRACKDFILE=/tmp/dstate
|
||||
BTTRACKLOG=/opt/opengnsys/log/bttrack.log
|
||||
BTINTERVAL=30
|
||||
BTTORRENTSDIR=/opt/opengnsys/images
|
||||
BTALLOW_GET=1
|
||||
BTTRACK_OPTIONS=" --port $BTTRACKPORT --dfile $BTTRACKDFILE --reannounce_interval $BTINTERVAL --logfile $BTTRACKLOG --allowed_dir $BTTORRENTSDIR --allow_get $BTALLOW_GET --parse_allowed_interval 1"
|
||||
BTTRACKPID="/var/run/bttrack.pid"
|
||||
BTSEEDERPID="/var/run/btseeder.pid"
|
||||
|
||||
|
||||
set -e
|
||||
export PATH="${PATH:+$PATH:}/usr/sbin:/sbin:/usr/bin"
|
||||
|
||||
# Read config file if it is present.
|
||||
if [ -r /etc/default/opengnsys ]
|
||||
then
|
||||
. /etc/default/opengnsys
|
||||
fi
|
||||
|
||||
arranca_demonios() {
|
||||
if [ $RUN_OGADMSERVER = "yes" ]
|
||||
then
|
||||
echo -n "Iniciando demonio: "$SERVERNAME
|
||||
start-stop-daemon --start --quiet --background --exec $SERVERDAEMON -- $SERVERDAEMON_OPTIONS
|
||||
echo "."
|
||||
fi
|
||||
if [ $RUN_OGADMSERVER = "yes" ] && [ $RUN_OGADMREPO = "yes" ]
|
||||
then
|
||||
sleep 5 # Damos tiempo a que ogAdmServer este funcionando
|
||||
fi
|
||||
if [ $RUN_OGADMREPO = "yes" ]
|
||||
then
|
||||
echo -n "Iniciando demonio: "$REPONAME
|
||||
start-stop-daemon --start --quiet --background --exec $REPODAEMON -- $REPODAEMON_OPTIONS
|
||||
echo "."
|
||||
fi
|
||||
if [ $RUN_OGADMAGENT = "yes" ]
|
||||
then
|
||||
echo -n "Iniciando demonio: "$AGENTNAME
|
||||
start-stop-daemon --start --quiet --background --exec $AGENTDAEMON -- $AGENTDAEMON_OPTIONS
|
||||
echo "."
|
||||
fi
|
||||
|
||||
if [ $RUN_BTTRACKER = "yes" ]
|
||||
then
|
||||
echo -n "Iniciando demonio: "$BTTRACK
|
||||
start-stop-daemon --make-pidfile --pidfile $BTTRACKPID --start --quiet --background --exec $BTTRACK -- $BTTRACK_OPTIONS
|
||||
echo "."
|
||||
fi
|
||||
if [ $RUN_BTSEEDER = "yes" ]
|
||||
then
|
||||
echo -n "Iniciando demonio: "$BTSEEDER
|
||||
start-stop-daemon --make-pidfile --pidfile $BTSEEDERPID --start --quiet --background --exec $BTSEEDER -- $BTTORRENTSDIR
|
||||
echo "."
|
||||
fi
|
||||
|
||||
}
|
||||
para_demonios() {
|
||||
if [ -e $BTSEEDERPID ]
|
||||
then
|
||||
echo -n "Parando demonio: "$BTSEEDER
|
||||
start-stop-daemon --stop --quiet --oknodo --retry 30 --pidfile $BTSEEDERPID
|
||||
echo "."
|
||||
rm $BTSEEDERPID > /dev/null
|
||||
fi
|
||||
if [ -e $BTTRACKPID ]
|
||||
then
|
||||
echo -n "Parando demonio: "$BTTRACK
|
||||
start-stop-daemon --stop --quiet --oknodo --pidfile $BTTRACKPID
|
||||
echo "."
|
||||
rm $BTTRACKPID > /dev/null
|
||||
fi
|
||||
echo -n "Parando demonio: "$AGENTNAME
|
||||
start-stop-daemon --stop --quiet --oknodo --name $AGENTNAME
|
||||
echo "."
|
||||
echo -n "Parando demonio: "$REPONAME
|
||||
start-stop-daemon --stop --quiet --oknodo --name $REPONAME
|
||||
echo "."
|
||||
echo -n "Parando demonio: "$SERVERNAME
|
||||
start-stop-daemon --stop --quiet --oknodo --name $SERVERNAME
|
||||
echo "."
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
start)
|
||||
arranca_demonios
|
||||
;;
|
||||
stop)
|
||||
para_demonios
|
||||
;;
|
||||
restart)
|
||||
para_demonios
|
||||
arranca_demonios
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Uso: opengnsys "$1" {start|stop|restart}"
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
|
@ -1,21 +0,0 @@
|
|||
<?
|
||||
// ********************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Diciembre-2003
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: barramenu.php
|
||||
// Descripción :Este fichero implementa el menu general de la Aplicación
|
||||
// ********************************************************************************************************
|
||||
if(isset($_SESSION)){ // Si existe algua sesión ...
|
||||
session_unset(); // Elimina variables
|
||||
session_destroy(); // Destruye sesión
|
||||
}
|
||||
|
||||
include_once("controlacceso.php");
|
||||
|
||||
$herror=0;
|
||||
if (isset($_GET["herror"])) $herror=$_GET["herror"];
|
||||
if (isset($_POST["herror"])) $herror=$_POST["herror"];
|
||||
Header("Location: acceso_".$idi.".php?herror=".$herror); // Redireccionamiento a la página de inicio en el idioma por defecto
|
||||
?>
|
|
@ -1,105 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Diciembre-2003
|
||||
// Fecha Última modificación: Febrero-2005
|
||||
// Nombre del fichero: acceso.php
|
||||
// Descripción : Presenta la pantalla de login de la aplicación
|
||||
// *************************************************************************************************************************************************
|
||||
if(isset($_SESSION)){ // Si existe algua sesión ...
|
||||
session_unset(); // Elimina variables
|
||||
session_destroy(); // Destruye sesión
|
||||
}
|
||||
$herror=0;
|
||||
if (isset($_GET["herror"])) $herror=$_GET["herror"];
|
||||
|
||||
$TbErr=array();
|
||||
$TbErr[0]="NO ERRORS";
|
||||
$TbErr[1]="WARNING:You must access to aplication through login pag";
|
||||
$TbErr[2]="WARNING:Aplication without access to Server Data Base";
|
||||
$TbErr[3]="WARNING: There are some problem to recovery the record, must be it is removed";
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE> Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="estilos.css">
|
||||
<SCRIPT LANGUAGE="JAVASCRIPT">
|
||||
//________________________________________________________________________________________________________
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var usu=document.fdatos.usu.value;
|
||||
var pss=document.fdatos.pss.value;
|
||||
var ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
var wurl="controlacceso.php?usu="+usu+"&pss="+pss
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
if (document.fdatos.usu.value==""){
|
||||
alert("You must introduce a User name")
|
||||
document.fdatos.usu.focus()
|
||||
return(false)
|
||||
}
|
||||
if (document.fdatos.pss.value==""){
|
||||
alert("You must introduce a Password")
|
||||
document.fdatos.pss.focus()
|
||||
return(false)
|
||||
}
|
||||
return(true)
|
||||
}
|
||||
//______________________________________________________________________________________________________
|
||||
function resultado_acceso(resul){
|
||||
if (!resul){
|
||||
alert('WARNING: You are not authorized to access this aplication')
|
||||
return
|
||||
}
|
||||
location.href="frames.php";
|
||||
}
|
||||
//______________________________________________________________________________________________________
|
||||
function PulsaEnter(oEvento){
|
||||
var iAscii;
|
||||
if (oEvento.keyCode)
|
||||
iAscii = oEvento.keyCode;
|
||||
else{
|
||||
if (oEvento.which)
|
||||
iAscii = oEvento.which;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
if (iAscii == 13) confirmar();
|
||||
return true;
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
</SCRIPT>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<DIV style="POSITION:absolute;top:90;left:212">
|
||||
<FORM action="controlacceso.php" name="fdatos" method="post">
|
||||
<DIV align="center">
|
||||
<IMG src="./images/login_eng.jpg" >
|
||||
<INPUT onkeypress="PulsaEnter(event)" name="usu" style="POSITION:absolute;top:160;left:455;width=130;height:20;COLOR: #999999; FONT-FAMILY: Verdana; FONT-SIZE: 12px;">
|
||||
<INPUT onkeypress="PulsaEnter(event)" name="pss" type="password" style="POSITION:absolute;top:190;left:455;width=130;height:20;COLOR: #999999; FONT-FAMILY: Verdana; FONT-SIZE: 12px;">
|
||||
<IMG onclick="confirmar()" src="./images/botonok.gif" style="POSITION:absolute;top:215;left:555;CURSOR: hand">
|
||||
</DIV>
|
||||
</FORM>
|
||||
</DIV>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
echo '<DIV style="POSITION: absolute;LEFT: 20px;TOP:300px;visibility=hidden" height=300 width=300>';
|
||||
echo '<IFRAME scrolling=yes height=300 width=310 id="iframes_comodin" src="./nada.php"></IFRAME>';
|
||||
echo '</DIV>';
|
||||
//________________________________________________________________________________________________________
|
||||
// Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera
|
||||
echo '<SCRIPT LANGUAGE="javascript">';
|
||||
if (!empty($herror))
|
||||
echo " alert('".$TbErr[$herror]."');";
|
||||
echo 'document.fdatos.usu.focus()';
|
||||
echo '</SCRIPT>';
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,117 +0,0 @@
|
|||
<?
|
||||
// *********************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación: Diciembre-2003
|
||||
// Fecha Última modificación: Febrero-2005
|
||||
// Nombre del fichero: acceso.php
|
||||
// Descripción : Presenta la pantalla de login de la aplicación
|
||||
// ********************************************************************************************************
|
||||
include_once("controlacceso.php");
|
||||
include_once("./includes/CreaComando.php");
|
||||
include_once("./clases/AdoPhp.php");
|
||||
include_once("./includes/HTMLSELECT.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$cmd=CreaComando($cnx); // Crea objeto comando
|
||||
if (!$cmd)
|
||||
die("Error de acceso");
|
||||
//________________________________________________________________________________________________________
|
||||
$herror=0;
|
||||
if (isset($_GET["herror"])) $herror=$_GET["herror"];
|
||||
if (isset($_POST["herror"])) $herror=$_POST["herror"];
|
||||
|
||||
$TbErr=array();
|
||||
$TbErr[0]="SIN ERRORES";
|
||||
$TbErr[1]="ATENCIÓN: Debe acceder a la aplicación a través de la pagina inicial";
|
||||
$TbErr[2]="ATENCIÓN: La Aplicación no tiene acceso al Servidor de Bases de Datos";
|
||||
$TbErr[3]="ATENCIÓN: Existen problemas para recuperar el registro, puede que haya sido eliminado";
|
||||
$TbErr[4]="ATENCIÓN: Usted no tiene acceso a esta aplicación";
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="estilos.css">
|
||||
<SCRIPT LANGUAGE="JAVASCRIPT">
|
||||
//________________________________________________________________________________________________________
|
||||
function confirmar(){
|
||||
if (comprobar_datos())
|
||||
document.fdatos.submit();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
if (document.fdatos.usu.value==""){
|
||||
alert("Debe introducir un nombre de Usuario")
|
||||
document.fdatos.usu.focus()
|
||||
return(false)
|
||||
}
|
||||
if (document.fdatos.pss.value==""){
|
||||
alert("Debe introducir una contraseña")
|
||||
document.fdatos.pss.focus()
|
||||
return(false)
|
||||
}
|
||||
var p=document.fdatos.idcentro.selectedIndex
|
||||
if (p==0){
|
||||
var res=confirm("ATENCIÓN: No ha introducido ninguna Unidad Organizativa. NO tendrá acceso al sistema a menos que sea adminstrador general de la Aplicación. ¿Desea acceder con este perfil?");
|
||||
if(!res)
|
||||
return(false)
|
||||
}
|
||||
return(true)
|
||||
}
|
||||
//______________________________________________________________________________________________________
|
||||
function PulsaEnter(oEvento){
|
||||
var iAscii;
|
||||
if (oEvento.keyCode)
|
||||
iAscii = oEvento.keyCode;
|
||||
else{
|
||||
if (oEvento.which)
|
||||
iAscii = oEvento.which;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
if (iAscii == 13) confirmar();
|
||||
return true;
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
</SCRIPT>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<DIV style="POSITION:absolute;top:90;left:250">
|
||||
<FORM action="controlpostacceso.php" name="fdatos" method="post">
|
||||
<DIV align="center">
|
||||
<IMG src="./images/login_esp.jpg" width=500 >
|
||||
<INPUT onkeypress="PulsaEnter(event)" name="usu"
|
||||
style="POSITION:absolute;top:125px;left:365px;width:90;height:20;COLOR: #999999; FONT-FAMILY: Verdana; FONT-SIZE: 12px;">
|
||||
<INPUT onkeypress="PulsaEnter(event)" name="pss" type="password"
|
||||
style="POSITION:absolute;top:160px;left:365;width:90;height:20;COLOR: #999999; FONT-FAMILY: Verdana; FONT-SIZE: 12px;">
|
||||
|
||||
<DIV style="POSITION:absolute;top:180px;left:265;COLOR: #F9F9F9; FONT-FAMILY: Verdana; FONT-SIZE: 12px;">
|
||||
<P>Unidad Organizativa<BR>
|
||||
<?
|
||||
|
||||
echo HTMLSELECT($cmd,0,'centros',$idcentro,'idcentro','nombrecentro',220);
|
||||
?>
|
||||
</P></DIV>
|
||||
|
||||
<IMG onclick="confirmar()" src="./images/botonok.gif" style="POSITION:absolute;top:240;left:400;CURSOR: hand">
|
||||
</DIV>
|
||||
</FORM>
|
||||
</DIV>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
echo '<DIV style="POSITION: absolute;LEFT: 20px;TOP:300px;visibility:hidden" height=300 width=300>';
|
||||
echo '<IFRAME scrolling=yes height=300 width=310 id="iframes_comodin" src="./nada.php"></IFRAME>';
|
||||
echo '</DIV>';
|
||||
//________________________________________________________________________________________________________
|
||||
// Posiciona cursor en campo usuario y muestra mensaje de error si lo hubiera
|
||||
echo '<SCRIPT LANGUAGE="javascript">';
|
||||
if (!empty($herror))
|
||||
echo " alert('".$TbErr[$herror]."');";
|
||||
echo 'document.fdatos.usu.focus()';
|
||||
echo '</SCRIPT>';
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,194 +0,0 @@
|
|||
<?
|
||||
// ********************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Diciembre-2003
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: barramenu.php
|
||||
// Descripción :Este fichero implementa el menu general de la Aplicación
|
||||
// ********************************************************************************************************
|
||||
include_once("./includes/ctrlacc.php");
|
||||
include_once("./includes/constantes.php");
|
||||
include_once("./idiomas/php/".$idioma."/barramenu_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
|
||||
<LINK rel="stylesheet" type="text/css" href="estilos.css">
|
||||
<SCRIPT language="javascript">
|
||||
var currentOp=null;
|
||||
//________________________________________________________________________________________________________
|
||||
function resaltar(o){
|
||||
if (o==currentOp) return
|
||||
o.style.borderBottomColor="#808080"
|
||||
o.style.borderRightColor="#808080"
|
||||
o.style.borderTopColor="#ffffff"
|
||||
o.style.borderLeftColor="#ffffff"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function desresaltar(o){
|
||||
if (o==currentOp) return
|
||||
o.style.borderBottomColor="#d4d0c8"
|
||||
o.style.borderRightColor="#d4d0c8"
|
||||
o.style.borderTopColor="#d4d0c8"
|
||||
o.style.borderLeftColor="#d4d0c8"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function eleccion(o,op){
|
||||
opadre=window.parent // Toma frame padre
|
||||
opadre.frames["frame_contenidos"].document.location.href="nada.php"
|
||||
var href;
|
||||
var href2="nada.php"
|
||||
var href3="./api/tree.html"
|
||||
var href4="./api/main.html"
|
||||
var href5="./api/index.html"
|
||||
|
||||
switch(op){
|
||||
case 1:
|
||||
href="./principal/aulas.php"
|
||||
break;
|
||||
case 2:
|
||||
href="./principal/acciones.php"
|
||||
break;
|
||||
case 3:
|
||||
href="./principal/imagenes.php"
|
||||
break;
|
||||
case 4:
|
||||
href="./principal/hardwares.php"
|
||||
break;
|
||||
case 5:
|
||||
href="./principal/softwares.php"
|
||||
break;
|
||||
case 6:
|
||||
href="./principal/servidores.php"
|
||||
break;
|
||||
case 7:
|
||||
href="./principal/menus.php"
|
||||
break;
|
||||
case 8:
|
||||
href="./principal/reservas.php"
|
||||
break;
|
||||
case 9:
|
||||
href="./principal/administracion.php"
|
||||
break;
|
||||
case 10:
|
||||
href="./images/L_Iconos.php"
|
||||
href2="./images/M_Iconos.php"
|
||||
break;
|
||||
case 13:
|
||||
href="./principal/usuarios.php"
|
||||
break;
|
||||
}
|
||||
var oldOp=currentOp
|
||||
currentOp=o;
|
||||
if (oldOp) desresaltar(oldOp);
|
||||
currentOp.style.borderBottomColor="#ffffff"
|
||||
currentOp.style.borderRightColor="#ffffff"
|
||||
currentOp.style.borderTopColor="#808080"
|
||||
currentOp.style.borderLeftColor="#808080"
|
||||
if(op<20){
|
||||
opadre.frames["frame_arbol"].document.location.href=href
|
||||
opadre.frames["frame_contenidos"].document.location.href=href2
|
||||
}
|
||||
else{
|
||||
switch(op){
|
||||
case 21:
|
||||
window.top.location.href="acceso.php";
|
||||
break;
|
||||
case 22:
|
||||
opadre.frames["frame_contenidos"].document.location.href=href4
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//________________________________________________________________________________________________________
|
||||
</SCRIPT>
|
||||
</HEAD>
|
||||
<BODY bgcolor="#d4d0c8">
|
||||
<FORM name=fdatos>
|
||||
<TABLE border=0 style="POSITION:absolute;LEFT:0px;TOP:0px" cellPadding=2 cellSpacing=0>
|
||||
<TR>
|
||||
<TD align=left>
|
||||
<TABLE class=menupral align=left cellPadding=1 cellSpacing=0 >
|
||||
<TR valign=baseline>
|
||||
<TD width=10><IMG src="./images/iconos/pomo.gif"></TD>
|
||||
|
||||
<? if($idtipousuario!=$SUPERADMINISTRADOR){?>
|
||||
<TD onclick=eleccion(this,1) onmouseout=desresaltar(this) onmouseover=resaltar(this) >
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/centros.gif"> <SPAN class="menupral"><?echo $TbMsg[0]?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
<TD onclick=eleccion(this,2) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/acciones.gif"> <SPAN class=menupral ><?echo $TbMsg[1]?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
<TD onclick=eleccion(this,3) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/imagenes.gif"> <SPAN class=menupral ><?echo $TbMsg[2]?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
<TD onclick=eleccion(this,4) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/confihard.gif"> <SPAN class=menupral ><?echo $TbMsg[3] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
<TD onclick=eleccion(this,5) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/confisoft.gif"> <SPAN class=menupral ><?echo $TbMsg[4] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
|
||||
|
||||
<? if($_SESSION["repcentralizado"]==0) {?>
|
||||
|
||||
<TD onclick=eleccion(this,6) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/servidores.gif"> <SPAN class=menupral ><?echo $TbMsg[5] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
|
||||
<?}?>
|
||||
|
||||
<TD onclick=eleccion(this,7) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/menus.gif"> <SPAN class=menupral ><?echo $TbMsg[6] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
<TD onclick=eleccion(this,8) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/reservas.gif"> <SPAN class=menupral ><?echo $TbMsg[7] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
<? }
|
||||
else{
|
||||
if($idtipousuario==$SUPERADMINISTRADOR){?>
|
||||
<TD onclick=eleccion(this,9) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/administracion.gif">
|
||||
<SPAN class=menupral ><?echo $TbMsg[8] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
|
||||
<TD onclick=eleccion(this,10) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/iconos.gif">
|
||||
<SPAN class=menupral ><?echo $TbMsg[9] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
|
||||
<? if($_SESSION["repcentralizado"]==1) {?>
|
||||
<TD onclick=eleccion(this,6) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/servidores.gif">
|
||||
<SPAN class=menupral ><?echo $TbMsg[5] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
|
||||
<?}?>
|
||||
|
||||
|
||||
|
||||
|
||||
<?}?>
|
||||
<?}?>
|
||||
|
||||
<TD onclick=eleccion(this,22) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/ayuda.gif">
|
||||
<SPAN class=menupral ><?echo $TbMsg[11] ?></SPAN></A> </TD>
|
||||
<TD width=4 align=middle><IMG src="./images/iconos/separitem.gif"></TD>
|
||||
<TD onclick=eleccion(this,21) onmouseout=desresaltar(this) onmouseover=resaltar(this) align=middle>
|
||||
<A href="#" style="text-decoration: none"><IMG border=0 src="./images/iconos/usuarioslog.gif">
|
||||
<SPAN class=menupral ><?echo $TbMsg[10] ?></SPAN></A> </TD>
|
||||
|
||||
|
||||
</TR>
|
||||
</TABLE>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</FORM>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,654 +0,0 @@
|
|||
<?php
|
||||
/*================================================================================
|
||||
Clase para conectar con una base de datos.
|
||||
|
||||
Especificaciones:
|
||||
- Estado de la conexión($estado)
|
||||
0: No conectado
|
||||
1: Conectado
|
||||
2: Se est<EFBFBD>intentando conectar
|
||||
|
||||
================================================================================*/
|
||||
|
||||
class Conexion{
|
||||
var $basedatos; // Base de datos
|
||||
var $servidor; // Servidor de Base de datos
|
||||
var $usuario; // Nombre de usuario
|
||||
var $password; // Clave de usuario
|
||||
var $controlador; // Controlador
|
||||
var $estado; // Estado de la conexion
|
||||
var $proveedor; // Proveedor de BD
|
||||
var $error; // Colecci<63> de errores ocurridos durante el proceso (C<>igo de error)
|
||||
var $ultimoerror; // Ultimo error detectado
|
||||
var $inderror; // Nmero de errores ocurridos durante el proceso
|
||||
var $msgerrores=array(
|
||||
"No se ha producido ningn error",
|
||||
"001 : conexiónError - La conexion no se pudo establecer",
|
||||
"002 : conexiónError - Se estableci<63> la conexióncon el servidor pero la base de datos no responde",
|
||||
"003 : conexiónError - No se ha podido cerrar la actual conexi<78>",
|
||||
"004 : conexiónError - El objeto est<73>ocupado intentando establecer una conexiónanterior",
|
||||
"005 : conexiónError - La conexiónya est<73>cerrada",
|
||||
"006 : conexiónError - No se ha especificado ningn servidor de base de datos",
|
||||
"007 : conexiónError - No se ha especificado ningn usuario de la base de datos",
|
||||
"008 : conexiónError - No se ha especificado password de usuario",
|
||||
"009 : conexiónError - No se ha especificado ninguna base de datos",
|
||||
"010 : conexiónError - No se ha especificado ningn proveedor de bases de datos",
|
||||
);
|
||||
/*--------------------------------------------------------------------------------------------*/
|
||||
function Conexion(){ // Constructor de la clase
|
||||
$this->inderror=0;
|
||||
$this->ultimoerror=0;
|
||||
$this->estado=0;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Adquiere o actualiza los datos necesarias para establecer conexiones
|
||||
|
||||
Par<EFBFBD>etros de entrada:
|
||||
servidor: Servidor donde se ubica la base de datos
|
||||
usuario : Un usuario con acceso al servidor
|
||||
passwor : Clave de usuario
|
||||
basedato: Base de datos a la se quiere acceder
|
||||
proveedor: Proveedor de Base de datos
|
||||
|
||||
Devuelve :
|
||||
true : Si los datos aportadospara establecer conexiones son correctos
|
||||
false: En caso contrario
|
||||
|
||||
En el caso de devolver false, la funci<EFBFBD> TomaUltimoError() devuelve el error ocurrido
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function CadenaConexion($servidor,$usuario,$password,$basedatos,$proveedor){
|
||||
$this->servidor=$servidor;
|
||||
$this->usuario=$usuario;
|
||||
$this->password=$password;
|
||||
$this->basedatos=$basedatos;
|
||||
$this->proveedor=$proveedor;
|
||||
if (!$this->_cadena_conexion()) return(false); else return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Abre una conexión
|
||||
|
||||
Devuelve :
|
||||
true : Si la apertura de la conexiónha sido satisfactoria
|
||||
false: En caso contrario
|
||||
|
||||
En el caso de devolver false, la funci<EFBFBD> TomaUltimoError() devuelve el error ocurrido
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function Abrir(){
|
||||
$this->inderror=-1; // Inicializar contador de errores
|
||||
$this->ultimoerror=-1;
|
||||
$MAXIMOS_INTENTOS_DE_CONECCION=10;
|
||||
if (!$this->_cadena_conexion()) return(false); // Comprueba si los datos necesarios para conexiones se han aportado
|
||||
switch ($this->estado) {
|
||||
case 1: // Existe actualmente una conexiónabierta que se sustituir<69>por la nueva
|
||||
if (mysql_close($this->controlador)){ // Se cierra la conexion actual
|
||||
$this->estado=0;
|
||||
$intentos_de_conexion=0;
|
||||
while(true){
|
||||
$intentos_de_conexion++;
|
||||
$resul=($this->_nueva_conexion());
|
||||
if ($resul || $intentos_de_conexion>$MAXIMOS_INTENTOS_DE_CONECCION) return($resul);
|
||||
sleep(1); // Espera 1 segundo para intentar la conexiónde nuevo
|
||||
}
|
||||
}
|
||||
else{ // Error al cerrar la conexi<78>
|
||||
$this->error[$this->inderror++]=3;
|
||||
$this->ultimoerror=3;
|
||||
return(false);
|
||||
}
|
||||
break;
|
||||
case 2: // Actualmente est<73>objeto est<73>ocupado intentando establecer otra conexi<78>
|
||||
$this->error[$this->inderror++]=4;
|
||||
$this->ultimoerror=4;
|
||||
return(false);
|
||||
break;
|
||||
default : // No existe actualmente ninguna conexiónabierta, se abrir<69>una nueva
|
||||
$intentos_de_conexion=0;
|
||||
while(true){
|
||||
$intentos_de_conexion++;
|
||||
$resul=($this->_nueva_conexion());
|
||||
if ($resul || $intentos_de_conexion>$MAXIMOS_INTENTOS_DE_CONECCION) return($resul);
|
||||
sleep(1); // Espera 1 segundo para intentar la conexiónde nuevo
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Cierra una conexión
|
||||
|
||||
Devuelve :
|
||||
true : Si la conexiónse ha cerrado satisfactoriamente
|
||||
false: En caso contrario
|
||||
|
||||
En el caso de devolver false, la funci<EFBFBD> TomaUltimoError() devuelve el error ocurrido
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function Cerrar(){
|
||||
$this->inderror=-1; // Inicializar contador de errores
|
||||
$this->ultimoerror=-1;
|
||||
switch ($this->estado) {
|
||||
case 1: // Actualmente la conexion est<73>abierta
|
||||
if (mysql_close($this->controlador)){ // Se cierra la conexion actual
|
||||
$this->estado=0;
|
||||
$this->error[$this->inderror++]=0;
|
||||
$this->ultimoerror=0;
|
||||
return(true);
|
||||
}
|
||||
else{ // Error al cerrar la conexi<78>
|
||||
$this->error[$this->inderror++]=3;
|
||||
$this->ultimoerror=3;
|
||||
return(false);
|
||||
}
|
||||
break;
|
||||
case 2: // Actualmente est<73>objeto est<73>ocupado intentando establecer otra conexi<78>
|
||||
$this->error[$this->inderror++]=4;
|
||||
$this->ultimoerror=4;
|
||||
return(false);
|
||||
break;
|
||||
|
||||
default : // Actualmente la conexiónest<73>ya cerrada
|
||||
$this->error[$this->inderror++]=5;
|
||||
$this->ultimoerror=5;
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece una nueva conexi<EFBFBD>. Este m<EFBFBD>odo es privado y s<EFBFBD>o lo puede ejecutar la propia
|
||||
clase desde el m<EFBFBD>odo pblico Abrir.
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function _nueva_conexion(){
|
||||
$this->estado=2;// Intenta la conexion
|
||||
if ($this->controlador=mysql_connect($this->servidor,$this->usuario,$this->password)){// Conexion O.K.
|
||||
$this->estado=1; // La conexion con el servidor se estableci<63>
|
||||
if (mysql_select_db($this->basedatos, $this->controlador)){// Base datos O.K.
|
||||
$this->error[$this->inderror++]=0;
|
||||
$this->ultimoerror=0;
|
||||
return(true);
|
||||
}
|
||||
else{ // Problemas con la base de datos
|
||||
$this->error[$this->inderror++]=2;
|
||||
$this->ultimoerror=2;
|
||||
if (mysql_close ($this->controlador)) $this->estado=0; // Se cierra la conexion
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
else{ // Problemas con la conexion
|
||||
$this->estado=0;
|
||||
$this->error[$this->inderror++]=1;
|
||||
$this->ultimoerror=1;
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece una sistema UTF8 para las consultas
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function SetUtf8(){
|
||||
mysql_query("SET NAMES 'utf8'");
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Revisa y detecta las condiciones que deben cumplir los datos necesarios para establecer
|
||||
conexiones
|
||||
|
||||
Devuelve :
|
||||
true : Si los datos aportados son correctos
|
||||
false: Si algn dato NO ha sido aportado o es incorrecto
|
||||
|
||||
Este m<EFBFBD>odo es privado y s<EFBFBD>o lo ejecutan m<EFBFBD>odos pblicos de la propia clase
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function _cadena_conexion(){
|
||||
|
||||
if ($this->servidor==null){
|
||||
$this->error[$this->inderror++]=6; // Servidor no establecido
|
||||
$this->ultimoerror=6;
|
||||
return(false);
|
||||
}
|
||||
if ($this->usuario==null){
|
||||
$this->error[$this->inderror++]=7;// usuario no establecido
|
||||
$this->ultimoerror=7;
|
||||
return(false);
|
||||
}
|
||||
if ($this->password==null){
|
||||
$this->error[$this->inderror++]=8; // password no establecido
|
||||
$this->ultimoerror=8;
|
||||
return(false);
|
||||
}
|
||||
if ($this->basedatos==null){
|
||||
$this->error[$this->inderror++]=9; // base de datos no establecido
|
||||
$this->ultimoerror=9;
|
||||
return(false);
|
||||
}
|
||||
if ($this->proveedor==null){
|
||||
$this->error[$this->inderror++]=10; // proveedor no establecido
|
||||
$this->ultimoerror=10;
|
||||
return(false);
|
||||
}
|
||||
$this->error[$this->inderror++]=0; // Datos de conexióncorrectos
|
||||
$this->ultimoerror=0;
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve el c<EFBFBD>igo del ltimo error ocurrido durante el proceso anterior.
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function UltimoError(){
|
||||
return($this->ultimoerror);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve una cadena con el mensage del ltimo error ocurrido durante el proceso anterior.
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function DescripUltimoError(){
|
||||
return($this->msgerrores[$this->ultimoerror]);
|
||||
}
|
||||
}
|
||||
/*=========================================================================================
|
||||
Clase para usarla con la clase comando.
|
||||
|
||||
Especificaciones:
|
||||
|
||||
Esta clase tiene dos propiedades que definen su contenido
|
||||
nombre=nombre del parametro
|
||||
valor = valor de dicho par<EFBFBD>etro
|
||||
tipo = tipo de parametro:
|
||||
0: El valor del par<EFBFBD>etro debe ir encerrado entre comillas simples
|
||||
1: El valor del par<EFBFBD>etro no necesita ir entre comillas simples
|
||||
========================================================================================*/
|
||||
class parametro{
|
||||
var $nombre;
|
||||
var $valor;
|
||||
var $tipo;
|
||||
/*--------------------------------------------------------------------------------------------*/
|
||||
function parametro($nombre="SinNombre",$valor="",$tipo="0"){ // Constructor de la clase
|
||||
$this->SetParametro($nombre,$valor,$tipo);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Modifica los valores de las propiedades de la clase
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function SetParametro($nombre,$valor,$tipo){
|
||||
$this->nombre=$nombre;
|
||||
$this->valor=$valor;
|
||||
$this->tipo=$tipo;
|
||||
if($tipo==1 && empty($valor)) $this->valor=0;
|
||||
}
|
||||
}
|
||||
/*==========================================================================================
|
||||
Clase para manipular bases de datos a traves de una conexiónprevia.
|
||||
|
||||
Especificaciones:
|
||||
|
||||
Las sentencias SQL pueden contener par<EFBFBD>etros que pueden ser sustituidos por el valor
|
||||
de los objetos par<EFBFBD>etro. Estos par<EFBFBD>etros tendr<EFBFBD> la forma:@nombre_del_parametro
|
||||
==================================================================================================*/
|
||||
class Comando{
|
||||
var $texto;
|
||||
var $Conexion;
|
||||
var $parametros=array();
|
||||
var $Recordset;
|
||||
var $resul;
|
||||
var $error; // Error
|
||||
var $ultimoerror; // Ultimo error detectado
|
||||
var $inderror; // Contador de errores
|
||||
var $msgerrores=array(
|
||||
"No se ha producido ningn error",
|
||||
"001 : Comando Error - No se ha establecido el texto del comando",
|
||||
"002 : Comando Error - No se ha establecido la conexióndel comando",
|
||||
"003 : Comando Error - No se ha abierto la conexi<78>",
|
||||
"004 : Comando Error - La sentencia SQl del comando no es correcta",
|
||||
"005 : Comando Error - No se ha podido recuperar el valor @@identity de la ltima clave insertada",
|
||||
);
|
||||
/*--------------------------------------------------------------------------------------------*/
|
||||
function Comando(){ // Constructor de la clase
|
||||
$this->inderror=0;
|
||||
$this->ultimoerror=0;
|
||||
$this->Recordset=new Recordset;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve el c<EFBFBD>igo del ltimo error ocurrido durante el proceso anterior.
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function UltimoError(){
|
||||
return($this->ultimoerror);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve una cadena con el mensage del ltimo error ocurrido durante el proceso anterior.
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function DescripUltimoError(){
|
||||
return($this->msgerrores[$this->ultimoerror]);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
A<EFBFBD>de un par<EFBFBD>etro a la colecci<EFBFBD> de parametros. La matriz que implementa la colecci<EFBFBD>
|
||||
es una matriz asociativa cuyo indice asociativo es el nombre del par<EFBFBD>etro
|
||||
|
||||
Par<EFBFBD>etros de entrada:
|
||||
objparam: Un objeto parametro
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function AddParametro($objparam){
|
||||
$tbparametro["nombre"]=$objparam->nombre;
|
||||
$tbparametro["valor"]=$objparam->valor;
|
||||
$tbparametro["tipo"]=$objparam->tipo;
|
||||
$this->parametros[]=$tbparametro;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
A<EFBFBD>de un par<EFBFBD>etro a la colecci<EFBFBD> de parametros. La matriz que implementa la colecci<EFBFBD>
|
||||
es una matriz asociativa cuyo indice asociativo es el del par<EFBFBD>etro
|
||||
|
||||
Par<EFBFBD>etros de entrada:
|
||||
nombre: El nombre del par<EFBFBD>etro
|
||||
valor : El valor del par<EFBFBD>etro
|
||||
tipo = tipo de parametro:
|
||||
0: El valor del par<EFBFBD>etro debe ir encerrado entre comillas simples
|
||||
1: El valor del par<EFBFBD>etro no necesita ir entre comillas simples
|
||||
|
||||
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function CreaParametro($nombre,$valor,$tipo){
|
||||
for($i=0;$i<sizeof($this->parametros);$i++){
|
||||
if($this->parametros[$i]["nombre"]==$nombre){
|
||||
$this->parametros[$i]["valor"]=$valor;
|
||||
return;
|
||||
}
|
||||
}
|
||||
$p = new parametro($nombre,$valor,$tipo);
|
||||
$this->AddParametro($p);
|
||||
}
|
||||
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Sustituye el valor de un par<EFBFBD>etro existente por otro
|
||||
Par<EFBFBD>etros de entrada:
|
||||
nombre: El nombre del par<EFBFBD>etro
|
||||
valor : El nuevo valor del par<EFBFBD>etro
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function ParamSetValor($nombre,$valor){
|
||||
for($i=0;$i<sizeof($this->parametros);$i++){
|
||||
if($this->parametros[$i]["nombre"]==$nombre)
|
||||
$this->parametros[$i]["valor"]=$valor;
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece la conexiónque se usar<EFBFBD>para ejecutar las acciones pertinentes
|
||||
|
||||
Par<EFBFBD>etros de entrada:
|
||||
objconexion: Un objeto conexion
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function EstableceConexion($objconexion){
|
||||
$this->Conexion= $objconexion;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece la conexiónque se usar<EFBFBD>para ejecutar las acciones pertinentes
|
||||
|
||||
Par<EFBFBD>etros de entrada:
|
||||
textocomando: Un texto con la sentencia SQL (Puede contener par<EFBFBD>etros)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function EstableceTexto($textocomando){
|
||||
$this->texto=$textocomando;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Sustituye el valor de los parametros en la expresi<EFBFBD> que forma el texto del Comando
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Traduce(){
|
||||
$execomando=$this->texto;
|
||||
if (sizeof($this->parametros)>0){ // Hay par<61>etros que sustituir
|
||||
foreach($this->parametros as $parametro){
|
||||
if ($parametro["tipo"]==0) // Tipo alfanum<75>ico
|
||||
$execomando=str_replace($parametro["nombre"],"'".$parametro["valor"]."'",$execomando);
|
||||
else
|
||||
$execomando=str_replace($parametro["nombre"],$parametro["valor"],$execomando);
|
||||
}
|
||||
}
|
||||
$this->texto=$execomando;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Ejecuta la sentencia SQL contenida en la propiedad texto
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Ejecutar(){
|
||||
$this->inderror=-1; // Inicializar contador de errores
|
||||
$this->ultimoerror=-1;
|
||||
if ($this->texto==null){
|
||||
$this->error[$this->inderror++]=1; // Texto no especificado
|
||||
$this->ultimoerror=1;
|
||||
return(false);
|
||||
}
|
||||
else{
|
||||
if ($this->Conexion==null){
|
||||
$this->error[$this->inderror++]=2; // conexiónNO establecida
|
||||
$this->ultimoerror=2;
|
||||
return(false);
|
||||
}
|
||||
else{
|
||||
if ($this->Conexion->estado==0){
|
||||
$this->error[$this->inderror++]=3; // conexiónNO abierta
|
||||
$this->ultimoerror=3;
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->Traduce();
|
||||
if (!$this->resul=mysql_query($this->texto,$this->Conexion->controlador)){
|
||||
$this->error[$this->inderror++]=4; // Error en la sentencia SQL del comando
|
||||
$this->ultimoerror=4;
|
||||
return(false);
|
||||
}
|
||||
if (stristr($this->texto,"select")){
|
||||
$this->Recordset->Inicializar();
|
||||
$this->Recordset->filas=$this->resul;
|
||||
$this->Recordset->numerodecampos=mysql_num_fields($this->Recordset->filas);
|
||||
$this->Recordset->numeroderegistros=mysql_num_rows($this->Recordset->filas);
|
||||
if ($this->Recordset->numeroderegistros>0){
|
||||
$this->Recordset->BOF=false;
|
||||
$this->Recordset->EOF=false;
|
||||
$this->Recordset->campos=mysql_fetch_array($this->Recordset->filas);
|
||||
}
|
||||
}
|
||||
|
||||
$this->error[$this->inderror++]=0; // Comando ejecutado correctamante
|
||||
$this->ultimoerror=0;
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Esta funci<EFBFBD> recupera el ltimo nmero asignado a una clave autonum<EFBFBD>ica de una tabla
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Autonumerico(){
|
||||
$ulreg=mysql_insert_id();
|
||||
return($ulreg);
|
||||
}
|
||||
}
|
||||
/*=========================================================================================
|
||||
Clase para consultar tablas y vistas de una base de datos.
|
||||
|
||||
Especificaciones:
|
||||
- Estado del recordset ($estado)
|
||||
0: Cerrado
|
||||
1: Abierto
|
||||
=========================================================================================*/
|
||||
class Recordset{
|
||||
var $Comando;
|
||||
var $filas= array();
|
||||
var $BOF,$EOF,$estado;
|
||||
var $campos;
|
||||
var $numeroderegistros,$numerodecampos,$posicion;
|
||||
|
||||
var $error; // Error
|
||||
var $ultimoerror; // Ultimo error detectado
|
||||
var $inderror; // Contador de errores
|
||||
var $msgerrores=array(
|
||||
"No se ha producido ningn error",
|
||||
"001 : Recordset Error - Comando no establecido",
|
||||
"002 : Recordset Error - No se ha establecido la conexióndel comando",
|
||||
"003 : Recordset Error - No se ha abierto la conexi<78>",
|
||||
"004 : Recordset Error - No se pudo abrir la consulta",
|
||||
"005 : Recordset Error - La sentencia SQl del comando no contiene la clausula SELECT",
|
||||
"006 : Recordset Error - No se puede liberar la consulta",
|
||||
);
|
||||
/*--------------------------------------------------------------------------------------------*/
|
||||
function Recordset(){ // Constructor de la clase
|
||||
$this->Inicializar();
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Inicializa propiedades de las clase
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function Inicializar(){
|
||||
$this->BOF=true;
|
||||
$this->EOF=true;
|
||||
$this->posicion=0;
|
||||
$this->numeroderegistros=0;
|
||||
$this->numerodecampos=0;
|
||||
$this->estado=0;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve el c<EFBFBD>igo del ltimo error ocurrido durante el proceso anterior.
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function UltimoError(){
|
||||
return($this->ultimoerror);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve una cadena con el mensage del ltimo error ocurrido durante el proceso anterior.
|
||||
----------------------------------------------------------------------------------------------*/
|
||||
function DescripUltimoError(){
|
||||
return($this->msgerrores[$this->ultimoerror]);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece el comando que se usar<EFBFBD>para ejecutar las consultas pertinentes
|
||||
|
||||
Par<EFBFBD>etros de entrada:
|
||||
objcomando: Un objeto comando con la sentencia SQL (Puede contener par<EFBFBD>etros)
|
||||
|
||||
Devuelve :
|
||||
true : Si el texto del comando contiene la clausula SELECT
|
||||
false: En caso contrario
|
||||
|
||||
En el caso de devolver false, la funci<EFBFBD> TomaUltimoError() devuelve el error ocurrido
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function EstableceComando($objcomando){
|
||||
$this->inderror=-1; // Inicializar contador de errores
|
||||
$this->ultimoerror=-1;
|
||||
if (stristr($objcomando->texto,"select")){
|
||||
$this->Comando=$objcomando;
|
||||
$this->error[$this->inderror++]=0; // Comando v<>ido, contiene "SELECT"
|
||||
$this->ultimoerror=0;
|
||||
return(true);
|
||||
}
|
||||
else{
|
||||
$this->error[$this->inderror++]=5; // Comando no valido, NO contiene "SELECT"
|
||||
$this->ultimoerror=5;
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Sustituye el valor de los parametros en la expresi<EFBFBD> que forma el texto del Comando
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Traduce(){
|
||||
$execomando=$this->Comando->texto;
|
||||
if (sizeof($this->Comando->parametros)>0){ // Hay par<61>etros que sustituir
|
||||
foreach($this->Comando->parametros as $parametro){
|
||||
if ($parametro["tipo"]==0) // Tipo alfanum<75>ico
|
||||
$execomando=str_replace($parametro["nombre"],"'".$parametro["valor"]."'",$execomando);
|
||||
else
|
||||
$execomando=str_replace($parametro["nombre"],$parametro["valor"],$execomando);
|
||||
}
|
||||
}
|
||||
$this->Comando->texto=$execomando;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Recupera registros de la base de datos
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Abrir(){
|
||||
$this->inderror=-1; // Inicializar contador de errores
|
||||
$this->ultimoerror=-1;
|
||||
if ($this->Comando==null){
|
||||
$this->error[$this->inderror++]=1; // Comando no especificado
|
||||
$this->ultimoerror=1;
|
||||
return(false);
|
||||
}
|
||||
else{
|
||||
if ($this->Comando->Conexion==null){
|
||||
$this->error[$this->inderror++]=2; // conexiónNO establecida
|
||||
$this->ultimoerror=2;
|
||||
return(false);
|
||||
}
|
||||
else{
|
||||
if ($this->Comando->Conexion->estado==0){
|
||||
$this->error[$this->inderror++]=3; // conexiónNO abierta
|
||||
$this->ultimoerror=3;
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->Traduce();
|
||||
$this->Inicializar();
|
||||
if (!$this->filas=mysql_query($this->Comando->texto,$this->Comando->Conexion->controlador)){
|
||||
$this->error[$this->inderror++]=4; // Error en la sentencia SQL del comando o al abrir la consula
|
||||
$this->ultimoerror=4;
|
||||
return(false);
|
||||
}
|
||||
$this->numeroderegistros=mysql_num_rows($this->filas); // La consulta se ha realizado con <20>ito
|
||||
$this->numerodecampos=mysql_num_fields($this->filas);
|
||||
if ($this->numeroderegistros>0){
|
||||
$this->BOF=false;
|
||||
$this->EOF=false;
|
||||
$this->campos=mysql_fetch_array($this->filas);
|
||||
}
|
||||
$this->estado=1; // Recordset abierto
|
||||
$this->error[$this->inderror++]=0; // Recuperaci<63> de registros correcta
|
||||
$this->ultimoerror=0;
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Libera los registros de una consulta de la base de datos
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Cerrar(){
|
||||
$this->inderror=-1; // Inicializar contador de errores
|
||||
$this->ultimoerror=-1;
|
||||
if (!mysql_free_result($this->filas)){
|
||||
$this->error[$this->inderror++]=6; // Error al cerrar la consulta (Al liberar memoria)
|
||||
$this->ultimoerror=6;
|
||||
return(false);
|
||||
}
|
||||
$this->Inicializar();
|
||||
$this->error[$this->inderror++]=0; // Recuperaci<63> de registros correcta
|
||||
$this->ultimoerror=0;
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Mueve el puntero de lectura al siguiente registro del recordset
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Siguiente(){
|
||||
if (!$this->EOF){
|
||||
$this->posicion++;
|
||||
if ($this->posicion==$this->numeroderegistros)
|
||||
$this->EOF=true;
|
||||
else{
|
||||
if (mysql_data_seek($this->filas,$this->posicion))
|
||||
$this->campos=mysql_fetch_array($this->filas);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Mueve el puntero de lectura al anterior registro del recordset
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Anterior(){
|
||||
if (!$this->BOF){
|
||||
$this->posicion--;
|
||||
if ($this->posicion<0)
|
||||
$this->BOF=true;
|
||||
else{
|
||||
if (mysql_data_seek($this->filas,$this->posicion));
|
||||
$this->campos=mysql_fetch_array($this->filas);
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Mueve el puntero de lectura al primer registro del recordset
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Primero(){
|
||||
if ($this->numeroderegistros>0){
|
||||
$this->posicion=0;
|
||||
if (mysql_data_seek($this->filas,$this->posicion))
|
||||
$this->campos=mysql_fetch_array($this->filas);
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Mueve el puntero de lectura al ltimo registro del recordset
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Ultimo(){
|
||||
if ($this->numeroderegistros>0){
|
||||
$this->posicion=$this->numeroderegistros-1;
|
||||
if (mysql_data_seek($this->filas,$this->posicion))
|
||||
$this->campos=mysql_fetch_array($this->filas);
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -1,272 +0,0 @@
|
|||
<?
|
||||
include_once("XmlPhp.php");
|
||||
/*===============================================================
|
||||
Esta clase implementa la apariencia y comportamiento de un treeview en código HTML y javascript.
|
||||
La clase utiliza la clase XmlPhp.php para acceder al documento XML.
|
||||
|
||||
Parámetros del constructor:
|
||||
-fXML=Fichero XML
|
||||
-fileocade=Indica si el dato anterior es un fichero o una variable con el contenido del árbol
|
||||
0: Es una cadena
|
||||
1: Es un fichero
|
||||
-baseurlimg= Url base de las imágenes de los nodos de contracción-expansión
|
||||
-clasedefault=Clase por defecto de los literales de los nodos
|
||||
-nivelexp= Máximo nivel que aparecera expandido
|
||||
-x= Posición x donde aparecerá la tabla
|
||||
-y= Posición y donde aparecerá la tabla
|
||||
=================================================================*/
|
||||
class ArbolVistaXML{
|
||||
var $baseurlimg; // Base de la URL de las imágenes de los nodos de contracción-expansión
|
||||
var $clasedefault; // Clase por defecto de los literales de los nodos
|
||||
var $gXML; // Objeto gestor del documento XML
|
||||
var $nivelexp; // Nivel máximo que aprecerá visible
|
||||
var $x; // Posición x donde aparecerá la tabla
|
||||
var $y; // Posición y donde aparecerá la tabla
|
||||
var $c_imgnivel=array(); // Imagenes de expansión y contracción para los distintos niveles
|
||||
var $v_imgnivel=array(); // Valores de expansión y contracción para los distintos niveles
|
||||
var $nodos_count; // Contador de nodo
|
||||
|
||||
Function ArbolVistaXML($fXML,$fileocade,$baseurlimg="/.images/",$clasedefault,$nivelexp=0,$x=0,$y=0,$tipotabla=0,$titulotabla=""){
|
||||
// Constructor
|
||||
$this->gXML=new XmlPhp($fXML,$fileocade);
|
||||
$this->baseurlimg=$baseurlimg;
|
||||
$this->clasedefault=$clasedefault;
|
||||
$this->nivelexp=$nivelexp;
|
||||
$this->x=$x;
|
||||
$this->y=$y;
|
||||
$this->tipotabla=$tipotabla;
|
||||
$this->titulotabla=$titulotabla;
|
||||
|
||||
// Anchura de los distibtos tipos de tablas
|
||||
if($this->tipotabla>0){
|
||||
$this->anchoM=" width=100% ";
|
||||
$this->ancho=" width=100% ";
|
||||
}
|
||||
else{
|
||||
$this->anchoM=" width=1024 ";
|
||||
$this->ancho="";
|
||||
}
|
||||
for($i=0;$i<=5;$i++){ // Inicializar
|
||||
$this->c_imgnivel[$i]=$this->baseurlimg.'/nada.gif';
|
||||
$this->v_imgnivel[$i]="nada";
|
||||
}
|
||||
$this->nodos_count=0;
|
||||
}
|
||||
/*------------------------------------------------------------------------------------------------
|
||||
Esta función devuelve una cadena con el contenido de un treeview en código HTML
|
||||
------------------------------------------------------------------------------------------------*/
|
||||
Function CreaArbolVistaXML(){
|
||||
if (!$this->gXML->NodoRaiz()) return; // No existe documento XML que analizar
|
||||
$arbol_total='<TABLE border=0 '.$this->anchoM.' class="'.$this->clasedefault. '" style="POSITION:absolute;TOP:'.$this->y.'px;LEFT:'.$this->x.'px" class=texto_arbol cellspacing=0 cellpadding=0 border=0>';
|
||||
if($this->tipotabla>0) $arbol_total.='<TR><TH>'. $this->titulotabla .'</TH></TR>';
|
||||
$arbol_total.='<TR style="display:block">';
|
||||
$arbol_total.='<TD>';
|
||||
$arbol_total.='<TABLE id=tablanivel-0 border=0 cellspacing=0 cellpadding="0">';
|
||||
$arbol_total.=$this->_arbolXmlrecur(0);
|
||||
$arbol_total.='</TABLE>';
|
||||
$arbol_total.='</TD>';
|
||||
$arbol_total.='</TR>';
|
||||
$arbol_total.='</TABLE>';
|
||||
return($arbol_total);
|
||||
}
|
||||
// -------------------------------------------------------------------------------------
|
||||
// Recorrido recursivo del arbol XML
|
||||
// Parámetros:
|
||||
// nivel: nivel del nodo
|
||||
// -------------------------------------------------------------------------------------
|
||||
function _arbolXmlrecur($nivel){
|
||||
$arbol_total="";
|
||||
if ($nivel+1>$this->nivelexp) $displai="none"; else $displai="block";
|
||||
do{
|
||||
$gnptr=$this->gXML->nptr;
|
||||
$arbol_total.='<TR style="display:block" id=TRNodo-'.$this->nodos_count.'>';
|
||||
$arbol_total.='<TD>';
|
||||
$arbol_total.=$this->_dibujo_nodo($this->gXML->Nodo(),$nivel,$this->gXML->NumerodeHijos(),$this->gXML->EsUltimoHermano());
|
||||
$arbol_total.='</TD>';
|
||||
$arbol_total.='</TR>';
|
||||
$this->nodos_count++;
|
||||
if ($this->gXML->PrimerNodoHijo()){
|
||||
$arbol_total.='<TR id="TRNodoHijo-'.$this->nodos_count.'" style="display:'.$displai.'">';
|
||||
$arbol_total.='<TD>';
|
||||
$arbol_total.='<TABLE id="tablanivel-'.($nivel+1).'" border=0 cellspacing=0 cellpadding=0>';
|
||||
$arbol_total.=$this->_arbolXmlrecur($nivel+1);
|
||||
$arbol_total.='</TABLE>';
|
||||
$arbol_total.='</TD>';
|
||||
$arbol_total.='</TR>';
|
||||
}
|
||||
$this->gXML->nptr=$gnptr;
|
||||
}while($this->gXML->SiguienteNodoHermano());
|
||||
return($arbol_total);
|
||||
}
|
||||
// -------------------------------------------------------------------------------------
|
||||
// Crea un nodo
|
||||
// Parámetros:
|
||||
// nivel: nivel del nodo
|
||||
// -------------------------------------------------------------------------------------
|
||||
function CreaNodo($nivel){
|
||||
$nodo=$this->_dibujo_nodo($this->gXML->Nodo(),$nivel,0,true);
|
||||
return($nodo);
|
||||
}
|
||||
/*------------------------------------------------------------------------------------------------
|
||||
Dibuja los nodos del árbol
|
||||
parámetros:
|
||||
nodo: La información del nodo
|
||||
nivel: Nivel del nodo
|
||||
nhijos: numero de hijos
|
||||
uhermano: Es true si el nodo es el último de sus hermanos
|
||||
|
||||
Especificaciones:
|
||||
Los atributos de los nodos pueden ser HTML o especificos de
|
||||
esta aplicación. Lso atributos del nodo propios de ésta son:
|
||||
|
||||
- clicksupimg: Función suplementaria de la imagen de signo
|
||||
- imagenid: Identificador de la imagen de signo
|
||||
- clickimg: La función que se ejecutará al hacer click sobre la imagen de nodo
|
||||
- downimg: La función que se ejecutará al pulsar el ratón sobre la imagen de nodo
|
||||
- clickcontextualimg: Función que se ejecutara al hacer click con el boton derecho sobre la imagen del nodo
|
||||
- imagenodo: Es la url de la imagen de nodo
|
||||
- infonodo: Es texto que se visualiza del nodo
|
||||
- mouseovernodo: La función a ejecutar cuando se posa el ratón sobre el literal del nodo
|
||||
- clicksupnodo: Función suplementaria del literal del nodo
|
||||
- clickcontextualnodo: Función que se ejecutara al hacer click con el boton derecho sobre el nodo
|
||||
- classnodo: Clase (style) a la que pertenece el nodo
|
||||
- nodoid: identificador del nodo
|
||||
- nodovalue: parametro value del nodo
|
||||
------------------------------------------------------------------------------------------------*/
|
||||
function _dibujo_nodo($nodo,$nivel,$nhijos,$uhermano){
|
||||
// Comprobar descendencia y posición dentro de los hermanos
|
||||
$swu=false; // switch para saber si el nodo es el último hermano
|
||||
$swh=false; // switch para saber si el nodo tiene hijos
|
||||
if ($nhijos>0) $swh=true;
|
||||
$swu=$uhermano;
|
||||
if ($swh){ // Si tiene hijos ..
|
||||
if ($swu){ // Si es el último de sus hermanos ..
|
||||
if ($nivel<$this->nivelexp){
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/menos_c.gif';
|
||||
$this->v_imgnivel[$nivel]="menos_c";
|
||||
}
|
||||
else{
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/mas_c.gif';
|
||||
$this->v_imgnivel[$nivel]="mas_c";
|
||||
}
|
||||
}
|
||||
else{ // Si NO lo es ..
|
||||
if ($nivel<$this->nivelexp){
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/menos_t.gif';
|
||||
$this->v_imgnivel[$nivel]="menos_t";
|
||||
}
|
||||
else{
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/mas_t.gif';
|
||||
$this->v_imgnivel[$nivel]="mas_t";
|
||||
}
|
||||
}
|
||||
if ($nivel==0){
|
||||
if ($this->nivelexp>0)
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/menos_root.gif';
|
||||
else
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/mas_root.gif';
|
||||
}
|
||||
}
|
||||
else{ // Si NO tiene hijos ..
|
||||
if ($swu){ // Si es el último de sus hermanos ..
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/nada_c.gif';
|
||||
$this->v_imgnivel[$nivel]="nada_c";
|
||||
}
|
||||
else{ // Si no lo es ..
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/nada_t.gif';
|
||||
$this->v_imgnivel[$nivel]="nada_t";
|
||||
}
|
||||
}
|
||||
// Fin Comprobar descendencia y posición dentro de los hermanos
|
||||
if($this->tipotabla==0)
|
||||
$arbol='<TABLE border=0 cellspacing=0 cellpadding=0>';
|
||||
else
|
||||
$arbol='<TABLE style="BORDER-BOTTOM:#000000 1px solid;" border=0 cellspacing=0 cellpadding=0>';
|
||||
$arbol.='<TR height="16px">';
|
||||
$atributosHTML=" ";
|
||||
$atributosHTML=$this->gXML->Atributos($nodo);
|
||||
$colornodo="";
|
||||
$fondonodo="";
|
||||
$estilo="";
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("colornodo",$colornodo,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("fondonodo",$fondonodo,$atributosHTML);
|
||||
if ($colornodo!="" ) $colornodo=' COLOR:'.$colornodo.";";
|
||||
if ($fondonodo!="" ) $fondonodo=' BACKGROUND-COLOR:'.$fondonodo.";";
|
||||
$estilo=$colornodo || $fondonodo;
|
||||
if ($estilo!="" ) $estilo='style="'.$colornodo.$fondonodo.'"';
|
||||
|
||||
for ($i=0;$i<$nivel;$i++){ // Niveles previos
|
||||
$arbol.='<TD '.$estilo.'width="3px"></TD>';
|
||||
$arbol.='<TD '.$estilo.' width="16px"><IMG src="'.$this->c_imgnivel[$i].'" width="16px" height="16px" ></TD>';
|
||||
}
|
||||
$arbol.='<TD '.$estilo.' width="3px"></TD>'; // Desplazamiento de la imagen
|
||||
$arbol.='<TD '.$estilo.' width="16px">';
|
||||
|
||||
$imagenid="";
|
||||
$clicksupimg="";
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("imagenid",$imagenid,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("clicksupimg",$clicksupimg,$atributosHTML);
|
||||
if ($clicksupimg!="") $clicksupimg.=';';
|
||||
if ($swh){ // El nodo tiene hijos
|
||||
$arbol.='<A href="#nodo"><IMG border=0 '.$estilo.' id="'.$imagenid.'" onclick="clickImagenSigno(this,' ."'".$this->baseurlimg."'".','.$nivel.');'.$clicksupimg.'" src="'.$this->c_imgnivel[$nivel].'" width="16px" height="16px" value="'.$this->v_imgnivel[$nivel].'"></A></TD>';
|
||||
}
|
||||
else
|
||||
$arbol.='<SPAN><IMG '.$estilo.' id="'.$imagenid.'" src="'.$this->c_imgnivel[$nivel].'" width="16px" height="16px" value="'.$this->v_imgnivel[$nivel].'"></SPAN></TD>';
|
||||
|
||||
$imagenodo="";
|
||||
$clickimg="";
|
||||
$downimg="";
|
||||
$clickcontextualimg="";
|
||||
$styleimg="";
|
||||
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("imagenodo",$imagenodo,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("clickimg",$clickimg,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("downimg",$downimg,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("clickcontextualimg",$clickcontextualimg,$atributosHTML);
|
||||
if ($clickimg!="" ) $clickimg=' onclick="'.$clickimg.'" ';
|
||||
if ($downimg!="" ) $downimg=' onmousedown="'.$downimg.'" ';
|
||||
if ($clickcontextualimg!="" ) $clickcontextualimg=' oncontextmenu=" '.$clickcontextualimg.'" ';
|
||||
|
||||
if ($clickimg!="" || $downimg!="" || $clickcontextualimg!="" ) $styleimg=' style="cursor:hand"';
|
||||
|
||||
$arbol.='<TD '.$estilo.' width=16px><IMG '.$styleimg.' src="'.$imagenodo.'"'.$clickimg.$downimg.$clickcontextualimg.' width="16px" height="16px"></TD>';
|
||||
$arbol.='<TD '.$estilo.' width="4px"></TD>';
|
||||
|
||||
$clicksupnodo="";
|
||||
$clickcontextualnodo="";
|
||||
$classnodo="";
|
||||
$nodoid="";
|
||||
$nodovalue="";
|
||||
$mouseovernodo="";
|
||||
$infonodo="";
|
||||
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("clickcontextualnodo",$clickcontextualnodo,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("clicksupnodo",$clicksupnodo,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("classnodo",$classnodo,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("nodoid",$nodoid,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("nodovalue",$nodovalue,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("colornodo",$colornodo,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("fondonodo",$fondonodo,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("mouseovernodo",$mouseovernodo,$atributosHTML);
|
||||
$atributosHTML=$this->gXML->TomaAtributoEspecial("infonodo",$infonodo,$atributosHTML);
|
||||
if ($clickcontextualnodo!="" ) $clickcontextualnodo=' oncontextmenu="'.$clickcontextualnodo.'" ';
|
||||
if ($mouseovernodo!="" ) $mouseovernodo=' onmouseover="'.$mouseovernodo.'" ';
|
||||
if ($nodovalue!="" ) $nodovalue=' value="'.$nodovalue.'" ';
|
||||
if (!$classnodo) $classnodo=$this->clasedefault;
|
||||
|
||||
$arbol.='<TD width="1024px" '.$estilo.' class="'.$classnodo.'">';
|
||||
$arbol.='<A href="#nodo" class="'.$this->clasedefault. '" style="text-decoration: none"><SPAN id="'.$nodoid.'" ';
|
||||
if($this->tipotabla<2){
|
||||
$arbol.=' onclick="clickLiteralNodo(this ,' ."'".$this->baseurlimg."'".');';
|
||||
$arbol.=" ".$clicksupnodo.'"'.$nodovalue.$mouseovernodo.$clickcontextualnodo;
|
||||
}
|
||||
$arbol.=' >'.$infonodo.'</SPAN></A></TD>';
|
||||
$arbol.='</TR>';
|
||||
$arbol.='</TABLE>';
|
||||
if ($swu)
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/nada.gif';
|
||||
else
|
||||
$this->c_imgnivel[$nivel]=$this->baseurlimg.'/nada_l.gif';
|
||||
return($arbol);
|
||||
}
|
||||
} // Fin de la clase
|
|
@ -1,56 +0,0 @@
|
|||
<?php
|
||||
|
||||
/*================================================================================
|
||||
Clase para encriptar y desencriptar cadenas cadenas
|
||||
================================================================================*/
|
||||
class EncripDescrip{
|
||||
var $cadena; // La cadena encriptada o desencriptada que ser<65>devuelta
|
||||
var $clave; // La clave de la cadena encriptada o desencriptada que ser<65>devuelta
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Constructor
|
||||
//________________________________________________________________________________________
|
||||
function EncripDescrip($clave=12){
|
||||
$this->cadena="";
|
||||
$this->clave=$clave;
|
||||
}
|
||||
// ____________________________________________________________________________
|
||||
//
|
||||
// Encripta una cadena
|
||||
//_____________________________________________________________________________
|
||||
function Encriptar($cadena){
|
||||
|
||||
return( $cadena);
|
||||
|
||||
$clave=(int)$this->clave;
|
||||
$clave = (int)$clave & 0xFF;
|
||||
$lon=strlen($cadena);
|
||||
$this->cadena="";
|
||||
for($i=0;$i<$lon;$i++){
|
||||
$ch=(int)ord($cadena[$i]);
|
||||
$pot=(int)$ch^(int)$clave;
|
||||
$this->cadena.=chr($pot);
|
||||
}
|
||||
return( $this->cadena);
|
||||
}
|
||||
// ____________________________________________________________________________
|
||||
//
|
||||
// Desencripta una cadena
|
||||
//_____________________________________________________________________________
|
||||
function Desencriptar($cadena){
|
||||
|
||||
return( $cadena);
|
||||
|
||||
$clave=(int)$this->clave;
|
||||
$clave = (int)$clave & 0xFF;
|
||||
$lon=strlen($cadena);
|
||||
$this->cadena="";
|
||||
for($i=0;$i<$lon;$i++){
|
||||
$ch=(int)ord($cadena[$i]);
|
||||
$pot=(int)$ch^(int)$clave;
|
||||
$this->cadena.=chr($pot);
|
||||
}
|
||||
return( $this->cadena);
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -1,164 +0,0 @@
|
|||
<?php
|
||||
/*==================================================================================================
|
||||
Clase para trabajar con menús contextuales.
|
||||
|
||||
Especificaciones de las etiquetas XML:
|
||||
- MENUCONTEXTUAL: Elemento raiz en el se especifican los atributos del <DIV>
|
||||
- ITEM: Especificaciones de cada item.
|
||||
- SEPARADOR: Indica una linea divisoria entre items
|
||||
|
||||
Especificaciones de atributos:
|
||||
- idctx: Identificador del menu contextual (DIV)
|
||||
- imgitem: La url de la imagen que acompañará al literal
|
||||
- alignitem: La alineación del texto del item (por defecto left)
|
||||
- textoitem: El literal del item
|
||||
- subflotante: Si el item despliega otro menu contextual. El valor es el id de ése
|
||||
- maxanchu: Máxima anchura del menu contextual
|
||||
- swimg: Vale 1 si el menu tiene algún item con imagen y 0 en caso contrario
|
||||
- alpulsar: Nombre de la función javascript que se ejecutará en respuesta al evento onclick
|
||||
- clase: Estilo CSS que tendrán los item menu contextual
|
||||
- origen_x: Posición de origen, coordenada x
|
||||
- origen_y: Posición de origen, coordenada y
|
||||
|
||||
|
||||
Especificaciones de eventos:
|
||||
- Los eventos onmouseover y onmouseout están implicitos en la clase por defecto
|
||||
Especificaciones de submenus:
|
||||
- Si una opción lleva un submenu asociado el id de éste va en el atributo name del <TR>
|
||||
|
||||
|
||||
==================================================================================================*/
|
||||
class MenuContextual{
|
||||
Function MenuContextual($urlImages="../images/flotantes"){
|
||||
$this->urlImg=$urlImages;
|
||||
}
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
Devuelve una cadena en formato HTML de un layer para usarlo como menu contextual
|
||||
Parametros:
|
||||
- cadenaXML: Una cadena en formato XML con los atributos de cada item
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function CreaMenuContextual($cadenaXML){
|
||||
$idx=0;
|
||||
$layer="";
|
||||
$idctx="";
|
||||
$maxanchu=100;
|
||||
$swimg=0;
|
||||
$imgitem="";
|
||||
$alignitem="";
|
||||
$textoitem="";
|
||||
$clase="";
|
||||
$subflotante="";
|
||||
$origen_x="0";
|
||||
$origen_y="0";
|
||||
|
||||
$gXML=new XmlPhp($cadenaXML,0);
|
||||
$gXML->NodoRaiz();
|
||||
$atributosHTML=$gXML->Atributos();
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("maxanchu",$maxanchu,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("swimg",$swimg,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("clase",$clase,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("idctx",$idctx,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("origen_x",$origen_x,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("origen_y",$origen_y,$atributosHTML);
|
||||
if(empty($origen_x)) $origen_x=0;
|
||||
if(empty($origen_y)) $origen_y=0;
|
||||
if (!$clase) $clase="menu_contextual";
|
||||
$layer.='<DIV class="'.$clase.'" id="'.$idctx.'" width='.$maxanchu.' style="visibility:hidden;position:absolute;top:'.$origen_y.';left:'.$origen_x.'" >';
|
||||
$nuitems=2;
|
||||
if ($gXML->PrimerNodoHijo()){
|
||||
$layer.='<TABLE border=0 width='.$maxanchu.' border=0 cellspacing=0 cellpadding=0>';
|
||||
$layer.='<TR width='.$maxanchu.' height=3>'; // Primera linea
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/esi.gif"></TD>';
|
||||
$layer.='<TD colspan=6 background="'.$this->urlImg.'/lsu.gif"></TD>';
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/esd.gif"></TD>';
|
||||
$layer.='</TR>';
|
||||
|
||||
$layer.='<TR width='.$maxanchu.' height=3>'; // Linea de relleno
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/liz.gif"></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD colspan=4></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/ldr.gif"></TD>';
|
||||
$layer.='</TR>';
|
||||
do{
|
||||
$nuitems++;
|
||||
$atributosHTML=$gXML->Atributos();
|
||||
$tiponodo=$gXML->NombreNodo();
|
||||
if ($tiponodo=="ITEM"){
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("imgitem",$imgitem,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("textoitem",$textoitem,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("subflotante",$subflotante,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("alpulsar",$alpulsar,$atributosHTML);
|
||||
$atributosHTML=$gXML->TomaAtributoEspecial("alignitem",$alignitem,$atributosHTML);
|
||||
|
||||
if ($alignitem==null) $alignitem="left";
|
||||
|
||||
$clickcontextual=' onclick="'.$alpulsar.'" ';
|
||||
$oncontextual=' onmouseover="sobre_contextual(this)" ';
|
||||
$offcontextual="";
|
||||
|
||||
$idx++;
|
||||
$layer.='<TR id='.$idx.' name="'.$subflotante.'" width='.$maxanchu.' '.$clickcontextual.' '.$oncontextual.' '.$offcontextual.' height=20>'; // Linea de item
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/liz.gif"></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
|
||||
if ($imgitem!=null){ // Item con imagen
|
||||
$imgonclick="";
|
||||
$layer.='<TD width=20 align=center id="TDimg-'.$idx .'"><IMG width=16 src="'.$imgitem.'"></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD align='.$alignitem.' id="TDLit-'.$idx .'" width='.($maxanchu-38).' '.$atributosHTML.'><A href="#" style="text-decoration: none"><SPAN>'.$textoitem.'</SPAN></A></TD>';
|
||||
}
|
||||
else{
|
||||
if ($swimg==1){ // Hay algún item con imagen
|
||||
$layer.='<TD width=20></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD align='.$alignitem.' width='.($maxanchu-38).' '.$atributosHTML.'><A href="#" style="text-decoration: none"><SPAN>'.$textoitem.'</SPAN></A></TD>';
|
||||
}
|
||||
else{
|
||||
$layer.='<TD width=10></TD>';
|
||||
$layer.='<TD colspan=2 align='.$alignitem.' width='.($maxanchu-25).' ' .$atributosHTML.' ><A href="#" style="text-decoration: none"><SPAN>'.$textoitem.'</SPAN></A></TD>';
|
||||
}
|
||||
}
|
||||
if ($subflotante!=null)
|
||||
$layer.='<TD valign=middle><IMG width=3 name="swsbfn" align=left src="'.$this->urlImg.'/swsbfn.gif">';
|
||||
else
|
||||
$layer.='<TD width=3 >';
|
||||
$layer.='</TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/ldr.gif"></TD>';
|
||||
$layer.='</TR>';
|
||||
}
|
||||
if ($tiponodo=="SEPARADOR"){ // Separadores
|
||||
$layer.='<TR width='.$maxanchu.' height=16>'; // Linea de separación
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/liz.gif"></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD colspan=4 background="'.$this->urlImg.'/sep.gif"></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/ldr.gif"></TD>';
|
||||
$layer.='</TR>';
|
||||
}
|
||||
|
||||
}while($gXML->SiguienteNodoHermano());
|
||||
|
||||
$layer.='<TR width='.$maxanchu.' height=3>'; // Linea de relleno
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/liz.gif"></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD colspan=4></TD>';
|
||||
$layer.='<TD width=3></TD>';
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/ldr.gif"></TD>';
|
||||
$layer.='</TR>';
|
||||
|
||||
|
||||
$layer.='<TR width='.$maxanchu.' height=3>'; // Última linea
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/eii.gif"></TD>';
|
||||
$layer.='<TD colspan=6 background="'.$this->urlImg.'/lin.gif"></TD>';
|
||||
$layer.='<TD width=3 background="'.$this->urlImg.'/eid.gif"></TD>';
|
||||
$layer.='</TR>';
|
||||
$layer.='</TABLE>';
|
||||
$layer.='<INPUT type=hidden value="-1">'; // Representará el índice seleccionado
|
||||
$layer.='</DIV>';
|
||||
}
|
||||
return($layer);
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -1,120 +0,0 @@
|
|||
<?php
|
||||
|
||||
include_once("EncripDescrip.php");
|
||||
|
||||
/*================================================================================
|
||||
Clase para conectarse con el servidor hidra y enviar comandos
|
||||
Cualquier error producido en los procesos se puede recuperar con los m<EFBFBD>odos
|
||||
================================================================================*/
|
||||
class SockHidra{
|
||||
var $ultimoerror; // Ultimo error detectado
|
||||
var $descripultimoerror; // Descripción del ltimo error detectado
|
||||
var $socket; // Stream socket
|
||||
var $servidor; // El servidor hidra
|
||||
var $puerto; // El puerto odnde se conectar<61>
|
||||
var $timeout; // El tiempo de espera para la conexi<78>
|
||||
var $encripdescrip; // El encriptador
|
||||
var $LONGITUD_TRAMA; // M<>ima longitud de la trama
|
||||
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Constructor
|
||||
// Par<61>etros:
|
||||
// - servidor: El nombre o la IP del servidor
|
||||
// - puerto: El puerto usado para las comunicaciones
|
||||
// - timeout: El tiempo de espera para la conexi<78>
|
||||
//________________________________________________________________________________________
|
||||
function SockHidra($servidor,$puerto,$timeout=30){
|
||||
$this->servidor=$servidor;
|
||||
if (!$this->_esIP($this->servidor))
|
||||
$this->servidor = gethostbyname ($servidor);
|
||||
$this->puerto=$puerto;
|
||||
$this->timeout=$timeout;
|
||||
$this->LONGITUD_TRAMA=4048;
|
||||
|
||||
$this->encripdescrip=new EncripDescrip();
|
||||
}
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Averigua si el parametro pasado es una IP. devuelve true en caso afirmativo
|
||||
//________________________________________________________________________________________
|
||||
function _esIP(){
|
||||
return(false);
|
||||
}
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Conecta con el servidor
|
||||
// Devuelve:
|
||||
// - false: Si falla la conexi<78>
|
||||
// - true: En caso contrario
|
||||
//________________________________________________________________________________________
|
||||
function conectar(){
|
||||
$this->socket = socket_create (AF_INET, SOCK_STREAM, 0);
|
||||
if ($this->socket < 0) {
|
||||
$this->ultimoerror=socket_strerror($socket);
|
||||
$this->descripultimoerror="socket_create() fallo";
|
||||
return(false);
|
||||
}
|
||||
$result = socket_connect ($this->socket,$this->servidor,$this->puerto);
|
||||
if ($result < 0) {
|
||||
$this->ultimoerror=socket_strerror($result);
|
||||
$this->descripultimoerror="socket_connect() fallo";
|
||||
return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Cerrar la conexióncon el servidor
|
||||
// Devuelve:
|
||||
// - false: Si falla la conexi<78>
|
||||
// - true: En caso contrario
|
||||
//________________________________________________________________________________________
|
||||
function desconectar(){
|
||||
socket_close ($this->socket);
|
||||
}
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Devuelve el c<>igo del ltimo error ocurrido durante el proceso anterior.
|
||||
//________________________________________________________________________________________
|
||||
function UltimoError(){
|
||||
return($this->ultimoerror);
|
||||
}
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Devuelve una cadena con el mensage del ltimo error ocurrido durante el proceso anterior.
|
||||
//________________________________________________________________________________________
|
||||
function DescripUltimoError(){
|
||||
return($this->descripultimoerror);
|
||||
}
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Envia una trama de comando al servidor
|
||||
// Par<61>etros:
|
||||
// - trama: Trama a enviar
|
||||
//________________________________________________________________________________________
|
||||
function envia_comando($parametros){
|
||||
$trama="@JMMLCAMDJ".$parametros;
|
||||
$resul=socket_write($this->socket, $this->encripdescrip->Encriptar($trama), strlen($trama));
|
||||
if (!$resul) {
|
||||
$this->ultimoerror=socket_strerror($resul);
|
||||
$this->descripultimoerror="socket_write() fallo";
|
||||
return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//________________________________________________________________________________________
|
||||
//
|
||||
// Recibe una trama del servidor
|
||||
// Par<61>etros:
|
||||
// - lon: Longitud de la trama
|
||||
// Devuelve:
|
||||
// La trama recibida
|
||||
//________________________________________________________________________________________
|
||||
function recibe_respuesta(){
|
||||
$trama = socket_read ($this->socket,$this->LONGITUD_TRAMA);
|
||||
$cadenaret=$this->encripdescrip->Desencriptar($trama);
|
||||
return($cadenaret);
|
||||
}
|
||||
}
|
||||
?>
|
|
@ -1,285 +0,0 @@
|
|||
<?
|
||||
/*================================================================================
|
||||
Esta clase implementa funciones de utilidad para tratar ficheros XML
|
||||
|
||||
Parametros del constructor:
|
||||
fxml=Fichero XML que contiene los atributos de los nodos
|
||||
fileocade=Indica si el dato anterior es un fichero o una variable con el contenido del árbol:
|
||||
0: Es una cadena
|
||||
1: Es un fichero
|
||||
|
||||
Especificaciones:
|
||||
Se le llama información del nodo al nombre del nodo + sus atributos eliminando los marcadores
|
||||
de comienzo:"<" y fin:">"
|
||||
================================================================================*/
|
||||
class XmlPhp{
|
||||
var $buffer;
|
||||
var $nptr;
|
||||
|
||||
Function XmlPhp($fxml,$fileocade){ // Constructor
|
||||
if ($fileocade==0){
|
||||
$this->nptr=1;
|
||||
$this->buffer=trim($fxml);
|
||||
}
|
||||
else{
|
||||
$tbuffer=filesize($fxml); // Calcula tamaño del fichero
|
||||
if ($tbuffer>0){ // EL fichero tiene contenido
|
||||
$fd=fopen($fxml, "r");
|
||||
$this->buffer=fread ($fd,$tbuffer);
|
||||
fclose ($fd);
|
||||
$this->nptr=1;
|
||||
$this->buffer=trim($this->buffer);
|
||||
}
|
||||
}
|
||||
$this->buffer=ereg_replace( "[\n\r\t]"," ", $this->buffer );
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Recupera la información del primer nodo (nodo raiz) del arbol.Devuelve false en caso de que
|
||||
no tenga hijos o bien no exista documento XML que analizar.
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function InfoNodoRaiz(){
|
||||
if (!$this->NodoRaiz()) // No existe documento XML
|
||||
return(false);
|
||||
return($this->Infonodo());
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece el puntero de nodos al primer nodo del árbol (nodo raiz). Devuelve false en caso
|
||||
de que no exista documento XML que analizar.
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function NodoRaiz(){
|
||||
if ($this->buffer==null) return(false); // No existe documento XML
|
||||
$this->nptr=0;
|
||||
while ($this->nptr<strlen($this->buffer))
|
||||
if ('<'==substr($this->buffer,$this->nptr++,1)) return(true);
|
||||
return(false);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Recupera la información del primer nodo hijo del nodo actual. Devuelve false en caso de que
|
||||
no tenga hijos o bien no exista documento XML que analizar.
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function InfoPrimerNodoHijo(){
|
||||
if (!$this->PrimerNodoHijo()) // No tiene hijos o no existe documento XML
|
||||
return(false);
|
||||
return($this->Infonodo());
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece el puntero de nodos al primer nodo hijo del nodo actual. Devuelve false en caso
|
||||
de que no tenga hijos o bien no exista documento XML que analizar.
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function PrimerNodoHijo(){
|
||||
if ($this->buffer==null) return(false); // No existe documento XML
|
||||
$gnptr=$this->nptr;
|
||||
while ($this->nptr<strlen($this->buffer))
|
||||
if ('<'==substr($this->buffer,$this->nptr++,1)) break;
|
||||
$lon=$this->nptr;
|
||||
if ('/'==substr($this->buffer,$lon,1)){ // No tiene hijos
|
||||
$this->nptr=$gnptr;
|
||||
return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Recupera la información del siguiente nodo hermano del actual. Devuelve false en caso de que
|
||||
el nodo actual sea el último de sus hermanos o bien no exista documento XML que analizar.
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function InfoSiguienteNodoHermano(){
|
||||
if (!$this->SiguienteNodoHermano()) // No tiene hermanos o no existe documento XML
|
||||
return(false);
|
||||
return($this->Infonodo());
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece el puntero de nodos al siguiente nodo hermano del nodo actual. Devuelve false en
|
||||
caso de que el nodo actual sea el último de los hermanos o bien no exista documento XML que analizar.
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function SiguienteNodoHermano(){
|
||||
if ($this->buffer==null) return(false); // No existe documento XML
|
||||
$gnptr=$this->nptr;
|
||||
$resul=$this->_siguiente_hermano();
|
||||
if (!$resul){
|
||||
$this->nptr=$gnptr; // Es el último hermano
|
||||
return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Establece el puntero de nodos al siguiente nodo hermano del actual
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function _siguiente_hermano(){
|
||||
$lon=$this->nptr;
|
||||
$sw=1;
|
||||
$nombrenodo=$this->NombreNodo();
|
||||
while (1){
|
||||
$lon = strpos($this->buffer,'<',++$lon);
|
||||
if (substr($this->buffer,++$lon,1)=='/')
|
||||
$sw--;
|
||||
else
|
||||
$sw++;
|
||||
if ($sw==0){
|
||||
while ($lon<strlen($this->buffer)){
|
||||
if (substr($this->buffer,$lon++,1)=='<'){
|
||||
if (substr($this->buffer,$lon,1)=='/')
|
||||
return(false); // Es el último hermano
|
||||
else{
|
||||
$this->nptr=$lon;
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
return(false); // Se trata del nodo raiz
|
||||
}
|
||||
}
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Recupera el número de hijos del nodo actual
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function NumerodeHijos(){
|
||||
$gnptr=$this->nptr;
|
||||
$nh=0;
|
||||
if ($this->PrimerNodoHijo()){
|
||||
$nh++;
|
||||
while ($this->SiguienteNodoHermano()) $nh++;
|
||||
}
|
||||
$this->nptr=$gnptr;
|
||||
return($nh);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve true si el nodo es el último de sus hermanos
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function EsUltimoHermano(){
|
||||
$gnptr=$this->nptr;
|
||||
if (!$this->SiguienteNodoHermano()){
|
||||
$this->nptr=$gnptr;
|
||||
return(true);
|
||||
}
|
||||
$this->nptr=$gnptr;
|
||||
return(false);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve los atributos del nodo.
|
||||
Prámetros:
|
||||
Si se aporta el puntero del nodo se devolverán los atributos del nodo apuntado
|
||||
pero si no se especifican argumentos se devuelven los atributos del nodo actual.
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Atributos($ptrnodo=-1){
|
||||
if ($ptrnodo!=-1)
|
||||
$this->_setnodo($ptrnodo);
|
||||
$atributosHTML="";
|
||||
$info=$this->Infonodo();
|
||||
$pos=strpos($info," ");
|
||||
if ($pos) // El nodo tiene atributos
|
||||
$atributosHTML=" ".substr($info,$pos);
|
||||
return($atributosHTML);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Posiciona el puntero de nodos
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function _setnodo($ptrnodo){
|
||||
$this->nptr=$ptrnodo;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Devuelve el puntero del nodo actual
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Nodo(){
|
||||
return($this->nptr);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Recupera el nombre del nodo
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function NombreNodo(){
|
||||
$infonodo=$this->Infonodo();
|
||||
$trozos=split(" ",$infonodo);
|
||||
return ($trozos[0]);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Recupera la información del nodo actual
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Infonodo(){
|
||||
if ($this->buffer==null) return(false); // No existe documento XML
|
||||
$lon=$this->nptr;
|
||||
while ($lon<strlen($this->buffer))
|
||||
if ('>'==substr($this->buffer,++$lon,1)) break;
|
||||
$info=trim(substr($this->buffer,$this->nptr,$lon-$this->nptr));
|
||||
$info=str_replace("[","<",$info);
|
||||
$info=str_replace("]",">",$info);
|
||||
return $info;
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Recorre el arbol de nodos del documento XML y para cada nodo genera un evento que se
|
||||
puede capturar a través de una funcion que tiene esta forma:
|
||||
fNodoXML(nivel,infonodo) donde:
|
||||
- nivel es el nivel de profundidad del nodo (en base 0)
|
||||
- infonodo es toda la información contenida en el nodo.
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function RecorreArboXML(){
|
||||
if (!$this->NodoRaiz()) return; // No existe documento XML que analizar
|
||||
$this->_arbolXmlrecur(0);
|
||||
}
|
||||
// -------------------------------------------------------------------------------------
|
||||
// Recorrido recursivo del arbol XML
|
||||
// -------------------------------------------------------------------------------------
|
||||
function _arbolXmlrecur($nivel){
|
||||
do{
|
||||
$infonodo=$this->Infonodo();
|
||||
fNodoXML($nivel,$infonodo);
|
||||
$gnptr=$this->nptr;
|
||||
if ($this->PrimerNodoHijo())
|
||||
$this->_arbolXmlrecur($nivel+1);
|
||||
$this->nptr=$gnptr;
|
||||
}while($this->SiguienteNodoHermano());
|
||||
}
|
||||
/*------------------------------------------------------------------------------------------------
|
||||
Elimina un atributo de la información del nodo
|
||||
Parametros:
|
||||
- nombreatributo:El nombre del atributo
|
||||
- info: La información del Nodo
|
||||
------------------------------------------------------------------------------------------------*/
|
||||
function EliminaAtributo($nombreatributo,$info){
|
||||
$nada="";
|
||||
return($this->TomaAtributo($nombreatributo,&$nada,$info,true));
|
||||
}
|
||||
/*------------------------------------------------------------------------------------------------
|
||||
Recupera el valor del atributo y lo elimina de la información del nodo
|
||||
Parametros:
|
||||
- nombreatributo:El nombre del atributo
|
||||
- puntero: Referencia a la variable que contendrá el valor del atributo
|
||||
- info: La información del Nodo
|
||||
------------------------------------------------------------------------------------------------*/
|
||||
function TomaAtributoEspecial($nombreatributo,&$puntero,$info){
|
||||
return($this->TomaAtributo($nombreatributo,&$puntero,$info,true));
|
||||
}
|
||||
/*------------------------------------------------------------------------------------------------
|
||||
Recupera el valor del atributo
|
||||
Parametros:
|
||||
- nombreatributo:El nombre del atributo
|
||||
- puntero: Referencia a la variable que contendrá el valor del atributo
|
||||
- info: La información del Nodo
|
||||
- sw: Si vale true el atributo se eliminará de la información del nodo
|
||||
------------------------------------------------------------------------------------------------*/
|
||||
function TomaAtributo($nombreatributo,&$puntero,$info,$swkill=false){
|
||||
$doblescomillas='"';
|
||||
$strAtributo=" ".$nombreatributo."=";
|
||||
$pos=strpos($info,$strAtributo);
|
||||
if (!$pos){
|
||||
$puntero=null;
|
||||
return($info);
|
||||
}
|
||||
$pos+=strlen($strAtributo); // Avanza hasta el signo igual
|
||||
$posa=$pos; // Primera posición del valor del atributo
|
||||
$swcomillas=false;
|
||||
while ($pos<strlen($info)){
|
||||
if ($doblescomillas==substr($info,$pos,1)) $swcomillas=!$swcomillas;
|
||||
if (' '==substr($info,$pos,1) || '> '==substr($info,$pos,1))
|
||||
if (!$swcomillas) break;
|
||||
$pos++;
|
||||
}
|
||||
$posb=$pos;
|
||||
$valoratributo=substr($info,$posa,$posb-$posa);
|
||||
if ($swkill) // Eliminar el atributo de la la cadena
|
||||
$info=str_replace($strAtributo.$valoratributo,"",$info); // Elimina el atributo de la información
|
||||
if ($doblescomillas==substr($valoratributo,0,1)) // Elimina las comillas
|
||||
$valoratributo=str_replace($doblescomillas,"",$valoratributo);
|
||||
$puntero=$valoratributo;
|
||||
return($info);
|
||||
}
|
||||
} // Fin de la clase
|
||||
?>
|
|
@ -1,565 +0,0 @@
|
|||
// ************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fichero: ArbolVistaXML.js
|
||||
// Este fichero implementa las funciones javascript de la clase ArbolVistaXML.php
|
||||
// *************************************************************************************************
|
||||
var botonraton=null; // Botón presionado
|
||||
var currentNodo=""; // Nodo actual
|
||||
var currentpathimg=""; // Path por defecto de las imágenes de signo
|
||||
var gLiteralcolor; // Color nodo vista para restablecer
|
||||
var gLiteralbackground; // Fondo color nodo vista para restablecer
|
||||
//________________________________________________________________________________________________________
|
||||
// definicion dela clase triada
|
||||
//________________________________________________________________________________________________________
|
||||
function NodoVista(){
|
||||
this.nivel=0; // Profundidad del nodo
|
||||
this.imgsigno=null; // Objeto IMG (Imagen de signo de la celda vista) O SPAN si el nodo vista no tiene hijos
|
||||
this.literal=null; // Objeto SPAN (Literal de la celda vista)
|
||||
|
||||
this.CeldaVista=null; // El objeto TABLE que contiene la imagen de signo y el literal)
|
||||
this.Nodo=null; // El nodo en si (Objeto TR que contiene el objeto TABLE celda vista final)
|
||||
this.ArbolHijos=null; // El arbol conteniendo todos los nodos hijos ( Si nulo no tiene hijos)(Objeto TR)
|
||||
this.NodoPadre=null; // El nodo padre (Objeto TR que contiene el objeto TABLE celda vista final, del padre)
|
||||
this.ArbolHijosNodoPadre=null; // El arbol del padre conteniendo los nodos hijos(Objeto TR)
|
||||
this.siguienteHermano=null; // El nodo hermano siguiente ( Si nulo es el último hermano)(Objeto TR)
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Devuelve el estado del nodo 0: Contraido 1:Desplegado
|
||||
//____________________________________________________________________________
|
||||
this.estadoNodo= function(){
|
||||
var signoimg=this.imgsigno.getAttribute("value");
|
||||
var estado;
|
||||
switch(signoimg){
|
||||
case "menos_t" :
|
||||
case "menos_c" :
|
||||
estado=1;
|
||||
break;
|
||||
case "mas_t" :
|
||||
case "mas_c" :
|
||||
estado=0;
|
||||
break;
|
||||
default:
|
||||
estado=-1;
|
||||
}
|
||||
return(estado);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Devuelve el segundo dato de una cadena con formato xxxxx-xxx que es id del nodo vista
|
||||
//____________________________________________________________________________
|
||||
this.toma_identificador= function(){
|
||||
if(this.literal==null) return(null);
|
||||
var cadena=this.literal.getAttribute("id");
|
||||
var iditem=cadena.split("-") // Toma el identificador
|
||||
return(iditem[1]);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Devuelve el primer dato de una cadena con formato xxxxx-xxx que es sufijo del nodo vista
|
||||
//____________________________________________________________________________
|
||||
this.toma_sufijo= function(){
|
||||
if(this.literal==null) return(null);
|
||||
var cadena=this.literal.getAttribute("id");
|
||||
var iditem=cadena.split("-") // Toma el identificador
|
||||
return(iditem[0]);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Devuelve el literal de un nodo vista
|
||||
//____________________________________________________________________________
|
||||
this.toma_infonodo= function(){
|
||||
if(this.literal==null) return(null);
|
||||
return(this.literal.innerHTML);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Devuelve el literal de un nodo vista
|
||||
//____________________________________________________________________________
|
||||
this.pone_infonodo= function(lit){
|
||||
this.literal.innerHTML=lit;
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Devuelve true si el nodo tiene hijos,false en caso contrario
|
||||
//____________________________________________________________________________
|
||||
this.TieneHijos= function(){
|
||||
return(this.ArbolHijos!=null);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Devuelve true si el nodo es el último, false en caso contrario
|
||||
//____________________________________________________________________________
|
||||
this.UltimoHermano= function(){
|
||||
return(this.siguienteHermano==null);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Devuelve el nodo vista padre
|
||||
//____________________________________________________________________________
|
||||
this.PapaNodo= function(){
|
||||
if(this.NodoPadre==null) return(null);
|
||||
var oTABLE=this.NodoPadre.getElementsByTagName('TABLE')[0];
|
||||
return(TomaDatosNodo(oTABLE));
|
||||
}
|
||||
// Fin de la clase
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Devuelve un nodo vista
|
||||
// Parametro:
|
||||
// o: Objeto que puede ser la imagen de signo o el literal de una de las lineas del arbolVista
|
||||
//________________________________________________________________________________________________________
|
||||
function TomaDatosNodo(o){
|
||||
var nodo=new NodoVista();
|
||||
|
||||
while(o.tagName!="TABLE" )
|
||||
o=o.parentNode;
|
||||
nodo.CeldaVista=o;
|
||||
var TAnchor=nodo.CeldaVista.getElementsByTagName('A');
|
||||
if(TAnchor.length==2){ // Imagen de signo pulsable
|
||||
nodo.imgsigno=TAnchor[0].childNodes[0];
|
||||
nodo.literal=TAnchor[1].childNodes[0];
|
||||
}
|
||||
else{
|
||||
var TSpan=nodo.CeldaVista.getElementsByTagName('SPAN');
|
||||
nodo.imgsigno=TSpan[0].childNodes[0];
|
||||
nodo.literal=TAnchor[0].childNodes[0];
|
||||
}
|
||||
while(o.tagName!="TR" )
|
||||
o=o.parentNode;
|
||||
nodo.Nodo=o;
|
||||
|
||||
while(o.tagName!="TABLE" )
|
||||
o=o.parentNode;
|
||||
var Mnivel=o.getAttribute("id").split("-")
|
||||
nodo.nivel=Mnivel[1]
|
||||
|
||||
while(o.tagName!="TR" )
|
||||
o=o.parentNode;
|
||||
nodo.ArbolHijosNodoPadre=o;
|
||||
|
||||
if(parseInt(nodo.nivel)>0){
|
||||
o=o.previousSibling;
|
||||
while(o.nodeType!=1 )
|
||||
o=o.previousSibling
|
||||
nodo.NodoPadre=o;
|
||||
}
|
||||
else
|
||||
nodo.NodoPadre=null; // Es el primer nodo
|
||||
var o=nodo.Nodo;
|
||||
var auxsplit=o.getAttribute("id");
|
||||
var idTR=auxsplit.split("-") [0];
|
||||
o=o.nextSibling
|
||||
while(o!=null && o.nodeType!=1 )
|
||||
o=o.nextSibling
|
||||
if(o==null){ // Es el último hermano y no tiene hijos
|
||||
nodo.ArbolHijos=null;
|
||||
nodo.siguienteHermano=null;
|
||||
return(nodo);
|
||||
}
|
||||
var auxsplit=o.getAttribute("id");
|
||||
var idTRhijo=auxsplit.split("-") [0];
|
||||
if(idTR==idTRhijo) { // El nodo no tiene hiijos y no es último hermano
|
||||
nodo.ArbolHijos=null;
|
||||
nodo.siguienteHermano=o;
|
||||
return(nodo);
|
||||
}
|
||||
nodo.ArbolHijos=o;
|
||||
o=o.nextSibling
|
||||
while(o!=null && o.nodeType!=1)
|
||||
o=o.nextSibling
|
||||
if(o==null){ // El nodo tiene hijos y es ultimo hermano
|
||||
nodo.siguienteHermano=null;
|
||||
return(nodo);
|
||||
}
|
||||
nodo.siguienteHermano=o; // El nodo tiene hijos y no es último hermano
|
||||
return(nodo);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Gestiona el despliegue y contracción de nodovs
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function clickNodo(nodov,pathimg){
|
||||
var signoimg=nodov.imgsigno.getAttribute("value");
|
||||
switch(signoimg){
|
||||
case "menos_t" :
|
||||
nodov.imgsigno.setAttribute("value","mas_t",null);
|
||||
nodov.imgsigno.setAttribute("src",pathimg+"/mas_t.gif",null);
|
||||
nodov.ArbolHijos.style.display="none"
|
||||
break;
|
||||
case "menos_c" :
|
||||
nodov.imgsigno.setAttribute("value","mas_c",null);
|
||||
nodov.imgsigno.setAttribute("src",pathimg+"/mas_c.gif",null);
|
||||
if (nodov.nivel==0)
|
||||
nodov.imgsigno.setAttribute("src",pathimg+"/mas_root.gif",null);
|
||||
nodov.ArbolHijos.style.display="none"
|
||||
break;
|
||||
case "mas_t" :
|
||||
nodov.imgsigno.setAttribute("value","menos_t",null);
|
||||
nodov.imgsigno.setAttribute("src",pathimg+"/menos_t.gif",null);
|
||||
nodov.ArbolHijos.style.display="block"
|
||||
break;
|
||||
case "mas_c" :
|
||||
nodov.imgsigno.setAttribute("value","menos_c",null);
|
||||
nodov.imgsigno.setAttribute("src",pathimg+"/menos_c.gif",null);
|
||||
if (nodov.nivel==0)
|
||||
nodov.imgsigno.setAttribute("src",pathimg+"/menos_root.gif",null);
|
||||
nodov.ArbolHijos.style.display="block"
|
||||
break;
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Gestiona el despliegue y contracción de nodos a través de la imagen del nodo
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function clickImagenSigno(oIMG,pathimg){
|
||||
currentpathimg=pathimg;
|
||||
var nodov=TomaDatosNodo(oIMG);
|
||||
clickNodo(nodov,pathimg);
|
||||
if (EsAncestro(nodov,currentNodo))
|
||||
resalta(nodov);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Gestiona el despliegue y contracción de nodos a través del literal del nodo
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function clickLiteralNodo(oLIT,pathimg){
|
||||
var nodov=TomaDatosNodo(oLIT);
|
||||
resalta(nodov);
|
||||
if(nodov.imgsigno==null) return;
|
||||
|
||||
if(pathimg==null){
|
||||
var signoimg=nodov.imgsigno.getAttribute("src");
|
||||
var p=signoimg.lastIndexOf("/");
|
||||
var pathimg=signoimg.substring(0,p);
|
||||
currentpathimg=pathimg;
|
||||
}
|
||||
var signoimg=nodov.imgsigno.getAttribute("value");
|
||||
var signo=signoimg.split("_")
|
||||
if(botonraton==1){
|
||||
if (signo[0]=="mas" || signo[0]=="menos" ) clickNodo(nodov,pathimg);
|
||||
}
|
||||
else{
|
||||
if (signo[0]=="mas" ) clickNodo(nodov,pathimg);
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Resalta el nodo vista seleccionado y lo pone como nodo vista actual
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function resalta(nodov){
|
||||
if(currentNodo==nodov) return;
|
||||
if (currentNodo){
|
||||
currentNodo.literal.style.color=gLiteralcolor;
|
||||
currentNodo.literal.style.backgroundColor=gLiteralbackground;
|
||||
}
|
||||
gLiteralcolor=nodov.literal.style.color; // Guarda el color del nodo
|
||||
gLiteralbackground=nodov.literal.style.backgroundColor; // Guarda el background del nodo
|
||||
|
||||
nodov.literal.style.color="#FFFFFF"; // Blanco
|
||||
nodov.literal.style.backgroundColor="#0a266a"; // Azul marino
|
||||
currentNodo=nodov;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Deja de resaltar un nodo vista
|
||||
//____________________________________________________________________________
|
||||
function desresalta(nodov){
|
||||
nodov.literal.style.color=nodov.Literalcolor;
|
||||
nodov.literal.style.backgroundColor=nodov.Literalbackground;
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Averigua si el primer nodo vista es ancestro del segundo
|
||||
//____________________________________________________________________________
|
||||
function EsAncestro(nodoA,nodoH){
|
||||
if(nodoH==null) return(false);
|
||||
var NodoAncestro=nodoA.ArbolHijos;
|
||||
var NodoHijo=nodoH.Nodo;
|
||||
while(NodoHijo!=null){
|
||||
if(NodoHijo==NodoAncestro) return(true);
|
||||
NodoHijo=NodoHijo.parentNode;
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Despliega un nivel el nodo indicado
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function despliega(o,pathimg){
|
||||
var nodov=TomaDatosNodo(o);
|
||||
clickNodo(nodov,pathimg);
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Despliega el nodo indicado ( desde la pagina
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function DespliegaNodo(lit,id){
|
||||
var o=document.getElementById(lit+"-"+id);
|
||||
if(o!=null){
|
||||
var ancestro= TomaDatosNodo(o);
|
||||
resalta(ancestro);
|
||||
while(ancestro!=null){
|
||||
if(ancestro.estadoNodo()==0) // Nodo contraido
|
||||
clickNodo(ancestro,currentpathimg);
|
||||
ancestro=ancestro.PapaNodo();
|
||||
}
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Inserta un nodo en el árbol
|
||||
// Especificaciones:
|
||||
// Los parámetros recibidos son:
|
||||
// - nodov: Nodo vista
|
||||
// - tablanodo: Tabla nodo generada para la nueva celda vista
|
||||
//____________________________________________________________________________
|
||||
function InsertaNodo(nodov,tablanodo){
|
||||
var nwceldavista=CreaCeldaVista(nodov,tablanodo);
|
||||
var nwTR = document.createElement('TR');
|
||||
nwTR.id="TRNodo-0";
|
||||
var nwTD = document.createElement('TD');
|
||||
nwTD.innerHTML=nwceldavista;
|
||||
nwTR.appendChild(nwTD);
|
||||
|
||||
if(!nodov.TieneHijos()){
|
||||
CreaNodoHijo(nodov);
|
||||
if(parseInt(nodov.nivel)==0){ // Nodo raiz
|
||||
nodov.imgsigno.setAttribute("value","menos_c",null);
|
||||
nodov.imgsigno.setAttribute("src",currentpathimg+"/menos_root.gif",null);
|
||||
}
|
||||
else{
|
||||
if(nodov.UltimoHermano()){
|
||||
nodov.imgsigno.setAttribute("value","menos_c",null);
|
||||
nodov.imgsigno.setAttribute("src",currentpathimg+"/menos_c.gif",null);
|
||||
}
|
||||
else{
|
||||
nodov.imgsigno.setAttribute("value","menos_t",null);
|
||||
nodov.imgsigno.setAttribute("src",currentpathimg+"/menos_t.gif",null);
|
||||
}
|
||||
}
|
||||
var ATTonclick='clickImagenSigno(this,' + "'"+currentpathimg+"'"+','+nodov.nivel+');';
|
||||
nodov.imgsigno.setAttribute("onclick",ATTonclick,null);
|
||||
nodov.imgsigno.setAttribute("border","0",null);
|
||||
var oSPAN=nodov.imgsigno.parentNode;
|
||||
var htmlIMG=oSPAN.innerHTML;
|
||||
TDpadre=oSPAN.parentNode;
|
||||
TDpadre.innerHTML='<A href="#">'+htmlIMG+'</A>';
|
||||
}
|
||||
var pivoteNodo=nodov.ArbolHijos;
|
||||
var nodoTD = pivoteNodo.childNodes[0];;
|
||||
var nodoTABLE=nodoTD.childNodes[0];
|
||||
var nodoTBODY=nodoTABLE.childNodes[0];
|
||||
var nodoTR=nodoTBODY.childNodes[0];
|
||||
if(nodoTR!=null)
|
||||
nodoTBODY.insertBefore(nwTR,nodoTR);
|
||||
else
|
||||
nodoTBODY.appendChild(nwTR);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Monta y devuelve el código HTML de la estructura de una celda vista
|
||||
// Los parámetros recibidos son:
|
||||
// - pivoteNodo: Nodo vista
|
||||
// - tablanodo: Tabla nodo generada para la nueva celda vista
|
||||
//____________________________________________________________________________
|
||||
function CreaCeldaVista(nodov,tablanodo){
|
||||
var nodoTD = document.createElement('TD');
|
||||
nodoTD.innerHTML=tablanodo;
|
||||
var nodoTABLE=nodoTD.childNodes[0];
|
||||
var nodoTBODY=nodoTABLE.childNodes[0];
|
||||
var nodoTBODYTR=nodoTBODY.childNodes[0];
|
||||
var oIMG=nodoTBODYTR.getElementsByTagName('IMG')[0];
|
||||
var HTMLinner=nodoTBODYTR.innerHTML;
|
||||
|
||||
if(nodov.TieneHijos()){
|
||||
var patron = new RegExp("nada_c","gi")
|
||||
HTMLinner=HTMLinner.replace(patron,"nada_t");
|
||||
}
|
||||
else{
|
||||
var patron = new RegExp("nada_t","gi")
|
||||
HTMLinner=HTMLinner.replace(patron,"nada_c");
|
||||
}
|
||||
var auxnodo=nodov;
|
||||
var nwHTMLinner="";
|
||||
var img="";
|
||||
while(auxnodo!=null){
|
||||
(auxnodo.UltimoHermano())? img="nada.gif" : img="nada_l.gif";
|
||||
nwHTMLinner='<TD width="3px"></TD><TD width="16px"><IMG src="../images/signos/'+img+'" width="16px" height="16px" ></TD>'+nwHTMLinner;
|
||||
auxnodo=auxnodo.PapaNodo();
|
||||
}
|
||||
nwHTMLinner='<TABLE border=0 cellspacing=0 cellpadding=0><TR height="16px">'+nwHTMLinner+HTMLinner+"</TR></TABLE>"; // Contenido de la tabla del nodo literal
|
||||
return(nwHTMLinner);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Crea un nuevo nodo Hijo (objeto TABLE)
|
||||
// Parámetros:
|
||||
// - nodov: Un nodo vista
|
||||
//____________________________________________________________________________
|
||||
function CreaNodoHijo(nodov){
|
||||
var nivel=parseInt(nodov.nivel)+1;
|
||||
var nTR=document.createElement('TR');
|
||||
nTR.id="TRNodoHijo-0";
|
||||
var nTD=document.createElement('TD');
|
||||
nTD.innerHTML='<TABLE with="100%"id="tablanivel-'+nivel+'" border="0" cellspacing="0" cellpadding="0"><TBODY></TBODY></TABLE>';
|
||||
nTR.appendChild(nTD);
|
||||
|
||||
var pivoteNodo=nodov.Nodo.parentNode;
|
||||
if(nodov.UltimoHermano()){
|
||||
pivoteNodo.appendChild(nTR); // Para insertar al final
|
||||
}
|
||||
else{
|
||||
pivoteNodo.insertBefore(nTR,nodov.siguienteHermano)
|
||||
}
|
||||
nodov.ArbolHijos=nTR;
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Inserta un nodo en el árbol
|
||||
// Especificaciones:
|
||||
// Los parámetros recibidos son:
|
||||
// - nodov: Nodo vista
|
||||
//____________________________________________________________________________
|
||||
function EliminaNodo(nodov){
|
||||
var swuh=nodov.UltimoHermano();
|
||||
var pn=nodov.Nodo.parentNode; // Nodo padre
|
||||
var papa=nodov.PapaNodo(); // Nodo vista padre
|
||||
|
||||
if(nodov.TieneHijos())
|
||||
pn.removeChild(nodov.ArbolHijos); // Elimina arbol hijo
|
||||
pn.removeChild(nodov.Nodo); // Elimina Nodo
|
||||
|
||||
var antHermano=pn.lastChild
|
||||
if(antHermano==null){ // El nodo padre no tiene más hijos
|
||||
var pn=papa.ArbolHijos.parentNode; // Nodo padre
|
||||
pn.removeChild(papa.ArbolHijos); // Elimina arbol hijo
|
||||
ChgSignoPadreEliminaNodo(papa.imgsigno);
|
||||
}
|
||||
else{
|
||||
if(swuh){ // Si era el último hermano ...
|
||||
var auxsplit=antHermano.getAttribute("id");
|
||||
var idTR=auxsplit.split("-") [0];
|
||||
if(idTR=="TRNodoHijo"){
|
||||
antHermano=antHermano.previousSibling;
|
||||
while(antHermano.nodeType!=1 )
|
||||
antHermano=antHermano.previousSibling
|
||||
var TAnchor=antHermano.getElementsByTagName('A');
|
||||
if(TAnchor.length==2) // Imagen de signo pulsable
|
||||
var oIMG=TAnchor[0].childNodes[0];
|
||||
}
|
||||
else{
|
||||
var TSpan=antHermano.getElementsByTagName('SPAN');
|
||||
var oIMG=TSpan[0].childNodes[0];
|
||||
}
|
||||
var nh=TomaDatosNodo(oIMG);
|
||||
ChgSignoEliminaNodo(oIMG);
|
||||
if(nh.TieneHijos())
|
||||
ChgSignoNivel(nh.ArbolHijos,nh.nivel);
|
||||
}
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Cambia la imagen de signo del hermano anterior de un nodo eliminado
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function ChgSignoEliminaNodo(imgsigno){
|
||||
var signoimg=imgsigno.getAttribute("value");
|
||||
switch(signoimg){
|
||||
case "menos_t" :
|
||||
imgsigno.setAttribute("value","menos_c",null);
|
||||
imgsigno.setAttribute("src",currentpathimg+"/menos_c.gif",null);
|
||||
break;
|
||||
case "mas_t" :
|
||||
imgsigno.setAttribute("value","mas_c",null);
|
||||
imgsigno.setAttribute("src",currentpathimg+"/mas_c.gif",null);
|
||||
break;
|
||||
case "nada_t" :
|
||||
imgsigno.setAttribute("value","nada_c",null);
|
||||
imgsigno.setAttribute("src",currentpathimg+"/nada_c.gif",null);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Cambia la imagen de signo del nodo padre de un nodo eliminado ( unico hijo)
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function ChgSignoPadreEliminaNodo(imgsigno){
|
||||
var signoimg=imgsigno.getAttribute("value");
|
||||
switch(signoimg){
|
||||
case "menos_t" :
|
||||
imgsigno.setAttribute("value","nada_t",null);
|
||||
imgsigno.setAttribute("src",currentpathimg+"/nada_t.gif",null);
|
||||
QuitaANCHOR(imgsigno);
|
||||
break;
|
||||
case "menos_c" :
|
||||
imgsigno.setAttribute("value","nada_c",null);
|
||||
imgsigno.setAttribute("src",currentpathimg+"/nada_c.gif",null);
|
||||
QuitaANCHOR(imgsigno);
|
||||
break;
|
||||
case "mas_t" :
|
||||
imgsigno.setAttribute("value","nada_t",null);
|
||||
imgsigno.setAttribute("src",currentpathimg+"/nada_t.gif",null);
|
||||
QuitaANCHOR(imgsigno);
|
||||
break;
|
||||
case "mas_c" :
|
||||
imgsigno.setAttribute("value","nada_c",null);
|
||||
imgsigno.setAttribute("src",currentpathimg+"/nada_c.gif",null);
|
||||
QuitaANCHOR(imgsigno);
|
||||
break;
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Cambia la imagen de un determinado nivel
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function QuitaANCHOR(oIMG){
|
||||
var TAnchor=oIMG.parentNode;
|
||||
var oHTML=TAnchor.innerHTML;
|
||||
var oTD=TAnchor.parentNode;
|
||||
oTD.innerHTML="<SPAN>"+oHTML+"</SPAN>";
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
// Cambia la imagen de un determinado nivel
|
||||
//-----------------------------------------------------------------------------------------------------------------------
|
||||
function ChgSignoNivel(arbolv,n){
|
||||
if(arbolv==null) return
|
||||
var nodoTD =arbolv.childNodes[0];
|
||||
var nodoTABLE=nodoTD.childNodes[0];
|
||||
var nodoTBODY=nodoTABLE.childNodes[0];
|
||||
var oTRs=nodoTBODY.childNodes;
|
||||
for(var i=0;i<oTRs.length;i++){
|
||||
var auxsplit=oTRs[i].getAttribute("id");
|
||||
var idTR=auxsplit.split("-") [0];
|
||||
if(idTR=="TRNodoHijo"){
|
||||
ChgSignoNivel(oTRs[i],n)
|
||||
}
|
||||
else{
|
||||
var oTABLE=oTRs[i].getElementsByTagName('TABLE');
|
||||
var oIMGs=oTABLE[0].getElementsByTagName('IMG');
|
||||
oIMGs[n].setAttribute("src",currentpathimg+"/nada.gif",null);
|
||||
}
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Se ejecuta cada vez que se mueve el puntero del ratón. Se usa para desmarca
|
||||
// cualquier item de menu contextual que estuviese activo
|
||||
//____________________________________________________________________________
|
||||
function click_de_raton_prov(e){
|
||||
if(IE){
|
||||
botonraton=event.button
|
||||
event.returnValue=true;
|
||||
return;
|
||||
}
|
||||
if(NS){
|
||||
botonraton=e.which;
|
||||
e.returnValue=true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Recupera el navegador utilizado
|
||||
//____________________________________________________________________________
|
||||
var IE=(navigator.appName=="Microsoft Internet Explorer");
|
||||
var NS=(navigator.appName=="Netscape");
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Redirecciona el evento onmousedown a la función de usuario especificada.
|
||||
//____________________________________________________________________________
|
||||
document.onmousedown = click_de_raton_prov; // Redefine el evento onmousedown
|
||||
if(NS) document.captureEvents(Event.MOUSEDOWN | Event.MOUSEMOVE | Event.MOUSEUP)
|
||||
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
// ********************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Febrero-2005
|
||||
// Nombre del fichero: consolaremota.php
|
||||
// Descripción : Clase para llamar páginas web usando metodología AJAX
|
||||
// ********************************************************************************
|
||||
var _url;
|
||||
var _fun;
|
||||
var oXMLHttpRequest;
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// LLama a la página
|
||||
//
|
||||
// Parámetros:
|
||||
//
|
||||
// url // Url de la página a la que se llama
|
||||
// fun // Función a la que se llama despues de descargarse la página
|
||||
//____________________________________________________________________________
|
||||
function CallPage(url,prm,fun,met){
|
||||
_url=url;
|
||||
_fun=fun;
|
||||
|
||||
if (window.XMLHttpRequest) {
|
||||
oXMLHttpRequest= new XMLHttpRequest();
|
||||
oXMLHttpRequest.onreadystatechange = procesaoXMLHttpRequest;
|
||||
oXMLHttpRequest.open("POST",_url, true);
|
||||
oXMLHttpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
|
||||
oXMLHttpRequest.send(prm);
|
||||
} else if (window.ActiveXObject) {
|
||||
isIE = true;
|
||||
try {
|
||||
oXMLHttpRequest= new ActiveXObject("Msxml2.XMLHTTP");
|
||||
} catch (e) {
|
||||
try {
|
||||
oXMLHttpRequest= new ActiveXObject("Microsoft.XMLHTTP");
|
||||
} catch (E) {
|
||||
oXMLHttpRequest= false;
|
||||
}
|
||||
}
|
||||
if (oXMLHttpRequest) {
|
||||
oXMLHttpRequest.onreadystatechange =procesaoXMLHttpRequest;
|
||||
oXMLHttpRequest.open("POST",_url, true);
|
||||
oXMLHttpRequest.setRequestHeader('Content-Type','application/x-www-form-urlencoded')
|
||||
oXMLHttpRequest.send(prm);
|
||||
}
|
||||
}
|
||||
}
|
||||
//_____________________________________________________________________________________
|
||||
function procesaoXMLHttpRequest(){
|
||||
if (oXMLHttpRequest.readyState == 4) {
|
||||
if (oXMLHttpRequest.status == 200) {
|
||||
var fcbk=_fun+"(oXMLHttpRequest.responseText)";
|
||||
eval(fcbk)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,395 +0,0 @@
|
|||
// ***************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fichero: menucontextual.js
|
||||
// Este fichero implementa las funciones javascript de la clase MenuContextual
|
||||
// ***************************************************************************
|
||||
var ctx_grissistema="#d4d0c8"
|
||||
var ctx_azulmarino="#0a266a";
|
||||
var ctx_blanco="#ffffff";
|
||||
var ctx_negro="#000000";
|
||||
var ctx_grissombra="#808080";
|
||||
|
||||
gmenuctx=new Array(); // Guarda el último menu flotante
|
||||
var idxmnu=0 // Indice de los menus flotantes
|
||||
var currentItem=null;
|
||||
var currentPadresubmenu;
|
||||
var currentPadreY;
|
||||
|
||||
var ClickX=null // Coordenada x del evento click del boton derecho
|
||||
var ClickY=null // Coordenada y del evento click del boton derecho
|
||||
var botonraton=null;
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Esta función muestra un menu contextual
|
||||
// Parámetros:
|
||||
// - x: Coordenada x de referencia
|
||||
// - y: Coordenada y de referencia
|
||||
// - menuctx: Objeto DIV contenedor del menu contextual
|
||||
//____________________________________________________________________________
|
||||
function muestra_contextual(x,y,menuctx){
|
||||
var margen=0
|
||||
dpzx=16
|
||||
dpzy=16
|
||||
wtop=calculatop_ctx(y,dpzy,margen,menuctx) // Calcula posición del menu contextual
|
||||
wleft=calculaleft_ctx(x,dpzx,margen,menuctx)
|
||||
ftop=wtop+parseInt(document.body.scrollTop) // Tiene en cuenta el scrolling
|
||||
fleft=wleft+parseInt(document.body.scrollLeft)
|
||||
menuctx.style.top=ftop
|
||||
menuctx.style.left=fleft
|
||||
menuctx.style.visibility="visible"
|
||||
menuctxSetSelectedIndex(menuctx,-1) // Coloca el nuevo indice
|
||||
gmenuctx[idxmnu++]=menuctx;
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Calcula coordenada top para el menu contextual que se mostrará.
|
||||
// Parametros:
|
||||
// - oriy : Coordenada Y del objeto que provoca el evento
|
||||
// - dpzy : Desplazamiento sobre el eje y
|
||||
// - margen : Margen para que el menu aparezca un poco separado del ese objeto
|
||||
// - menuctx: El menu (objeto DIV) que se mostrará
|
||||
//____________________________________________________________________________
|
||||
function calculatop_ctx(oriy,dpzy,margen,menuctx){ // Calcula Y del menu contextual
|
||||
largodiv=parseInt(menuctx.offsetHeight);
|
||||
var wtop=oriy+dpzy+margen
|
||||
if (wtop+largodiv>parseInt(document.body.clientHeight)){
|
||||
var nwtop=oriy-dpzy-margen-largodiv
|
||||
if (nwtop>0) wtop=nwtop
|
||||
}
|
||||
return(wtop)
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Calcula coordenada left para el menu contextual que se mostrará.
|
||||
// Parametros:
|
||||
// - orix : Coordenada X del objeto que provoca el evento
|
||||
// - dpzx : Desplazamiento sobre el eje x
|
||||
// - margen : Margen para que el menu aparezca un poco separado del ese objeto
|
||||
// - menuctx: El menu (objeto DIV) que se mostrará
|
||||
//____________________________________________________________________________
|
||||
function calculaleft_ctx(orix,dpzx,margen,menuctx){ // Calcula Y del menu contextual
|
||||
anchodiv=parseInt(menuctx.offsetWidth)
|
||||
var wleft=orix+dpzx+margen
|
||||
var maximodpl=parseInt(document.body.clientWidth)
|
||||
if (wleft+anchodiv>maximodpl){ // Si no cabe a la derecha
|
||||
var nwleft=orix-dpzx-margen-anchodiv // lo intenta a la izda.
|
||||
if (nwleft>0) wleft=nwleft
|
||||
else{
|
||||
wleft=maximodpl-dpzx-margen-anchodiv;
|
||||
if(wleft<document.body.scrollLeft) wleft=document.body.scrollLeft+16
|
||||
}
|
||||
}
|
||||
return(wleft)
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Esta función devuelve el objeto DIV al que pertenece el item <TR>
|
||||
// Parametros:
|
||||
// - o: El objeto <TR>
|
||||
//____________________________________________________________________________
|
||||
function contextual(o){
|
||||
while(o.tagName!="DIV")
|
||||
o=o.parentNode
|
||||
return(o)
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Esta función devuelve el objeto <TR> apuntado por el indice
|
||||
// Parametros:
|
||||
// - o: El objeto TR
|
||||
// - idx: el indice del item, si es nulo se devuelve el item(objeto TR), seleccionado
|
||||
//____________________________________________________________________________
|
||||
function menuctxSelectedItem(o,idx){
|
||||
var oDIV=contextual(o); // Se asegura que el objeto de inicio es DIV
|
||||
var oTABLE=oDIV.childNodes[0]; // objeto TABLE
|
||||
var oINPUT=oDIV.childNodes[1]; // objeto INPUT
|
||||
var oTBODY=oTABLE.getElementsByTagName('TBODY')[0];
|
||||
if(idx==null) // No se especificó indice, devuelve el item seleccionado
|
||||
idx=oINPUT.getAttribute("value");
|
||||
var oTRS=oTBODY.getElementsByTagName('TR');
|
||||
for (var i=0;i<oTRS.length;i++){
|
||||
var oTR=oTRS[i];
|
||||
if(oTR.getAttribute("id")==idx) return(oTR);
|
||||
}
|
||||
return(null);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Esta función actualiza el nuevo el indice del item seleccionado
|
||||
// Parametros:
|
||||
// - o: El objeto DIV que contiene el menu contextual o un item(objeto TR) de él
|
||||
// - i: El valor del indice
|
||||
//____________________________________________________________________________
|
||||
function menuctxSetSelectedIndex(o,idx){
|
||||
var oDIV=contextual(o); // Se asegura que el objeto de inicio es DIV
|
||||
var oINPUT=oDIV.childNodes[1];
|
||||
oINPUT.value=idx;
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Esta función devuelve el indice del item seleccionado
|
||||
// Parametros:
|
||||
// -o : El objeto DIV que contiene el menu contextual o un item(objeto TR) de él
|
||||
//____________________________________________________________________________
|
||||
function menuctxSelectedIndex(o){
|
||||
var oDIV=contextual(o); // Se asegura que el objeto de inicio es DIV
|
||||
var oINPUT=oDIV.childNodes[1];
|
||||
return(oINPUT.value);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
// Se ejecuta cuando se posiciona el cursor dentro de un item de algún menú contextual.
|
||||
// Parámetros:
|
||||
// - o: El item (objeto TR) donde se ha colocado el ratón
|
||||
//____________________________________________________________________________
|
||||
function sobre_contextual(o){
|
||||
var oDIV=contextual(o) // Se asegura que el objeto de inicio es DIV
|
||||
var idx=menuctxSelectedIndex(oDIV) // Indice del Item anterior seleccionado
|
||||
var nwid=o.getAttribute("id");
|
||||
if (parseInt(idx)!=parseInt(nwid)){ // Si cambio de item
|
||||
if(idx>0){ // Si existía item anterior seleccionado
|
||||
desmarcar_item(oDIV,idx) // Desmarca item anterior
|
||||
}
|
||||
marcar_item(o); // Marca el actual item
|
||||
currentItem=o;
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Hace resaltar el item del menu contextual donde se coloca el cursor.
|
||||
// Si este item tuviese un submenu contextual,éste también aparecería.
|
||||
// Además, inicializa el campo oculto de cada DIV donde se guarda el índice
|
||||
// del item selecionado.
|
||||
//
|
||||
// Parametros:
|
||||
// - item: El objeto <TR>
|
||||
//____________________________________________________________________________
|
||||
function marcar_item(item){
|
||||
marca_desmarca(item,true) // Marca el item
|
||||
if (item.getAttribute("name")!=""){ // Existe submenu contextual
|
||||
currentPadresubmenu=item
|
||||
currentPadreY=ClickY
|
||||
setTimeout ("muestra_submenu();", 300);
|
||||
}
|
||||
menuctxSetSelectedIndex(contextual(item),item.getAttribute("id")); // Coloca el nuevo indice
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Quita el resalte de un item y oculta los posibles submenus que tuviera
|
||||
// Parametros:
|
||||
// -o : El objeto DIV que contiene el menu contextual
|
||||
// - idx: el indice del item, si es nulo desmarca el item(objeto TR), seleccionado
|
||||
//____________________________________________________________________________
|
||||
function desmarcar_item(o,idx){
|
||||
var oDIV=contextual(o) // Se asegura que el objeto de inicio es DIV
|
||||
if(idx==null) // No se especificó indice
|
||||
idx=menuctxSelectedIndex(oDIV) // Indice del Item seleccionado
|
||||
var item=menuctxSelectedItem(oDIV,idx)
|
||||
if(item==null) return // No hay item seleccionado
|
||||
marca_desmarca(item,false);
|
||||
var nomsub=item.getAttribute("name");
|
||||
if (nomsub!=null &&nomsub!=""){ // Tiene submenu
|
||||
var submenuctx=document.getElementById(nomsub);
|
||||
desmarcar_item(submenuctx); // Desmarca submenu
|
||||
submenuctx.style.visibility="hidden";
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Marca o desmarca items dependiendo del parametro sw.
|
||||
// Parámetros:
|
||||
// - o: El item (objeto TR)
|
||||
// Si sw=true marca, si sw=false demarca
|
||||
//____________________________________________________________________________
|
||||
function marca_desmarca(o,sw){
|
||||
if(sw){ // Marca
|
||||
var wfondo=ctx_azulmarino;
|
||||
var wcolor=ctx_blanco;
|
||||
}
|
||||
else{ // Desmarca
|
||||
var wfondo=ctx_grissistema;
|
||||
var wcolor=ctx_negro;
|
||||
}
|
||||
(MenuconImagen(contextual(o)) ? i0=2:i0=1);
|
||||
var nh=o.childNodes.length;
|
||||
for (var i=i0;i<nh-1;i++){
|
||||
var oTD=o.childNodes[i];
|
||||
var oIMGS=oTD.getElementsByTagName('IMG');
|
||||
if (oIMGS.length>0){
|
||||
var oIMG=oIMGS[0];
|
||||
if (oIMG.getAttribute("name")=="swsbfn"){ // imagen switch submenu
|
||||
oTD.style.backgroundColor=wfondo
|
||||
oTD.style.color=wcolor
|
||||
if (sw)
|
||||
oIMG.setAttribute("src","../images/flotantes/swsbfb.gif",null);
|
||||
else
|
||||
oIMG.setAttribute("src","../images/flotantes/swsbfn.gif",null);
|
||||
}
|
||||
else{ // imagen del item
|
||||
if (sw){ // Marcar
|
||||
oIMG.style.border="1px";
|
||||
oIMG.style.borderStyle="outset";
|
||||
|
||||
}
|
||||
else{ // Desmarcar
|
||||
oIMG.style.borderStyle="none";
|
||||
}
|
||||
}
|
||||
}
|
||||
else{
|
||||
oTD.style.backgroundColor=wfondo
|
||||
var oSPAN=oTD.getElementsByTagName('SPAN');
|
||||
if (oSPAN.length>0)
|
||||
oSPAN[0].style.color=wcolor
|
||||
}
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Detecta si el menu contextual tiene items con imágenes asociadas
|
||||
// Devuelve true en caso afirmativo y false en caso contrario.
|
||||
//____________________________________________________________________________
|
||||
function MenuconImagen(o){
|
||||
var oDIV=contextual(o);
|
||||
var oIMGS=oDIV.getElementsByTagName('IMG');
|
||||
return(oIMGS.length>0);
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
function reset_contextual(x,y){
|
||||
var swm=false;
|
||||
for (var i=0;i<idxmnu;i++ ){
|
||||
if (gmenuctx[i].style.visibility=="visible")
|
||||
swm=swm || EnContextual(x,y,gmenuctx[i])
|
||||
}
|
||||
if (!swm){ // No se ha hecho click en ningún menu contextual
|
||||
for (var i=0;i<idxmnu;i++ ){
|
||||
desmarcar_item(gmenuctx[i]);
|
||||
gmenuctx[i].style.visibility="hidden";
|
||||
gmenuctx[i]=null
|
||||
}
|
||||
idxmnu=0;
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Detecta si ha hecho fuera del menu contextual pasado como parametro
|
||||
// Parametros:
|
||||
// - x : Coordenada X de la pantalla donde se hizo click
|
||||
// - y : Coordenada Y de la pantalla donde se hizo click
|
||||
// - menuctx: El submenu (objeto DIV)
|
||||
//____________________________________________________________________________
|
||||
function EnContextual(x,y,menuctx){
|
||||
origen_x=parseInt(menuctx.offsetLeft)-parseInt(document.body.scrollLeft)
|
||||
origen_y=parseInt(menuctx.offsetTop)-parseInt(document.body.scrollTop)
|
||||
anchodiv=parseInt(menuctx.offsetWidth)
|
||||
largodiv=parseInt(menuctx.offsetHeight)
|
||||
|
||||
if ( x>=origen_x && x<=origen_x+anchodiv && y>=origen_y && y<=origen_y+largodiv ) return true
|
||||
return(false)
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Muestra un submenu
|
||||
// Parametros:
|
||||
// - item: El objeto <TR> padre del submenu
|
||||
//____________________________________________________________________________
|
||||
function muestra_submenu(){
|
||||
if(currentPadresubmenu==currentItem){
|
||||
var objdiv=contextual(currentPadresubmenu)
|
||||
var menuctx=document.getElementById(currentPadresubmenu.getAttribute("name")); // Obtiene el submenu
|
||||
//desmarcar_item(menuctx) // Desmarca el submenu por si se ha usado anteriormente
|
||||
wleft=subcalculaleft_ctx(objdiv,menuctx) // La x en función del padre
|
||||
wtop=subcalculatop_ctx(currentPadreY,menuctx) // La y depende de la longitud del submenu
|
||||
menuctx.style.top=wtop
|
||||
menuctx.style.left=wleft
|
||||
menuctx.style.visibility="visible";
|
||||
menuctxSetSelectedIndex(menuctx,-1) // Coloca el nuevo indice
|
||||
gmenuctx[idxmnu++]=menuctx;
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Calcula coordenada top para el submenu contextual que se mostrará.
|
||||
// Parametros:
|
||||
// - y : Coordenada Y de la pantalla donde se hizo click
|
||||
// - menuctx: El submenu (objeto DIV) que se mostrará
|
||||
//____________________________________________________________________________
|
||||
function subcalculatop_ctx(y,menuctx){ // Calcula el posicionamiento (y) del DIV ( SUBmenu contextual)
|
||||
var dpl=0
|
||||
largodiv=parseInt(menuctx.offsetHeight)
|
||||
var wtop=y+dpl+parseInt(document.body.scrollTop)
|
||||
if (parseInt(wtop+largodiv)>parseInt(document.body.clientHeight+parseInt(document.body.scrollTop))){
|
||||
var nwtop=y+parseInt(document.body.scrollTop)-16-largodiv
|
||||
if (nwtop>0) wtop=nwtop
|
||||
}
|
||||
return(wtop)
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Calcula coordenada left para el submenu contextual que se mostrará.
|
||||
// Parametros:
|
||||
// - padrediv : Objeto DIV padre del submenu a mostrar
|
||||
// - menuctx: El submenu (objeto DIV) que se mostrará
|
||||
//____________________________________________________________________________
|
||||
function subcalculaleft_ctx(padrediv,menuctx){ // Calcula el posicionamiento (x) del DIV ( SUBmenu contextual)
|
||||
anchopadrediv=parseInt(padrediv.offsetWidth) // Ancho del div padre
|
||||
anchomenuctx=parseInt(menuctx.offsetWidth) // Ancho del div
|
||||
if(IE)
|
||||
leftpadrediv=padrediv.style.pixelLeft // Coordenada x del div padre
|
||||
else
|
||||
if(NS)
|
||||
leftpadrediv=parseInt(padrediv.style.left) // Coordenada x del div padre
|
||||
desplazamiento=leftpadrediv+anchopadrediv-4 // Desplazamiento
|
||||
var wleft=parseInt(desplazamiento)
|
||||
var maximodpl=parseInt(document.body.clientWidth)+parseInt(document.body.scrollLeft)
|
||||
if (wleft+anchomenuctx>maximodpl){
|
||||
var nwleft=leftpadrediv-anchomenuctx
|
||||
if (nwleft>0) wleft=nwleft
|
||||
else{
|
||||
wleft=maximodpl-anchomenuctx;
|
||||
if(wleft<document.body.scrollLeft) wleft=document.body.scrollLeft+18
|
||||
}
|
||||
}
|
||||
return(wleft)
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Se ejecuta cada vez que se hace click con el puntero del ratón. Se usa para desmarca
|
||||
// cualquier item de menu contextual que estuviese activo
|
||||
//____________________________________________________________________________
|
||||
function click_de_raton(e){
|
||||
if(IE){
|
||||
botonraton=event.button
|
||||
event.returnValue=true;
|
||||
}
|
||||
if(NS){
|
||||
botonraton=e.which;
|
||||
e.returnValue=true;
|
||||
}
|
||||
if (gmenuctx.length>0){
|
||||
reset_contextual(ClickX,ClickY);
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Se ejecuta cada vez que se mueve el puntero del ratón. Se usa para capturar coordenadas
|
||||
//____________________________________________________________________________
|
||||
function move_de_raton(e){
|
||||
if(IE){
|
||||
ClickX=event.clientX
|
||||
ClickY=event.clientY
|
||||
event.returnValue=true;
|
||||
}
|
||||
if(NS){
|
||||
ClickX=e.clientX
|
||||
ClickY=e.clientY
|
||||
e.returnValue=true;
|
||||
}
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
//
|
||||
// Redirecciona el evento onmousedown a la función de usuario especificada.
|
||||
//____________________________________________________________________________
|
||||
document.onmousedown = click_de_raton; // Redefine el evento onmousedown
|
||||
document.onmousemove = move_de_raton; // Redefine el evento onmousedown
|
|
@ -1,82 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Apagar.php
|
||||
// Descripción :
|
||||
// Implementación del comando "Apagar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/apagar_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/Apagar.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<BR>
|
||||
<BR>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,82 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Arrancar.php
|
||||
// Descripción :
|
||||
// Implementación del comando "Arrancar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/arrancar_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/Arrancar.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].':'.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<BR>
|
||||
<BR>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,432 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Configurar.php
|
||||
// Descripción :
|
||||
// Implementación del comando "Configurar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/HTMLCTESELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/configurar_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$nombreambito="";
|
||||
$cadenaip="";
|
||||
$tbconfigur="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
//___________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/Configurar.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/configurar_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatosocultos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
</FORM>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<BR>
|
||||
<FORM name="fdatos">
|
||||
<?
|
||||
echo tabla_configuraciones($cmd,$idcentro,$idambito,$ambito);
|
||||
echo '<TABLE border=0 style="visibility: hidden" id=patron_contenidoparticion>'.Patrontabla_Particion().'</TABLE>';
|
||||
echo '<INPUT type=hidden id=tbconfigur value="'.$tbconfigur.'">';
|
||||
?>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// ***********************************************************************************************************
|
||||
function tabla_configuraciones($cmd,$idcentro,$idambito,$ambito){
|
||||
global $cadenaip;
|
||||
global $AMBITO_AULAS;
|
||||
global $AMBITO_GRUPOSORDENADORES;
|
||||
global $AMBITO_ORDENADORES;
|
||||
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$numorde=0;
|
||||
|
||||
switch($ambito){
|
||||
case $AMBITO_AULAS :
|
||||
$cmd->texto="SELECT COUNT(*) AS numorde FROM ordenadores WHERE idaula=".$idambito;
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$cmd->texto="SELECT COUNT(*) AS numorde FROM ordenadores WHERE grupoid=".$idambito;
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$cmd->texto="SELECT COUNT(*) AS numorde FROM ordenadores WHERE idordenador=".$idambito;
|
||||
break;
|
||||
}
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF)
|
||||
$numorde=$rs->campos["numorde"];
|
||||
$idconfiguracion="";
|
||||
|
||||
switch($ambito){
|
||||
case $AMBITO_AULAS :
|
||||
$cmd->texto="SELECT COUNT(*) AS cuenta,configuraciones.descripcion,configuraciones.idconfiguracion FROM aulas";
|
||||
$cmd->texto.=" INNER JOIN ordenadores ON aulas.idaula = ordenadores.idaula";
|
||||
$cmd->texto.=" INNER JOIN configuraciones ON ordenadores.idconfiguracion = configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" WHERE aulas.idaula = ".$idambito;
|
||||
$cmd->texto.=" GROUP BY configuraciones.descripcion, configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" HAVING configuraciones.idconfiguracion>0";
|
||||
$cmd->texto.=" ORDER BY configuraciones.descripcion";
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$cmd->texto="SELECT COUNT(*) AS cuenta,configuraciones.descripcion,configuraciones.idconfiguracion FROM gruposordenadores";
|
||||
$cmd->texto.=" INNER JOIN ordenadores ON gruposordenadores.idgrupo = ordenadores.grupoid";
|
||||
$cmd->texto.=" INNER JOIN configuraciones ON ordenadores.idconfiguracion = configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" WHERE (gruposordenadores.idgrupo = ".$idambito.") AND configuraciones.idconfiguracion>0";
|
||||
$cmd->texto.=" GROUP BY configuraciones.descripcion, configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" HAVING configuraciones.idconfiguracion>0";
|
||||
$cmd->texto.=" ORDER BY configuraciones.descripcion";
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$cmd->texto="SELECT COUNT(*) AS cuenta,configuraciones.descripcion,configuraciones.idconfiguracion FROM ordenadores";
|
||||
$cmd->texto.=" INNER JOIN configuraciones ON ordenadores.idconfiguracion = configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" WHERE ordenadores.idordenador = ".$idambito;
|
||||
$cmd->texto.=" GROUP BY configuraciones.descripcion, configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" HAVING configuraciones.idconfiguracion>0";
|
||||
$cmd->texto.=" ORDER BY configuraciones.descripcion";
|
||||
break;
|
||||
}
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF){
|
||||
if($numorde!=$rs->campos["cuenta"]){ // El numero de ordenadores del aula no coincide con los que tienen el mismo perfil hardware
|
||||
while (!$rs->EOF){
|
||||
if($idconfiguracion!=$rs->campos["idconfiguracion"]){
|
||||
if($idconfiguracion!=0) $tablaHtml.="</TABLE>";
|
||||
$tablaHtml.= '<TABLE align=center border=0 cellPadding=1 cellSpacing=1';
|
||||
$descripcion=$rs->campos["descripcion"];
|
||||
$tablaHtml.= "<TR>";
|
||||
$tablaHtml.= '<TD align=center ><IMG style="cursor:hand" oncontextmenu="resalta(this,'.$rs->campos["idconfiguracion"].')" src="../images/iconos/configuraciones.gif">';
|
||||
$tablaHtml.='  <span style="COLOR: #000000;FONT-FAMILY: Verdana;FONT-SIZE: 12px; "><U><b>Configuration</b> '.$rs->campos["descripcion"].'</U></SPAN></TD>';
|
||||
$tablaHtml.= "</TR>";
|
||||
}
|
||||
$tablaHtml.= '<TR><TD>';
|
||||
$tablaHtml.=PintaOrdenadores($cmd,$idambito,$ambito,$rs->campos["idconfiguracion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.= '</TD></TR>';
|
||||
$tablaHtml.= '<TR><TD>';
|
||||
$tablaHtml.=tabla_particiones($cmd,$idcentro,$idambito,$rs->campos["idconfiguracion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.= '</TD></TR>';
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$tablaHtml.="</TABLE>";
|
||||
}
|
||||
else{
|
||||
$tablaHtml.=tabla_particiones($cmd,$idcentro,$idambito,$rs->campos["idconfiguracion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.='<INPUT type=hidden name="nuevasipes" id="ipes_'.$rs->campos["idconfiguracion"].'" value="'.$cadenaip.'">';
|
||||
}
|
||||
}
|
||||
echo $tablaHtml;
|
||||
$rs->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function PintaOrdenadores($cmd,$idambito,$ambito,$idconfiguracion){
|
||||
global $AMBITO_AULAS;
|
||||
global $AMBITO_GRUPOSORDENADORES;
|
||||
$ipidpidc="";
|
||||
$rs=new Recordset;
|
||||
$contor=0;
|
||||
$maxcontor=10;
|
||||
switch($ambito){
|
||||
case $AMBITO_AULAS :
|
||||
$cmd->texto=" SELECT nombreordenador,ip FROM ordenadores WHERE idconfiguracion=".$idconfiguracion." AND idaula=".$idambito." ORDER BY nombreordenador";
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$cmd->texto=" SELECT nombreordenador,ip FROM ordenadores WHERE idconfiguracion=".$idconfiguracion." AND grupoid=".$idambito." ORDER BY nombreordenador";
|
||||
break;
|
||||
}
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$tablaHtml='<TABLE align=center border=0><TR>';
|
||||
while (!$rs->EOF){
|
||||
$contor++;
|
||||
$tablaHtml.= '<TD align=center style="FONT-FAMILY: Arial, Helvetica, sans-serif;FONT-SIZE: 8px"><br><IMG src="../images/iconos/ordenador.gif"><br><span style="FONT-SIZE:9px" >'.$rs->campos["nombreordenador"].'</TD>';
|
||||
if($contor>$maxcontor){
|
||||
$contor=0;
|
||||
$tablaHtml.='</TR><TR>';
|
||||
}
|
||||
$ipidpidc.=$rs->campos["ip"].";";
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$ipidpidc= substr($ipidpidc,0,strlen($ipidpidc)-1); // Quita la coma
|
||||
$tablaHtml.='</TR>';
|
||||
$tablaHtml.= '</TR></TABLE>';
|
||||
$tablaHtml.='<INPUT type=hidden name="nuevasipes" id="ipes_'.$idconfiguracion.'" value="'.$ipidpidc.'">';
|
||||
return($tablaHtml);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function tabla_particiones($cmd,$idcentro,$idambito,$idconfiguracion,$cuenta){
|
||||
global $tbconfigur;
|
||||
global $TbMsg;
|
||||
$tablaHtml="";
|
||||
$configuracion="";
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT idconfiguracion, configuracion FROM configuraciones WHERE idconfiguracion=".$idconfiguracion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF)
|
||||
$idc=$rs->campos["idconfiguracion"];
|
||||
$configuracion=$rs->campos["configuracion"];
|
||||
$rs->Cerrar();
|
||||
$auxsplit=split("\t",$configuracion);
|
||||
$tablaHtml.= '<TABLE align=center id=tabla_contenidoparticion_'.$idc.' value=0>';
|
||||
$tablaHtml.='<TR>';
|
||||
$tablaHtml.=' <TD>';
|
||||
$tablaHtml.= '<TABLE id=tb_particiones_'.$idc.' class=tabla_listados_sin align=center value=0 cellPadding=1 cellSpacing=1 >';
|
||||
$tablaHtml.= '<TR>';
|
||||
$tablaHtml.= '<TH align=center ><IMG src="../images/iconos/eliminar.gif"></TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[8].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[9].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[10].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[11].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[12].' </TH>';
|
||||
$tablaHtml.= '</TR>';
|
||||
$ultpa=0;
|
||||
for($j=0;$j<8;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(10),'=');
|
||||
$particion=$ValorParametros["numpart"]; // Toma la partición
|
||||
if(!empty($particion)){
|
||||
$p=$particion;
|
||||
$tipopart=$ValorParametros["tipopart"]; // Toma tipo la partición
|
||||
if($tipopart=="CACHE" || $tipopart=="EMPTY") continue;
|
||||
$tamapart=$ValorParametros["tamapart"]; // Toma tamaño la partición
|
||||
$nombreso=$ValorParametros["nombreso"]; // Toma nombre del sistema operativo
|
||||
$tiposo=$ValorParametros["tiposo"];
|
||||
$ultpa=$p; // Valor de la ultima particion de esa configuración
|
||||
}
|
||||
else{
|
||||
$p=$j+1;
|
||||
$tipopart="EMPTY"; // Toma tipo la partición
|
||||
$tamapart=0; // Toma tamaño la partición
|
||||
$nombreso=""; // Toma nombre del sistema operativo
|
||||
$tiposo="";
|
||||
}
|
||||
$valocul=0;
|
||||
$codpar=0;
|
||||
switch($tipopart){
|
||||
case "EMPTY":
|
||||
$codpar=0;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red"> Espacio sin particionar !!</span>';
|
||||
break;
|
||||
case "EXT":
|
||||
$codpar=0;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red"> partición extendida !!</span>';
|
||||
break;
|
||||
case "BIGDOS":
|
||||
$codpar=1;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Msdos</span>';
|
||||
break;
|
||||
case "FAT32":
|
||||
$codpar=2;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Windows 98, Millenium</span>';
|
||||
break;
|
||||
case "HFAT32":
|
||||
$codpar=2;
|
||||
$valocul=2;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Windows 98, Millenium<span style="COLOR:green;font-weight:600"> ('.$TbMsg[7].')</span></span>';
|
||||
else
|
||||
$nombreso.='<span style="COLOR:green;font-weight:600"> (partición oculta)</span>';
|
||||
break;
|
||||
case "NTFS":
|
||||
$codpar=3;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Windows XP, Windows 2000, Windows 2003</span>';
|
||||
break;
|
||||
case "HNTFS":
|
||||
$codpar=3;
|
||||
$valocul=2;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Windows XP, Windows 2000, Windows 2003<span style="COLOR:green;font-weight:600"> ('.$TbMsg[7].')</span></span>';
|
||||
else
|
||||
$nombreso.='<span style="COLOR:green;font-weight:600"> ('.$TbMsg[7].')</span>';
|
||||
break;
|
||||
case "EXT2":
|
||||
$codpar=4;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Linux</span>';
|
||||
break;
|
||||
case "EXT3":
|
||||
$codpar=5;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Linux</span>';
|
||||
break;
|
||||
case "EXT4":
|
||||
$codpar=6;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Linux</span>';
|
||||
break;
|
||||
case "LINUX-SWAP":
|
||||
$codpar=7;
|
||||
$nombreso='<span style="COLOR:blue">Linux-swap</span>';
|
||||
break;
|
||||
case "CACHE":
|
||||
$codpar=8;
|
||||
$nombreso='<span style="COLOR:blue">CACHE</span>';
|
||||
break;
|
||||
}
|
||||
|
||||
$tablaHtml.='<TR id="TRparticion_'.$p."_".$idc.'"';
|
||||
if($tipopart=="EMPTY")
|
||||
$tablaHtml.=' style="visibility:hidden"';
|
||||
$tablaHtml.='>';
|
||||
$tablaHtml.='<TD><input type=checkbox onclick="elimina_particion(this,'.$idc.')" id=eliminarparticion_'.$p."_".$idc.' value=0></TD>'.chr(13);
|
||||
$opciones="";
|
||||
for($i=1;$i<8;$i++){
|
||||
$opciones.=$i."=".$i.chr(13);
|
||||
}
|
||||
$opciones.="8=8";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"numpar_".$p."_".$idc,"estilodesple","",$p,35,"chgpar").'</TD>'.chr(13);
|
||||
$opciones="1=BIGDOS".chr(13);
|
||||
$opciones.="2=FAT32".chr(13);
|
||||
$opciones.="3=NTFS".chr(13);
|
||||
$opciones.="4=EXT2".chr(13);
|
||||
$opciones.="5=EXT3".chr(13);
|
||||
$opciones.="6=EXT4".chr(13);
|
||||
$opciones.="7=LINUX-SWAP";
|
||||
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"tipospar_".$p."_".$idc,"estilodesple","EMPTY",$codpar,100,"chgtipopar").'</TD>'.chr(13);
|
||||
$tablaHtml.='<TD><span id=tiposo_'.$p."_".$idc.' value=0> '.$nombreso.' </span></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center><input type=text onchange="chgtama('.$idc.')" id="tamano_'.$p."_".$idc.'" style="width=70" value='.$tamapart.' ></TD>'.chr(13);
|
||||
$opciones="1=".$TbMsg[14]."".chr(13);
|
||||
$opciones.="2=".$TbMsg[15]."".chr(13);
|
||||
$opciones.="3=".$TbMsg[16]."";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"acciones_".$p."_".$idc,"estilodesple",$TbMsg[13],$valocul,100,"chgaccion").'</TD>'.chr(13);
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
}
|
||||
$tablaHtml.='</TABLE>';
|
||||
$tablaHtml.= '</TD>';
|
||||
$tablaHtml.= '</TR>';
|
||||
$tablaHtml.= '</TABLE>';
|
||||
|
||||
// Boton de insercion
|
||||
$tablaHtml.= '<INPUT type=hidden id="ultpa_'.$idc.'" value='.$ultpa.'>';
|
||||
$tablaHtml.= '<div align=center>';
|
||||
$tablaHtml.= '<br><A href="#boton_add"><IMG border=0 name="btanade_"'.$idc.' src="../images/boton_annadir.gif" onclick="annadir_particion('.$idc.')" WIDTH="73" HEIGHT="22"></A>';
|
||||
$tablaHtml.= '</div><br>';
|
||||
$tbconfigur.=$idc.";";
|
||||
return($tablaHtml);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Crea la patron de linea de la tabla Particiones
|
||||
//________________________________________________________________________________________________________
|
||||
function Patrontabla_Particion(){
|
||||
global $TbMsg;
|
||||
$p="_upa_";
|
||||
$idc="_cfg_";
|
||||
$tablaHtml='<TR id=TRparticion_'.$p."_".$idc.'>'.chr(13);
|
||||
$tablaHtml.='<TD><input type=checkbox onclick="elimina_particion(this,'.$idc.')" id=eliminarparticion_'.$p."_".$idc.' value=0></TD>'.chr(13);
|
||||
$opciones="";
|
||||
for($i=1;$i<8;$i++){
|
||||
$opciones.=$i."=".$i.chr(13);
|
||||
}
|
||||
$opciones.="8=8";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"numpar_".$p."_".$idc,"estilodesple","",$p,35,"chgpar").'</TD>'.chr(13);
|
||||
$opciones="1=BIGDOS".chr(13);
|
||||
$opciones.="2=FAT32".chr(13);
|
||||
$opciones.="3=NTFS".chr(13);
|
||||
$opciones.="4=EXT2".chr(13);
|
||||
$opciones.="5=EXT3".chr(13);
|
||||
$opciones.="6=EXT4".chr(13);
|
||||
$opciones.="7=LINUX-SWAP";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"tipospar_".$p."_".$idc,"estilodesple","EMPTY",0,100,"chgtipopar").'</TD>'.chr(13);
|
||||
$tablaHtml.='<TD><span id=tiposo_'.$p."_".$idc.' value=0> <span style="COLOR:red">'.$TbMsg[17].'</span> </span></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center><input type=text onchange="chgtama('.$idc.')" id="tamano_'.$p."_".$idc.'" style="width=70" value=0 ></TD>'.chr(13);
|
||||
$opciones="1=".$TbMsg[14]."".chr(13);
|
||||
$opciones.="2=".$TbMsg[15]."".chr(13);
|
||||
$opciones.="3=".$TbMsg[16]."";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"acciones_".$p."_".$idc,"estilodesple",$TbMsg[13],0,100,"chgaccion").' </TD>'.chr(13);
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
//$tablaHtml.='</TABLE>';
|
||||
//$tablaHtml.= '</TD></TR></TABLE>';
|
||||
return($tablaHtml);
|
||||
}
|
||||
?>
|
|
@ -1,238 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: CrearPerfilSoftware.php
|
||||
// Descripción :
|
||||
// Implementaci<63> del comando "CrearPerfilSoftware"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/TomaDato.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/crearperfilsoftware_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
//________________________________________________________________________________________________________
|
||||
$idperfilsoftware=0;
|
||||
$idordenador=$idambito;
|
||||
$nombreordenador="";
|
||||
$ip="";
|
||||
$mac="";
|
||||
$idperfilhard=0;
|
||||
$idservidordhcp=0;
|
||||
$idservidorrembo=0;
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
$resul=toma_propiedades($cmd,$idordenador);
|
||||
if (!$resul)
|
||||
Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci<63> de datos.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/CrearPerfilSoftware.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/crearperfilsoftware_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<P align=center class=cabeceras><? echo $TbMsg[0] ?><P>
|
||||
<P align=center>
|
||||
<SPAN align=center class=subcabeceras><? echo $TbMsg[1] ?></SPAN>
|
||||
</BR>
|
||||
<TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[2] ?> </TD>
|
||||
<? echo '<TD>'.$nombreordenador.'</TD>';?>
|
||||
<TD colspan=2 valign=top align=left rowspan=3><IMG border=2 style="border-color:#63676b" src="../images/fotoordenador.gif"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[3] ?> </TD>
|
||||
<? echo '<TD>'.$ip.'</TD>';?>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[4] ?> </TD>
|
||||
<? echo '<TD>'.$mac.'</TD>';?>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[5] ?> </TD>
|
||||
<? echo '<TD colspan=3>'.TomaDato($cmd,$idcentro,'perfileshard',$idperfilhard,'idperfilhard','descripcion').'</TD>'; ?>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</P>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<P align=center>
|
||||
<SPAN align=center class=subcabeceras><? echo $TbMsg[6] ?></SPAN>
|
||||
</BR>
|
||||
<TABLE id="tabla_conf" align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>
|
||||
<TR>
|
||||
<TH align=center> </TH>
|
||||
<TH align=center> <? echo $TbMsg[8] ?> </TH>
|
||||
<TH align=center> <? echo $TbMsg[9] ?> </TH>
|
||||
<TH align=center> <? echo $TbMsg[10] ?> </TD></TR>
|
||||
<?
|
||||
echo tabla_configuraciones($cmd,$idordenador);
|
||||
?>
|
||||
</TABLE>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/**************************************************************************************************************************************************
|
||||
Recupera los datos de un ordenador
|
||||
Parametros:
|
||||
- cmd: Una comando ya operativo (con conexiónabierta)
|
||||
- ido: El identificador del ordenador
|
||||
________________________________________________________________________________________________________*/
|
||||
function toma_propiedades($cmd,$ido){
|
||||
global $nombreordenador;
|
||||
global $ip;
|
||||
global $mac;
|
||||
global $idperfilhard;
|
||||
global $idservidordhcp;
|
||||
global $idservidorrembo;
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT nombreordenador,ip,mac,idperfilhard FROM ordenadores WHERE idordenador='".$ido."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF){
|
||||
$nombreordenador=$rs->campos["nombreordenador"];
|
||||
$ip=$rs->campos["ip"];
|
||||
$mac=$rs->campos["mac"];
|
||||
$idperfilhard=$rs->campos["idperfilhard"];
|
||||
$rs->Cerrar();
|
||||
return(true);
|
||||
}
|
||||
else
|
||||
return(false);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la etiqueta html <SELECT> de los perfiles softwares
|
||||
________________________________________________________________________________________________________*/
|
||||
function HTMLSELECT_perfiles($cmd,$idcentro,$tipopart,$particion,$idordenador){
|
||||
$SelectHtml="";
|
||||
$rs=new Recordset;
|
||||
/*
|
||||
$cmd->texto="SELECT imagenes.descripcion,perfilessoft.idperfilsoft,perfilessoft.descripcion as perfil,tiposos.nemonico
|
||||
FROM tiposos
|
||||
INNER JOIN softwares ON tiposos.idtiposo = softwares.idtiposo
|
||||
INNER JOIN perfilessoft_softwares ON softwares.idsoftware = perfilessoft_softwares.idsoftware
|
||||
INNER JOIN perfilessoft ON perfilessoft.idperfilsoft = perfilessoft_softwares.idperfilsoft
|
||||
INNER JOIN imagenes ON perfilessoft.idperfilsoft = imagenes.idperfilsoft
|
||||
|
||||
WHERE perfilessoft.idcentro=".$idcentro;
|
||||
*/
|
||||
$cmd->texto="SELECT imagenes.descripcion,ordenador_perfilsoft.idperfilsoft FROM imagenes
|
||||
INNER JOIN perfilessoft ON perfilessoft.idperfilsoft=imagenes.idperfilsoft
|
||||
INNER JOIN ordenador_perfilsoft ON ordenador_perfilsoft .idperfilsoft=perfilessoft.idperfilsoft
|
||||
WHERE ordenador_perfilsoft.particion=".$particion."
|
||||
AND ordenador_perfilsoft.idordenador=".$idordenador."
|
||||
AND perfilessoft.idcentro=".$idcentro;
|
||||
|
||||
// Cuesti<74> partici<63> oculta
|
||||
/*
|
||||
$swo=substr ($tipopart,0,1);
|
||||
if($swo=="H")
|
||||
$tipopart=substr ($tipopart,1,strlen($tipopart)-1);
|
||||
$cmd->texto.=" AND (tiposos.tipopar = '".$tipopart."' OR tiposos.tipopar ='H".$tipopart."' )";
|
||||
$cmd->texto.=" AND tiposos.tipopar = '".$tipopart."'";
|
||||
*/
|
||||
$rs->Comando=&$cmd;
|
||||
|
||||
if (!$rs->Abrir()) return(0); // Error al abrir recordset
|
||||
$SelectHtml.= '<SELECT class="formulariodatos" id="desple_'.$particion.'" style="WIDTH: 300">';
|
||||
$SelectHtml.= ' <OPTION value="0"></OPTION>';
|
||||
$rs->Primero();
|
||||
while (!$rs->EOF){
|
||||
$SelectHtml.='<OPTION value="'.$rs->campos["idperfilsoft"].'">';
|
||||
$SelectHtml.= $rs->campos["descripcion"].'</OPTION>';
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$SelectHtml.= '</SELECT>';
|
||||
$rs->Cerrar();
|
||||
return($SelectHtml);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la tabla de configuraciones y perfiles a crear
|
||||
________________________________________________________________________________________________________*/
|
||||
function tabla_configuraciones($cmd,$idordenador){
|
||||
global $idcentro;
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$rsp=new Recordset;
|
||||
$cmd->texto="SELECT configuraciones.configuracion FROM configuraciones INNER JOIN ordenadores ON configuraciones.idconfiguracion=ordenadores.idconfiguracion WHERE ordenadores.idordenador='".$idordenador."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$configuracion= $rs->campos["configuracion"];
|
||||
$auxsplit=split("\t",$configuracion);
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(10),'=');
|
||||
$particion=$ValorParametros["numpart"]; // Toma la partici<63>
|
||||
$tiposo=$ValorParametros["tiposo"]; // Toma nombre del sistema operativo
|
||||
$tipopart=trim($ValorParametros["tipopart"]); // Toma tipo de partici<63> del sistema operativo
|
||||
$nombreso=$ValorParametros["nombreso"]; // Toma nombre del sistema operativo
|
||||
if(!empty($tiposo)){
|
||||
$tablaHtml.='<TR>'.chr(13);
|
||||
$tablaHtml.='<TD ><input type=checkbox name=particion_'.$particion.' value='.$particion.'></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center> '.$particion.' </TD>'.chr(13);
|
||||
$tablaHtml.='<TD> '.$nombreso.' </TD>'.chr(13);
|
||||
$tiposo=$ValorParametros["tiposo"];
|
||||
$tablaHtml.='<TD>'.HTMLSELECT_perfiles($cmd,$idcentro,$tipopart,$particion,$idordenador).'</TD>';
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
}
|
||||
}
|
||||
$rs->Cerrar();
|
||||
return($tablaHtml);
|
||||
}
|
||||
?>
|
|
@ -1,218 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: CrearSoftIncremental.php
|
||||
// Descripción :
|
||||
// Implementación del comando "CrearSoftIncremental"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/TomaDato.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/CrearSoftIncremental_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
//________________________________________________________________________________________________________
|
||||
$idsoftincrementalware=0;
|
||||
$idordenador=$idambito;
|
||||
$nombreordenador="";
|
||||
$ip="";
|
||||
$mac="";
|
||||
$idperfilhard=0;
|
||||
$idservidordhcp=0;
|
||||
$idservidorrembo=0;
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
|
||||
$resul=toma_propiedades($cmd,$idordenador);
|
||||
if (!$resul)
|
||||
Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/CrearSoftIncremental.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/CrearSoftIncremental_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
<INPUT type=hidden name=idperfilhard value=<? echo $idperfilhard ?>>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<P align=center class=cabeceras><? echo $TbMsg[0] ?><P>
|
||||
<P align=center>
|
||||
<SPAN align=center class=subcabeceras><? echo $TbMsg[1] ?></SPAN>
|
||||
</BR>
|
||||
<TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[2] ?> </TD>
|
||||
<? echo '<TD>'.$nombreordenador.'</TD>';?>
|
||||
<TD colspan=2 valign=top align=left rowspan=3><IMG border=2 style="border-color:#63676b" src="../images/fotoordenador.gif"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[3] ?> </TD>
|
||||
<? echo '<TD>'.$ip.'</TD>';?>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[4] ?> </TD>
|
||||
<? echo '<TD>'.$mac.'</TD>';?>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[5] ?> </TD>
|
||||
<? echo '<TD colspan=3>'.TomaDato($cmd,$idcentro,'perfileshard',$idperfilhard,'idperfilhard','descripcion').'</TD>'; ?>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</P>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<P align=center>
|
||||
<SPAN align=center class=subcabeceras><? echo $TbMsg[6] ?></SPAN>
|
||||
</BR>
|
||||
<TABLE id="tabla_conf" align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>
|
||||
<TR>
|
||||
<TH align=center> </TH>
|
||||
<TH align=center> <? echo $TbMsg[8] ?> </TH>
|
||||
<TH align=center> <? echo $TbMsg[9] ?> </TH>
|
||||
<TH align=center> <? echo $TbMsg[10] ?> </TD></TR>
|
||||
<?
|
||||
echo tabla_configuraciones($cmd,$idordenador);
|
||||
?>
|
||||
</TABLE>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/**************************************************************************************************************************************************
|
||||
Recupera los datos de un ordenador
|
||||
Parametros:
|
||||
- cmd: Una comando ya operativo (con conexión abierta)
|
||||
- ido: El identificador del ordenador
|
||||
________________________________________________________________________________________________________*/
|
||||
function toma_propiedades($cmd,$ido){
|
||||
global $nombreordenador;
|
||||
global $ip;
|
||||
global $mac;
|
||||
global $idperfilhard;
|
||||
global $idservidordhcp;
|
||||
global $idservidorrembo;
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT nombreordenador,ip,mac,idperfilhard FROM ordenadores WHERE idordenador='".$ido."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF){
|
||||
$nombreordenador=$rs->campos["nombreordenador"];
|
||||
$ip=$rs->campos["ip"];
|
||||
$mac=$rs->campos["mac"];
|
||||
$idperfilhard=$rs->campos["idperfilhard"];
|
||||
$rs->Cerrar();
|
||||
return(true);
|
||||
}
|
||||
else
|
||||
return(false);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la etiqueta html <SELECT> de los perfiles softwares
|
||||
________________________________________________________________________________________________________*/
|
||||
function HTMLSELECT_incrementales($cmd,$idcentro,$idperfilsoft,$particion){
|
||||
$SelectHtml="";
|
||||
$rs=new Recordset;
|
||||
|
||||
$cmd->texto="SELECT softincrementales.idsoftincremental, softincrementales.descripcion, tiposoftwares.idtiposoftware FROM softincrementales INNER JOIN softwares INNER JOIN softincremental_softwares ON softwares.idsoftware = softincremental_softwares.idsoftware ON softincrementales.idsoftincremental = softincremental_softwares.idsoftincremental INNER JOIN perfilessoft_softwares ON softwares.idsoftware = perfilessoft_softwares.idsoftware INNER JOIN perfilessoft ON perfilessoft_softwares.idperfilsoft = perfilessoft.idperfilsoft INNER JOIN tiposoftwares ON softwares.idtiposoftware = tiposoftwares.idtiposoftware";
|
||||
|
||||
$cmd->texto.=" WHERE (softincrementales.idcentro = ".$idcentro.") AND (perfilessoft.idperfilsoft = ".$idperfilsoft.") AND (tiposoftwares.idtiposoftware = 1)";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(0); // Error al abrir recordset
|
||||
$SelectHtml.= '<SELECT class="formulariodatos" id="desple_'.$particion.'" style="WIDTH: 300">';
|
||||
$SelectHtml.= ' <OPTION value="0"></OPTION>';
|
||||
$rs->Primero();
|
||||
while (!$rs->EOF){
|
||||
$SelectHtml.='<OPTION value="'.$idperfilsoft.'_'.$rs->campos["idsoftincremental"].'">';
|
||||
$SelectHtml.= $rs->campos["descripcion"].'</OPTION>';
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$SelectHtml.= '</SELECT>';
|
||||
$rs->Cerrar();
|
||||
return($SelectHtml);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la tabla de configuraciones y perfiles a crear
|
||||
________________________________________________________________________________________________________*/
|
||||
function tabla_configuraciones($cmd,$idordenador){
|
||||
global $idcentro;
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT ordenadores.idordenador,perfilessoft.idperfilsoft, perfilessoft.descripcion, ordenadores.ip, ordenador_imagen.particion FROM ordenadores INNER JOIN ordenador_imagen ON ordenadores.idordenador = ordenador_imagen.idordenador INNER JOIN imagenes ON ordenador_imagen.idimagen = imagenes.idimagen INNER JOIN perfilessoft ON imagenes.idperfilsoft = perfilessoft.idperfilsoft WHERE ordenadores.idordenador=".$idordenador." ORDER BY ordenador_imagen.particion ";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
while (!$rs->EOF){
|
||||
$tablaHtml.='<TR>'.chr(13);
|
||||
$tablaHtml.='<TD ><input type=checkbox name=particion_'.$rs->campos["particion"].' value='.$rs->campos["particion"].'></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center> '.$rs->campos["particion"].' </TD>'.chr(13);
|
||||
$tablaHtml.='<TD> '.$rs->campos["descripcion"].' </TD>'.chr(13);
|
||||
$tablaHtml.='<TD>'.HTMLSELECT_incrementales($cmd,$idcentro,$rs->campos["idperfilsoft"],$rs->campos["particion"]).'</TD>';
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$rs->Cerrar();
|
||||
return($tablaHtml);
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -1,132 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: EjecutarScripts.php
|
||||
// Descripción :
|
||||
// Implementación del comando "EjecutarScripts"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/ejecutarscripts_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$nombreambito="";
|
||||
$cadenaip="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
|
||||
//___________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/EjecutarScripts.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/ejecutarscripts_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM action="./gestores/gestor_EjecutarScripts.php" method="post" enctype="multipart/form-data" name="fdatos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
<INPUT type=hidden name=pseudocodigo value=0>
|
||||
<INPUT type=hidden name=sw_ejya value="">
|
||||
<INPUT type=hidden name=sw_seguimiento value="">
|
||||
<INPUT type=hidden name=sw_mkprocedimiento value="">
|
||||
<INPUT type=hidden name=nwidprocedimiento value="">
|
||||
<INPUT type=hidden name=nwdescriprocedimiento value="">
|
||||
<INPUT type=hidden name=sw_mktarea value="">
|
||||
<INPUT type=hidden name=nwidtarea value="">
|
||||
<INPUT type=hidden name=nwdescritarea value="">
|
||||
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<table align=center class=tabla_datos border="0" cellpadding="0" cellspacing="1">
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<tr>
|
||||
<th> <? echo $TbMsg[7]?> </th>
|
||||
<td ><input class="cajatexto" name="titulo" type="text" style="width:352"></td></tr>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<tr>
|
||||
<th> <? echo $TbMsg[8]?> </th>
|
||||
<td ><textarea class="cajatexto" name="descripcion" cols="70" rows="3"></textarea></td></tr>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<tr>
|
||||
<th> <? echo $TbMsg[9]?> </th>
|
||||
<td><textarea class="cajatexto" name="codigo" cols="70" rows="18"></textarea></td></tr>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<tr>
|
||||
<th> <? echo $TbMsg[10]?> </th>
|
||||
<td ><input class="cajatexto" name="userfile" type="file" size="45"></td></tr>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
</TABLE>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,191 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: IniciarSesion.php
|
||||
// Descripción :
|
||||
// Implementación<C3B3> del comando "Iniciar Sesión"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/TomaDato.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/iniciarsesion_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
//________________________________________________________________________________________________________
|
||||
$idperfilsoftware=0;
|
||||
$idordenador=$idambito;
|
||||
$nombreordenador="";
|
||||
$ip="";
|
||||
$mac="";
|
||||
$idperfilhard=0;
|
||||
$idservidordhcp=0;
|
||||
$idservidorrembo=0;
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
$resul=toma_propiedades($cmd,$idordenador);
|
||||
if (!$resul)
|
||||
Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci<63> de datos.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/IniciarSesion.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/iniciarsesion_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<P align=center class=cabeceras><? echo $TbMsg[0] ?><P>
|
||||
<P align=center>
|
||||
<SPAN align=center class=subcabeceras><? echo $TbMsg[1] ?></SPAN>
|
||||
</BR>
|
||||
<TABLE align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[2] ?> </TD>
|
||||
<? echo '<TD>'.$nombreordenador.'</TD>';?>
|
||||
<TD colspan=2 valign=top align=left rowspan=3><IMG border=2 style="border-color:#63676b" src="../images/fotoordenador.gif"></TD>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[3] ?> </TD>
|
||||
<? echo '<TD>'.$ip.'</TD>';?>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[4] ?> </TD>
|
||||
<? echo '<TD>'.$mac.'</TD>';?>
|
||||
</TR>
|
||||
<TR>
|
||||
<TH align=center> <? echo $TbMsg[5] ?> </TD>
|
||||
<? echo '<TD colspan=3>'.TomaDato($cmd,$idcentro,'perfileshard',$idperfilhard,'idperfilhard','descripcion').'</TD>'; ?>
|
||||
</TR>
|
||||
</TABLE>
|
||||
</P>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<P align=center>
|
||||
<SPAN align=center class=subcabeceras><? echo $TbMsg[6] ?></SPAN>
|
||||
</BR>
|
||||
<TABLE id="tabla_conf" align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>
|
||||
<TR>
|
||||
<TH align=center> </TH>
|
||||
<TH align=center> <? echo $TbMsg[8] ?> </TH>
|
||||
<TH align=center> <? echo $TbMsg[9] ?> </TH>
|
||||
</TR>
|
||||
<?
|
||||
echo tabla_configuraciones($cmd,$idordenador);
|
||||
?>
|
||||
</TABLE>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/**************************************************************************************************************************************************
|
||||
Recupera los datos de un ordenador
|
||||
Parametros:
|
||||
- cmd: Una comando ya operativo (con conexiónabierta)
|
||||
- ido: El identificador del ordenador
|
||||
________________________________________________________________________________________________________*/
|
||||
function toma_propiedades($cmd,$ido){
|
||||
global $nombreordenador;
|
||||
global $ip;
|
||||
global $mac;
|
||||
global $idperfilhard;
|
||||
global $idservidordhcp;
|
||||
global $idservidorrembo;
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT nombreordenador,ip,mac,idperfilhard FROM ordenadores WHERE idordenador='".$ido."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF){
|
||||
$nombreordenador=$rs->campos["nombreordenador"];
|
||||
$ip=$rs->campos["ip"];
|
||||
$mac=$rs->campos["mac"];
|
||||
$idperfilhard=$rs->campos["idperfilhard"];
|
||||
$rs->Cerrar();
|
||||
return(true);
|
||||
}
|
||||
else
|
||||
return(false);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la tabla de configuraciones y perfiles a crear
|
||||
________________________________________________________________________________________________________*/
|
||||
function tabla_configuraciones($cmd,$idordenador){
|
||||
global $idcentro;
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$rsp=new Recordset;
|
||||
$cmd->texto="SELECT configuraciones.configuracion FROM configuraciones INNER JOIN ordenadores ON configuraciones.idconfiguracion=ordenadores.idconfiguracion WHERE ordenadores.idordenador='".$idordenador."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$configuracion= $rs->campos["configuracion"];
|
||||
$auxsplit=split("\t",$configuracion);
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(10),'=');
|
||||
$particion=$ValorParametros["numpart"]; // Toma la partici<63>
|
||||
$tiposo=$ValorParametros["tiposo"]; // Toma nombre del sistema operativo
|
||||
$tipopart=trim($ValorParametros["tipopart"]); // Toma tipo de partici<63> del sistema operativo
|
||||
$nombreso=$ValorParametros["nombreso"]; // Toma nombre del sistema operativo
|
||||
if(!empty($tiposo)){
|
||||
$tablaHtml.='<TR>'.chr(13);
|
||||
$tablaHtml.='<TD ><input type="radio" name="particion" value='.$particion.'></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center> '.$particion.' </TD>'.chr(13);
|
||||
$tablaHtml.='<TD> '.$nombreso.' </TD>'.chr(13);
|
||||
$tiposo=$ValorParametros["tiposo"];
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
}
|
||||
}
|
||||
$rs->Cerrar();
|
||||
return($tablaHtml);
|
||||
}
|
||||
?>
|
|
@ -1,82 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: InventarioHardware.php
|
||||
// Descripción :
|
||||
// Implementaci<63> del comando "Inventario Hardware"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/inventariohardware_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/InventarioHardware.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<BR>
|
||||
<BR>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,130 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: InventarioSoftware.php
|
||||
// Descripción :
|
||||
// Implementación del comando "Inventario Software"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/inventariosoftware_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/InventarioSoftware.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<P align=center>
|
||||
<SPAN align=center class=subcabeceras><? echo $TbMsg[7] ?></SPAN>
|
||||
</BR>
|
||||
<TABLE id="tabla_conf" align=center border=0 cellPadding=1 cellSpacing=1 class=tabla_datos>
|
||||
<TR>
|
||||
<TH align=center> </TH>
|
||||
<TH align=center> <? echo $TbMsg[8] ?> </TH>
|
||||
<TH align=center> <? echo $TbMsg[9] ?> </TH>
|
||||
</TR>
|
||||
<?
|
||||
echo tabla_configuraciones($cmd,$idambito);
|
||||
?>
|
||||
</TABLE>
|
||||
|
||||
<BR>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/*________________________________________________________________________________________________________
|
||||
Particiones
|
||||
________________________________________________________________________________________________________*/
|
||||
function tabla_configuraciones($cmd,$idordenador){
|
||||
global $idcentro;
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$rsp=new Recordset;
|
||||
$cmd->texto="SELECT configuraciones.configuracion FROM configuraciones INNER JOIN ordenadores ON configuraciones.idconfiguracion=ordenadores.idconfiguracion WHERE ordenadores.idordenador='".$idordenador."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$configuracion= $rs->campos["configuracion"];
|
||||
$auxsplit=split("\t",$configuracion);
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(10),'=');
|
||||
$particion=$ValorParametros["numpart"]; // Toma la partici<63>
|
||||
$tiposo=$ValorParametros["tiposo"]; // Toma nombre del sistema operativo
|
||||
$tipopart=trim($ValorParametros["tipopart"]); // Toma tipo de partici<63> del sistema operativo
|
||||
$nombreso=$ValorParametros["nombreso"]; // Toma nombre del sistema operativo
|
||||
if(!empty($tiposo)){
|
||||
$tablaHtml.='<TR>'.chr(13);
|
||||
$tablaHtml.='<TD ><input type=checkbox name=particion_'.$particion.' value='.$particion.'></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center> '.$particion.' </TD>'.chr(13);
|
||||
$tablaHtml.='<TD> '.$nombreso.' </TD>'.chr(13);
|
||||
$tiposo=$ValorParametros["tiposo"];
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
}
|
||||
}
|
||||
$rs->Cerrar();
|
||||
return($tablaHtml);
|
||||
}
|
||||
?>
|
|
@ -1,401 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Configurar.php
|
||||
// Descripción :
|
||||
// Implementaci<63> del comando "Configurar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/HTMLCTESELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/configurar_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$nombreambito="";
|
||||
$cadenaip="";
|
||||
$tbconfigur="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
//___________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/Configurar.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/configurar_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatosocultos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
</FORM>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<BR>
|
||||
<FORM name="fdatos">
|
||||
<?
|
||||
echo tabla_configuraciones($cmd,$idcentro,$idambito,$ambito);
|
||||
echo '<TABLE border=0 style="visibility: hidden" id=patron_contenidoparticion>'.Patrontabla_Particion().'</TABLE>';
|
||||
echo '<INPUT type=hidden id=tbconfigur value="'.$tbconfigur.'">';
|
||||
?>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function tabla_configuraciones($cmd,$idcentro,$idambito,$ambito){
|
||||
global $cadenaip;
|
||||
global $AMBITO_AULAS;
|
||||
global $AMBITO_GRUPOSORDENADORES;
|
||||
global $AMBITO_ORDENADORES;
|
||||
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$numorde=0;
|
||||
|
||||
switch($ambito){
|
||||
case $AMBITO_AULAS :
|
||||
$cmd->texto="SELECT COUNT(*) AS numorde FROM ordenadores WHERE idaula=".$idambito;
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$cmd->texto="SELECT COUNT(*) AS numorde FROM ordenadores WHERE grupoid=".$idambito;
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$cmd->texto="SELECT COUNT(*) AS numorde FROM ordenadores WHERE idordenador=".$idambito;
|
||||
break;
|
||||
}
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF)
|
||||
$numorde=$rs->campos["numorde"];
|
||||
$idconfiguracion="";
|
||||
|
||||
switch($ambito){
|
||||
case $AMBITO_AULAS :
|
||||
$cmd->texto="SELECT COUNT(*) AS cuenta,configuraciones.descripcion,configuraciones.idconfiguracion FROM aulas";
|
||||
$cmd->texto.=" INNER JOIN ordenadores ON aulas.idaula = ordenadores.idaula";
|
||||
$cmd->texto.=" INNER JOIN configuraciones ON ordenadores.idconfiguracion = configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" WHERE aulas.idaula = ".$idambito;
|
||||
$cmd->texto.=" GROUP BY configuraciones.descripcion, configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" HAVING configuraciones.idconfiguracion>0";
|
||||
$cmd->texto.=" ORDER BY configuraciones.descripcion";
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$cmd->texto="SELECT COUNT(*) AS cuenta,configuraciones.descripcion,configuraciones.idconfiguracion FROM gruposordenadores";
|
||||
$cmd->texto.=" INNER JOIN ordenadores ON gruposordenadores.idgrupo = ordenadores.grupoid";
|
||||
$cmd->texto.=" INNER JOIN configuraciones ON ordenadores.idconfiguracion = configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" WHERE (gruposordenadores.idgrupo = ".$idambito.") AND configuraciones.idconfiguracion>0";
|
||||
$cmd->texto.=" GROUP BY configuraciones.descripcion, configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" HAVING configuraciones.idconfiguracion>0";
|
||||
$cmd->texto.=" ORDER BY configuraciones.descripcion";
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$cmd->texto="SELECT COUNT(*) AS cuenta,configuraciones.descripcion,configuraciones.idconfiguracion FROM ordenadores";
|
||||
$cmd->texto.=" INNER JOIN configuraciones ON ordenadores.idconfiguracion = configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" WHERE ordenadores.idordenador = ".$idambito;
|
||||
$cmd->texto.=" GROUP BY configuraciones.descripcion, configuraciones.idconfiguracion";
|
||||
$cmd->texto.=" HAVING configuraciones.idconfiguracion>0";
|
||||
$cmd->texto.=" ORDER BY configuraciones.descripcion";
|
||||
break;
|
||||
}
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF){
|
||||
if($numorde!=$rs->campos["cuenta"]){ // El numero de ordenadores del aula no coincide con los que tienen el mismo perfil hardware
|
||||
while (!$rs->EOF){
|
||||
if($idconfiguracion!=$rs->campos["idconfiguracion"]){
|
||||
if($idconfiguracion!=0) $tablaHtml.="</TABLE>";
|
||||
$tablaHtml.= '<TABLE align=center border=0 cellPadding=1 cellSpacing=1';
|
||||
$descripcion=$rs->campos["descripcion"];
|
||||
$tablaHtml.= "<TR>";
|
||||
$tablaHtml.= '<TD align=center ><IMG style="cursor:hand" oncontextmenu="resalta(this,'.$rs->campos["idconfiguracion"].')" src="../images/iconos/configuraciones.gif">';
|
||||
$tablaHtml.='  <span style="COLOR: #000000;FONT-FAMILY: Verdana;FONT-SIZE: 12px; "><U><b>Configuration</b> '.$rs->campos["descripcion"].'</U></SPAN></TD>';
|
||||
$tablaHtml.= "</TR>";
|
||||
}
|
||||
$tablaHtml.= '<TR><TD>';
|
||||
$tablaHtml.=PintaOrdenadores($cmd,$idambito,$ambito,$rs->campos["idconfiguracion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.= '</TD></TR>';
|
||||
$tablaHtml.= '<TR><TD>';
|
||||
$tablaHtml.=tabla_particiones($cmd,$idcentro,$idambito,$rs->campos["idconfiguracion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.= '</TD></TR>';
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$tablaHtml.="</TABLE>";
|
||||
}
|
||||
else{
|
||||
$tablaHtml.=tabla_particiones($cmd,$idcentro,$idambito,$rs->campos["idconfiguracion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.='<INPUT type=hidden name="nuevasipes" id="ipes_'.$rs->campos["idconfiguracion"].'" value="'.$cadenaip.'">';
|
||||
}
|
||||
}
|
||||
echo $tablaHtml;
|
||||
$rs->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function PintaOrdenadores($cmd,$idambito,$ambito,$idconfiguracion){
|
||||
global $AMBITO_AULAS;
|
||||
global $AMBITO_GRUPOSORDENADORES;
|
||||
$ipidpidc="";
|
||||
$rs=new Recordset;
|
||||
$contor=0;
|
||||
$maxcontor=10;
|
||||
switch($ambito){
|
||||
case $AMBITO_AULAS :
|
||||
$cmd->texto=" SELECT nombreordenador,ip FROM ordenadores WHERE idconfiguracion=".$idconfiguracion." AND idaula=".$idambito." ORDER BY nombreordenador";
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$cmd->texto=" SELECT nombreordenador,ip FROM ordenadores WHERE idconfiguracion=".$idconfiguracion." AND grupoid=".$idambito." ORDER BY nombreordenador";
|
||||
break;
|
||||
}
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$tablaHtml='<TABLE align=center border=0><TR>';
|
||||
while (!$rs->EOF){
|
||||
$contor++;
|
||||
$tablaHtml.= '<TD align=center style="FONT-FAMILY: Arial, Helvetica, sans-serif;FONT-SIZE: 8px"><br><IMG src="../images/iconos/ordenador.gif"><br><span style="FONT-SIZE:9px" >'.$rs->campos["nombreordenador"].'</TD>';
|
||||
if($contor>$maxcontor){
|
||||
$contor=0;
|
||||
$tablaHtml.='</TR><TR>';
|
||||
}
|
||||
$ipidpidc.=$rs->campos["ip"].";";
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$ipidpidc= substr($ipidpidc,0,strlen($ipidpidc)-1); // Quita la coma
|
||||
$tablaHtml.='</TR>';
|
||||
$tablaHtml.= '</TR></TABLE>';
|
||||
$tablaHtml.='<INPUT type=hidden name="nuevasipes" id="ipes_'.$idconfiguracion.'" value="'.$ipidpidc.'">';
|
||||
return($tablaHtml);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function tabla_particiones($cmd,$idcentro,$idambito,$idconfiguracion,$cuenta){
|
||||
global $tbconfigur;
|
||||
global $TbMsg;
|
||||
$tablaHtml="";
|
||||
$configuracion="";
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT idconfiguracion, configuracion FROM configuraciones WHERE idconfiguracion=".$idconfiguracion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF)
|
||||
$idc=$rs->campos["idconfiguracion"];
|
||||
$configuracion=$rs->campos["configuracion"];
|
||||
$rs->Cerrar();
|
||||
$auxsplit=split("\t",$configuracion);
|
||||
$tablaHtml.= '<TABLE align=center id=tabla_contenidoparticion_'.$idc.' value=0><TR><TD>';
|
||||
$tablaHtml.= '<TABLE id=tb_particiones_'.$idc.' class=tabla_listados_sin align=center value=0 cellPadding=1 cellSpacing=1 >';
|
||||
$tablaHtml.= '<TR>';
|
||||
$tablaHtml.= '<TH align=center ><IMG src="../images/iconos/eliminar.gif"></TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[8].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[9].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[10].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[11].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[12].' </TH>';
|
||||
$tablaHtml.= '</TR>';
|
||||
$ultpa=0;
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(10),'=');
|
||||
$particion=$ValorParametros["numpart"]; // Toma la partici<63>
|
||||
$p=$particion;
|
||||
$tipopart=$ValorParametros["tipopart"]; // Toma tama<6D> la partici<63>
|
||||
$tamapart=$ValorParametros["tamapart"]; // Toma tama<6D> la partici<63>
|
||||
$nombreso=$ValorParametros["nombreso"]; // Toma nombre del sistema operativo
|
||||
$tiposo=$ValorParametros["tiposo"];
|
||||
$valocul=0;
|
||||
$codpar=0;
|
||||
echo "<BR>tipopart=".$tipopart;
|
||||
switch($tipopart){
|
||||
case "EMPTY":
|
||||
$codpar=0;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red"> Espacio sin particionar !!</span>';
|
||||
break;
|
||||
case "EXT":
|
||||
$codpar=0;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red"> Partici<63> extendida !!</span>';
|
||||
break;
|
||||
case "BIGDOS":
|
||||
$codpar=1;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Msdos</span>';
|
||||
break;
|
||||
case "FAT32":
|
||||
$codpar=2;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Windows 98, Millenium</span>';
|
||||
break;
|
||||
case "HFAT32":
|
||||
$codpar=2;
|
||||
$valocul=2;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Windows 98, Millenium<span style="COLOR:green;font-weight:600"> ('.$TbMsg[7].')</span></span>';
|
||||
else
|
||||
$nombreso.='<span style="COLOR:green;font-weight:600"> (Partici<63> oculta)</span>';
|
||||
break;
|
||||
case "NTFS":
|
||||
$codpar=3;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Windows XP, Windows 2000, Windows 2003</span>';
|
||||
break;
|
||||
case "HNTFS":
|
||||
$codpar=3;
|
||||
$valocul=2;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Windows XP, Windows 2000, Windows 2003<span style="COLOR:green;font-weight:600"> ('.$TbMsg[7].')</span></span>';
|
||||
else
|
||||
$nombreso.='<span style="COLOR:green;font-weight:600"> ('.$TbMsg[7].')</span>';
|
||||
break;
|
||||
case "EXT2":
|
||||
$codpar=4;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Linux</span>';
|
||||
break;
|
||||
case "EXT3":
|
||||
$codpar=6;
|
||||
if(empty($tiposo))
|
||||
$nombreso='<span style="COLOR:red">Linux</span>';
|
||||
break;
|
||||
case "LINUX-SWAP":
|
||||
$codpar=5;
|
||||
$nombreso='<span style="COLOR:blue">Linux-swap</span>';
|
||||
break;
|
||||
}
|
||||
$ultpa=$p; // Valor de la ultima particion de esa configuraci<63>
|
||||
$tablaHtml.='<TR id=TRparticion_'.$p."_".$idc.'>'.chr(13);
|
||||
$tablaHtml.='<TD><input type=checkbox onclick="elimina_particion(this,'.$idc.')" id=eliminarparticion_'.$p."_".$idc.' value=0></TD>'.chr(13);
|
||||
$opciones="";
|
||||
for($i=1;$i<8;$i++){
|
||||
$opciones.=$i."=".$i.chr(13);
|
||||
}
|
||||
$opciones.="8=8";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"numpar_".$p."_".$idc,"estilodesple","",$p,35,"chgpar").'</TD>'.chr(13);
|
||||
$opciones="1=BIGDOS".chr(13);
|
||||
$opciones.="2=FAT32".chr(13);
|
||||
$opciones.="3=NTFS".chr(13);
|
||||
$opciones.="4=EXT2".chr(13);
|
||||
$opciones.="5=LINUX-SWAP";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"tipospar_".$p."_".$idc,"estilodesple","EMPTY",$codpar,100,"chgtipopar").'</TD>'.chr(13);
|
||||
$tablaHtml.='<TD><span id=tiposo_'.$p."_".$idc.' value=0> '.$nombreso.' </span></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center> <input type=text onchange="chgtama('.$idc.')" id="tamano_'.$p."_".$idc.'" style="width=70" value='.$tamapart.' > </TD>'.chr(13);
|
||||
$opciones="1=".$TbMsg[14]."".chr(13);
|
||||
$opciones.="2=".$TbMsg[15]."".chr(13);
|
||||
$opciones.="3=".$TbMsg[16]."";
|
||||
$tablaHtml.='<TD> '.HTMLCTESELECT($opciones,"acciones_".$p."_".$idc,"estilodesple",$TbMsg[13],$valocul,100,"chgaccion").' </TD>'.chr(13);
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
}
|
||||
$tablaHtml.='</TABLE>';
|
||||
$tablaHtml.= '</TD></TR></TABLE>';
|
||||
|
||||
// Boton de insercion
|
||||
$tablaHtml.= '<INPUT type=hidden id="ultpa_'.$idc.'" value='.$ultpa.'>';
|
||||
$tablaHtml.= '<div align=center>';
|
||||
$tablaHtml.= '<br><IMG style="cursor:hand" name="btanade_"'.$idc.' src="../images/boton_annadir.gif" onclick="annadir_particion('.$idc.')" WIDTH="73" HEIGHT="22">';
|
||||
$tablaHtml.= '</div><br>';
|
||||
$tbconfigur.=$idc.";";
|
||||
return($tablaHtml);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Crea la patron de linea de la tabla Particiones
|
||||
//________________________________________________________________________________________________________
|
||||
function Patrontabla_Particion(){
|
||||
global $TbMsg;
|
||||
$p="_upa_";
|
||||
$idc="_cfg_";
|
||||
$tablaHtml='<TR id=TRparticion_'.$p."_".$idc.'>'.chr(13);
|
||||
$tablaHtml.='<TD><input type=checkbox onclick="elimina_particion(this,'.$idc.')" id=eliminarparticion_'.$p."_".$idc.' value=0></TD>'.chr(13);
|
||||
$opciones="";
|
||||
for($i=1;$i<8;$i++){
|
||||
$opciones.=$i."=".$i.chr(13);
|
||||
}
|
||||
$opciones.="8=8";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"numpar_".$p."_".$idc,"estilodesple","",$p,35,"chgpar").'</TD>'.chr(13);
|
||||
$opciones="1=BIGDOS".chr(13);
|
||||
$opciones.="2=FAT32".chr(13);
|
||||
$opciones.="3=NTFS".chr(13);
|
||||
$opciones.="4=EXT2".chr(13);
|
||||
$opciones.="5=LINUX-SWAP";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"tipospar_".$p."_".$idc,"estilodesple","EMPTY",0,100,"chgtipopar").'</TD>'.chr(13);
|
||||
$tablaHtml.='<TD><span id=tiposo_'.$p."_".$idc.' value=0> <span style="COLOR:red">'.$TbMsg[17].'</span> </span></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center> <input type=text onchange="chgtama('.$idc.')" id="tamano_'.$p."_".$idc.'" style="width=70" value=0 > </TD>'.chr(13);
|
||||
$opciones="1=".$TbMsg[14]."".chr(13);
|
||||
$opciones.="2=".$TbMsg[15]."".chr(13);
|
||||
$opciones.="3=".$TbMsg[16]."";
|
||||
$tablaHtml.='<TD> '.HTMLCTESELECT($opciones,"acciones_".$p."_".$idc,"estilodesple",$TbMsg[13],0,100,"chgaccion").' </TD>'.chr(13);
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
$tablaHtml.='</TABLE>';
|
||||
$tablaHtml.= '</TD></TR></TABLE>';
|
||||
return($tablaHtml);
|
||||
}
|
||||
?>
|
|
@ -1,183 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: ParticionaryFormatear.php
|
||||
// Descripción :
|
||||
// Implementación del comando "ParticionaryFormatear"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/HTMLCTESELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/particionaryformatear_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$nombreambito="";
|
||||
$cadenaip="";
|
||||
|
||||
$tbconfigur="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/ParticionaryFormatear.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="../clases/jscripts/MenuContextual.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="../jscripts/comunes.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/particionaryformatear_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatosocultos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
</FORM>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<BR>
|
||||
<P align=center><SPAN align=center class=subcabeceras><? echo "Partitions"?></SPAN></P>
|
||||
<FORM name="fdatos">
|
||||
<?
|
||||
echo tabla_configuraciones($cmd,$idcentro,$idambito,$ambito);
|
||||
echo '<TABLE border=0 style="visibility: hidden" id=patron_contenidoparticion>'.Patrontabla_Particion().'</TABLE>';
|
||||
echo '<INPUT type=hidden id=tbconfigur value="'.$tbconfigur.'">';
|
||||
?>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function tabla_configuraciones($cmd,$idcentro,$idambito,$ambito){
|
||||
global $tbconfigur;
|
||||
global $TbMsg;
|
||||
$idc=0;
|
||||
$tablaHtml="";
|
||||
$tablaHtml.= '<TABLE align=center id=tabla_contenidoparticion_'.$idc.' value=0><TR><TD>';
|
||||
$tablaHtml.= '<TABLE id=tb_particiones_'.$idc.' class=tabla_listados_sin align=center value=0 cellPadding=1 cellSpacing=1 >';
|
||||
$tablaHtml.= '<TR>';
|
||||
$tablaHtml.= '<TH align=center ><IMG src="../images/iconos/eliminar.gif"></TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[8].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[9].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[10].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[11].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[12].' </TH>';
|
||||
$tablaHtml.= '</TR>';
|
||||
$ultpa=0;
|
||||
$tablaHtml.='</TABLE>';
|
||||
$tablaHtml.= '</TD></TR></TABLE>';
|
||||
|
||||
// Boton de insercion
|
||||
$tablaHtml.= '<INPUT type=hidden id="ultpa_'.$idc.'" value='.$ultpa.'>';
|
||||
$tablaHtml.= '<div align=center>';
|
||||
$tablaHtml.= '<br><A href="#"><IMG border=0 style="cursor:hand" name="btanade_"'.$idc.' src="../images/boton_annadir.gif" onclick="annadir_particion('.$idc.')" WIDTH="73" HEIGHT="22"></A>';
|
||||
$tablaHtml.= '</div><br>';
|
||||
$tbconfigur.=$idc.";";
|
||||
return($tablaHtml);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function Patrontabla_Particion(){
|
||||
global $TbMsg;
|
||||
$p="_upa_";
|
||||
$idc="_cfg_";
|
||||
$tablaHtml='<TR id=TRparticion_'.$p."_".$idc.'>'.chr(13);
|
||||
$tablaHtml.='<TD><input type=checkbox onclick="elimina_particion(this,'.$idc.')" id=eliminarparticion_'.$p."_".$idc.' value=0></TD>'.chr(13);
|
||||
$opciones="";
|
||||
for($i=1;$i<8;$i++){
|
||||
$opciones.=$i."=".$i.chr(13);
|
||||
}
|
||||
$opciones.="8=8";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"numpar_".$p."_".$idc,"estilodesple","",$p,35,"chgpar").'</TD>'.chr(13);
|
||||
$opciones="1=BIGDOS".chr(13);
|
||||
$opciones.="2=FAT32".chr(13);
|
||||
$opciones.="3=NTFS".chr(13);
|
||||
$opciones.="4=EXT2".chr(13);
|
||||
$opciones.="5=EXT3".chr(13);
|
||||
$opciones.="6=EXT4".chr(13);
|
||||
$opciones.="7=LINUX-SWAP".chr(13);
|
||||
$opciones.="8=CACHE";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"tipospar_".$p."_".$idc,"estilodesple","EMPTY",0,100,"chgtipopar").'</TD>'.chr(13);
|
||||
$tablaHtml.='<TD><span id=tiposo_'.$p."_".$idc.' value=0> <span style="COLOR:red">'.$TbMsg[17].'</span> </span></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center><INPUT type=text onchange="chgtama('.$idc.')" id="tamano_'.$p."_".$idc.'" style="width=70" value=0 ></TD>'.chr(13);
|
||||
$opciones="1=".$TbMsg[14]."".chr(13);
|
||||
$opciones.="2=".$TbMsg[15]."".chr(13);
|
||||
$opciones.="3=".$TbMsg[16]."";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($opciones,"acciones_".$p."_".$idc,"estilodesple",$TbMsg[13],0,100,"chgaccion").'</TD>'.chr(13);
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
$tablaHtml.='</TABLE>';
|
||||
$tablaHtml.= '</TD></TR></TABLE>';
|
||||
return($tablaHtml);
|
||||
}
|
||||
?>
|
|
@ -1,82 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Reiniciar.php
|
||||
// Descripción :
|
||||
// Implementación del comando "Reiniciar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/reiniciar_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
|
||||
//__________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/Reiniciar.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<BR>
|
||||
<BR>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,82 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Abril-2005
|
||||
// Nombre del fichero: RemboOffline.php
|
||||
// Descripción :
|
||||
// Implementación del comando "RemboOffline"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/rembooffline_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/rembooffline.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<BR>
|
||||
<BR>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,414 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: RestaurarImagenAula.php
|
||||
// Descripción :
|
||||
// Implementación del comando "RestaurarImagen" (Aula)
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/HTMLCTESELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/restaurarimagen_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$nombreambito="";
|
||||
$cadenaip="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
//________________________________________________________________________________________________________
|
||||
$idaula=$idambito;
|
||||
$nombreaula="";
|
||||
$urlfoto="";
|
||||
$cagnon=false;
|
||||
$pizarra=false;
|
||||
$ubicacion="";
|
||||
$comentarios="";
|
||||
$ordenadores=0;
|
||||
$puestos=0;
|
||||
$grupoid=0;
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
$resul=toma_propiedades($cmd,$idaula);
|
||||
if (!$resul)
|
||||
Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci<63> de datos.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/RestaurarImagenAula.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/restaurarimagen_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatosocultos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
</FORM>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].'</span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<BR>
|
||||
<P align=center><SPAN align=center class=subcabeceras><? echo $TbMsg[7]?></SPAN>
|
||||
<BR><BR>
|
||||
<FORM name="fdatos">
|
||||
<? echo tabla_imagenes($cmd,$idcentro,$idambito); ?>
|
||||
</FORM>
|
||||
<BR>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
//*************************************************************************************************************************************************
|
||||
function tabla_imagenes($cmd,$idcentro,$idaula){
|
||||
global $cadenaip;
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$numorde=0;
|
||||
$cmd->texto="SELECT COUNT(*) AS numorde FROM ordenadores WHERE idaula=".$idaula;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF)
|
||||
$numorde=$rs->campos["numorde"];
|
||||
$descripcion="";
|
||||
$cmd->texto="SELECT COUNT(*) AS cuenta,perfileshard.descripcion,perfileshard.idperfilhard, ordenadores.idparticion FROM aulas";
|
||||
$cmd->texto.=" INNER JOIN ordenadores ON aulas.idaula = ordenadores.idaula";
|
||||
$cmd->texto.=" INNER JOIN perfileshard ON ordenadores.idperfilhard = perfileshard.idperfilhard";
|
||||
$cmd->texto.=" WHERE (aulas.idaula = ".$idaula.") AND idparticion>0";
|
||||
$cmd->texto.=" GROUP BY perfileshard.descripcion,perfileshard.idperfilhard,ordenadores.idparticion";
|
||||
$cmd->texto.=" ORDER BY perfileshard.descripcion";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF){
|
||||
if($numorde!=$rs->campos["cuenta"]){ // El numero de ordenadores del aula no coincide con los que tienen el mismo perfil hardware
|
||||
while (!$rs->EOF){
|
||||
if($descripcion!=$rs->campos["descripcion"]){
|
||||
if($descripcion!="")
|
||||
$tablaHtml.="</TABLE><br><br>";
|
||||
$tablaHtml.= '<TABLE align=center border=0 cellPadding=1 cellSpacing=1';
|
||||
$descripcion=$rs->campos["descripcion"];
|
||||
$tablaHtml.= "<TR>";
|
||||
$tablaHtml.= '<TD align=center ><IMG src="../images/iconos/perfilhardware.gif">';
|
||||
$tablaHtml.='<span style="COLOR: #000000;FONT-FAMILY: Verdana;FONT-SIZE: 12px; "><U><b> Perfil Hardware:</b> '.$rs->campos["descripcion"].'</U></SPAN></TD>';
|
||||
$tablaHtml.= "</TR>";
|
||||
}
|
||||
$tablaHtml.= '<TR><TD align=center>';
|
||||
$tablaHtml.=PintaOrdenadores($cmd,$idaula,$rs->campos["idperfilhard"],$rs->campos["idparticion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.= '</TD></TR>';
|
||||
$tablaHtml.= '<TR><TD>';
|
||||
$tablaHtml.=tabla_particiones($cmd,$idcentro,$idaula,$rs->campos["idperfilhard"],$rs->campos["idparticion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.= '</TD></TR>';
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$tablaHtml.="</TABLE>";
|
||||
}
|
||||
else{
|
||||
$tablaHtml.=tabla_particiones($cmd,$idcentro,$idaula,$rs->campos["idperfilhard"],$rs->campos["idparticion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.='<INPUT type=hidden name="nuevasipes" id="ipes_'.$rs->campos["idperfilhard"].'_'.$rs->campos["idparticion"].'" value="'.$cadenaip.'">';
|
||||
}
|
||||
}
|
||||
echo $tablaHtml;
|
||||
$rs->Cerrar();
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea los desplegables de las imagenes disponibles para la particiones
|
||||
________________________________________________________________________________________________________*/
|
||||
function HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,$miso,$idimagen,$idaula,$idperfilhard,$idparticion,$cuenta){
|
||||
$SelectHtml="";
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) AS contador, perfilessoft.idperfilsoft, imagenes.descripcion, imagenes.idimagen,tiposos.tipopar,tiposos.nemonico FROM ordenadores";
|
||||
$cmd->texto.=" INNER JOIN perfileshard ON ordenadores.idperfilhard = perfileshard.idperfilhard";
|
||||
$cmd->texto.=" INNER JOIN perfileshard_perfilessoft ON perfileshard.idperfilhard = perfileshard_perfilessoft.idperfilhard";
|
||||
$cmd->texto.=" INNER JOIN perfilessoft ON perfileshard_perfilessoft.idperfilsoft = perfilessoft.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN imagenes ON perfilessoft.idperfilsoft = imagenes.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN perfilessoft_softwares ON perfilessoft.idperfilsoft = perfilessoft_softwares.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN softwares ON perfilessoft_softwares.idsoftware = softwares.idsoftware";
|
||||
$cmd->texto.=" INNER JOIN tiposos ON softwares.idtiposo = tiposos.idtiposo";
|
||||
$cmd->texto.=" WHERE (imagenes.idcentro = ".$idcentro.") AND (ordenadores.idaula = ".$idaula.") AND (ordenadores.idperfilhard = ".$idperfilhard.") AND (ordenadores.idparticion=".$idparticion.")";
|
||||
|
||||
$swo=substr ($tipopart,0,1);
|
||||
if($swo=="H")
|
||||
$tipopart=substr ($tipopart,1,strlen($tipopart)-1);
|
||||
|
||||
$sufi="";
|
||||
if($miso){
|
||||
$cmd->texto.=" AND (tiposos.tipopar = '".$tipopart."' OR tiposos.tipopar ='H".$tipopart."' )";
|
||||
$sufi="M"; // Mismo sistema
|
||||
}
|
||||
else{
|
||||
$cmd->texto.=" AND (tiposos.tipopar <> '".$tipopart."' AND tiposos.tipopar <> 'H".$tipopart."')";
|
||||
$sufi="O"; // Otro sistema
|
||||
}
|
||||
$cmd->texto.=" GROUP BY perfilessoft.idperfilsoft, imagenes.descripcion, imagenes.idimagen,tiposos.tipopar,tiposos.nemonico ";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(0); // Error al abrir recordset
|
||||
$SelectHtml.= '<SELECT onchange="marcar(this,'."'".$particion."_".$idperfilhard."_".$idparticion."'".')" class="formulariodatos" id="desple_'.$sufi."_".$particion."_".$idperfilhard."_".$idparticion.'" style="WIDTH: 250">';
|
||||
$SelectHtml.= ' <OPTION value="0"></OPTION>';
|
||||
$rs->Primero();
|
||||
while (!$rs->EOF){
|
||||
if($rs->campos["contador"]==$cuenta){
|
||||
if(CuestionIncrementales($cmd,$idperfilhard,$rs->campos["idperfilsoft"],$rs->campos["idimagen"])){
|
||||
$SelectHtml.='<OPTION value="'.$rs->campos["idimagen"]."_".$idperfilhard."_".$rs->campos["idperfilsoft"]."_".$rs->campos["tipopar"]."_".$rs->campos["nemonico"].'"';
|
||||
if($idimagen==$rs->campos["idimagen"]) $SelectHtml.= " selected ";
|
||||
$SelectHtml.=">".$rs->campos["descripcion"].'</OPTION>';
|
||||
}
|
||||
}
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$SelectHtml.= '</SELECT>';
|
||||
$rs->Cerrar();
|
||||
return($SelectHtml);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la tabla de ordenadores ( iconos peque<EFBFBD>s cuando en el aula no hay uniformidad
|
||||
________________________________________________________________________________________________________*/
|
||||
function PintaOrdenadores($cmd,$idaula,$idperfilhard,$idparticion){
|
||||
$ipidpidc="";
|
||||
$rs=new Recordset;
|
||||
$contor=0;
|
||||
$maxcontor=10;
|
||||
$cmd->texto=" SELECT nombreordenador,ip FROM ordenadores WHERE idperfilhard=".$idperfilhard." AND idparticion=".$idparticion." AND idaula=".$idaula." ORDER BY nombreordenador";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$tablaHtml='<TABLE align=center border=0><TR>';
|
||||
while (!$rs->EOF){
|
||||
$contor++;
|
||||
$tablaHtml.= '<TD align=center style="FONT-FAMILY: Arial, Helvetica, sans-serif;FONT-SIZE: 8px"><br><IMG src="../images/iconos/ordenador.gif"><br><span style="FONT-SIZE:9px" >'.$rs->campos["nombreordenador"].'</TD>';
|
||||
if($contor>$maxcontor){
|
||||
$contor=0;
|
||||
$tablaHtml.='</TR><TR>';
|
||||
}
|
||||
$ipidpidc.=$rs->campos["ip"].";";
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$ipidpidc= substr($ipidpidc,0,strlen($ipidpidc)-1); // Quita la coma
|
||||
$tablaHtml.='</TR>';
|
||||
$tablaHtml.= '</TR></TABLE>';
|
||||
$tablaHtml.='<INPUT type=hidden name="nuevasipes" id="ipes_'.$idperfilhard.'_'.$idparticion.'" value="'.$ipidpidc.'">';
|
||||
return($tablaHtml);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la tabla de particiones
|
||||
________________________________________________________________________________________________________*/
|
||||
function tabla_particiones($cmd,$idcentro,$idaula,$idperfilhard,$idparticion,$cuenta){
|
||||
global $TbMsg;
|
||||
$tablaHtml="";
|
||||
$particion="";
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT particion FROM particiones WHERE idparticion=".$idparticion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF)
|
||||
$particion=$rs->campos["particion"];
|
||||
$rs->Cerrar();
|
||||
$tablaHtml.= '<TABLE class=tabla_listados_sin align=center border=0 cellPadding=1 cellSpacing=1>';
|
||||
$tablaHtml.= '<TR>';
|
||||
$tablaHtml.= '<TH align=center> </TH>';
|
||||
$tablaHtml.= '<TH align=center> P </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[9].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> Path </TH>';
|
||||
$tablaHtml.= '<TH align=center> Repositorios centralizados </TH>';
|
||||
|
||||
$tablaHtml.= '</TR>';
|
||||
$auxsplit=split(";",$particion);
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$dual=split("=",$auxsplit[$j]);
|
||||
$particion=$dual[0]; // Toma la partici<63>
|
||||
$tipopart=$dual[1]; // Toma la partici<63>
|
||||
if($tipopart== "EMPTY" || $tipopart== "LINUX-SWAP" || $tipopart== "CACHE" ) continue;
|
||||
|
||||
$tablaHtml.='<TR >'.chr(13);
|
||||
$tablaHtml.='<TD ><input onclick=seleccionar("'.$particion.'_'.$idperfilhard.'_'.$idparticion.'") type=checkbox name=particion_'.$particion.'_'.$idperfilhard.'_'.$idparticion.' value='.$particion.'_'.$idperfilhard.'_'.$idparticion.'></TD>'.chr(13);
|
||||
$tablaHtml.='<TD ><b> '.$particion.' </b></TD>'.chr(13);
|
||||
$idimagen=TomaImagen($cmd,$idaula,$idperfilhard,$idparticion,$particion,$cuenta);
|
||||
|
||||
$tablaHtml.='<TD align=center>'. HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,true,$idimagen,$idaula,$idperfilhard,$idparticion,$cuenta).'</TD>';
|
||||
|
||||
$parametros="0=".chr(13);
|
||||
$parametros.="1=cache".chr(13);
|
||||
$parametros.="2=repositorio";
|
||||
$tablaHtml.= '<TD>'.HTMLCTESELECT($parametros, "pathrmb_".$particion.'_'.$idperfilhard.'_'.$idparticion,"estilodesple","",0,60).'</TD>';
|
||||
|
||||
|
||||
//Clonación
|
||||
$metodos="UNICAST=UNICAST".chr(13);
|
||||
$metodos.="MULTICAST=MULTICAST".chr(13);
|
||||
$metodos.="TORRENT=TORRENT";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($metodos,"protoclonacion_".$particion.'_'.$idperfilhard.'_'.$idparticion,"estilodesple","",$_SESSION["protclonacion"],150).'</TD>';
|
||||
|
||||
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
|
||||
/*
|
||||
$idimagen=TomaImagen($cmd,$idaula,$idperfilhard,$idparticion,$particion,$cuenta);
|
||||
|
||||
$tablaHtml.='<TR>'.chr(13);
|
||||
$tablaHtml.='<TD></TD>'.chr(13);
|
||||
$tablaHtml.='<TD></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center>'. HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,true,$idimagen,$idaula,$idperfilhard,$idparticion,$cuenta).'</TD>';
|
||||
|
||||
$parametros="0=".chr(13);
|
||||
$parametros.="1=cache".chr(13);
|
||||
$parametros.="2=net";
|
||||
$tablaHtml.= '<TD>'.HTMLCTESELECT($parametros, "pathrmb_".$particion.'_'.$idperfilhard.'_'.$idparticion,"estilodesple","",0,60).'</TD>';
|
||||
|
||||
$tablaHtml.='<TD align=center>'. HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,false,$idimagen,$idaula,$idperfilhard,$idparticion,$cuenta).'</TD>';
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
*/
|
||||
}
|
||||
$tablaHtml.='</TABLE>';
|
||||
$tablaHtml.='<BR>';
|
||||
return($tablaHtml);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que la imagen no tiene incrementales o si la tiene que existen para el perfil hardware del ordenador
|
||||
//________________________________________________________________________________________________________
|
||||
function CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen){
|
||||
$wrs=new Recordset;
|
||||
$cmd->texto=" SELECT idsoftincremental FROM imagenes_softincremental WHERE idimagen=".$idimagen;
|
||||
$wrs->Comando=&$cmd;
|
||||
if (!$wrs->Abrir()) return(false); // Error al abrir recordset
|
||||
if ($wrs->numeroderegistros==0) return(true);
|
||||
while (!$wrs->EOF){
|
||||
if(!ExisteIncremental($cmd,$idperfilhard,$idperfilsoft ,$wrs->campos["idsoftincremental"])) return(false);
|
||||
$wrs->Siguiente();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que existe una incremental para cierta combinaci<63> de perfil software y perfil hardware
|
||||
//________________________________________________________________________________________________________
|
||||
function ExisteIncremental($cmd,$idperfilhard,$idperfilsoft ,$idsoftincremental){
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) as contador FROM perfileshard_perfilessoft INNER JOIN phard_psoft_softincremental ON perfileshard_perfilessoft.idphardidpsoft = phard_psoft_softincremental.idphardidpsoft WHERE (perfileshard_perfilessoft.idperfilhard = ".$idperfilhard.") AND (perfileshard_perfilessoft.idperfilsoft = ".$idperfilsoft.") AND (phard_psoft_softincremental.idsoftincremental = ".$idsoftincremental.")";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
if ($rs->campos["contador"]==0) return(false);
|
||||
return(true);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Recupera los datos de un aula
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexiónabierta)
|
||||
- ida:El identificador del aula
|
||||
________________________________________________________________________________________________________*/
|
||||
function toma_propiedades($cmd,$ida){
|
||||
global $nombreaula;
|
||||
global $urlfoto;
|
||||
global $cagnon;
|
||||
global $pizarra;
|
||||
global $ubicacion;
|
||||
global $comentarios;
|
||||
global $ordenadores;
|
||||
global $puestos;
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT * FROM aulas WHERE idaula=".$ida;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF){
|
||||
$nombreaula=$rs->campos["nombreaula"];
|
||||
$urlfoto=$rs->campos["urlfoto"];
|
||||
$cagnon=$rs->campos["cagnon"];
|
||||
$pizarra=$rs->campos["pizarra"];
|
||||
$ubicacion=$rs->campos["ubicacion"];
|
||||
$comentarios=$rs->campos["comentarios"];
|
||||
$puestos=$rs->campos["puestos"];
|
||||
$rs->Cerrar();
|
||||
$cmd->texto="SELECT count(*) as numordenadores FROM ordenadores WHERE idaula=".$ida;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF)
|
||||
$ordenadores=$rs->campos["numordenadores"];
|
||||
return(true);
|
||||
}
|
||||
else
|
||||
return(false);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Toma el identificador de la imagen
|
||||
________________________________________________________________________________________________________*/
|
||||
function TomaImagen($cmd,$idaula,$idperfilhard,$idparticion,$particion,$cuenta){
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) AS contador, imagenes.idimagen FROM ordenadores INNER JOIN ordenador_imagen ON ordenadores.idordenador = ordenador_imagen.idordenador INNER JOIN imagenes ON ordenador_imagen.idimagen = imagenes.idimagen WHERE ordenadores.idperfilhard = ".$idperfilhard." AND ordenadores.idparticion = ".$idparticion." AND ordenadores.idaula =".$idaula." AND ordenador_imagen.particion = ".$particion." GROUP BY imagenes.idimagen" ;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$idimagen=0;
|
||||
if(!$rs->EOF){
|
||||
if($rs->campos["contador"]==$cuenta){
|
||||
$idimagen=$rs->campos["idimagen"];
|
||||
}
|
||||
}
|
||||
$rs->Cerrar();
|
||||
return($idimagen);
|
||||
}
|
||||
?>
|
|
@ -1,390 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: RestaurarImagenGrupoOrdenadores.php
|
||||
// Descripción :
|
||||
// Implementación del comando "RestaurarImagen" ( Grupo de ordenadores)
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/HTMLCTESELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/restaurarimagen_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$nombreambito="";
|
||||
$cadenaip="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
//___________________________________________________________________________________________________
|
||||
$idgrupo=$idambito;
|
||||
$nombregrupoordenador="";
|
||||
$ordenadores=0;
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
|
||||
$resul=toma_propiedades($cmd,$idgrupo);
|
||||
if (!$resul)
|
||||
Header('Location: '.$pagerror.'?herror=3'); // Error de recuperación de datos.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/RestaurarImagenGrupoOrdenadores.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/restaurarimagen_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatosocultos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
</FORM>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].'</span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<P align=center><SPAN align=center class=subcabeceras><? echo $TbMsg[7]?></SPAN>
|
||||
<BR>
|
||||
<FORM name="fdatos">
|
||||
<? echo tabla_imagenes($cmd,$idcentro,$idambito);?>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
//*************************************************************************************************************************************************
|
||||
function tabla_imagenes($cmd,$idcentro,$idgrupo){
|
||||
global $cadenaip;
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$numorde=0;
|
||||
$cmd->texto="SELECT COUNT(*) AS numorde FROM ordenadores WHERE grupoid=".$idgrupo;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF)
|
||||
$numorde=$rs->campos["numorde"];
|
||||
$descripcion="";
|
||||
$cmd->texto="SELECT COUNT(*) AS cuenta,perfileshard.descripcion,perfileshard.idperfilhard, ordenadores.idparticion FROM gruposordenadores";
|
||||
$cmd->texto.=" INNER JOIN ordenadores ON gruposordenadores.idgrupo = ordenadores.grupoid";
|
||||
$cmd->texto.=" INNER JOIN perfileshard ON ordenadores.idperfilhard = perfileshard.idperfilhard";
|
||||
$cmd->texto.=" WHERE (gruposordenadores.idgrupo = ".$idgrupo.") AND idparticion>0";
|
||||
$cmd->texto.=" GROUP BY perfileshard.descripcion,perfileshard.idperfilhard,ordenadores.idparticion";
|
||||
$cmd->texto.=" ORDER BY perfileshard.descripcion";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF){
|
||||
if($numorde!=$rs->campos["cuenta"]){
|
||||
while (!$rs->EOF){
|
||||
if($descripcion!=$rs->campos["descripcion"]){
|
||||
if($descripcion!="")
|
||||
$tablaHtml.="</TABLE><br><br>";
|
||||
$tablaHtml.= '<TABLE align=center border=0 cellPadding=1 cellSpacing=1';
|
||||
$descripcion=$rs->campos["descripcion"];
|
||||
$tablaHtml.= "<TR>";
|
||||
$tablaHtml.= '<TD align=center><IMG src="../images/iconos/perfilhardware.gif">';
|
||||
$tablaHtml.='<span style="COLOR: #000000;FONT-FAMILY: Verdana;FONT-SIZE: 12px; "><U><b> Perfil Hardware:</b> '.$rs->campos["descripcion"].'</U></SPAN></TD>';
|
||||
$tablaHtml.= "</TR>";
|
||||
}
|
||||
$tablaHtml.= '<TR><TD>';
|
||||
$tablaHtml.=PintaOrdenadores($cmd,$idgrupo,$rs->campos["idperfilhard"],$rs->campos["idparticion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.= '</TD></TR>';
|
||||
$tablaHtml.= '<TR><TD>';
|
||||
$tablaHtml.=tabla_particiones($cmd,$idcentro,$idgrupo,$rs->campos["idperfilhard"],$rs->campos["idparticion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.= '</TD></TR>';
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$tablaHtml.="</TABLE>";
|
||||
}
|
||||
else{
|
||||
$tablaHtml.=tabla_particiones($cmd,$idcentro,$idgrupo,$rs->campos["idperfilhard"],$rs->campos["idparticion"],$rs->campos["cuenta"]);
|
||||
$tablaHtml.='<INPUT type=hidden name="nuevasipes" id="ipes_'.$rs->campos["idperfilhard"].'_'.$rs->campos["idparticion"].'" value="'.$cadenaip.'">';
|
||||
}
|
||||
}
|
||||
echo $tablaHtml;
|
||||
$rs->Cerrar();
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea los desplegables de las imagenes disponibles para la particiones
|
||||
________________________________________________________________________________________________________*/
|
||||
function HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,$miso,$idimagen,$idgrupo,$idperfilhard,$idparticion,$cuenta){
|
||||
$SelectHtml="";
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) AS contador, perfilessoft.idperfilsoft, imagenes.descripcion, imagenes.idimagen,tiposos.tipopar,tiposos.nemonico FROM ordenadores";
|
||||
$cmd->texto.=" INNER JOIN perfileshard ON ordenadores.idperfilhard = perfileshard.idperfilhard";
|
||||
$cmd->texto.=" INNER JOIN perfileshard_perfilessoft ON perfileshard.idperfilhard = perfileshard_perfilessoft.idperfilhard";
|
||||
$cmd->texto.=" INNER JOIN perfilessoft ON perfileshard_perfilessoft.idperfilsoft = perfilessoft.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN imagenes ON perfilessoft.idperfilsoft = imagenes.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN perfilessoft_softwares ON perfilessoft.idperfilsoft = perfilessoft_softwares.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN softwares ON perfilessoft_softwares.idsoftware = softwares.idsoftware";
|
||||
$cmd->texto.=" INNER JOIN tiposos ON softwares.idtiposo = tiposos.idtiposo";
|
||||
$cmd->texto.=" WHERE (imagenes.idcentro = ".$idcentro.") AND (ordenadores.grupoid = ".$idgrupo.") AND (ordenadores.idperfilhard = ".$idperfilhard.") AND (ordenadores.idparticion=".$idparticion.")";
|
||||
|
||||
$swo=substr ($tipopart,0,1);
|
||||
if($swo=="H")
|
||||
$tipopart=substr ($tipopart,1,strlen($tipopart)-1);
|
||||
|
||||
$sufi="";
|
||||
if($miso){
|
||||
$cmd->texto.=" AND (tiposos.tipopar = '".$tipopart."' OR tiposos.tipopar ='H".$tipopart."' )";
|
||||
$sufi="M"; // Mismo sistema
|
||||
}
|
||||
else{
|
||||
$cmd->texto.=" AND (tiposos.tipopar <> '".$tipopart."' AND tiposos.tipopar <> 'H".$tipopart."')";
|
||||
$sufi="O"; // Otro sistema
|
||||
}
|
||||
$cmd->texto.=" GROUP BY perfilessoft.idperfilsoft, imagenes.descripcion, imagenes.idimagen,tiposos.tipopar,tiposos.nemonico ";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(0); // Error al abrir recordset
|
||||
$SelectHtml.= '<SELECT onchange="marcar(this,'."'".$particion."_".$idperfilhard."_".$idparticion."'".')" class="formulariodatos" id="desple_'.$sufi."_".$particion."_".$idperfilhard."_".$idparticion.'" style="WIDTH: 250">';
|
||||
$SelectHtml.= ' <OPTION value="0"></OPTION>';
|
||||
$rs->Primero();
|
||||
while (!$rs->EOF){
|
||||
if($rs->campos["contador"]==$cuenta){
|
||||
if(CuestionIncrementales($cmd,$idperfilhard,$rs->campos["idperfilsoft"],$rs->campos["idimagen"])){
|
||||
$SelectHtml.='<OPTION value="'.$rs->campos["idimagen"]."_".$idperfilhard."_".$rs->campos["idperfilsoft"]."_".$rs->campos["tipopar"]."_".$rs->campos["nemonico"].'"';
|
||||
if($idimagen==$rs->campos["idimagen"]) $SelectHtml.= " selected ";
|
||||
$SelectHtml.=">".$rs->campos["descripcion"].'</OPTION>';
|
||||
}
|
||||
}
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$SelectHtml.= '</SELECT>';
|
||||
$rs->Cerrar();
|
||||
return($SelectHtml);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la tabla de ordenadores ( iconos pequeños cuando en el aula no hay uniformidad
|
||||
________________________________________________________________________________________________________*/
|
||||
function PintaOrdenadores($cmd,$idgrupo,$idperfilhard,$idparticion){
|
||||
$ipidpidc="";
|
||||
$rs=new Recordset;
|
||||
$contor=0;
|
||||
$cmd->texto=" SELECT nombreordenador,ip FROM ordenadores WHERE idperfilhard=".$idperfilhard." AND idparticion=".$idparticion." AND grupoid=".$idgrupo." ORDER BY nombreordenador";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$tablaHtml='<TABLE align=center border=0 ><TR>';
|
||||
while (!$rs->EOF){
|
||||
$contor++;
|
||||
$tablaHtml.= '<TD><IMG src="../images/iconos/ordenador.gif"><span style="COLOR: #000000;FONT-FAMILY:Verdana;FONT-SIZE:9px; "> '.$rs->campos["nombreordenador"].' </TD>';
|
||||
if($contor>10){
|
||||
$contor=0;
|
||||
$tablaHtml.='</TR><TR>';
|
||||
}
|
||||
$ipidpidc.=$rs->campos["ip"].";";
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$tablaHtml.='</TR>';
|
||||
$tablaHtml.= '</TR></TABLE>';
|
||||
$tablaHtml.='<INPUT type=hidden name="nuevasipes" id="ipes_'.$idperfilhard.'_'.$idparticion.'" value="'.$ipidpidc.'">';
|
||||
return($tablaHtml);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea la tabla de particiones
|
||||
________________________________________________________________________________________________________*/
|
||||
function tabla_particiones($cmd,$idcentro,$idgrupo,$idperfilhard,$idparticion,$cuenta){
|
||||
global $TbMsg;
|
||||
$tablaHtml="";
|
||||
$particion="";
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT particion FROM particiones WHERE idparticion=".$idparticion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if(!$rs->EOF)
|
||||
$particion=$rs->campos["particion"];
|
||||
$rs->Cerrar();
|
||||
$tablaHtml.= '<TABLE class=tabla_listados_sin align=center border=0 cellPadding=1 cellSpacing=1>';
|
||||
$tablaHtml.= '<TR>';
|
||||
$tablaHtml.= '<TH align=center> </TH>';
|
||||
$tablaHtml.= '<TH align=center> P </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[9].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> path </TH>';
|
||||
$tablaHtml.= '<TH align=center> Repositorios centralizados </TH>';
|
||||
$tablaHtml.= '</TR>';
|
||||
$auxsplit=split(";",$particion);
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$dual=split("=",$auxsplit[$j]);
|
||||
$particion=$dual[0]; // Toma la partición
|
||||
$tipopart=$dual[1]; // Toma la partición
|
||||
if($tipopart== "EMPTY" || $tipopart== "LINUX-SWAP" || $tipopart== "CACHE") continue;
|
||||
|
||||
$tablaHtml.='<TR >'.chr(13);
|
||||
$tablaHtml.='<TD ><input onclick=seleccionar("'.$particion.'_'.$idperfilhard.'_'.$idparticion.'") type=checkbox name=particion_'.$particion.'_'.$idperfilhard.'_'.$idparticion.' value='.$particion.'_'.$idperfilhard.'_'.$idparticion.'></TD>'.chr(13);
|
||||
$tablaHtml.='<TD ><b> '.$particion.' </b></TD>'.chr(13);
|
||||
$idimagen=TomaImagen($cmd,$idgrupo,$idperfilhard,$idparticion,$particion,$cuenta);
|
||||
|
||||
$tablaHtml.='<TD align=center>'. HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,true,$idimagen,$idgrupo,$idperfilhard,$idparticion,$cuenta).'</TD>';
|
||||
|
||||
$parametros="0=".chr(13);
|
||||
$parametros.="1=cache".chr(13);
|
||||
$parametros.="2=repositorio";
|
||||
$tablaHtml.= '<TD>'.HTMLCTESELECT($parametros, "pathrmb_".$particion.'_'.$idperfilhard.'_'.$idparticion,"estilodesple","",0,60).'</TD>';
|
||||
$tablaHtml.= '<TD'.chr(13);
|
||||
|
||||
|
||||
//Clonación
|
||||
$metodos="UNICAST=UNICAST".chr(13);
|
||||
$metodos.="MULTICAST=MULTICAST".chr(13);
|
||||
$metodos.="TORRENT=TORRENT";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($metodos,"protoclonacion_".$particion.'_'.$idperfilhard.'_'.$idparticion,"estilodesple","",$_SESSION["protclonacion"],150).'</TD>';
|
||||
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
/*
|
||||
$idimagen=TomaImagen($cmd,$idgrupo,$idperfilhard,$idparticion,$particion,$cuenta);
|
||||
|
||||
$tablaHtml.='<TR>'.chr(13);
|
||||
$tablaHtml.='<TD></TD>'.chr(13);
|
||||
$tablaHtml.='<TD></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=center>'. HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,true,$idimagen,$idgrupo,$idperfilhard,$idparticion,$cuenta).'</TD>';
|
||||
|
||||
$parametros="0=".chr(13);
|
||||
$parametros.="1=cache".chr(13);
|
||||
$parametros.="2=net";
|
||||
$tablaHtml.= '<TD>'.HTMLCTESELECT($parametros, "pathrmb_".$particion.'_'.$idperfilhard.'_'.$idparticion,"estilodesple","",0,60).'</TD>';
|
||||
$tablaHtml.= '<TD'.chr(13);
|
||||
|
||||
$tablaHtml.='<TD align=center>'. HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,false,$idimagen,$idgrupo,$idperfilhard,$idparticion,$cuenta).'</TD>';
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
*/
|
||||
}
|
||||
$tablaHtml.='</TABLE>';
|
||||
$tablaHtml.='<BR>';
|
||||
return($tablaHtml);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que la imagen no tiene incrementales o si la tiene que existen para el perfil hardware del ordenador
|
||||
//________________________________________________________________________________________________________
|
||||
function CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen){
|
||||
$wrs=new Recordset;
|
||||
$cmd->texto=" SELECT idsoftincremental FROM imagenes_softincremental WHERE idimagen=".$idimagen;
|
||||
$wrs->Comando=&$cmd;
|
||||
if (!$wrs->Abrir()) return(false); // Error al abrir recordset
|
||||
if ($wrs->numeroderegistros==0) return(true);
|
||||
while (!$wrs->EOF){
|
||||
if(!ExisteIncremental($cmd,$idperfilhard,$idperfilsoft ,$wrs->campos["idsoftincremental"])) return(false);
|
||||
$wrs->Siguiente();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que existe una incremental para cierta combinación de perfil software y perfil hardware
|
||||
//________________________________________________________________________________________________________
|
||||
function ExisteIncremental($cmd,$idperfilhard,$idperfilsoft ,$idsoftincremental){
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) as contador FROM perfileshard_perfilessoft INNER JOIN phard_psoft_softincremental ON perfileshard_perfilessoft.idphardidpsoft = phard_psoft_softincremental.idphardidpsoft WHERE (perfileshard_perfilessoft.idperfilhard = ".$idperfilhard.") AND (perfileshard_perfilessoft.idperfilsoft = ".$idperfilsoft.") AND (phard_psoft_softincremental.idsoftincremental = ".$idsoftincremental.")";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
if ($rs->campos["contador"]==0) return(false);
|
||||
return(true);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Recupera los datos de un grupo de ordenadores
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
- idg:El identificador del grupo
|
||||
________________________________________________________________________________________________________*/
|
||||
function toma_propiedades($cmd,$idg){
|
||||
global $nombregrupoordenador;
|
||||
global $ordenadores;
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT * FROM gruposordenadores WHERE idgrupo=".$idg;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF){
|
||||
$nombregrupoordenador=$rs->campos["nombregrupoordenador"];
|
||||
$rs->Cerrar();
|
||||
$cmd->texto="SELECT count(*) as numordenadores FROM ordenadores WHERE grupoid=".$idg;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF)
|
||||
$ordenadores=$rs->campos["numordenadores"];
|
||||
return(true);
|
||||
}
|
||||
else
|
||||
return(false);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Toma el identificador de la imagen
|
||||
________________________________________________________________________________________________________*/
|
||||
function TomaImagen($cmd,$idgrupo,$idperfilhard,$idparticion,$particion,$cuenta){
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) AS contador, imagenes.idimagen FROM ordenadores INNER JOIN ordenador_imagen ON ordenadores.idordenador = ordenador_imagen.idordenador INNER JOIN imagenes ON ordenador_imagen.idimagen = imagenes.idimagen WHERE ordenadores.idperfilhard = ".$idperfilhard." AND ordenadores.idparticion = ".$idparticion." AND ordenadores.grupoid =".$idgrupo." AND ordenador_imagen.particion = ".$particion." GROUP BY imagenes.idimagen" ;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$idimagen=0;
|
||||
if(!$rs->EOF){
|
||||
if($rs->campos["contador"]==$cuenta){
|
||||
$idimagen=$rs->campos["idimagen"];
|
||||
}
|
||||
}
|
||||
$rs->Cerrar();
|
||||
return($idimagen);
|
||||
}
|
||||
?>
|
|
@ -1,325 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: RestaurarImagenOrdenador.php
|
||||
// Descripción :
|
||||
// Implementación del comando "RestaurarImagen" (Ordenadores)
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../includes/HTMLCTESELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/restaurarimagen_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$nombreambito="";
|
||||
$cadenaip="";
|
||||
$cadenamac="";
|
||||
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$cadenamac=$ValorParametros["cadenamac"];
|
||||
//________________________________________________________________________________________________________
|
||||
$idordenador=$idambito;
|
||||
$nombreordenador="";
|
||||
$ip=$cadenaip;
|
||||
$mac=$cadenamac;
|
||||
$idperfilhard=0;
|
||||
$idservidordhcp=0;
|
||||
$idservidorrembo=0;
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexióncon servidor B.D.
|
||||
$resul=toma_propiedades($cmd,$idordenador);
|
||||
if (!$resul)
|
||||
Header('Location: '.$pagerror.'?herror=3'); // Error de recuperaci<63> de datos.
|
||||
//___________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<STYLE TYPE="text/css"></STYLE>
|
||||
<SCRIPT language="javascript" src="./jscripts/RestaurarImagenOrdenador.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/restaurarimagen_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<FORM name="fdatosocultos">
|
||||
<INPUT type=hidden name=identificador value=<? echo $identificador ?>>
|
||||
<INPUT type=hidden name=nombrefuncion value=<? echo $nombrefuncion ?>>
|
||||
<INPUT type=hidden name=ejecutor value=<? echo $ejecutor ?>>
|
||||
<INPUT type=hidden name=tipotrama value=<? echo $tipotrama ?>>
|
||||
<INPUT type=hidden name=ambito value=<? echo $ambito ?>>
|
||||
<INPUT type=hidden name=idambito value=<? echo $idambito ?>>
|
||||
<INPUT type=hidden name=cadenaip value=<? echo $cadenaip ?>>
|
||||
</FORM>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].'</span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<!------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------->
|
||||
<BR>
|
||||
<P align=center><SPAN align=center class=subcabeceras><? echo $TbMsg[7]?></SPAN>
|
||||
<BR>
|
||||
<FORM name="fdatos">
|
||||
<?echo tabla_particiones($cmd,$idcentro,$idambito);?>
|
||||
</FORM>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
//*************************************************************************************************************************************************
|
||||
function tabla_particiones($cmd,$idcentro,$idordenador){
|
||||
global $TbMsg;
|
||||
$tablaHtml="";
|
||||
$rs=new Recordset;
|
||||
$rsp=new Recordset;
|
||||
$cmd->texto="SELECT particiones.particion FROM particiones INNER JOIN ordenadores ON particiones.idparticion=ordenadores.idparticion WHERE ordenadores.idordenador='".$idordenador."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
if ($rs->EOF) return($tablaHtml);
|
||||
$particion=$rs->campos["particion"];
|
||||
$tablaHtml.= '<TABLE class=tabla_listados_sin align=center border=0 cellPadding=1 cellSpacing=1 >';
|
||||
$tablaHtml.= '<TR>';
|
||||
$tablaHtml.= '<TH align=center> </TH>';
|
||||
$tablaHtml.= '<TH align=center> P </TH>';
|
||||
$tablaHtml.= '<TH align=center> '.$TbMsg[9].' </TH>';
|
||||
$tablaHtml.= '<TH align=center> Path </TH>';
|
||||
$tablaHtml.= '<TH align=center> Repositorios centralizados </TH>';
|
||||
//$tablaHtml.= '<TH colspan=4 align=center> '.$TbMsg[9].' </TH>';
|
||||
$tablaHtml.= '</TR>';
|
||||
$auxsplit=split(";",$particion);
|
||||
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$dual=split("=",$auxsplit[$j]);
|
||||
$particion=$dual[0]; // Toma la partici<63>
|
||||
$tipopart=$dual[1]; // Toma la partici<63>
|
||||
|
||||
if($tipopart== "EMPTY" || $tipopart== "LINUX-SWAP" || $tipopart== "CACHE") continue;
|
||||
|
||||
$tablaHtml.='<TR >'.chr(13);
|
||||
// selector checkbox
|
||||
$tablaHtml.='<TD ><input onclick=seleccionar("'.$particion.'") type=checkbox name=particion_'.$particion.' value='.$particion.'></TD>'.chr(13);
|
||||
// partición
|
||||
$tablaHtml.='<TD ><b> '.$particion.' </b></TD>'.chr(13);
|
||||
//$tablaHtml.='<TD align=center><b> ('.$tipopart.") - </b>".$TbMsg[10].'</TD>';
|
||||
|
||||
$idimagen=TomaImagen($cmd,$idordenador,$particion);
|
||||
//imagen a elegir
|
||||
$tablaHtml.='<TD align=cente>'.HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,true,$idimagen,$idordenador).'</TD>';
|
||||
|
||||
//path
|
||||
$parametros="0=".chr(13);
|
||||
$parametros.="1=cache".chr(13);
|
||||
$parametros.="2=repositorio";
|
||||
$tablaHtml.= '<TD>'.HTMLCTESELECT($parametros,"pathrmb_".$particion,"estilodesple","",0,60).'</TD>';
|
||||
|
||||
|
||||
//Clonación
|
||||
$metodos="UNICAST=UNICAST".chr(13);
|
||||
$metodos.="MULTICAST=MULTICAST".chr(13);
|
||||
$metodos.="TORRENT=TORRENT";
|
||||
$tablaHtml.='<TD>'.HTMLCTESELECT($metodos,"protoclonacion_".$particion,"estilodesple","",$_SESSION["protclonacion"],150).'</TD>';
|
||||
|
||||
//$tablaHtml.='<TD align=center><b> ('.$tipopart.") -</b> ".$TbMsg[11].'</TD>';
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
|
||||
|
||||
|
||||
/*
|
||||
$tablaHtml.='<TR>'.chr(13);
|
||||
$tablaHtml.='<TD></TD>'.chr(13);
|
||||
$tablaHtml.='<TD></TD>'.chr(13);
|
||||
$tablaHtml.='<TD align=cente>'.HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,true,$idimagen,$idordenador).'</TD>';
|
||||
|
||||
$parametros="0=".chr(13);
|
||||
$parametros.="1=cache".chr(13);
|
||||
$parametros.="2=net";
|
||||
$tablaHtml.= '<TD>'.HTMLCTESELECT($parametros,"pathrmb_".$particion,"estilodesple","",0,60).'</TD>';
|
||||
|
||||
$tablaHtml.='<TD align=cente>'.HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,false,$idimagen,$idordenador).'</TD>';
|
||||
$tablaHtml.='</TR>'.chr(13);
|
||||
*/
|
||||
}
|
||||
$tablaHtml.='</TABLE>';
|
||||
$tablaHtml.='<BR>';
|
||||
return($tablaHtml);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea los desplegables de las imagenes disponibles para la particiones
|
||||
________________________________________________________________________________________________________*/
|
||||
function HTMLSELECT_Imagendis($cmd,$idcentro,$tipopart,$particion,$miso,$idimagen,$idordenador){
|
||||
$SelectHtml="";
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT perfilessoft.idperfilsoft,ordenadores.idperfilhard,imagenes.descripcion,imagenes.idimagen,tiposos.tipopar,tiposos.nemonico FROM ordenadores";
|
||||
$cmd->texto.=" INNER JOIN perfileshard ON ordenadores.idperfilhard = perfileshard.idperfilhard";
|
||||
$cmd->texto.=" INNER JOIN perfileshard_perfilessoft ON perfileshard.idperfilhard = perfileshard_perfilessoft.idperfilhard";
|
||||
$cmd->texto.=" INNER JOIN perfilessoft ON perfileshard_perfilessoft.idperfilsoft = perfilessoft.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN imagenes ON perfilessoft.idperfilsoft = imagenes.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN perfilessoft_softwares ON perfilessoft.idperfilsoft = perfilessoft_softwares.idperfilsoft";
|
||||
$cmd->texto.=" INNER JOIN softwares ON perfilessoft_softwares.idsoftware = softwares.idsoftware";
|
||||
$cmd->texto.=" INNER JOIN tiposos ON softwares.idtiposo = tiposos.idtiposo";
|
||||
$cmd->texto.=" WHERE imagenes.idcentro=".$idcentro." AND ordenadores.idordenador='".$idordenador."'";
|
||||
|
||||
$swo=substr ($tipopart,0,1);
|
||||
if($swo=="H")
|
||||
$tipopart=substr ($tipopart,1,strlen($tipopart)-1);
|
||||
|
||||
$sufi="";
|
||||
if($miso){
|
||||
$cmd->texto.=" AND (tiposos.tipopar = '".$tipopart."' OR tiposos.tipopar ='H".$tipopart."' )";
|
||||
$sufi="M"; // Mismo sistema
|
||||
}
|
||||
else{
|
||||
$cmd->texto.=" AND (tiposos.tipopar <> '".$tipopart."' AND tiposos.tipopar <> 'H".$tipopart."')";
|
||||
$sufi="O"; // Otro sistema
|
||||
}
|
||||
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(0); // Error al abrir recordset
|
||||
$SelectHtml.= '<SELECT onchange="marcar(this,'.$particion.')" class="formulariodatos" id="desple_'.$sufi."_".$particion.'" style="WIDTH: 250">';
|
||||
$SelectHtml.= ' <OPTION value="0"></OPTION>';
|
||||
$rs->Primero();
|
||||
while (!$rs->EOF){
|
||||
if(CuestionIncrementales($cmd,$rs->campos["idperfilhard"],$rs->campos["idperfilsoft"],$rs->campos["idimagen"])){
|
||||
$SelectHtml.='<OPTION value="'.$rs->campos["idimagen"]."_".$rs->campos["idperfilhard"]."_".$rs->campos["idperfilsoft"]."_".$rs->campos["tipopar"]."_".$rs->campos["nemonico"].'"';
|
||||
if($idimagen==$rs->campos["idimagen"]) $SelectHtml.= " selected ";
|
||||
$SelectHtml.=">".$rs->campos["descripcion"].'</OPTION>';
|
||||
}
|
||||
$rs->Siguiente();
|
||||
}
|
||||
$SelectHtml.= '</SELECT>';
|
||||
$rs->Cerrar();
|
||||
return($SelectHtml);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que la imagen no tiene incrementales o si la tiene que existen para el perfil hardware del ordenador
|
||||
//________________________________________________________________________________________________________
|
||||
function CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen){
|
||||
$wrs=new Recordset;
|
||||
$cmd->texto=" SELECT idsoftincremental FROM imagenes_softincremental WHERE idimagen=".$idimagen;
|
||||
$wrs->Comando=&$cmd;
|
||||
if (!$wrs->Abrir()) return(false); // Error al abrir recordset
|
||||
if ($wrs->numeroderegistros==0) return(true);
|
||||
while (!$wrs->EOF){
|
||||
if(!ExisteIncremental($cmd,$idperfilhard,$idperfilsoft ,$wrs->campos["idsoftincremental"])) return(false);
|
||||
$wrs->Siguiente();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que existe una incremental para cierta combinaci<63> de perfil software y perfil hardware
|
||||
//________________________________________________________________________________________________________
|
||||
function ExisteIncremental($cmd,$idperfilhard,$idperfilsoft ,$idsoftincremental){
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) as contador FROM perfileshard_perfilessoft INNER JOIN phard_psoft_softincremental ON perfileshard_perfilessoft.idphardidpsoft = phard_psoft_softincremental.idphardidpsoft WHERE (perfileshard_perfilessoft.idperfilhard = ".$idperfilhard.") AND (perfileshard_perfilessoft.idperfilsoft = ".$idperfilsoft.") AND (phard_psoft_softincremental.idsoftincremental = ".$idsoftincremental.")";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
if ($rs->campos["contador"]==0) return(false);
|
||||
return(true);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Recupera los datos de un ordenador
|
||||
Parametros:
|
||||
- cmd: Una comando ya operativo (con conexiónabierta)
|
||||
- ido: El identificador del ordenador
|
||||
________________________________________________________________________________________________________*/
|
||||
function toma_propiedades($cmd,$ido){
|
||||
global $nombreordenador;
|
||||
global $ip;
|
||||
global $mac;
|
||||
global $idperfilhard;
|
||||
global $idservidordhcp;
|
||||
global $idservidorrembo;
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT nombreordenador,ip,mac,idperfilhard FROM ordenadores WHERE idordenador='".$ido."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF){
|
||||
$nombreordenador=$rs->campos["nombreordenador"];
|
||||
$ip=$rs->campos["ip"];
|
||||
$mac=$rs->campos["mac"];
|
||||
$idperfilhard=$rs->campos["idperfilhard"];
|
||||
$rs->Cerrar();
|
||||
return(true);
|
||||
}
|
||||
else
|
||||
return(false);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Toma el identificador de la imagen
|
||||
________________________________________________________________________________________________________*/
|
||||
function TomaImagen($cmd,$idordenador,$particion){
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT imagenes.idimagen FROM ordenador_imagen";
|
||||
$cmd->texto.=" INNER JOIN imagenes ON ordenador_imagen.idimagen = imagenes.idimagen ";
|
||||
$cmd->texto.=" INNER JOIN ordenadores ON ordenador_imagen.idordenador = ordenadores.idordenador ";
|
||||
$cmd->texto.=" WHERE ordenadores.idordenador ='".$idordenador."' AND ordenador_imagen.particion = ".$particion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(""); // Error al abrir recordset
|
||||
$idimagen=0;
|
||||
if(!$rs->EOF)
|
||||
$idimagen=$rs->campos["idimagen"];
|
||||
$rs->Cerrar();
|
||||
return($idimagen);
|
||||
}
|
||||
?>
|
|
@ -1,82 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: TomaConfiguracion.php
|
||||
// Descripción :
|
||||
// Implementación del comando "TomaConfiguracion"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/HTMLSELECT.php");
|
||||
include_once("../idiomas/php/".$idioma."/comandos/tomaconfiguracion_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$fp = fopen($fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ($fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$nombreambito=$ValorParametros["nombreambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion);
|
||||
if (!$cmd)
|
||||
Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D.
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
<SCRIPT language="javascript" src="./jscripts/TomaConfiguracion.js"></SCRIPT>
|
||||
<SCRIPT language="javascript" src="./jscripts/comunescomandos.js"></SCRIPT>
|
||||
<? echo '<SCRIPT language="javascript" src="../idiomas/javascripts/'.$idioma.'/comandos/comunescomandos_'.$idioma.'.js"></SCRIPT>'?>
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
switch($ambito){
|
||||
case $AMBITO_CENTROS :
|
||||
$urlimg='../images/iconos/centros.gif';
|
||||
$textambito=$TbMsg[0];
|
||||
break;
|
||||
case $AMBITO_GRUPOSAULAS :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[1];
|
||||
break;
|
||||
case $AMBITO_AULAS :
|
||||
$urlimg='../images/iconos/aula.gif';
|
||||
$textambito=$TbMsg[2];
|
||||
break;
|
||||
case $AMBITO_GRUPOSORDENADORES :
|
||||
$urlimg='../images/iconos/carpeta.gif';
|
||||
$textambito=$TbMsg[3];
|
||||
break;
|
||||
case $AMBITO_ORDENADORES :
|
||||
$urlimg='../images/iconos/ordenador.gif';
|
||||
$textambito=$TbMsg[4];
|
||||
break;
|
||||
}
|
||||
echo '<p align=center><span class=cabeceras>'.$TbMsg[5].' </span><br>';
|
||||
echo '<IMG src="'.$urlimg.'"> <span align=center class=subcabeceras><U>'.$TbMsg[6].': '.$textambito.','.$nombreambito.'</U></span> </span></p>';
|
||||
?>
|
||||
<BR>
|
||||
<BR>
|
||||
<?
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesacciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/opcionesbotones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
//________________________________________________________________________________________________________
|
||||
include_once("../includes/iframecomun.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,106 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_Apagar.php
|
||||
// Descripción :
|
||||
// Gestor del comando "Apagar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$cadenaip="";
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$fp = fopen('../'.$fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ("../".$fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_apagar(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_apagar(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $cadenaip;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
|
||||
return(CuestionAcciones($cmd,$shidra,$parametros));
|
||||
}
|
||||
?>
|
|
@ -1,148 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_Arrancar.php
|
||||
// Descripción :
|
||||
// Gestor del comando "Arrancar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$cadenamac="";
|
||||
$cadenaip="";
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$fp = fopen('../'.$fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ("../".$fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$cadenamac=$ValorParametros["cadenamac"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_arrancar(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_arrancar(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $cadenamac;
|
||||
global $cadenaip;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=true;
|
||||
$cadenamac=ereg_replace( ";", "','", $cadenamac );
|
||||
$cmd->texto="SELECT ordenadores.mac,servidoresrembo.ip FROM ordenadores INNER JOIN servidoresrembo ON ordenadores.idservidorrembo =servidoresrembo.idservidorrembo WHERE ordenadores.mac IN ('".$cadenamac."') ORDER BY servidoresrembo.ip";
|
||||
$rs=new Recordset;
|
||||
$rs->Comando=&$cmd;
|
||||
|
||||
if (!$rs->Abrir()) $resul=false; // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if(!$rs->EOF){
|
||||
$ipservidorrembo=trim($rs->campos["ip"]); // toma ip servidor rembo
|
||||
$cadenamac="";
|
||||
while(!$rs->EOF && $resul){
|
||||
if($ipservidorrembo!=trim($rs->campos["ip"])){ // compara si cambia el servidor rembo
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$cadenamac=substr($cadenamac,0,strlen($cadenamac)-1); // Quita la coma
|
||||
$parametros.="mac=".$cadenamac.chr(13);
|
||||
$parametros.="rmb=".$ipservidorrembo.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
$resul=CuestionAcciones($cmd,$shidra,$parametros);
|
||||
if(!$resul)
|
||||
return($resul);
|
||||
$ipservidorrembo=trim($rs->campos["ip"]); // toma ip servidor rembo
|
||||
$cadenamac="";
|
||||
}
|
||||
$cadenamac.=trim($rs->campos["mac"]).";"; // toma mac del cliente
|
||||
$rs->Siguiente();
|
||||
}
|
||||
if($resul){
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$cadenamac=substr($cadenamac,0,strlen($cadenamac)-1); // Quita la coma
|
||||
$parametros.="mac=".$cadenamac.chr(13);
|
||||
$parametros.="rmb=".$ipservidorrembo.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
$resul=CuestionAcciones($cmd,$shidra,$parametros);
|
||||
}
|
||||
}
|
||||
$rs->Cerrar();
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
?>
|
|
@ -1,152 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_Configurar.php
|
||||
// Descripción :
|
||||
// Gestor del comando "Configurar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
$particiones="";
|
||||
|
||||
$parametros="";
|
||||
if (isset($_GET["parametros"])) $parametros=$_GET["parametros"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$resul=false;
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
if ($cmd){
|
||||
$auxsplit=split("\t",$parametros);
|
||||
$numpar=sizeof($auxsplit);
|
||||
for($j=0;$j<$numpar-1;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$particiones=$ValorParametros["particiones"];
|
||||
$resul=false;
|
||||
$idaula=$idambito;
|
||||
$resul=Gestiona($cmd);
|
||||
if(!$resul) break;
|
||||
}
|
||||
}
|
||||
$cmd->Conexion->Cerrar();
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_Configurar(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_Configurar(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algn error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $idaula;
|
||||
global $cadenaip;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $tipotrama;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $particiones;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
global $tbTiposParticiones;
|
||||
|
||||
$swvez=true;
|
||||
$auxsplit=split("\n",$particiones); // Toma las distintas particiones con sus particiones
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$parampar="";
|
||||
$lparampar="";
|
||||
$hdclean="";
|
||||
$isizepart=0;
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$cuadruparticion=split(";",$auxsplit[$j]);
|
||||
$particion=$cuadruparticion[0];
|
||||
$tipopart=$cuadruparticion[1];
|
||||
$nemopar=$tbTiposParticiones[$tipopart];
|
||||
$sizepart=$cuadruparticion[2];
|
||||
if($particion>4)
|
||||
$isizepart+=(int)($sizepart);
|
||||
$accion=$cuadruparticion[3];
|
||||
if($accion==2) $nemopar="H".$nemopar; // Particion oculta
|
||||
if($particion<5)
|
||||
$parampar.=$nemopar.":".$sizepart." ";
|
||||
else
|
||||
$lparampar.=$nemopar.":".$sizepart." ";
|
||||
if($accion==1) $hdclean.=$particion.";"; // Formatear la partici<63>
|
||||
}
|
||||
if($isizepart>0) // Existen particiones extendidas
|
||||
$parampar.="EXT:".$isizepart." ";
|
||||
$parampar=substr($parampar,0,strlen($parampar)-1); // Quita el espacion final
|
||||
if(strlen($lparampar)>0)
|
||||
$lparampar=substr($lparampar,0,strlen($lparampar)-1); // Quita el espacion final
|
||||
$hdclean=substr($hdclean,0,strlen($hdclean)-1); // Quita la coma final
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="ppa=".$parampar.chr(13);
|
||||
$parametros.="lpa=".$lparampar.chr(13);
|
||||
$parametros.="hdc=".$hdclean.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
return(CuestionAcciones($cmd,$shidra,$parametros));
|
||||
}
|
||||
?>
|
|
@ -1,163 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_CrearPerfilSoftware.php
|
||||
// Descripción :
|
||||
// Gestor del comando "CrearPerfilSoftware"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
$perfiles="";
|
||||
|
||||
if (isset($_GET["identificador"])) $identificador=$_GET["identificador"];
|
||||
if (isset($_GET["nombrefuncion"])) $nombrefuncion=$_GET["nombrefuncion"];
|
||||
if (isset($_GET["ejecutor"])) $ejecutor=$_GET["ejecutor"];
|
||||
if (isset($_GET["tipotrama"])) $tipotrama=$_GET["tipotrama"];
|
||||
if (isset($_GET["ambito"])) $ambito=$_GET["ambito"];
|
||||
if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
|
||||
if (isset($_GET["cadenaip"])) $cadenaip=$_GET["cadenaip"];
|
||||
if (isset($_GET["perfiles"])) $perfiles=$_GET["perfiles"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$idaula=0;
|
||||
$idperfilhard=0;
|
||||
$idordenador=$idambito;
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
TomaPerfilAula($cmd,&$idperfilhard,&$idaula,$idordenador);
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_crearperfilsoftware(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_crearperfilsoftware(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function TomaPerfilAula($cmd,$idperfilhard,$idaula,$ido){
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT idaula,idperfilhard FROM ordenadores WHERE idordenador=".$ido;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(0); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF){
|
||||
$idperfilhard=$rs->campos["idperfilhard"];
|
||||
$idaula=$rs->campos["idaula"];
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Devuelve el nemonico de un S.O. incluido en un perfil software
|
||||
// Parametros:
|
||||
// - cmd:Una comando ya operativo (con conexión abierta)
|
||||
// - ips: identificador del perfil software
|
||||
//________________________________________________________________________________________________________
|
||||
function toma_nemonico($cmd,$ips){
|
||||
$cmd->texto="SELECT tiposos.nemonico FROM perfilessoft INNER JOIN perfilessoft_softwares ON perfilessoft.idperfilsoft = perfilessoft_softwares.idperfilsoft INNER JOIN softwares ON perfilessoft_softwares.idsoftware = softwares.idsoftware INNER JOIN tiposos ON softwares.idtiposo = tiposos.idtiposo WHERE tiposos.idtiposo > 0 AND perfilessoft.idperfilsoft=".$ips;
|
||||
$rs=new Recordset;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(0); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF)
|
||||
return($rs->campos["nemonico"]);
|
||||
else
|
||||
return("");
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_EXITOSA; // Finalizada con exito
|
||||
global $ACCION_FALLIDA; // Finalizada con errores
|
||||
global $ACCION_TERMINADA; // Finalizada manualmente con indicacion de exito
|
||||
global $ACCION_ABORTADA; // Finalizada manualmente con indicacion de errores
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_CONERRORES; // Activa y sin error
|
||||
global $ACCION_DETENIDA;
|
||||
global $ACCION_INICIADA;
|
||||
global $ACCION_FINALIZADA;
|
||||
global $idcentro;
|
||||
global $idaula;
|
||||
global $idperfilhard;
|
||||
global $cadenaip;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $tipotrama;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $perfiles;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$auxsplit=split(";",$perfiles); // Toma las distintas particiones con sus perfiles
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$dualperfil=split("_",$auxsplit[$j]);
|
||||
$particion=$dualperfil[0];
|
||||
$idperfilsoft=$dualperfil[1];
|
||||
$nemonico=toma_nemonico($cmd,$idperfilsoft);
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="par=".$particion.chr(13);
|
||||
$parametros.="ifs=".$idperfilsoft.chr(13);
|
||||
$parametros.="ifh=".$idperfilhard.chr(13);
|
||||
$parametros.="nem=".$nemonico.chr(13);
|
||||
$parametros.="idc=".$idcentro.chr(13);
|
||||
$parametros.="ida=".$idaula.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
if(!CuestionAcciones($cmd,$shidra,$parametros)) return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
?>
|
|
@ -1,148 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_SoftIncremental.php
|
||||
// Descripción :
|
||||
// Gestor del comando "SoftIncremental"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
$perfiles="";
|
||||
$idperfilhard=0;
|
||||
|
||||
if (isset($_GET["identificador"])) $identificador=$_GET["identificador"];
|
||||
if (isset($_GET["nombrefuncion"])) $nombrefuncion=$_GET["nombrefuncion"];
|
||||
if (isset($_GET["ejecutor"])) $ejecutor=$_GET["ejecutor"];
|
||||
if (isset($_GET["tipotrama"])) $tipotrama=$_GET["tipotrama"];
|
||||
if (isset($_GET["ambito"])) $ambito=$_GET["ambito"];
|
||||
if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
|
||||
if (isset($_GET["idperfilhard"])) $idperfilhard=$_GET["idperfilhard"];
|
||||
if (isset($_GET["cadenaip"])) $cadenaip=$_GET["cadenaip"];
|
||||
if (isset($_GET["perfiles"])) $perfiles=$_GET["perfiles"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$idordenador=$idambito;
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_crearsoftincremental(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_crearsoftincremental(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Devuelve el nemonico de un S.O. incluido en un perfil software
|
||||
// Parametros:
|
||||
// - cmd:Una comando ya operativo (con conexión abierta)
|
||||
// - ips: identificador del perfil software
|
||||
//________________________________________________________________________________________________________
|
||||
function toma_nemonico($cmd,$ips){
|
||||
$cmd->texto="SELECT tiposos.nemonico FROM perfilessoft INNER JOIN perfilessoft_softwares ON perfilessoft.idperfilsoft = perfilessoft_softwares.idperfilsoft INNER JOIN softwares ON perfilessoft_softwares.idsoftware = softwares.idsoftware INNER JOIN tiposos ON softwares.idtiposo = tiposos.idtiposo WHERE tiposos.idtiposo > 0 AND perfilessoft.idperfilsoft=".$ips;
|
||||
$rs=new Recordset;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(0); // Error al abrir recordset
|
||||
$rs->Primero();
|
||||
if (!$rs->EOF)
|
||||
return($rs->campos["nemonico"]);
|
||||
else
|
||||
return("");
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_EXITOSA; // Finalizada con exito
|
||||
global $ACCION_FALLIDA; // Finalizada con errores
|
||||
global $ACCION_TERMINADA; // Finalizada manualmente con indicacion de exito
|
||||
global $ACCION_ABORTADA; // Finalizada manualmente con indicacion de errores
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_CONERRORES; // Activa y sin error
|
||||
global $ACCION_DETENIDA;
|
||||
global $ACCION_INICIADA;
|
||||
global $ACCION_FINALIZADA;
|
||||
global $idcentro;
|
||||
global $idperfilhard;
|
||||
global $cadenaip;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $tipotrama;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $perfiles;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$auxsplit=split(";",$perfiles); // Toma las distintas particiones con sus perfiles
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$dualperfil=split("_",$auxsplit[$j]);
|
||||
$particion=$dualperfil[0];
|
||||
$idperfilsoft=$dualperfil[1];
|
||||
$idsoftincremental=$dualperfil[2];
|
||||
$nemonico=toma_nemonico($cmd,$idperfilsoft);
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="par=".$particion.chr(13);
|
||||
$parametros.="ifs=".$idperfilsoft.chr(13);
|
||||
$parametros.="ifh=".$idperfilhard.chr(13);
|
||||
$parametros.="nem=".$nemonico.chr(13);
|
||||
$parametros.="icr=".$idsoftincremental.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
if(!CuestionAcciones($cmd,$shidra,$parametros)) return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
?>
|
|
@ -1,190 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_EjecutarScripts.php
|
||||
// Descripción :
|
||||
// Gestor del comando "EjecutarScripts"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
include_once("../../idiomas/php/".$idioma."/comandos/gestor_ejecutarscripts_".$idioma.".php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
$titulo="";
|
||||
$descripcion="";
|
||||
$pseudocodigo="";
|
||||
$filescript="";
|
||||
|
||||
if (isset($_POST["titulo"])) $titulo=$_POST["titulo"];
|
||||
if (isset($_POST["descripcion"])) $descripcion=$_POST["descripcion"];
|
||||
if (isset($_POST["pseudocodigo"])) $pseudocodigo=$_POST["pseudocodigo"];
|
||||
|
||||
if (isset($_POST["identificador"])) $identificador=$_POST["identificador"];
|
||||
if (isset($_POST["nombrefuncion"])) $nombrefuncion=$_POST["nombrefuncion"];
|
||||
if (isset($_POST["ejecutor"])) $ejecutor=$_POST["ejecutor"];
|
||||
|
||||
if (isset($_POST["tipotrama"])) $tipotrama=$_POST["tipotrama"];
|
||||
if (isset($_POST["ambito"])) $ambito=$_POST["ambito"];
|
||||
if (isset($_POST["idambito"])) $idambito=$_POST["idambito"];
|
||||
if (isset($_POST["cadenaip"])) $cadenaip=$_POST["cadenaip"];
|
||||
|
||||
/*
|
||||
// Se env<6E> fichero de script
|
||||
$ficheroPOST = $HTTP_POST_FILES['userfile']['tmp_name'];
|
||||
$nombreOriginal_archivo = $HTTP_POST_FILES['userfile']['name'];
|
||||
$tamano_archivo = $HTTP_POST_FILES['userfile']['size'];
|
||||
*/
|
||||
$URLPATHFILESCRIPT="./filescripts";
|
||||
$FISPATHFILESCRIPT=realpath($URLPATHFILESCRIPT);
|
||||
$NOMBREFILESCRIPT="cmdscript.rbc";
|
||||
$ficheroLOCAL=$FISPATHFILESCRIPT."/".$NOMBREFILESCRIPT;
|
||||
|
||||
$sw_ejya="";
|
||||
$sw_seguimiento="";
|
||||
$sw_mktarea="";
|
||||
$nwidtarea="";
|
||||
$nwdescritarea="";
|
||||
$sw_mkprocedimiento="";
|
||||
$nwidprocedimiento="";
|
||||
$nwdescriprocedimiento="";
|
||||
|
||||
if (isset($_POST["sw_ejya"])) $sw_ejya=$_POST["sw_ejya"];
|
||||
if (isset($_POST["sw_seguimiento"])) $sw_seguimiento=$_POST["sw_seguimiento"];
|
||||
if (isset($_POST["sw_mktarea"])) $sw_mktarea=$_POST["sw_mktarea"];
|
||||
if (isset($_POST["nwidtarea"])) $nwidtarea=$_POST["nwidtarea"];
|
||||
if (isset($_POST["nwdescritarea"])) $nwdescritarea=$_POST["nwdescritarea"];
|
||||
if (isset($_POST["sw_mkprocedimiento"])) $sw_mkprocedimiento=$_POST["sw_mkprocedimiento"];
|
||||
if (isset($_POST["nwidprocedimiento"])) $nwidprocedimiento=$_POST["nwidprocedimiento"];
|
||||
if (isset($_POST["nwdescriprocedimiento"])) $nwdescriprocedimiento=$_POST["nwdescriprocedimiento"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=0;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
}
|
||||
$cmd->Conexion->Cerrar();
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE>Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="../estilos.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
echo '<SCRIPT language="javascript">'.chr(13);
|
||||
echo ' var msg=new Array()'.chr(13);
|
||||
echo ' msg[1]='.$TbMsg[1].chr(13);
|
||||
echo ' msg[2]='.$TbMsg[2].chr(13);
|
||||
echo ' msg[3]='.$TbMsg[3].chr(13);
|
||||
echo ' msg[4]='.$TbMsg[4].chr(13);
|
||||
echo ' msg[5]='.$TbMsg[5].chr(13);
|
||||
echo 'alert( msg[' .$resul.'])';
|
||||
echo '</SCRIPT>';
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algn error
|
||||
global $ACCION_INICIADA;
|
||||
global $MAXSIZEFILERBC;
|
||||
global $idcentro;
|
||||
global $cadenaip;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $tipotrama;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $titulo;
|
||||
global $descripcion;
|
||||
global $pseudocodigo;
|
||||
global $filescript;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $FISPATHFILESCRIPT;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
global $nombre_archivo;
|
||||
global $nombreOriginal_archivo;
|
||||
global $tamano_archivo;
|
||||
global $ficheroPOST;
|
||||
global $ficheroLOCAL;
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="tis=".$titulo.chr(13);
|
||||
$parametros.="dcr=".$descripcion.chr(13);
|
||||
|
||||
// Se env<6E> fichero de script
|
||||
if(!empty($ficheroPOST)){
|
||||
$posrbc=strpos($nombreOriginal_archivo, "rbc");
|
||||
if ($posrbc>0 && $tamano_archivo < $MAXSIZEFILERBC) {
|
||||
if (salvafichero_POST($ficheroPOST,$ficheroLOCAL)){
|
||||
$fp = fopen ($ficheroLOCAL, "r");
|
||||
$pseudocodigo = fread ($fp, filesize ($ficheroLOCAL));
|
||||
fclose ($fp);
|
||||
if(empty($pseudocodigo)) // No hay c<>igo que ejecutar
|
||||
return(4); // El fichero no contiene c<>igo
|
||||
}
|
||||
else
|
||||
return(5); // No se puede salvar el fichero de script enviado por POST
|
||||
}
|
||||
else{
|
||||
return(3); // El fichero no tiene la extension .rbc
|
||||
}
|
||||
}
|
||||
$fp = fopen($ficheroLOCAL,"w");
|
||||
fwrite($fp, $pseudocodigo,strlen($pseudocodigo));
|
||||
fclose($fp);
|
||||
|
||||
$parametros.="scp=".$pseudocodigo.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
if(!CuestionAcciones($cmd,$shidra,$parametros)) return(2);
|
||||
return(1);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Salva un fichero enviado por POST
|
||||
//________________________________________________________________________________________________________
|
||||
function salvafichero_POST($ficheroPost,$ficheroLocal){
|
||||
if (file_exists($ficheroLocal)) // Borra el fichero si existe
|
||||
unlink($ficheroLocal);
|
||||
return(move_uploaded_file($ficheroPost,$ficheroLocal)); // salva el fichero
|
||||
}
|
||||
?>
|
|
@ -1,111 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_Apagar.php
|
||||
// Descripción :
|
||||
// Gestor del comando "IniciarSesion"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$cadenaip="";
|
||||
$particion="";
|
||||
|
||||
if (isset($_GET["particion"])) $particion=$_GET["particion"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$fp = fopen('../'.$fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ("../".$fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_iniciarsesion(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_iniciarsesion(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $cadenaip;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
global $particion;
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="par=".$particion.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
|
||||
return(CuestionAcciones($cmd,$shidra,$parametros));
|
||||
}
|
||||
?>
|
|
@ -1,106 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_InventarioHardware.php
|
||||
// Descripción :
|
||||
// Gestor del comando "InventarioHardware"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$cadenaip="";
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$fp = fopen('../'.$fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ("../".$fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_inventariohardware(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_inventariohardware(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algn error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $cadenaip;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
|
||||
return(CuestionAcciones($cmd,$shidra,$parametros));
|
||||
}
|
||||
?>
|
|
@ -1,117 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_InventarioSoftware.php
|
||||
// Descripción :
|
||||
// Gestor del comando "InventarioHardware"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$cadenaip="";
|
||||
|
||||
$particiones="";
|
||||
if (isset($_GET["particiones"])) $particiones=$_GET["particiones"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$fp = fopen('../'.$fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ("../".$fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_inventariosoftware(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_inventariosoftware(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algn error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $cadenaip;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
global $particiones;
|
||||
|
||||
$auxsplit=split(";",$particiones); // Toma las distintas particiones con sus perfiles
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$particion=$auxsplit[$j];
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="par=".$particion.chr(13);
|
||||
$parametros.="tpl=si".chr(13); // Tipo de listado reducido
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
if(!CuestionAcciones($cmd,$shidra,$parametros)) return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
?>
|
|
@ -1,151 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_ParticionaryFormatear.php
|
||||
// Descripción :
|
||||
// Gestor del comando "ParticionaryFormatear"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
$particiones="";
|
||||
$parametros="";
|
||||
if (isset($_GET["parametros"])) $parametros=$_GET["parametros"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$resul=false;
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
if ($cmd){
|
||||
$auxsplit=split("\t",$parametros);
|
||||
$numpar=sizeof($auxsplit);
|
||||
for($j=0;$j<$numpar-1;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$particiones=$ValorParametros["particiones"];
|
||||
$resul=false;
|
||||
$idaula=$idambito;
|
||||
$resul=Gestiona($cmd);
|
||||
if(!$resul) break;
|
||||
}
|
||||
}
|
||||
$cmd->Conexion->Cerrar();
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_ParticionaryFormatear(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_ParticionaryFormatear(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $idaula;
|
||||
global $cadenaip;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $tipotrama;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $particiones;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
global $tbTiposParticiones;
|
||||
|
||||
$swvez=true;
|
||||
|
||||
$auxsplit=split("\n",$particiones); // Toma las distintas particiones con sus particiones
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
$parampar="";
|
||||
$lparampar="";
|
||||
$hdclean="";
|
||||
$isizepart=0;
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$cuadruparticion=split(";",$auxsplit[$j]);
|
||||
$particion=$cuadruparticion[0];
|
||||
$tipopart=$cuadruparticion[1];
|
||||
$nemopar=$tbTiposParticiones[$tipopart];
|
||||
$sizepart=$cuadruparticion[2];
|
||||
if($particion>4)
|
||||
$isizepart+=(int)($sizepart);
|
||||
$accion=$cuadruparticion[3];
|
||||
if($accion==2) $nemopar="H".$nemopar; // Particion oculta
|
||||
if($particion<5)
|
||||
$parampar.=$nemopar.":".$sizepart." ";
|
||||
else
|
||||
$lparampar.=$nemopar.":".$sizepart." ";
|
||||
if($accion==1) $hdclean.=$particion.";"; // Formatear la partición
|
||||
}
|
||||
if($isizepart>0) // Existen particiones extendidas
|
||||
$parampar.="EXT:".$isizepart." ";
|
||||
$parampar=substr($parampar,0,strlen($parampar)-1); // Quita el espacion final
|
||||
if(strlen($lparampar)>0)
|
||||
$lparampar=substr($lparampar,0,strlen($lparampar)-1); // Quita el espacion final
|
||||
$hdclean=substr($hdclean,0,strlen($hdclean)-1); // Quita la coma final
|
||||
//________________________________________________________________________________________________________
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="ppa=".$parampar.chr(13);
|
||||
$parametros.="lpa=".$lparampar.chr(13);
|
||||
$parametros.="hdc=".$hdclean.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
return(CuestionAcciones($cmd,$shidra,$parametros));
|
||||
}
|
||||
?>
|
|
@ -1,105 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_Reiniciar.php
|
||||
// Descripción :
|
||||
// Gestor del comando "Reiniciar"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$cadenaip="";
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$fp = fopen('../'.$fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ("../".$fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_reiniciar(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_reiniciar(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $cadenaip;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
|
||||
return(CuestionAcciones($cmd,$shidra,$parametros));
|
||||
}
|
||||
?>
|
|
@ -1,106 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_RemboOffline.php
|
||||
// Descripción :
|
||||
// Gestor del comando "RemboOffline"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$cadenaip="";
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$fp = fopen('../'.$fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ("../".$fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_RemboOffline(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_RemboOffline(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $cadenaip;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
|
||||
return(CuestionAcciones($cmd,$shidra,$parametros));
|
||||
}
|
||||
?>
|
|
@ -1,170 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_RestaurarImagenAula.php
|
||||
// Descripción :
|
||||
// Gestor del comando "RestaurarImagenAula"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
$perfiles="";
|
||||
$pathrmb="";
|
||||
$protclona="";
|
||||
|
||||
$parametros="";
|
||||
if (isset($_GET["parametros"])) $parametros=$_GET["parametros"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$resul=false;
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
if ($cmd){
|
||||
$auxsplit=split("\t",$parametros);
|
||||
$numpar=sizeof($auxsplit);
|
||||
for($j=0;$j<$numpar-1;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$perfiles=$ValorParametros["perfiles"];
|
||||
$pathrmb=$ValorParametros["pathrmb"];
|
||||
$protclona=$ValorParametros["protclona"];
|
||||
$resul=false;
|
||||
$resul=Gestiona($cmd);
|
||||
if(!$resul) break;
|
||||
}
|
||||
}
|
||||
$cmd->Conexion->Cerrar();
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_RestaurarImagenAula(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_RestaurarImagenAula(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_EXITOSA; // Finalizada con exito
|
||||
global $ACCION_FALLIDA; // Finalizada con errores
|
||||
global $ACCION_TERMINADA; // Finalizada manualmente con indicacion de exito
|
||||
global $ACCION_ABORTADA; // Finalizada manualmente con indicacion de errores
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_CONERRORES; // Activa y sin error
|
||||
global $ACCION_DETENIDA;
|
||||
global $ACCION_INICIADA;
|
||||
global $ACCION_FINALIZADA;
|
||||
global $idcentro;
|
||||
global $cadenaip;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $tipotrama;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $perfiles;
|
||||
global $pathrmb;
|
||||
global $protclona;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$swvez=true;
|
||||
$auxsplit=split(";",$perfiles); // Toma las distintas particiones con sus perfiles
|
||||
$auxpsplit=split(";",$pathrmb); // Toma los distintas path de imagens
|
||||
$auxcsplit=split(";",$protclona); //Toma el protocolo de clonación de las imágenes
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$dualperfil=split("_",$auxsplit[$j]);
|
||||
$particion=$dualperfil[0];
|
||||
$swresimg=$dualperfil[1];
|
||||
$idimagen=$dualperfil[2];
|
||||
$idperfilhard=$dualperfil[3];
|
||||
$idperfilsoft=$dualperfil[4];
|
||||
$tipopar=$dualperfil[5];
|
||||
$nemonico=$dualperfil[6];
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="par=".$particion.chr(13);
|
||||
$parametros.="idi=".$idimagen.chr(13);
|
||||
$parametros.="ifs=".$idperfilsoft.chr(13);
|
||||
$parametros.="ifh=".$idperfilhard.chr(13);
|
||||
$parametros.="nem=".$nemonico.chr(13);
|
||||
$parametros.="idc=".$idcentro.chr(13);
|
||||
$parametros.="swr=".$swresimg.chr(13);
|
||||
$parametros.="icr=".CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen).chr(13);;
|
||||
$parametros.="tpa=".$tipopar.chr(13);
|
||||
$parametros.="pth=".$auxpsplit[$j].chr(13);
|
||||
$parametros.="mcl=".$auxcsplit[$j].chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
if(!CuestionAcciones($cmd,$shidra,$parametros)) return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que la imagen no tiene incrementales o si la tiene que existen para el perfil hardware del ordenador
|
||||
//________________________________________________________________________________________________________
|
||||
function CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen){
|
||||
$wrs=new Recordset;
|
||||
$cmd->texto=" SELECT idsoftincremental FROM imagenes_softincremental WHERE idimagen=".$idimagen;
|
||||
$wrs->Comando=&$cmd;
|
||||
if (!$wrs->Abrir()) return(""); // Error al abrir recordset
|
||||
$strInc="";
|
||||
while (!$wrs->EOF){
|
||||
$strInc.=$wrs->campos["idsoftincremental"].";";
|
||||
$wrs->Siguiente();
|
||||
}
|
||||
return($strInc);
|
||||
}
|
||||
?>
|
|
@ -1,170 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_RestaurarImagenGrupoOrdenadores.php
|
||||
// Descripción :
|
||||
// Gestor del comando "RestaurarImagenGrupoOrdenadores"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
$perfiles="";
|
||||
$pathrmb="";
|
||||
$protclona="";
|
||||
|
||||
$parametros="";
|
||||
if (isset($_GET["parametros"])) $parametros=$_GET["parametros"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$resul=false;
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
if ($cmd){
|
||||
$auxsplit=split("\t",$parametros);
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$ValorParametros=extrae_parametros($auxsplit[$j],chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$tipotrama=$ValorParametros["tipotrama"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$perfiles=$ValorParametros["perfiles"];
|
||||
$pathrmb=$ValorParametros["pathrmb"];
|
||||
$protclona=$ValorParametros["protclona"];
|
||||
$resul=false;
|
||||
$resul=Gestiona($cmd);
|
||||
if(!$resul) break;
|
||||
}
|
||||
}
|
||||
$cmd->Conexion->Cerrar();
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_RestaurarImagenGrupoOrdenadores(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_RestaurarImagenGrupoOrdenadores(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_EXITOSA; // Finalizada con exito
|
||||
global $ACCION_FALLIDA; // Finalizada con errores
|
||||
global $ACCION_TERMINADA; // Finalizada manualmente con indicacion de exito
|
||||
global $ACCION_ABORTADA; // Finalizada manualmente con indicacion de errores
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_CONERRORES; // Activa y sin error
|
||||
global $ACCION_DETENIDA;
|
||||
global $ACCION_INICIADA;
|
||||
global $ACCION_FINALIZADA;
|
||||
global $idcentro;
|
||||
global $cadenaip;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $tipotrama;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $perfiles;
|
||||
global $pathrmb;
|
||||
global $protclona;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$swvez=true;
|
||||
$auxsplit=split(";",$perfiles); // Toma las distintas particiones con sus perfiles
|
||||
$auxpsplit=split(";",$pathrmb); // Toma los distintas path de imagens
|
||||
$auxcsplit=split(";",$protclona); //Toma el protocolo de clonación de las imágenes
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$dualperfil=split("_",$auxsplit[$j]);
|
||||
$particion=$dualperfil[0];
|
||||
$swresimg=$dualperfil[1];
|
||||
$idimagen=$dualperfil[2];
|
||||
$idperfilhard=$dualperfil[3];
|
||||
$idperfilsoft=$dualperfil[4];
|
||||
$tipopar=$dualperfil[5];
|
||||
$nemonico=$dualperfil[6];
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="par=".$particion.chr(13);
|
||||
$parametros.="idi=".$idimagen.chr(13);
|
||||
$parametros.="ifs=".$idperfilsoft.chr(13);
|
||||
$parametros.="ifh=".$idperfilhard.chr(13);
|
||||
$parametros.="nem=".$nemonico.chr(13);
|
||||
$parametros.="idc=".$idcentro.chr(13);
|
||||
$parametros.="swr=".$swresimg.chr(13);
|
||||
$parametros.="icr=".CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen).chr(13);;
|
||||
$parametros.="tpa=".$tipopar.chr(13);
|
||||
$parametros.="pth=".$auxpsplit[$j].chr(13);
|
||||
$parametros.="mcl=".$auxcsplit[$j].chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
if(!CuestionAcciones($cmd,$shidra,$parametros)) return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que la imagen no tiene incrementales o si la tiene que existen para el perfil hardware del ordenador
|
||||
//________________________________________________________________________________________________________
|
||||
function CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen){
|
||||
$wrs=new Recordset;
|
||||
$cmd->texto=" SELECT idsoftincremental FROM imagenes_softincremental WHERE idimagen=".$idimagen;
|
||||
$wrs->Comando=&$cmd;
|
||||
if (!$wrs->Abrir()) return(""); // Error al abrir recordset
|
||||
$strInc="";
|
||||
while (!$wrs->EOF){
|
||||
$strInc.=$wrs->campos["idsoftincremental"].";";
|
||||
$wrs->Siguiente();
|
||||
}
|
||||
return($strInc);
|
||||
}
|
||||
?>
|
|
@ -1,164 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_RestaurarImagenOrdenador.php
|
||||
// Descripción :
|
||||
// Gestor del comando "RestaurarImagenOrdenador"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$tipotrama="";
|
||||
$ambito=0;
|
||||
$idambito=0;
|
||||
$cadenaip="";
|
||||
$perfiles="";
|
||||
$pathrmb="";
|
||||
$protclona="";
|
||||
|
||||
if (isset($_GET["identificador"])) $identificador=$_GET["identificador"];
|
||||
if (isset($_GET["nombrefuncion"])) $nombrefuncion=$_GET["nombrefuncion"];
|
||||
if (isset($_GET["ejecutor"])) $ejecutor=$_GET["ejecutor"];
|
||||
if (isset($_GET["tipotrama"])) $tipotrama=$_GET["tipotrama"];
|
||||
if (isset($_GET["ambito"])) $ambito=$_GET["ambito"];
|
||||
if (isset($_GET["idambito"])) $idambito=$_GET["idambito"];
|
||||
if (isset($_GET["cadenaip"])) $cadenaip=$_GET["cadenaip"];
|
||||
if (isset($_GET["perfiles"])) $perfiles=$_GET["perfiles"];
|
||||
if (isset($_GET["pathrmb"])) $pathrmb=$_GET["pathrmb"];
|
||||
if (isset($_GET["protclona"])) $protclona=$_GET["protclona"];
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$idordenador=$idambito;
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_RestaurarImagenOrdenador(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_RestaurarImagenOrdenador(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_EXITOSA; // Finalizada con exito
|
||||
global $ACCION_FALLIDA; // Finalizada con errores
|
||||
global $ACCION_TERMINADA; // Finalizada manualmente con indicacion de exito
|
||||
global $ACCION_ABORTADA; // Finalizada manualmente con indicacion de errores
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_CONERRORES; // Activa y sin error
|
||||
global $ACCION_DETENIDA;
|
||||
global $ACCION_INICIADA;
|
||||
global $ACCION_FINALIZADA;
|
||||
global $idcentro;
|
||||
global $idordenador;
|
||||
global $cadenaip;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $tipotrama;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $perfiles;
|
||||
global $pathrmb;
|
||||
global $protclona;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$auxsplit=split(";",$perfiles); // Toma las distintas particiones con sus perfiles
|
||||
$auxpsplit=split(";",$pathrmb); // Toma los distintas path de imagens
|
||||
$auxcsplit=split(";",$protclona); //Toma el protocolo de clonación de las imágenes
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
for($j=0;$j<sizeof($auxsplit)-1;$j++){
|
||||
$dualperfil=split("_",$auxsplit[$j]);
|
||||
$particion=$dualperfil[0];
|
||||
$swresimg=$dualperfil[1];
|
||||
$idimagen=$dualperfil[2];
|
||||
$idperfilhard=$dualperfil[3];
|
||||
$idperfilsoft=$dualperfil[4];
|
||||
$tipopar=$dualperfil[5];
|
||||
$nemonico=$dualperfil[6];
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="par=".$particion.chr(13);
|
||||
$parametros.="idi=".$idimagen.chr(13);
|
||||
$parametros.="ifs=".$idperfilsoft.chr(13);
|
||||
$parametros.="ifh=".$idperfilhard.chr(13);
|
||||
$parametros.="nem=".$nemonico.chr(13);
|
||||
$parametros.="idc=".$idcentro.chr(13);
|
||||
$parametros.="tpa=".$tipopar.chr(13);
|
||||
$parametros.="swr=".$swresimg.chr(13);
|
||||
$parametros.="icr=".CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen).chr(13);
|
||||
$parametros.="pth=".$auxpsplit[$j].chr(13);
|
||||
$parametros.="mcl=".$auxcsplit[$j].chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
if(!CuestionAcciones($cmd,$shidra,$parametros)) return(false);
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Comprueba que la imagen no tiene incrementales o si la tiene que existen para el perfil hardware del ordenador
|
||||
//________________________________________________________________________________________________________
|
||||
function CuestionIncrementales($cmd,$idperfilhard,$idperfilsoft,$idimagen){
|
||||
$wrs=new Recordset;
|
||||
$cmd->texto=" SELECT idsoftincremental FROM imagenes_softincremental WHERE idimagen=".$idimagen;
|
||||
$wrs->Comando=&$cmd;
|
||||
if (!$wrs->Abrir()) return(""); // Error al abrir recordset
|
||||
$strInc="";
|
||||
while (!$wrs->EOF){
|
||||
$strInc.=$wrs->campos["idsoftincremental"].";";
|
||||
$wrs->Siguiente();
|
||||
}
|
||||
return($strInc);
|
||||
}
|
||||
?>
|
|
@ -1,106 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_TomaConfiguracion.php
|
||||
// Descripción :
|
||||
// Gestor del comando "TomaConfiguracion"
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../../includes/ctrlacc.php");
|
||||
include_once("../../clases/AdoPhp.php");
|
||||
include_once("../../clases/SockHidra.php");
|
||||
include_once("../../includes/constantes.php");
|
||||
include_once("../../includes/comunes.php");
|
||||
include_once("../../includes/cuestionacciones.php");
|
||||
include_once("../../includes/CreaComando.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$identificador=0;
|
||||
$nombrefuncion="";
|
||||
$ejecutor="";
|
||||
$cadenaip="";
|
||||
|
||||
include_once("../../includes/cuestionaccionescab.php");
|
||||
|
||||
$fp = fopen('../'.$fileparam,"r");
|
||||
$parametros= fread ($fp, filesize ("../".$fileparam));
|
||||
fclose($fp);
|
||||
|
||||
$ValorParametros=extrae_parametros($parametros,chr(13),'=');
|
||||
$identificador=$ValorParametros["identificador"];
|
||||
$nombrefuncion=$ValorParametros["nombrefuncion"];
|
||||
$ejecutor=$ValorParametros["ejecutor"];
|
||||
$cadenaip=$ValorParametros["cadenaip"];
|
||||
$ambito=$ValorParametros["ambito"];
|
||||
$idambito=$ValorParametros["idambito"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona($cmd);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_tomaconfiguracion(1)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo 'window.parent.resultado_tomaconfiguracion(0)'.chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona($cmd){
|
||||
global $ACCION_SINERRORES; // Activa y con algn error
|
||||
global $ACCION_INICIADA;
|
||||
global $idcentro;
|
||||
global $identificador;
|
||||
global $nombrefuncion;
|
||||
global $ejecutor;
|
||||
global $cadenaip;
|
||||
global $ambito;
|
||||
global $idambito;
|
||||
global $EJECUCION_COMANDO;
|
||||
global $PROCESOS;
|
||||
global $servidorhidra;
|
||||
global $hidraport;
|
||||
|
||||
$shidra=new SockHidra($servidorhidra,$hidraport);
|
||||
|
||||
$cmd->CreaParametro("@tipoaccion",$EJECUCION_COMANDO,1);
|
||||
$cmd->CreaParametro("@idtipoaccion",$identificador,1);
|
||||
$cmd->CreaParametro("@cateaccion",$PROCESOS,1);
|
||||
$cmd->CreaParametro("@ambito",$ambito,1);
|
||||
$cmd->CreaParametro("@idambito",$idambito,1);
|
||||
$cmd->CreaParametro("@fechahorareg",date("y/m/d H:i:s"),0);
|
||||
$cmd->CreaParametro("@estado",$ACCION_INICIADA,0);
|
||||
$cmd->CreaParametro("@resultado",$ACCION_SINERRORES,0);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@parametros","",0);
|
||||
|
||||
$cmd->CreaParametro("@descripcion","",0);
|
||||
$cmd->CreaParametro("@idtarea",0,1);
|
||||
$cmd->CreaParametro("@idprocedimiento",0,1);
|
||||
$cmd->CreaParametro("@idcomando",0,1);
|
||||
|
||||
$parametros=$ejecutor;
|
||||
$parametros.="nfn=".$nombrefuncion.chr(13);
|
||||
$parametros.="iph=".$cadenaip.chr(13);
|
||||
$cmd->ParamSetValor("@parametros",$parametros);
|
||||
|
||||
return(CuestionAcciones($cmd,$shidra,$parametros));
|
||||
}
|
||||
?>
|
|
@ -1,37 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Apagar.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero Apagar.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var wurl="./gestores/gestor_Apagar.php?" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_apagar(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Arrancar.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero Arrancar.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var wurl="./gestores/gestor_Arrancar.php?" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_arrancar(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,413 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Configurar.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero Configurar.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
var patrontablaparticion;
|
||||
var ultpa;
|
||||
var currentconfiguracion=null;
|
||||
var currentimgconfiguracion=null;
|
||||
//________________________________________________________________________________________________________
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var cadenaip=document.fdatosocultos.cadenaip.value;
|
||||
var identificador=document.fdatosocultos.identificador.value;
|
||||
var nombrefuncion=document.fdatosocultos.nombrefuncion.value;
|
||||
var ejecutor=document.fdatosocultos.ejecutor.value;
|
||||
var tipotrama=document.fdatosocultos.tipotrama.value;
|
||||
var ambito=document.fdatosocultos.ambito.value;
|
||||
var idambito=document.fdatosocultos.idambito.value;
|
||||
var parametros="";
|
||||
var tagnuevasipes=document.fdatos.nuevasipes;
|
||||
if(tagnuevasipes.length>0)
|
||||
var nuevasipes=tagnuevasipes
|
||||
else{
|
||||
nuevasipes=new Array();
|
||||
nuevasipes[0]=tagnuevasipes
|
||||
}
|
||||
swenv=false
|
||||
for(var x=0;x<nuevasipes.length;x++){
|
||||
cadenaip=nuevasipes[x].value;
|
||||
var auxsplit=nuevasipes[x].getAttribute("id").split("_");
|
||||
var idconfiguracion=auxsplit[1]
|
||||
// Toma los datos de la tabla correspondiente a esa configuracion
|
||||
var oTABLE=document.getElementById("tb_particiones_"+idconfiguracion)
|
||||
var oTRs=oTABLE.getElementsByTagName('TR') // Numero de particiones
|
||||
swenvio=oTABLE.value
|
||||
if(parseInt(swenvio)==0) continue; // Tabla de particiones no modificada
|
||||
swenv=true
|
||||
var tbparticiones=new Array(9);
|
||||
for(var i=0;i<9;i++) tbparticiones[i]=null // Inicializa matriz
|
||||
for(var i=1;i<oTRs.length;i++){ // recorre TR's de las particiones
|
||||
if(oTRs[i].style.visibility=="hidden") continue
|
||||
var oTDs=oTRs[i].getElementsByTagName('TD') // Numero de particiones
|
||||
var desplepar=oTDs[1].childNodes[0] // recupera el desplegable de particiones
|
||||
var despletipopar=oTDs[2].childNodes[0] // recupera el desplegable de tipo de accion
|
||||
var inputtama=oTDs[4].childNodes[0] // recupera el tama<6D>
|
||||
var despleacc=oTDs[5].childNodes[0] // recupera el desplegable de accion
|
||||
var particion=desplepar.value
|
||||
var tipopart=despletipopar.value
|
||||
var sizepart=inputtama.value
|
||||
var accion=despleacc.value
|
||||
var idp=parseInt(particion)
|
||||
tbparticiones[idp]=particion+";"+tipopart+";"+sizepart+";"+accion+'%0A'
|
||||
}
|
||||
var particiones=""
|
||||
for(var i=0;i<9;i++){
|
||||
if(tbparticiones[i]!=null){
|
||||
particiones+=tbparticiones[i]
|
||||
}
|
||||
}
|
||||
parametros+="cadenaip="+cadenaip+'%0D'+"identificador="+identificador+'%0D'+"nombrefuncion="+nombrefuncion+'%0D'+"ejecutor="+ejecutor+'%0D'+"tipotrama="+tipotrama+'%0D'+"ambito="+ambito+'%0D'+"idambito="+idambito+'%0D'+"particiones="+particiones
|
||||
parametros+='%09';
|
||||
}
|
||||
if(swenv){
|
||||
var wurl="./gestores/gestor_Configurar.php"
|
||||
wurl+="?parametros="+parametros
|
||||
wurl+="&" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la p<>ina gestora
|
||||
}
|
||||
else
|
||||
alert(TbMsg[0]);
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
var tbconfigur=document.getElementById("tbconfigur") ;
|
||||
var tbidc=tbconfigur.value.split(";");
|
||||
for(var j=0;j<tbidc.length-1;j++){
|
||||
var oTABLE=document.getElementById("tb_particiones_"+tbidc[j])
|
||||
var oTRs=oTABLE.getElementsByTagName('TR')
|
||||
var tbp=new Array(9);
|
||||
var otbp=new Array(9);
|
||||
for(var i=0;i<9;i++){
|
||||
tbp[i]=0; // Inicializar matriz
|
||||
otbp[i]=null
|
||||
}
|
||||
for(var i=1;i<oTRs.length;i++){ // recorre TR's de las particiones
|
||||
if(oTRs[i].style.visibility=="hidden") continue
|
||||
var oTDs=oTRs[i].getElementsByTagName('TD')
|
||||
var desplepar=oTDs[1].childNodes[0]
|
||||
var p=desplepar.selectedIndex
|
||||
var wpar=desplepar.options[p].value
|
||||
if(tbp[wpar]==1){
|
||||
alert(TbMsg[1])
|
||||
desplepar.focus();
|
||||
return(false)
|
||||
}
|
||||
else{
|
||||
tbp[wpar]=1;
|
||||
otbp[wpar]=desplepar;
|
||||
}
|
||||
var inputtama=oTDs[4].childNodes[0]
|
||||
var tama=inputtama.value
|
||||
if (tama<=0){
|
||||
alert(TbMsg[2]);
|
||||
inputtama.focus();
|
||||
return(false)
|
||||
}
|
||||
}
|
||||
var swsw=false;
|
||||
for(var i=1;i<9;i++){
|
||||
if(i!=4){
|
||||
if (tbp[i]==0) swsw=true
|
||||
if (tbp[i]==1 && swsw){
|
||||
alert(TbMsg[3]);
|
||||
otbp[i].focus();
|
||||
return(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgpar(o){
|
||||
var auxSplit=o.getAttribute("id").split("_");
|
||||
var despletipopar=document.getElementById("tipospar_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var despleacc=document.getElementById("acciones_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var littiposo=document.getElementById("tiposo_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var swenvio=document.getElementById("tb_particiones_"+auxSplit[2])
|
||||
var p=despletipopar.selectedIndex
|
||||
var tipopar=despletipopar.options[p].value
|
||||
switch(parseInt(tipopar)){
|
||||
case 0: // Sin particionar
|
||||
littiposo.innerHTML=' <span style="COLOR:red"> Espacio sin particionar !!</span> ';
|
||||
littiposo.value=0
|
||||
despleacc.selectedIndex=0
|
||||
break;
|
||||
case 1: // Bigdos
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Msdos,Windows 95</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 2: // FAt32
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Windows 98,Millenium</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 3: // NTFS
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Windows XP, Windows 2000, Windows 2003</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 4: //Linux Ext2
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux (Ext2)</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 5: //Linux Ext3
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux(Ext3)</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 6: //Linux Ext4
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux (Ext4)</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 7:
|
||||
littiposo.innerHTML=' <span style="COLOR:blue">Linux swap</span> ';
|
||||
littiposo.value=0
|
||||
despleacc.selectedIndex=0
|
||||
break;
|
||||
case 8:
|
||||
littiposo.innerHTML=' <span style="COLOR:blue">Caché</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
}
|
||||
swenvio.value=1; // marca la partición para ser tratada en el env<6E> de trama
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgtipopar(o){
|
||||
|
||||
var auxSplit=o.getAttribute("id").split("_");
|
||||
var despleacc=document.getElementById("acciones_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var littiposo=document.getElementById("tiposo_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var swenvio=document.getElementById("tb_particiones_"+auxSplit[2])
|
||||
var p=o.selectedIndex
|
||||
var tipopar=o.options[p].value
|
||||
if(tipopar!=0 && tipopar!=7)
|
||||
despleacc.selectedIndex=1;
|
||||
else
|
||||
despleacc.selectedIndex=0;
|
||||
|
||||
switch(parseInt(tipopar)){
|
||||
case 0: // Bigdos
|
||||
littiposo.innerHTML=' <span style="COLOR:red"> Espacio sin particionar !!</span> ';
|
||||
break;
|
||||
case 1: // Bigdos
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Msdos,Windows 95</span> ';
|
||||
break;
|
||||
littiposo.value=1
|
||||
case 2: // FAt32
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Windows 98,Millenium</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 3: // NTFS
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Windows XP, Windows 2000, Windows 2003</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 4: //Linux Ext2
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux (Ext2)</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 5: //Linux Ext3
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux(Ext3)</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 6: //Linux Ext4
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux (Ext4)</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 7:
|
||||
littiposo.innerHTML=' <span style="COLOR:blue">Linux swap</span> ';
|
||||
littiposo.value=0
|
||||
break;
|
||||
case 8:
|
||||
littiposo.innerHTML=' <span style="COLOR:blue">Caché</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
|
||||
}
|
||||
swenvio.value=1; // marca la partición para ser tratada en el env<6E> de trama
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgtama(idc){
|
||||
var oTABLE=document.getElementById("tb_particiones_"+idc)
|
||||
var oTRs=oTABLE.getElementsByTagName('TR') // Numero de particiones
|
||||
for(var i=1;i<oTRs.length;i++){ // recorre TR's de las particiones
|
||||
var oTDs=oTRs[i].getElementsByTagName('TD') // Numero de particiones
|
||||
var despleacc=oTDs[5].childNodes[0] // recupera el desplegable de accion
|
||||
var desplepar=oTDs[2].childNodes[0] // recupera el desplegable de tipos departiciones
|
||||
if(desplepar.selectedIndex!=0 && desplepar.selectedIndex!=7){ // Si la particion no esta vacia
|
||||
despleacc.selectedIndex=1;
|
||||
var littiposo=oTDs[3].childNodes[0]
|
||||
littiposo.value=1 // Marca como forzamente formaeable esta paticion
|
||||
oTABLE.value=1; // marca la partición para ser tratada en el env<6E> de trama
|
||||
}
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgaccion(o){
|
||||
var auxSplit=o.getAttribute("id").split("_"); // Toma numero de particion
|
||||
var littiposo=document.getElementById("tiposo_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var despleacc=document.getElementById("acciones_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var despletipopar=document.getElementById("tipospar_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var swenvio=document.getElementById("tb_particiones_"+auxSplit[2])
|
||||
if(despletipopar.selectedIndex==0){
|
||||
alert(TbMsg[4]);
|
||||
o.selectedIndex=0
|
||||
return
|
||||
}
|
||||
if (littiposo.value==1){
|
||||
alert(TbMsg[5]);
|
||||
o.selectedIndex=1
|
||||
}
|
||||
if(despleacc.selectedIndex==2){
|
||||
if(despletipopar.selectedIndex>3)
|
||||
alert(TbMsg[6]);
|
||||
}
|
||||
if(despleacc.selectedIndex==3){
|
||||
if(despletipopar.selectedIndex>3)
|
||||
alert(TbMsg[7]);
|
||||
}
|
||||
swenvio.value=1; // marca la partición para ser tratada en el env<6E> de trama
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function annadir_particion(idc){
|
||||
|
||||
oINPUT=document.getElementById("ultpa_"+idc)
|
||||
var wultpa=parseInt(oINPUT.value); // Toma el valor de la última partición existente
|
||||
wultpa++; // Incrementa en uno este valor para posteriores inserciones
|
||||
oINPUT.value=wultpa; // Actualiza este valor en el campo oculto
|
||||
var ultpa=oINPUT.value; // Crear variable javascript de trabajo con este valor
|
||||
var oTR=document.getElementById("TRparticion_"+ultpa+"_"+idc)
|
||||
if(oTR){
|
||||
oTR.style.visibility="visible";
|
||||
}
|
||||
return;
|
||||
|
||||
|
||||
// Antiguo código
|
||||
var oTABLE=document.getElementById("tb_particiones_"+idc)
|
||||
var oTRs=oTABLE.getElementsByTagName('TR') // Numero de particiones
|
||||
if(parseInt(oTRs.length)>7){ // E número de particiones no puede ser mayor de 7
|
||||
alert(TbMsg[8]);
|
||||
return;
|
||||
}
|
||||
|
||||
oTABLE=document.getElementById("tabla_contenidoparticion_"+idc)
|
||||
var oTDs=oTABLE.getElementsByTagName('TD') // LLega hasta TD ( punto de pivote )
|
||||
textHtml=oTDs[0].innerHTML // Toma la tabla para añadir al final
|
||||
|
||||
// Toma código html de la tabla modelo
|
||||
oTABLE=document.getElementById("patron_contenidoparticion")
|
||||
var wpatrontablaparticion=oTABLE.innerHTML
|
||||
oINPUT=document.getElementById("ultpa_"+idc)
|
||||
var wultpa=parseInt(oINPUT.value); // Toma el valor de la última partición existente
|
||||
wultpa++; // Incrementa en uno este valor para posteriores inserciones
|
||||
oINPUT.value=wultpa; // Actualiza este valor en el campo oculto
|
||||
var ultpa=oINPUT.value; // Crear variable javascript de trabajo con este valor
|
||||
|
||||
var re = new RegExp ('_upa_', 'gi') ; // Reemplaza partición y configuración
|
||||
var rs =ultpa
|
||||
var patrontablaparticion = wpatrontablaparticion.replace(re,rs) ;
|
||||
wpatrontablaparticion=patrontablaparticion
|
||||
var re = new RegExp ('_cfg_', 'gi') ; // Reemplaza configuración
|
||||
var rs =idc
|
||||
var patrontablaparticion = wpatrontablaparticion.replace(re,rs) ;
|
||||
posb=textHtml.length
|
||||
for (var posa=posb;posa>=0;posa--) {
|
||||
if ("</TR>" == textHtml.substr(posa,5).toUpperCase()) break; // Retrocede buscando etiqueta </TR>
|
||||
}
|
||||
var nwrama=textHtml.substr(0,posa+5) // Primer trozo
|
||||
nwrama+=patrontablaparticion
|
||||
alert(patrontablaparticion);
|
||||
nwrama+=textHtml.substr(posa,textHtml.length-posa) // Segundo trozo
|
||||
oTDs[0].innerHTML=nwrama; // Actualiza todo el nuevo código de la tabla
|
||||
var oDESPLE=document.getElementById("numpar_"+ultpa+"_"+idc) // Selecciona item creado
|
||||
var ise=wultpa-1
|
||||
if (ise>3 && ise<7) ise-=1
|
||||
if(ise>6) ise=6
|
||||
oDESPLE.selectedIndex=ise
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function elimina_particion(o,idc){
|
||||
oTABLE=document.getElementById("tabla_contenidoparticion_"+idc)
|
||||
oTDs=oTABLE.getElementsByTagName('TD') // LLega hasta TD ( punto de pivote )
|
||||
textHtml=oTDs[0].innerHTML // Toma la rama a sustituir
|
||||
var patron=o.getAttribute("id")
|
||||
var re = new RegExp (patron, 'gi') ;
|
||||
var pos=textHtml.search(patron)
|
||||
for (var posa=pos;posa>=0;posa--) {
|
||||
if ("<TR" == textHtml.substr(posa,3).toUpperCase()) break; // Retrocede buscando etiqueta <TR>
|
||||
}
|
||||
for (var posb=pos;posb<textHtml.length;posb++) { // Avanza buscando etiqueta </TR>
|
||||
if ("</TR>" == textHtml.substr(posb,5).toUpperCase()) break;
|
||||
}
|
||||
posb+=5
|
||||
var nwrama=textHtml.substr(0,posa) // Primer trozo
|
||||
nwrama+=textHtml.substr(posb,textHtml.length-posb) // Segundo trozo
|
||||
oTDs[0].innerHTML=nwrama;
|
||||
|
||||
var swenvio=document.getElementById("tb_particiones_"+idc)
|
||||
swenvio.value=1; // marca la partición para ser tratada en el env<6E> de trama
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_Configurar(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function resalta(o,idc){
|
||||
currentconfiguracion=idc
|
||||
if(currentimgconfiguracion!=null)
|
||||
currentimgconfiguracion.src="../images/iconos/configuraciones.gif"
|
||||
currentimgconfiguracion=o;
|
||||
o.src="../images/iconos/configuraciones_ON.gif"
|
||||
menu_contextual(o,'flo_configuraciones');
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgtotal(op){
|
||||
idc=currentconfiguracion
|
||||
var oTABLE=document.getElementById("tb_particiones_"+idc)
|
||||
var oTRs=oTABLE.getElementsByTagName('TR') // Numero de particiones
|
||||
for(var i=1;i<oTRs.length;i++){ // recorre TR's de las particiones
|
||||
var oTDs=oTRs[i].getElementsByTagName('TD') // Numero de particiones
|
||||
var despleacc=oTDs[5].childNodes[0] // recupera el desplegable de accion
|
||||
var despletipopar=oTDs[2].childNodes[0] // recupera el desplegable de tipos de particiones
|
||||
var littiposo=oTDs[3].childNodes[0]
|
||||
if(despletipopar.selectedIndex==0 || despletipopar.selectedIndex==5) // partición est<73>vac<61>o es swap no puede llevarse a cabo ningn tipo de acci<63> sobre ella
|
||||
continue
|
||||
if (littiposo.value==1) // Est<73>partición debe ser necesariamente formateada porque se ha cambiado el S.O.
|
||||
continue
|
||||
if(op==2){ // No tiene sentido ocultar esta partición al no tratarse de un sistema Windows;
|
||||
if(despletipopar.selectedIndex>3)
|
||||
continue
|
||||
}
|
||||
if(op==3){ // No tiene sentido mostrar esta partición al no tratarse de un sistema Windows;
|
||||
if(despletipopar.selectedIndex>3)
|
||||
continue
|
||||
}
|
||||
despleacc.selectedIndex=op; // Coloca la acci<63> en el desplegable
|
||||
oTABLE.value=1; // marca la partición para ser tratada en el env<6E> de trama
|
||||
}
|
||||
}
|
|
@ -1,81 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: CrearPerfilSoftware.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero CrearPerfilSoftware.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var cadenaip=document.fdatos.cadenaip.value;
|
||||
var identificador=document.fdatos.identificador.value;
|
||||
var nombrefuncion=document.fdatos.nombrefuncion.value;
|
||||
var ejecutor=document.fdatos.ejecutor.value;
|
||||
var tipotrama=document.fdatos.tipotrama.value;
|
||||
var ambito=document.fdatos.ambito.value;
|
||||
var idambito=document.fdatos.idambito.value;
|
||||
tb_conf=document.getElementById("tabla_conf");
|
||||
var ochecks=tb_conf.getElementsByTagName('INPUT')
|
||||
var perfiles=""
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
var particion=ochecks[i].value
|
||||
desple=document.getElementById("desple_"+particion);
|
||||
perfiles+=particion+"_"+desple.value+";"
|
||||
}
|
||||
}
|
||||
var wurl="./gestores/gestor_CrearPerfilSoftware.php"
|
||||
wurl+="?cadenaip="+cadenaip+"&identificador="+identificador+"&nombrefuncion="+nombrefuncion+"&ejecutor="+ejecutor+"&tipotrama="+tipotrama+"&ambito="+ambito+"&idambito="+idambito+"&perfiles="+perfiles
|
||||
wurl+="&" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la p<>ina gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Cancela la edici<63>
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar_datos
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
tb_conf=document.getElementById("tabla_conf");
|
||||
var ochecks=tb_conf.getElementsByTagName('INPUT')
|
||||
var op=0
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
op++;
|
||||
var particion=ochecks[i].value
|
||||
desple=document.getElementById("desple_"+particion);
|
||||
var p=desple.selectedIndex
|
||||
if (p==0){
|
||||
alert(TbMsg[0])
|
||||
desple.focus()
|
||||
return(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(op==0){
|
||||
alert(TbMsg[1])
|
||||
return(false);
|
||||
}
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_crearperfilsoftware(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,83 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: CrearSoftIncremental.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero CrearSoftIncremental.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var cadenaip=document.fdatos.cadenaip.value;
|
||||
var identificador=document.fdatos.identificador.value;
|
||||
var nombrefuncion=document.fdatos.nombrefuncion.value;
|
||||
var ejecutor=document.fdatos.ejecutor.value;
|
||||
var tipotrama=document.fdatos.tipotrama.value;
|
||||
var ambito=document.fdatos.ambito.value;
|
||||
var idambito=document.fdatos.idambito.value;
|
||||
var idperfilhard=document.fdatos.idperfilhard.value;
|
||||
tb_conf=document.getElementById("tabla_conf");
|
||||
var ochecks=tb_conf.getElementsByTagName('INPUT')
|
||||
var perfiles=""
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
var particion=ochecks[i].value
|
||||
desple=document.getElementById("desple_"+particion);
|
||||
perfiles+=particion+"_"+desple.value+";"
|
||||
}
|
||||
}
|
||||
var wurl="./gestores/gestor_CrearSoftIncremental.php"
|
||||
wurl+="?cadenaip="+cadenaip+"&identificador="+identificador+"&nombrefuncion="+nombrefuncion+"&ejecutor="+ejecutor+"&tipotrama="+tipotrama+"&ambito="+ambito+"&idambito="+idambito+"&idperfilhard="+idperfilhard+"&perfiles="+perfiles
|
||||
wurl+="&" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Cancela la edición
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar_datos
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
tb_conf=document.getElementById("tabla_conf");
|
||||
var ochecks=tb_conf.getElementsByTagName('INPUT')
|
||||
var op=0
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
op++;
|
||||
var particion=ochecks[i].value
|
||||
desple=document.getElementById("desple_"+particion);
|
||||
var p=desple.selectedIndex
|
||||
if (p==0){
|
||||
alert(TbMsg[0])
|
||||
desple.focus()
|
||||
return(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
if(op==0){
|
||||
alert(TbMsg[1])
|
||||
return(false);
|
||||
}
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_crearsoftincremental(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,61 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: EjecutarScripts.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero EjecutarScripts.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
if(confirm(TbMsg[0])){
|
||||
document.fdatos.pseudocodigo.value=convierte_a_pseudocodigo("#!/bin/bash \n"+document.fdatos.codigo.value);
|
||||
document.fdatos.sw_ejya.value=document.fdatosejecucion.sw_ejya.checked
|
||||
document.fdatosejecucion.sw_seguimiento.value=document.fdatosejecucion.sw_seguimiento[0].checked;
|
||||
document.fdatos.sw_seguimiento.value=document.fdatosejecucion.sw_seguimiento.value
|
||||
document.fdatos.sw_mkprocedimiento.value=document.fdatosejecucion.sw_mkprocedimiento.checked
|
||||
document.fdatos.nwidprocedimiento.value=document.fdatosejecucion.idprocedimiento.value
|
||||
document.fdatos.nwdescriprocedimiento.value=document.fdatosejecucion.nombreprocedimiento.value
|
||||
document.fdatos.sw_mktarea.value=document.fdatosejecucion.sw_mktarea.checked
|
||||
document.fdatos.nwidtarea.value=document.fdatosejecucion.idtarea.value
|
||||
document.fdatos.nwdescritarea.value=document.fdatosejecucion.nombretarea.value
|
||||
document.fdatos.submit();
|
||||
}
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function convierte_a_pseudocodigo(codi){
|
||||
pseudo=""
|
||||
for(var i=0;i<codi.length;i++)
|
||||
pseudo+=escape(codi.charAt(i));
|
||||
return(pseudo);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
var sw_seguimientocon=document.fdatosejecucion.sw_seguimiento[0].checked;
|
||||
var sw_mkprocedimiento=document.fdatosejecucion.sw_mkprocedimiento.checked;
|
||||
var sw_mktarea=document.fdatosejecucion.sw_mktarea.checked;
|
||||
if (document.fdatos.codigo.value=="" && document.fdatos.userfile.value=="" ) {
|
||||
alert(TbMsg[1]);
|
||||
document.fdatos.codigo.focus();
|
||||
return(false);
|
||||
}
|
||||
if(!sw_seguimientocon && !sw_mkprocedimiento && !sw_mktarea) return(true)
|
||||
if (document.fdatos.titulo.value=="" ) {
|
||||
alert(TbMsg[2]);
|
||||
document.fdatos.titulo.focus();
|
||||
return(false);
|
||||
}
|
||||
if (document.fdatos.descripcion.value=="" ) {
|
||||
alert(TbMsg[3]);
|
||||
document.fdatos.descripcion.focus();
|
||||
return(false);
|
||||
}
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
|
@ -1,71 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: IniciarSesion.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero IniciarSesion.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var cadenaip=document.fdatos.cadenaip.value;
|
||||
var identificador=document.fdatos.identificador.value;
|
||||
var nombrefuncion=document.fdatos.nombrefuncion.value;
|
||||
var ejecutor=document.fdatos.ejecutor.value;
|
||||
var tipotrama=document.fdatos.tipotrama.value;
|
||||
var ambito=document.fdatos.ambito.value;
|
||||
var idambito=document.fdatos.idambito.value;
|
||||
tb_conf=document.getElementById("tabla_conf");
|
||||
var ochecks=tb_conf.getElementsByTagName('INPUT')
|
||||
var particion;
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
particion=ochecks[i].value
|
||||
}
|
||||
}
|
||||
var wurl="./gestores/gestor_IniciarSesion.php"
|
||||
wurl+="?cadenaip="+cadenaip+"&identificador="+identificador+"&nombrefuncion="+nombrefuncion+"&ejecutor="+ejecutor+"&tipotrama="+tipotrama+"&ambito="+ambito+"&idambito="+idambito+"&particion="+particion
|
||||
wurl+="&" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la p<>ina gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Cancela la edici<63>
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar_datos
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
tb_conf=document.getElementById("tabla_conf");
|
||||
var ochecks=tb_conf.getElementsByTagName('INPUT')
|
||||
var op=0
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
op++;
|
||||
}
|
||||
}
|
||||
if(op==0){
|
||||
alert(TbMsg[1])
|
||||
return(false);
|
||||
}
|
||||
return(true)
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_iniciarsesion(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creació<69>:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: InventarioHardware.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero InventarioHardware.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var wurl="./gestores/gestor_InventarioHardware.php?" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la p<>ina gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_inventariohardware(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,46 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creació<69>:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: InventarioHardware.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero InventarioHardware.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var tb_conf=document.getElementById("tabla_conf");
|
||||
var ochecks=tb_conf.getElementsByTagName('INPUT')
|
||||
var particiones=""
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
var particion=ochecks[i].value
|
||||
particiones+=particion+";"
|
||||
}
|
||||
}
|
||||
var wurl="./gestores/gestor_InventarioSoftware.php"
|
||||
wurl+="?particiones="+particiones+"&"+compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la p<>ina gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_inventariosoftware(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,394 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Configurar.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero Configurar.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
var patrontablaparticion;
|
||||
var ultpa;
|
||||
var currentconfiguracion=null;
|
||||
var currentimgconfiguracion=null;
|
||||
//________________________________________________________________________________________________________
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var cadenaip=document.fdatosocultos.cadenaip.value;
|
||||
var identificador=document.fdatosocultos.identificador.value;
|
||||
var nombrefuncion=document.fdatosocultos.nombrefuncion.value;
|
||||
var ejecutor=document.fdatosocultos.ejecutor.value;
|
||||
var tipotrama=document.fdatosocultos.tipotrama.value;
|
||||
var ambito=document.fdatosocultos.ambito.value;
|
||||
var idambito=document.fdatosocultos.idambito.value;
|
||||
var parametros="";
|
||||
var tagnuevasipes=document.fdatos.nuevasipes;
|
||||
if(tagnuevasipes.length>0)
|
||||
var nuevasipes=tagnuevasipes
|
||||
else{
|
||||
nuevasipes=new Array();
|
||||
nuevasipes[0]=tagnuevasipes
|
||||
}
|
||||
swenv=false
|
||||
for(var x=0;x<nuevasipes.length;x++){
|
||||
cadenaip=nuevasipes[x].value;
|
||||
var auxsplit=nuevasipes[x].getAttribute("id").split("_");
|
||||
var idconfiguracion=auxsplit[1]
|
||||
// Toma los datos de la tabla correspondiente a esa configuracion
|
||||
var oTABLE=document.getElementById("tb_particiones_"+idconfiguracion)
|
||||
var oTRs=oTABLE.getElementsByTagName('TR') // Numero de particiones
|
||||
swenvio=oTABLE.value
|
||||
if(parseInt(swenvio)==0) continue; // Tabla de particiones no modificada
|
||||
swenv=true
|
||||
var tbparticiones=new Array(9);
|
||||
for(var i=0;i<9;i++) tbparticiones[i]=null // Inicializa matriz
|
||||
for(var i=1;i<oTRs.length;i++){ // recorre TR's de las particiones
|
||||
var oTDs=oTRs[i].getElementsByTagName('TD') // Numero de particiones
|
||||
var desplepar=oTDs[1].childNodes[0] // recupera el desplegable de particiones
|
||||
var despletipopar=oTDs[2].childNodes[0] // recupera el desplegable de tipo de accion
|
||||
var inputtama=oTDs[4].childNodes[1] // recupera el tama<6D>
|
||||
var despleacc=oTDs[5].childNodes[1] // recupera el desplegable de accion
|
||||
var particion=desplepar.value
|
||||
var tipopart=despletipopar.value
|
||||
var sizepart=inputtama.value
|
||||
var accion=despleacc.value
|
||||
var idp=parseInt(particion)
|
||||
tbparticiones[idp]=particion+";"+tipopart+";"+sizepart+";"+accion+'%0A'
|
||||
}
|
||||
var particiones=""
|
||||
for(var i=0;i<9;i++){
|
||||
if(tbparticiones[i]!=null){
|
||||
particiones+=tbparticiones[i]
|
||||
}
|
||||
}
|
||||
parametros+="cadenaip="+cadenaip+'%0D'+"identificador="+identificador+'%0D'+"nombrefuncion="+nombrefuncion+'%0D'+"ejecutor="+ejecutor+'%0D'+"tipotrama="+tipotrama+'%0D'+"ambito="+ambito+'%0D'+"idambito="+idambito+'%0D'+"particiones="+particiones
|
||||
parametros+='%09';
|
||||
}
|
||||
if(swenv){
|
||||
var wurl="./gestores/gestor_Configurar.php"
|
||||
wurl+="?parametros="+parametros
|
||||
wurl+="&" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la p<>ina gestora
|
||||
}
|
||||
else
|
||||
alert(TbMsg[0]);
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
var tbconfigur=document.getElementById("tbconfigur") ;
|
||||
var tbidc=tbconfigur.value.split(";");
|
||||
for(var j=0;j<tbidc.length-1;j++){
|
||||
var oTABLE=document.getElementById("tb_particiones_"+tbidc[j])
|
||||
var oTRs=oTABLE.getElementsByTagName('TR')
|
||||
var tbp=new Array(9);
|
||||
var otbp=new Array(9);
|
||||
for(var i=0;i<9;i++){
|
||||
tbp[i]=0; // Inicializar matriz
|
||||
otbp[i]=null
|
||||
}
|
||||
for(var i=1;i<oTRs.length;i++){ // recorre TR's de las particiones
|
||||
var oTDs=oTRs[i].getElementsByTagName('TD')
|
||||
var desplepar=oTDs[1].childNodes[0]
|
||||
var p=desplepar.selectedIndex
|
||||
var wpar=desplepar.options[p].value
|
||||
if(tbp[wpar]==1){
|
||||
alert(TbMsg[1])
|
||||
desplepar.focus();
|
||||
return(false)
|
||||
}
|
||||
else{
|
||||
tbp[wpar]=1;
|
||||
otbp[wpar]=desplepar;
|
||||
}
|
||||
var inputtama=oTDs[4].childNodes[0]
|
||||
var tama=inputtama.value
|
||||
if (tama<=0){
|
||||
alert(TbMsg[2]);
|
||||
inputtama.focus();
|
||||
return(false)
|
||||
}
|
||||
}
|
||||
var swsw=false;
|
||||
for(var i=1;i<9;i++){
|
||||
if(i!=4){
|
||||
if (tbp[i]==0) swsw=true
|
||||
if (tbp[i]==1 && swsw){
|
||||
alert(TbMsg[3]);
|
||||
otbp[i].focus();
|
||||
return(false)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgpar(o){
|
||||
var auxSplit=o.getAttribute("id").split("_");
|
||||
var despletipopar=document.getElementById("tipospar_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var despleacc=document.getElementById("acciones_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var littiposo=document.getElementById("tiposo_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var swenvio=document.getElementById("tb_particiones_"+auxSplit[2])
|
||||
var p=despletipopar.selectedIndex
|
||||
var tipopar=despletipopar.options[p].value
|
||||
switch(parseInt(tipopar)){
|
||||
case 0: // Sin particionar
|
||||
littiposo.innerHTML=' <span style="COLOR:red"> Espacio sin particionar !!</span> ';
|
||||
littiposo.value=0
|
||||
despleacc.selectedIndex=0
|
||||
break;
|
||||
case 1: // Bigdos
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Msdos,Windows 95</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 2: // FAt32
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Windows 98,Millenium</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 3: // NTFS
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Windows XP, Windows 2000, Windows 2003</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 4: //Linux Ext2
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux (Ext2)</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 5: //Linux Ext3
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux(Ext3)</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 6: //Linux Ext4
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux (Ext4)</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
case 7:
|
||||
littiposo.innerHTML=' <span style="COLOR:blue">Linux swap</span> ';
|
||||
littiposo.value=0
|
||||
despleacc.selectedIndex=0
|
||||
break;
|
||||
case 8:
|
||||
littiposo.innerHTML=' <span style="COLOR:blue">Caché</span> ';
|
||||
littiposo.value=1
|
||||
despleacc.selectedIndex=1
|
||||
break;
|
||||
}
|
||||
swenvio.value=1; // marca la partici<63> para ser tratada en el env<6E> de trama
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgtipopar(o){
|
||||
alert("ooo");
|
||||
var auxSplit=o.getAttribute("id").split("_");
|
||||
var despleacc=document.getElementById("acciones_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var littiposo=document.getElementById("tiposo_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var swenvio=document.getElementById("tb_particiones_"+auxSplit[2])
|
||||
var p=o.selectedIndex
|
||||
var tipopar=o.options[p].value
|
||||
if(tipopar!=0 && tipopar!=7)
|
||||
despleacc.selectedIndex=1;
|
||||
else
|
||||
despleacc.selectedIndex=0;
|
||||
alert( "===================="+parseInt(tipopar));
|
||||
switch(parseInt(tipopar)){
|
||||
case 0: // Bigdos
|
||||
littiposo.innerHTML=' <span style="COLOR:red"> Espacio sin particionar !!</span> ';
|
||||
break;
|
||||
case 1: // Bigdos
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Msdos,Windows 95</span> ';
|
||||
break;
|
||||
littiposo.value=1
|
||||
case 2: // FAt32
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Windows 98,Millenium</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 3: // NTFS
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Windows XP, Windows 2000, Windows 2003</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 4: //Linux Ext2
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux (Ext2)</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 5: //Linux Ext3
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux(Ext3)</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 6: //Linux Ext4
|
||||
littiposo.innerHTML=' <span style="COLOR:red">Linux (Ext4)</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
case 7:
|
||||
littiposo.innerHTML=' <span style="COLOR:blue">Linux swap</span> ';
|
||||
littiposo.value=0
|
||||
break;
|
||||
case 8:
|
||||
littiposo.innerHTML=' <span style="COLOR:blue">Caché</span> ';
|
||||
littiposo.value=1
|
||||
break;
|
||||
|
||||
}
|
||||
swenvio.value=1; // marca la partici<63> para ser tratada en el env<6E> de trama
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgtama(idc){
|
||||
var oTABLE=document.getElementById("tb_particiones_"+idc)
|
||||
var oTRs=oTABLE.getElementsByTagName('TR') // Numero de particiones
|
||||
for(var i=1;i<oTRs.length;i++){ // recorre TR's de las particiones
|
||||
var oTDs=oTRs[i].getElementsByTagName('TD') // Numero de particiones
|
||||
var despleacc=oTDs[5].childNodes[0] // recupera el desplegable de accion
|
||||
var desplepar=oTDs[2].childNodes[0] // recupera el desplegable de tipos departiciones
|
||||
if(desplepar.selectedIndex!=0 && desplepar.selectedIndex!=5){ // Si la particion no esta vacia
|
||||
despleacc.selectedIndex=1;
|
||||
var littiposo=oTDs[3].childNodes[0]
|
||||
littiposo.value=1 // Marca como forzamente formaeable esta paticion
|
||||
oTABLE.value=1; // marca la partici<63> para ser tratada en el env<6E> de trama
|
||||
}
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgaccion(o){
|
||||
var auxSplit=o.getAttribute("id").split("_"); // Toma numero de particion
|
||||
var littiposo=document.getElementById("tiposo_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var despleacc=document.getElementById("acciones_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var despletipopar=document.getElementById("tipospar_"+auxSplit[1]+"_"+auxSplit[2])
|
||||
var swenvio=document.getElementById("tb_particiones_"+auxSplit[2])
|
||||
if(despletipopar.selectedIndex==0){
|
||||
alert(TbMsg[4]);
|
||||
o.selectedIndex=0
|
||||
return
|
||||
}
|
||||
if (littiposo.value==1){
|
||||
alert(TbMsg[5]);
|
||||
o.selectedIndex=1
|
||||
}
|
||||
if(despleacc.selectedIndex==2){
|
||||
if(despletipopar.selectedIndex>3)
|
||||
alert(TbMsg[6]);
|
||||
}
|
||||
if(despleacc.selectedIndex==3){
|
||||
if(despletipopar.selectedIndex>3)
|
||||
alert(TbMsg[7]);
|
||||
}
|
||||
swenvio.value=1; // marca la partici<63> para ser tratada en el env<6E> de trama
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function annadir_particion(idc){
|
||||
var oTABLE=document.getElementById("tb_particiones_"+idc)
|
||||
var oTRs=oTABLE.getElementsByTagName('TR') // Numero de particiones
|
||||
if(parseInt(oTRs.length)>7){
|
||||
alert(TbMsg[8]);
|
||||
return;
|
||||
}
|
||||
oTABLE=document.getElementById("tabla_contenidoparticion_"+idc)
|
||||
var oTDs=oTABLE.getElementsByTagName('TD') // LLega hasta TD ( punto de pivote )
|
||||
textHtml=oTDs[0].innerHTML // Toma la rama a sustituir
|
||||
|
||||
oTABLE=document.getElementById("patron_contenidoparticion")
|
||||
var wpatrontablaparticion=oTABLE.innerHTML // Toma la rama a sustituir
|
||||
oINPUT=document.getElementById("ultpa_"+idc)
|
||||
var wultpa=parseInt(oINPUT.value);
|
||||
wultpa++;
|
||||
oINPUT.value=wultpa;
|
||||
ultpa=oINPUT.value;
|
||||
|
||||
var re = new RegExp ('_upa_', 'gi') ; // Reemplaza partici<63> y configuraci<63>
|
||||
var rs =ultpa
|
||||
var patrontablaparticion = wpatrontablaparticion.replace(re,rs) ;
|
||||
wpatrontablaparticion=patrontablaparticion
|
||||
var re = new RegExp ('_cfg_', 'gi') ; // Reemplaza configuraci<63>
|
||||
var rs =idc
|
||||
var patrontablaparticion = wpatrontablaparticion.replace(re,rs) ;
|
||||
posb=textHtml.length
|
||||
for (var posa=posb;posa>=0;posa--) {
|
||||
if ("</TR>" == textHtml.substr(posa,5)) break; // Retrocede buscando etiqueta </TR>
|
||||
}
|
||||
var nwrama=textHtml.substr(0,posa+5) // Primer trozo
|
||||
nwrama+=patrontablaparticion
|
||||
nwrama+=textHtml.substr(posa,textHtml.length-posa) // Segundo trozo
|
||||
oTDs[0].innerHTML=nwrama;
|
||||
var oDESPLE=document.getElementById("numpar_"+ultpa+"_"+idc) // Selecciona item creado
|
||||
var ise=wultpa-1
|
||||
if (ise>3 && ise<7) ise-=1
|
||||
if(ise>6) ise=6
|
||||
oDESPLE.selectedIndex=ise
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function elimina_particion(o,idc){
|
||||
oTABLE=document.getElementById("tabla_contenidoparticion_"+idc)
|
||||
oTDs=oTABLE.getElementsByTagName('TD') // LLega hasta TD ( punto de pivote )
|
||||
textHtml=oTDs[0].innerHTML // Toma la rama a sustituir
|
||||
var patron=o.getAttribute("id")
|
||||
var re = new RegExp (patron, 'gi') ;
|
||||
var pos=textHtml.search(patron)
|
||||
for (var posa=pos;posa>=0;posa--) {
|
||||
if ("<TR" == textHtml.substr(posa,3)) break; // Retrocede buscando etiqueta <TR>
|
||||
}
|
||||
for (var posb=pos;posb<textHtml.length;posb++) { // Avanza buscando etiqueta </TR>
|
||||
if ("</TR>" == textHtml.substr(posb,5)) break;
|
||||
}
|
||||
posb+=5
|
||||
var nwrama=textHtml.substr(0,posa) // Primer trozo
|
||||
nwrama+=textHtml.substr(posb,textHtml.length-posb) // Segundo trozo
|
||||
oTDs[0].innerHTML=nwrama;
|
||||
|
||||
var swenvio=document.getElementById("tb_particiones_"+idc)
|
||||
swenvio.value=1; // marca la partici<63> para ser tratada en el env<6E> de trama
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_Configurar(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function resalta(o,idc){
|
||||
currentconfiguracion=idc
|
||||
if(currentimgconfiguracion!=null)
|
||||
currentimgconfiguracion.src="../images/iconos/configuraciones.gif"
|
||||
currentimgconfiguracion=o;
|
||||
o.src="../images/iconos/configuraciones_ON.gif"
|
||||
menu_contextual(o,'flo_configuraciones');
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function chgtotal(op){
|
||||
idc=currentconfiguracion
|
||||
var oTABLE=document.getElementById("tb_particiones_"+idc)
|
||||
var oTRs=oTABLE.getElementsByTagName('TR') // Numero de particiones
|
||||
for(var i=1;i<oTRs.length;i++){ // recorre TR's de las particiones
|
||||
var oTDs=oTRs[i].getElementsByTagName('TD') // Numero de particiones
|
||||
var despleacc=oTDs[5].childNodes[0] // recupera el desplegable de accion
|
||||
var despletipopar=oTDs[2].childNodes[0] // recupera el desplegable de tipos de particiones
|
||||
var littiposo=oTDs[3].childNodes[0]
|
||||
if(despletipopar.selectedIndex==0 || despletipopar.selectedIndex==5) // partici<63> est<73>vac<61>o es swap no puede llevarse a cabo ningn tipo de acci<63> sobre ella
|
||||
continue
|
||||
if (littiposo.value==1) // Est<73>partici<63> debe ser necesariamente formateada porque se ha cambiado el S.O.
|
||||
continue
|
||||
if(op==2){ // No tiene sentido ocultar esta partici<63> al no tratarse de un sistema Windows;
|
||||
if(despletipopar.selectedIndex>3)
|
||||
continue
|
||||
}
|
||||
if(op==3){ // No tiene sentido mostrar esta partici<63> al no tratarse de un sistema Windows;
|
||||
if(despletipopar.selectedIndex>3)
|
||||
continue
|
||||
}
|
||||
despleacc.selectedIndex=op; // Coloca la acci<63> en el desplegable
|
||||
oTABLE.value=1; // marca la partici<63> para ser tratada en el env<6E> de trama
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: Reiniciar.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero Reiniciar.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var wurl="./gestores/gestor_Reiniciar.php?" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//__________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//__________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//__________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//__________________________________________________________________________________________________
|
||||
function resultado_reiniciar(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Abril-2005
|
||||
// Nombre del fichero: RemboOffline.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero RemboOffline.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var wurl="./gestores/gestor_RemboOffline.php?" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_RemboOffline(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,164 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: RestaurarImagenAula.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero RestaurarImagenAula.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Cancela la edición
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Esta función desabilita la marca de un checkbox en opcion "bajas"
|
||||
//________________________________________________________________________________________________________
|
||||
function desabilita(o) {
|
||||
var b
|
||||
b=o.checked
|
||||
o.checked=!b
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Confirma la edición
|
||||
//________________________________________________________________________________________________________
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var cadenaip=document.fdatosocultos.cadenaip.value;
|
||||
var identificador=document.fdatosocultos.identificador.value;
|
||||
var nombrefuncion=document.fdatosocultos.nombrefuncion.value;
|
||||
var ejecutor=document.fdatosocultos.ejecutor.value;
|
||||
var tipotrama=document.fdatosocultos.tipotrama.value;
|
||||
var ambito=document.fdatosocultos.ambito.value;
|
||||
var idambito=document.fdatosocultos.idambito.value;
|
||||
var parametros="";
|
||||
var tagnuevasipes=document.fdatos.nuevasipes;
|
||||
if(tagnuevasipes.length>0)
|
||||
var nuevasipes=tagnuevasipes
|
||||
else{
|
||||
nuevasipes=new Array();
|
||||
nuevasipes[0]=tagnuevasipes
|
||||
}
|
||||
for(var x=0;x<nuevasipes.length;x++){
|
||||
cadenaip=nuevasipes[x].value;
|
||||
var auxsplit=nuevasipes[x].getAttribute("id").split("_");
|
||||
var idperfilhard=auxsplit[1]
|
||||
var idparticion=auxsplit[2]
|
||||
var ochecks=document.fdatos.getElementsByTagName("INPUT")
|
||||
var perfiles=""
|
||||
var pathrmb="";
|
||||
var protclona="";
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
var particion=ochecks[i].value
|
||||
var valparticion=particion.split("_");
|
||||
var widperfilhard=valparticion[1]
|
||||
var widparticion=valparticion[2]
|
||||
if(idperfilhard==widperfilhard && idparticion==widparticion){
|
||||
var desple_M=document.getElementById("desple_M_"+particion);
|
||||
var p_M=desple_M.selectedIndex
|
||||
if(p_M>0)
|
||||
perfiles+=valparticion[0]+"_M_"+desple_M.value+";"
|
||||
var opathrmb=document.getElementById("pathrmb_"+particion);
|
||||
pathrmb+=opathrmb.value+";";
|
||||
var protclon=document.getElementById("protoclonacion_"+particion);
|
||||
protclona+=protclon.value+";";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(perfiles!=""){
|
||||
parametros+="cadenaip="+cadenaip+'%0D'+"identificador="+identificador+'%0D'+"nombrefuncion="+nombrefuncion+'%0D'+"ejecutor="+ejecutor+'%0D'+"tipotrama="+tipotrama+'%0D'+"ambito="+ambito+'%0D'+"idambito="+idambito+'%0D'+"pathrmb="+pathrmb+'%0D'+"protclona="+protclona+'%0D'+"perfiles="+perfiles
|
||||
parametros+='%09';
|
||||
}
|
||||
}
|
||||
var wurl="./gestores/gestor_RestaurarImagenAula.php"
|
||||
wurl+="?parametros="+parametros
|
||||
wurl+="&" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// seleccionar automaticamente las particiones
|
||||
//________________________________________________________________________________________________________
|
||||
function seleccionar(particion){
|
||||
|
||||
var desplepath=document.getElementById("pathrmb_"+particion);
|
||||
var p=desplepath.selectedIndex
|
||||
if(p<1){
|
||||
desplepath.selectedIndex=1
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Marcar automaticamente los check box
|
||||
//________________________________________________________________________________________________________
|
||||
function marcar(desple,id){
|
||||
var p=desple.selectedIndex
|
||||
if(p>0){
|
||||
var casilla=document.getElementById("particion_"+id);
|
||||
casilla.checked=true;
|
||||
}
|
||||
var desplepath=document.getElementById("pathrmb_"+id);
|
||||
var p=desplepath.selectedIndex
|
||||
if(p<1){
|
||||
desplepath.selectedIndex=1
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar_datos
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
var ochecks=document.fdatos.getElementsByTagName("INPUT")
|
||||
var op=0
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
op++;
|
||||
var particion=ochecks[i].value
|
||||
var desple_M=document.getElementById("desple_M_"+particion);
|
||||
var valparticion=particion.split("_");
|
||||
var p_M=desple_M.selectedIndex
|
||||
if (p_M==0){
|
||||
alert(TbMsg[0]+valparticion[0])
|
||||
desple_M.focus()
|
||||
return(false)
|
||||
}
|
||||
var desple_path=document.getElementById("pathrmb_"+particion);
|
||||
var p=desple_path.selectedIndex
|
||||
if(p<1) {
|
||||
alert(TbMsg[5]+valparticion[0])
|
||||
return(false);
|
||||
}
|
||||
var desple_P=document.getElementById("protoclonacion_"+particion);
|
||||
if(desple_P.value=="TORRENT" || desple_P.value=="MULTICAST"){
|
||||
if(desple_path.value!=1)
|
||||
alert(TbMsg[6]+particion) // Debe existir caché
|
||||
}
|
||||
}
|
||||
}
|
||||
if(op==0){
|
||||
alert(TbMsg[4])
|
||||
return(false);
|
||||
}
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_RestaurarImagenAula(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,164 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: RestaurarImagenGrupoOrdenadores.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero RestaurarImagenGrupoOrdenadores.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Cancela la edición
|
||||
//___________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Esta función desabilita la marca de un checkbox en opcion "bajas"
|
||||
//___________________________________________________________________________________________________________
|
||||
function desabilita(o) {
|
||||
var b
|
||||
b=o.checked
|
||||
o.checked=!b
|
||||
}
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Confirma la edición
|
||||
//___________________________________________________________________________________________________________
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var cadenaip=document.fdatosocultos.cadenaip.value;
|
||||
var identificador=document.fdatosocultos.identificador.value;
|
||||
var nombrefuncion=document.fdatosocultos.nombrefuncion.value;
|
||||
var ejecutor=document.fdatosocultos.ejecutor.value;
|
||||
var tipotrama=document.fdatosocultos.tipotrama.value;
|
||||
var ambito=document.fdatosocultos.ambito.value;
|
||||
var idambito=document.fdatosocultos.idambito.value;
|
||||
var parametros="";
|
||||
var tagnuevasipes=document.fdatos.nuevasipes;
|
||||
if(tagnuevasipes.length>0)
|
||||
var nuevasipes=tagnuevasipes
|
||||
else{
|
||||
nuevasipes=new Array();
|
||||
nuevasipes[0]=tagnuevasipes
|
||||
}
|
||||
for(var x=0;x<nuevasipes.length;x++){
|
||||
cadenaip=nuevasipes[x].value;
|
||||
var auxsplit=nuevasipes[x].getAttribute("id").split("_");
|
||||
var idperfilhard=auxsplit[1]
|
||||
var idparticion=auxsplit[2]
|
||||
var ochecks=document.fdatos.getElementsByTagName("INPUT")
|
||||
var perfiles=""
|
||||
var pathrmb="";
|
||||
var $protclona="";
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
var particion=ochecks[i].value
|
||||
var valparticion=particion.split("_");
|
||||
var widperfilhard=valparticion[1]
|
||||
var widparticion=valparticion[2]
|
||||
if(idperfilhard==widperfilhard && idparticion==widparticion){
|
||||
var desple_M=document.getElementById("desple_M_"+particion);
|
||||
var p_M=desple_M.selectedIndex
|
||||
if(p_M>0)
|
||||
perfiles+=valparticion[0]+"_M_"+desple_M.value+";"
|
||||
var opathrmb=document.getElementById("pathrmb_"+particion);
|
||||
pathrmb+=opathrmb.value+";";
|
||||
var protclon=document.getElementById("protoclonacion_"+particion);
|
||||
protclona+=protclon.value+";";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(perfiles!=""){
|
||||
parametros+="cadenaip="+cadenaip+'%0D'+"identificador="+identificador+'%0D'+"nombrefuncion="+nombrefuncion+'%0D'+"ejecutor="+ejecutor+'%0D'+"tipotrama="+tipotrama+'%0D'+"ambito="+ambito+'%0D'+"idambito="+idambito+'%0D'+"pathrmb="+pathrmb+'%0D'+"protclona="+protclona+'%0D'+"perfiles="+perfiles
|
||||
parametros+='%09';
|
||||
}
|
||||
}
|
||||
var wurl="./gestores/gestor_RestaurarImagenGrupoOrdenadores.php"
|
||||
wurl+="?parametros="+parametros
|
||||
wurl+="&" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// seleccionar automaticamente las particiones
|
||||
//________________________________________________________________________________________________________
|
||||
function seleccionar(particion){
|
||||
|
||||
var desplepath=document.getElementById("pathrmb_"+particion);
|
||||
var p=desplepath.selectedIndex
|
||||
if(p<1){
|
||||
desplepath.selectedIndex=1
|
||||
}
|
||||
}
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Marcar automaticamente los check box
|
||||
//___________________________________________________________________________________________________________
|
||||
function marcar(desple,particion){
|
||||
var casilla=document.getElementById("particion_"+particion);
|
||||
var p=desple.selectedIndex
|
||||
if(p>0)
|
||||
casilla.checked=true;
|
||||
|
||||
var desplepath=document.getElementById("pathrmb_"+particion);
|
||||
var p=desplepath.selectedIndex
|
||||
if(p<1){
|
||||
desplepath.selectedIndex=1
|
||||
}
|
||||
}
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar_datos
|
||||
//___________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
var ochecks=document.fdatos.getElementsByTagName("INPUT")
|
||||
var op=0
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
op++;
|
||||
var particion=ochecks[i].value
|
||||
var desple_M=document.getElementById("desple_M_"+particion);
|
||||
var valparticion=particion.split("_");
|
||||
var p_M=desple_M.selectedIndex
|
||||
if (p_M==0 ){
|
||||
alert(TbMsg[0]+valparticion[0])
|
||||
desple_M.focus()
|
||||
return(false)
|
||||
}
|
||||
var desple_path=document.getElementById("pathrmb_"+particion);
|
||||
var p=desple_path.selectedIndex
|
||||
if(p<1) {
|
||||
alert(TbMsg[5]+valparticion[0])
|
||||
return(false);
|
||||
}
|
||||
var desple_P=document.getElementById("protoclonacion_"+particion);
|
||||
if(desple_P.value=="TORRENT" || desple_P.value=="MULTICAST"){
|
||||
if(desple_path.value!=1)
|
||||
alert(TbMsg[6]+particion) // Debe existir caché
|
||||
}
|
||||
}
|
||||
}
|
||||
if(op==0){
|
||||
alert(TbMsg[4])
|
||||
return(false);
|
||||
}
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//___________________________________________________________________________________________________________
|
||||
function resultado_RestaurarImagenGrupoOrdenadores(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,132 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: RestaurarImagenOrdenador.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero RestaurarImagenOrdenador.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Cancela la edición
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Confirma la edición
|
||||
//________________________________________________________________________________________________________
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var cadenaip=document.fdatosocultos.cadenaip.value;
|
||||
var identificador=document.fdatosocultos.identificador.value;
|
||||
var nombrefuncion=document.fdatosocultos.nombrefuncion.value;
|
||||
var ejecutor=document.fdatosocultos.ejecutor.value;
|
||||
var tipotrama=document.fdatosocultos.tipotrama.value;
|
||||
var ambito=document.fdatosocultos.ambito.value;
|
||||
var idambito=document.fdatosocultos.idambito.value;
|
||||
var ochecks=document.fdatos.getElementsByTagName("INPUT")
|
||||
var perfiles=""
|
||||
var pathrmb="";
|
||||
var protclona="";
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
var particion=ochecks[i].value
|
||||
var desple_M=document.getElementById("desple_M_"+particion);
|
||||
var p_M=desple_M.selectedIndex
|
||||
if(p_M>0)
|
||||
perfiles+=particion+"_M_"+desple_M.value+";"
|
||||
var opathrmb=document.getElementById("pathrmb_"+particion);
|
||||
pathrmb+=opathrmb.value+";";
|
||||
var protclon=document.getElementById("protoclonacion_"+particion);
|
||||
protclona+=protclon.value+";";
|
||||
|
||||
}
|
||||
}
|
||||
var wurl="./gestores/gestor_RestaurarImagenOrdenador.php"
|
||||
wurl+="?cadenaip="+cadenaip+"&identificador="+identificador+"&nombrefuncion="+nombrefuncion+"&ejecutor="+ejecutor+"&tipotrama="+tipotrama+"&ambito="+ambito+"&idambito="+idambito+"&pathrmb="+pathrmb+"&protclona="+protclona+'%0D'+"&perfiles="+perfiles
|
||||
wurl+="&" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// seleccionar automaticamente las particiones
|
||||
//________________________________________________________________________________________________________
|
||||
function seleccionar(particion){
|
||||
|
||||
var desplepath=document.getElementById("pathrmb_"+particion);
|
||||
var p=desplepath.selectedIndex
|
||||
if(p<1){
|
||||
desplepath.selectedIndex=1
|
||||
}
|
||||
}
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Marcar automaticamente los check box
|
||||
//___________________________________________________________________________________________________________
|
||||
function marcar(desple,particion){
|
||||
var casilla=document.getElementById("particion_"+particion);
|
||||
var p=desple.selectedIndex
|
||||
if(p>0)
|
||||
casilla.checked=true;
|
||||
|
||||
var desplepath=document.getElementById("pathrmb_"+particion);
|
||||
var p=desplepath.selectedIndex
|
||||
if(p<1){
|
||||
desplepath.selectedIndex=1
|
||||
}
|
||||
}
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar_datos
|
||||
//___________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
var ochecks=document.fdatos.getElementsByTagName("INPUT")
|
||||
var op=0
|
||||
for(var i=0;i<ochecks.length;i++){
|
||||
if(ochecks[i].checked){
|
||||
op++;
|
||||
var particion=ochecks[i].value
|
||||
var desple_M=document.getElementById("desple_M_"+particion);
|
||||
var p_M=desple_M.selectedIndex
|
||||
if (p_M==0){
|
||||
alert(TbMsg[0]+particion)
|
||||
desple_M.focus()
|
||||
return(false)
|
||||
}
|
||||
var desple_path=document.getElementById("pathrmb_"+particion);
|
||||
var p=desple_path.selectedIndex
|
||||
if(p<1) {
|
||||
alert(TbMsg[5]+particion)
|
||||
return(false);
|
||||
}
|
||||
var desple_P=document.getElementById("protoclonacion_"+particion);
|
||||
if(desple_P.value=="TORRENT" || desple_P.value=="MULTICAST"){
|
||||
if(desple_path.value!=1)
|
||||
alert(TbMsg[6]+particion) // Debe existir caché
|
||||
}
|
||||
}
|
||||
}
|
||||
if(op==0){
|
||||
alert(TbMsg[4])
|
||||
return(false);
|
||||
}
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//___________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//___________________________________________________________________________________________________________
|
||||
function resultado_RestaurarImagenOrdenador(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
// *************************************************************************************************************************************************
|
||||
// Libreria de scripts de Javascript
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
|
||||
// Fecha Creación:2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: TomaConfiguracion.js
|
||||
// Descripción :
|
||||
// Este fichero implementa las funciones javascript del fichero TomaConfiguracion.php (Comandos)
|
||||
// *************************************************************************************************************************************************
|
||||
function confirmar(){
|
||||
if (comprobar_datos()){
|
||||
var wurl="./gestores/gestor_TomaConfiguracion.php?" +compone_urlejecucion();
|
||||
ifr=document.getElementById("iframes_comodin"); // Toma objeto Iframe
|
||||
ifr.src=wurl; // LLama a la página gestora
|
||||
}
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function cancelar(){
|
||||
alert(CTbMsg[0]);
|
||||
location.href="../nada.php"
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
function comprobar_datos(){
|
||||
return(comprobar_datosejecucion())
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
//
|
||||
// Comprobar retorno
|
||||
//________________________________________________________________________________________________________
|
||||
function resultado_tomaconfiguracion(resul){
|
||||
if (!resul){
|
||||
alert(CTbMsg[1]);
|
||||
return
|
||||
}
|
||||
alert(CTbMsg[2]);
|
||||
}
|
|
@ -1,171 +0,0 @@
|
|||
//----------------------------------------------------------------------------------------------
|
||||
function comprobar_datosejecucion(){
|
||||
|
||||
// Comprobación de las opciones de ejecución ----------------------------------
|
||||
var sw_ejya=document.fdatosejecucion.sw_ejya.checked;
|
||||
var sw_seguimientocon=document.fdatosejecucion.sw_seguimiento[0].checked;
|
||||
var sw_seguimientosin=document.fdatosejecucion.sw_seguimiento[1].checked;
|
||||
|
||||
var sw_mkprocedimiento=document.fdatosejecucion.sw_mkprocedimiento.checked;
|
||||
var sw_nuevaprocedimiento=document.fdatosejecucion.sw_procedimiento[0].checked;
|
||||
var descripcion_nuevaprocedimiento=document.fdatosejecucion.nombreprocedimiento.value;
|
||||
var sw_procedimientoexistente=document.fdatosejecucion.sw_procedimiento[1].checked;
|
||||
|
||||
var sw_mktarea=document.fdatosejecucion.sw_mktarea.checked;
|
||||
var sw_nuevatarea=document.fdatosejecucion.sw_tarea[0].checked;
|
||||
var descripcion_nuevatarea=document.fdatosejecucion.nombretarea.value;
|
||||
var sw_tareaexistente=document.fdatosejecucion.sw_tarea[1].checked;
|
||||
|
||||
var pprocedimiento=document.fdatosejecucion.idprocedimiento.selectedIndex
|
||||
var ptarea=document.fdatosejecucion.idtarea.selectedIndex
|
||||
|
||||
if(!sw_ejya && !sw_mkprocedimiento && !sw_mktarea ){
|
||||
alert("ATENCIÓN.- Debe elegir al menos un modo de ejecución");
|
||||
return(false);
|
||||
}
|
||||
|
||||
// Cuestión procedimiento ------------------------------------------------------------------------------------------------------------------------------
|
||||
if(sw_ejya){
|
||||
if(!sw_seguimientocon && !sw_seguimientosin){
|
||||
alert("ATENCIÓN.- Debe elegir un modo de ejecución inmediata");
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
// Cuestión procedimiento ------------------------------------------------------------------------------------------------------------------------------
|
||||
if(sw_mkprocedimiento){
|
||||
if(!sw_nuevaprocedimiento && !sw_procedimientoexistente){
|
||||
alert("ATENCIÓN.- Debe elegir un modo de inclusión en procedimiento de este comando");
|
||||
return(false);
|
||||
}
|
||||
if(sw_nuevaprocedimiento && descripcion_nuevaprocedimiento==""){
|
||||
alert("ATENCIÓN.- Debe especificar el nombre del nuevo procedimiento que se creará y al que se añadirá este comando");
|
||||
document.fdatosejecucion.nombreprocedimiento.focus();
|
||||
return(false);
|
||||
}
|
||||
if(sw_procedimientoexistente && pprocedimiento==0){
|
||||
alert("ATENCIÓN.- Debe elegir el procedimiento al que se añadirá este comando");
|
||||
document.fdatosejecucion.idprocedimiento.focus();
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
|
||||
// Cuestión tarea ------------------------------------------------------------------------------------------------------------------------------
|
||||
if(sw_mktarea){
|
||||
if(!sw_nuevatarea && !sw_tareaexistente){
|
||||
alert("ATENCIÓN.- Debe elegir un modo de inclusión en tarea ejecutable, de este comando");
|
||||
return(false);
|
||||
}
|
||||
if(sw_nuevatarea && descripcion_nuevatarea==""){
|
||||
alert("ATENCIÓN.- Debe especificar el nombre de la nueva tarea ejecutable que se creará y a la que se añadirá este comando");
|
||||
document.fdatosejecucion.nombretarea.focus();
|
||||
return(false);
|
||||
}
|
||||
if(sw_tareaexistente && ptarea==0){
|
||||
alert("ATENCIÓN.- Debe elegir la tarea a la que se añadirá este comando");
|
||||
document.fdatosejecucion.idtarea.focus();
|
||||
return(false);
|
||||
}
|
||||
}
|
||||
//-----------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
return(true)
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
function clic_mktarea(o){
|
||||
if(!o.checked){
|
||||
document.fdatosejecucion.sw_tarea[0].checked=false;
|
||||
document.fdatosejecucion.nombretarea.value="";
|
||||
document.fdatosejecucion.sw_tarea[1].checked=false;
|
||||
document.fdatosejecucion.idtarea.selectedIndex=0;
|
||||
}
|
||||
}
|
||||
function clic_nwtarea(o){
|
||||
if(o.checked){
|
||||
document.fdatosejecucion.sw_mktarea.checked=true;
|
||||
document.fdatosejecucion.sw_tarea[1].checked=false;
|
||||
document.fdatosejecucion.idtarea.selectedIndex=0;
|
||||
}
|
||||
}
|
||||
function clic_extarea(o){
|
||||
if(o.checked){
|
||||
document.fdatosejecucion.sw_mktarea.checked=true;
|
||||
document.fdatosejecucion.sw_tarea[0].checked=false;
|
||||
document.fdatosejecucion.nombretarea.value="";
|
||||
}
|
||||
}
|
||||
function clic_nomtarea(o){
|
||||
document.fdatosejecucion.sw_mktarea.checked=true;
|
||||
document.fdatosejecucion.sw_tarea[0].checked=true;
|
||||
document.fdatosejecucion.idtarea.selectedIndex=0;
|
||||
}
|
||||
function clic_mkprocedimiento(o){
|
||||
if(!o.checked){
|
||||
document.fdatosejecucion.sw_procedimiento[0].checked=false;
|
||||
document.fdatosejecucion.nombreprocedimiento.value="";
|
||||
document.fdatosejecucion.sw_procedimiento[1].checked=false;
|
||||
document.fdatosejecucion.idprocedimiento.selectedIndex=0;
|
||||
}
|
||||
}
|
||||
function clic_nwprocedimiento(o){
|
||||
if(o.checked){
|
||||
document.fdatosejecucion.sw_mkprocedimiento.checked=true;
|
||||
document.fdatosejecucion.sw_procedimiento[1].checked=false;
|
||||
document.fdatosejecucion.idprocedimiento.selectedIndex=0;
|
||||
}
|
||||
}
|
||||
function clic_exprocedimiento(o){
|
||||
if(o.checked){
|
||||
document.fdatosejecucion.sw_mkprocedimiento.checked=true;
|
||||
document.fdatosejecucion.sw_procedimiento[0].checked=false;
|
||||
document.fdatosejecucion.nombreprocedimiento.value="";
|
||||
}
|
||||
}
|
||||
function clic_nomprocedimiento(o){
|
||||
document.fdatosejecucion.sw_mkprocedimiento.checked=true;
|
||||
document.fdatosejecucion.sw_procedimiento[0].checked=true;
|
||||
document.fdatosejecucion.idprocedimiento.selectedIndex=0;
|
||||
}
|
||||
|
||||
function procedimientoexistente(o){
|
||||
document.fdatosejecucion.sw_mkprocedimiento.checked=true;
|
||||
document.fdatosejecucion.sw_procedimiento[1].checked=true;
|
||||
document.fdatosejecucion.nombreprocedimiento.value="";
|
||||
}
|
||||
|
||||
function tareaexistente(o){
|
||||
document.fdatosejecucion.sw_mktarea.checked=true;
|
||||
document.fdatosejecucion.sw_tarea[1].checked=true;
|
||||
document.fdatosejecucion.nombretarea.value="";
|
||||
}
|
||||
//____________________________________________________________________________
|
||||
function compone_urlejecucion(){
|
||||
|
||||
var wurl=""
|
||||
|
||||
var sw_ejya=document.fdatosejecucion.sw_ejya.checked;
|
||||
var sw_seguimiento=document.fdatosejecucion.sw_seguimiento[0].checked;
|
||||
|
||||
var sw_mkprocedimiento=document.fdatosejecucion.sw_mkprocedimiento.checked;
|
||||
if (document.fdatosejecucion.sw_procedimiento[0].checked){
|
||||
var nwidprocedimiento=0
|
||||
var nwdescriprocedimiento=document.fdatosejecucion.nombreprocedimiento.value;
|
||||
}
|
||||
else{
|
||||
var p=document.fdatosejecucion.idprocedimiento.selectedIndex
|
||||
var nwidprocedimiento=document.fdatosejecucion.idprocedimiento.options[p].value
|
||||
var nwdescriprocedimiento=document.fdatosejecucion.idprocedimiento.options[p].text
|
||||
}
|
||||
|
||||
var sw_mktarea=document.fdatosejecucion.sw_mktarea.checked;
|
||||
if (document.fdatosejecucion.sw_tarea[0].checked){
|
||||
var nwidtarea=0
|
||||
var nwdescritarea=document.fdatosejecucion.nombretarea.value;
|
||||
}
|
||||
else{
|
||||
var p=document.fdatosejecucion.idtarea.selectedIndex
|
||||
var nwidtarea=document.fdatosejecucion.idtarea.options[p].value
|
||||
var nwdescritarea=document.fdatosejecucion.idtarea.options[p].text
|
||||
}
|
||||
wurl+="sw_ejya="+sw_ejya +"&sw_seguimiento="+sw_seguimiento+"&sw_mktarea="+sw_mktarea+"&nwidtarea="+nwidtarea+"&nwdescritarea="+nwdescritarea
|
||||
wurl+="&sw_mkprocedimiento="+sw_mkprocedimiento+"&nwidprocedimiento="+nwidprocedimiento+"&nwdescriprocedimiento="+nwdescriprocedimiento
|
||||
return(wurl)
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
<?
|
||||
// ********************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Diciembre-2003
|
||||
// Fecha Última modificación: Febrero-2005
|
||||
// Nombre del fichero: controlacceso.php
|
||||
// Descripción :Este fichero aporta los datos de acceso a la aplicación
|
||||
// *********************************************************************
|
||||
|
||||
//========================================================================================================
|
||||
// Variables de sessión de configuración de servidor y base de datos( Modificar aquípara cambio global)
|
||||
$cnx="localhost;usuog;passusuog;ogBDAdmin;mysql"; // Cadena de conexión a la base de datos
|
||||
$wer="OPENGNSYSURL/pagerror.php"; // Página de redireccionamiento de errores
|
||||
$wac="OPENGNSYSURL/acceso.php"; // Página de login de la aplicación
|
||||
$idi="esp"; // Idioma por defecto
|
||||
//========================================================================================================
|
||||
?>
|
|
@ -1,185 +0,0 @@
|
|||
<?
|
||||
// ********************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Diciembre-2003
|
||||
// Fecha Última modificación: Febrero-2005
|
||||
// Nombre del fichero: controlacceso.php
|
||||
// Descripción :Este fichero implementa el control de acceso a la aplicación
|
||||
// *********************************************************************
|
||||
include_once("controlacceso.php");
|
||||
include_once("./includes/CreaComando.php");
|
||||
include_once("./clases/AdoPhp.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$usu="";
|
||||
$pss="";
|
||||
$idc=0;
|
||||
$iph=""; // Switch menu cliente
|
||||
|
||||
if (isset($_POST["usu"])) $usu=$_POST["usu"];
|
||||
if (isset($_POST["pss"])) $pss=$_POST["pss"];
|
||||
if (isset($_POST["idcentro"])) $idc=$_POST["idcentro"];
|
||||
|
||||
if (isset($_GET["iph"])) $iph=$_GET["iph"];
|
||||
//________________________________________________________________________________________________________
|
||||
$cmd=CreaComando($cnx); // Crea objeto comando
|
||||
if (!$cmd)
|
||||
die("Error de acceso");
|
||||
//________________________________________________________________________________________________________
|
||||
|
||||
$nmc="";
|
||||
$idi="";
|
||||
|
||||
if(!empty($iph)){ // LLamada del browser del cliente
|
||||
list($wip,$wusu,$wpwd,$wbd,$tbd)=split(";",$cnx);
|
||||
$usu=$wusu;
|
||||
$pss=$wpwd;
|
||||
}
|
||||
|
||||
$resul=toma_datos($cmd,$idc,&$nmc,&$idi,$usu,&$tsu,$pss);
|
||||
if(!$resul)
|
||||
Header("Location: ".$wac."?herror=4"); // Error de conexión con servidor B.D.
|
||||
|
||||
if(!empty($iph)){
|
||||
$wurl="./varios/menucliente.php";
|
||||
Header("Location:".$wurl); // Accede a la página de menus
|
||||
}
|
||||
|
||||
|
||||
session_start(); // Activa variables de sesión
|
||||
|
||||
$_SESSION["widcentro"]=$idc;
|
||||
$_SESSION["wnombrecentro"]=$nmc;
|
||||
$_SESSION["wusuario"]=$usu;
|
||||
$_SESSION["widtipousuario"]=$tsu;
|
||||
$_SESSION["widioma"]=$idi;
|
||||
$_SESSION["wcadenaconexion"]=$cnx;
|
||||
$_SESSION["wpagerror"]=$wer;
|
||||
$_SESSION["wurlacceso"]=$wac;
|
||||
|
||||
// Variables de entorno
|
||||
$resul=toma_entorno($cmd,&$ips,&$prt,&$pclo,&$rep);
|
||||
if(!$resul)
|
||||
Header("Location: ".$wac."?herror=4"); // Error de conexión con servidor B.D.
|
||||
|
||||
$_SESSION["wservidorhidra"]=$ips;
|
||||
$_SESSION["whidraport"]=$prt;
|
||||
$_SESSION["protclonacion"]=$pclo;
|
||||
$_SESSION["repcentralizado"]=$rep;
|
||||
|
||||
/*
|
||||
echo "<BR>Cadena=".$_SESSION["wcadenaconexion"];
|
||||
echo "<BR>servidorhidra=".$_SESSION["wservidorhidra"];
|
||||
echo "<BR>hidraport=".$_SESSION["whidraport"];
|
||||
echo "<BR>usuario=".$_SESSION["wusuario"];
|
||||
echo "<BR>idtipousuario=".$_SESSION["widtipousuario"];
|
||||
*/
|
||||
|
||||
//________________________________________________________________________________________________________
|
||||
// Busca datos del usuario que intenta acceder a la aplicación
|
||||
// Parametros:
|
||||
// - cmd:Una comando ya operativo (con conexión abierta)
|
||||
// - usuario: Nombre del usuario
|
||||
// - pasguor: Password del uuario
|
||||
//
|
||||
// Devuelve el identificador del centro, el nombre y el idioma utilizado por el usuario
|
||||
//_______________________________________________________________________________________________________
|
||||
function toma_datos($cmd,$idcentro,$nombrecentro,$idioma,$usuario,$idtipousuario,$pasguor){
|
||||
$rs=new Recordset;
|
||||
if(!empty($idcentro)){
|
||||
$cmd->texto="SELECT usuarios.idtipousuario,centros.nombrecentro,idiomas.nemonico AS idioma FROM usuarios";
|
||||
$cmd->texto.=" INNER JOIN administradores_centros ON administradores_centros.idusuario=usuarios.idusuario";
|
||||
$cmd->texto.=" INNER JOIN centros ON centros.idcentro=administradores_centros.idcentro";
|
||||
$cmd->texto.=" INNER JOIN idiomas ON usuarios.ididioma=idiomas.ididioma";
|
||||
$cmd->texto.=" WHERE idtipousuario<>3
|
||||
AND usuarios.usuario='".$usuario."'
|
||||
AND usuarios.pasguor='".$pasguor."'
|
||||
AND administradores_centros.idcentro=".$idcentro;
|
||||
}
|
||||
else{
|
||||
$cmd->texto="SELECT usuarios.idtipousuario,idiomas.nemonico AS idioma FROM usuarios";
|
||||
$cmd->texto.=" INNER JOIN idiomas ON usuarios.ididioma=idiomas.ididioma";
|
||||
$cmd->texto.=" WHERE idtipousuario<>3
|
||||
AND usuarios.usuario='".$usuario."'
|
||||
AND usuarios.pasguor='".$pasguor."'";
|
||||
|
||||
}
|
||||
$rs->Comando=&$cmd;
|
||||
//echo $cmd->texto;
|
||||
if (!$rs->Abrir()) return($false); // Error al abrir recordset
|
||||
if(!$rs->EOF){
|
||||
$idtipousuario=$rs->campos["idtipousuario"];
|
||||
$idioma=$rs->campos["idioma"];
|
||||
$usuario=$rs->campos["usuario"];
|
||||
if(!empty($idcentro)){
|
||||
$nombrecentro=$rs->campos["nombrecentro"];
|
||||
$idtipousuario=2; // Fuerza al acceso como administrador de UNidad organizativa
|
||||
return(true);
|
||||
}
|
||||
else{
|
||||
$nombrecentro="";
|
||||
if($idtipousuario<>1) // Si NO es superadminsitrador
|
||||
return(false);
|
||||
else
|
||||
return(true);
|
||||
}
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
// Busca datos de configuración del sistema
|
||||
// Parametros:
|
||||
// - cmd:Una comando ya operativo (con conexión abierta)
|
||||
// - ips: Dirección IP del servidor de administración
|
||||
// - prt: Puerto de comunicaciones
|
||||
// - pclo: Protocolo de clonación
|
||||
// - rep: Uso de repositorio centralizado
|
||||
//
|
||||
// Devuelve datos generales de configuración del sistema
|
||||
//_______________________________________________________________________________________________________
|
||||
function toma_entorno($cmd,$ips,$prt,$pclo,$rep){
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT * FROM entornos";
|
||||
$rs->Comando=&$cmd;
|
||||
//echo $cmd->texto;
|
||||
if (!$rs->Abrir()) return($false); // Error al abrir recordset
|
||||
if(!$rs->EOF){
|
||||
$ips=$rs->campos["ipserveradm"];
|
||||
$prt=$rs->campos["portserveradm"];
|
||||
$pclo=$rs->campos["protoclonacion"];
|
||||
$rep=$rs->campos["repositorio"];
|
||||
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
//_______________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<TITLE> Administración web de aulas</TITLE>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<LINK rel="stylesheet" type="text/css" href="estilos.css">
|
||||
</HEAD>
|
||||
<BODY>
|
||||
<DIV id="mensaje" style="Position:absolute;TOP:250;LEFT:330; visibility:visible">
|
||||
<SPAN align=center class=subcabeceras>Acceso permitido. Espere por favor ...</SPAN></P>
|
||||
<SCRIPT LANGUAGE="JAVASCRIPT">
|
||||
var vez=0;
|
||||
setTimeout("acceso();",300);
|
||||
function acceso(){
|
||||
o=document.getElementById("mensaje");
|
||||
var s=o.style.visibility;
|
||||
if(s=="hidden")
|
||||
o.style.visibility="visible";
|
||||
else
|
||||
o.style.visibility="hidden";
|
||||
if(vez>5){
|
||||
var w=window.top;
|
||||
w.location="frames.php";
|
||||
}
|
||||
vez++;
|
||||
setTimeout("acceso();",300);
|
||||
}
|
||||
</SCRIPT>
|
||||
</BODY>
|
||||
</HTML>
|
|
@ -1,63 +0,0 @@
|
|||
<?php
|
||||
listar_directorios_ruta("./");
|
||||
function listar_directorios_ruta($ruta){
|
||||
// abrir un directorio y listarlo recursivo
|
||||
if (is_dir($ruta)) {
|
||||
if ($dh = opendir($ruta)) {
|
||||
while (($file = readdir($dh)) !== false) {
|
||||
if($file !=".svn" && $file!="." && $file!=".."){
|
||||
//esta línea la utilizaríamos si queremos listar todo lo que hay en el directorio
|
||||
//mostraría tanto archivos como directorios
|
||||
//echo "<br>Nombre de archivo: $file : Es un: " . filetype($ruta . $file);
|
||||
if (is_dir($ruta . $file) && $file!="." && $file!=".."){
|
||||
//solo si el archivo es un directorio, distinto que "." y ".."
|
||||
echo "<br>Directorio: $ruta$file";
|
||||
listar_directorios_ruta($ruta . $file . "/");
|
||||
}
|
||||
else{
|
||||
//echo "<br>Archivp:$file";
|
||||
//if($file=="aulas.php")
|
||||
procesaarchivo($ruta,$file);
|
||||
}
|
||||
}
|
||||
}
|
||||
closedir($dh);
|
||||
}
|
||||
}else
|
||||
echo "<br>No es ruta valida";
|
||||
}
|
||||
function procesaarchivo($ruta,$file){
|
||||
$meta='<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">';
|
||||
$archivo=realpath($ruta.$file);
|
||||
echo "<br>Procesando Archivo:".$file;
|
||||
|
||||
$tam=filesize($archivo);
|
||||
$fp = fopen($archivo, "rb");
|
||||
$buffer = fread($fp, $tam);
|
||||
fclose($fp);
|
||||
|
||||
$pos = strpos($buffer,'<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">');
|
||||
if($pos==0)
|
||||
$pos = strpos($buffer,'<head>');
|
||||
if($pos==0)
|
||||
return;
|
||||
|
||||
$dpl=strlen('<HEAD>');
|
||||
$prebuffer=substr($buffer,0,$pos+$dpl);
|
||||
$posbuffer=substr($buffer,$pos+$dpl);
|
||||
|
||||
$buffer=$prebuffer."\n\t".$meta.$posbuffer;
|
||||
|
||||
/*
|
||||
$buffer=ereg_replace( "<"," ",$buffer);
|
||||
$buffer=ereg_replace( ">"," ",$buffer);
|
||||
$buffer=ereg_replace( "[\n\r]","<BR>",$buffer);
|
||||
echo $buffer;
|
||||
*/
|
||||
|
||||
$fp = fopen($archivo,"w");
|
||||
fwrite($fp, $buffer,strlen($buffer));
|
||||
fclose($fp);
|
||||
}
|
||||
?>
|
|
@ -1,388 +0,0 @@
|
|||
.textos{
|
||||
COLOR: #A53B2D;
|
||||
FONT-FAMILY:MS Sans Serif;
|
||||
FONT-SIZE: 8pt;
|
||||
}
|
||||
|
||||
.texto_arbol{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
|
||||
.menu_contextual TABLE{
|
||||
BACKGROUND-COLOR: #d4d0c8;
|
||||
}
|
||||
|
||||
.menu_contextual TD{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
LETTER-SPACING: -1px;
|
||||
}
|
||||
.menu_contextual SPAN{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
LETTER-SPACING: -1px;
|
||||
}
|
||||
.tabla_standar TD{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Verdana;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
|
||||
.tabla_lista TD{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Verdana;
|
||||
FONT-SIZE: 11px;
|
||||
LETTER-SPACING: -1px;
|
||||
}
|
||||
|
||||
.input_nodo{
|
||||
BORDER-BOTTOM: 1px solid;
|
||||
BORDER-LEFT: 1px solid;
|
||||
BORDER-RIGHT: 1px solid;
|
||||
BORDER-TOP: 1px solid;
|
||||
COLOR: #000000;
|
||||
FONT-SIZE: 11px;
|
||||
HEIGHT: 14px;
|
||||
}
|
||||
.marcorelieve{
|
||||
BORDER-BOTTOM: #808080 1px solid;
|
||||
BORDER-LEFT: #ffffff 1px solid;
|
||||
BORDER-RIGHT: #808080 1px solid;
|
||||
BORDER-TOP: #ffffff 1px solid;
|
||||
}
|
||||
.marco{
|
||||
BORDER-BOTTOM: #999999 1px solid;
|
||||
BORDER-LEFT: #999999 1px solid;
|
||||
BORDER-RIGHT: #999999 1px solid;
|
||||
BORDER-TOP: #999999 1px solid;
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Verdana,Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 13px;
|
||||
}
|
||||
.menupral{
|
||||
BACKGROUND-COLOR: #d4d0c8;
|
||||
FONT-FAMILY: sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
.menupral TD{
|
||||
BORDER-BOTTOM: #d4d0c8 1px solid;
|
||||
BORDER-LEFT: #d4d0c8 1px solid;
|
||||
BORDER-RIGHT: #d4d0c8 1px solid;
|
||||
BORDER-TOP: #d4d0c8 1px solid;
|
||||
}
|
||||
|
||||
.menupral SPAN{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
|
||||
.filtros{
|
||||
}
|
||||
|
||||
.filtros TD{
|
||||
BORDER-BOTTOM: #999999 1px solid;
|
||||
BORDER-LEFT: #999999 1px solid;
|
||||
BORDER-RIGHT: #999999 1px solid;
|
||||
BORDER-TOP: #999999 1px solid;
|
||||
FONT-FAMILY: sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
COLOR:#999999;
|
||||
}
|
||||
.supercabeceras {
|
||||
COLOR:#FE6C65;
|
||||
FONT-FAMILY: Arial;
|
||||
FONT-SIZE: 30px;
|
||||
FONT-WEIGHT: 600;
|
||||
}
|
||||
.sobrecabeceras {
|
||||
COLOR:#7575DD;
|
||||
FONT-FAMILY: Arial;
|
||||
FONT-SIZE: 24px;
|
||||
FONT-WEIGHT: 400;
|
||||
}
|
||||
.cabeceras{
|
||||
COLOR: #999999;
|
||||
FONT-FAMILY: Verdana;
|
||||
FONT-SIZE: 24px;
|
||||
FONT-WEIGHT: 600;
|
||||
}
|
||||
.subcabeceras{
|
||||
COLOR: #D6A621;
|
||||
FONT-FAMILY: Verdana;
|
||||
FONT-SIZE: 20px;
|
||||
}
|
||||
|
||||
.presentaciones{
|
||||
COLOR: #999999;
|
||||
FONT-FAMILY: Verdana,Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px;
|
||||
}
|
||||
|
||||
|
||||
.notas{
|
||||
COLOR: #999999;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 10px;
|
||||
}
|
||||
|
||||
.tabla_datos{
|
||||
}
|
||||
|
||||
.tabla_datos TH{
|
||||
BACKGROUND-COLOR: #63676b;
|
||||
COLOR: #ffffff;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px;
|
||||
FONT-WEIGHT: 500;
|
||||
BORDER-BOTTOM:#000000 1px solid ;
|
||||
}
|
||||
|
||||
.tabla_datos TD{
|
||||
BACKGROUND-COLOR: #d4d0c8;
|
||||
COLOR: #003300;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px;
|
||||
BORDER-BOTTOM:#000000 1px solid;
|
||||
}
|
||||
|
||||
.formulariodatos{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px
|
||||
}
|
||||
|
||||
.tabla_listados{
|
||||
}
|
||||
|
||||
.tabla_listados TH{
|
||||
BACKGROUND-COLOR: #63676b;
|
||||
COLOR: #ffffff;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px;
|
||||
FONT-WEIGHT: 500;
|
||||
BORDER-BOTTOM:#000000 1px solid ;
|
||||
}
|
||||
.tabla_listados TD{
|
||||
BACKGROUND-COLOR: #EEEECC;
|
||||
COLOR: #003300;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
BORDER-BOTTOM:#000000 1px solid;
|
||||
}
|
||||
|
||||
.tabla_listados_sin {
|
||||
}
|
||||
|
||||
.tabla_listados_sin TH{
|
||||
BACKGROUND-COLOR: #63676b;
|
||||
COLOR: #ffffff;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px;
|
||||
FONT-WEIGHT: 500;
|
||||
}
|
||||
|
||||
.tabla_listados_sin TD{
|
||||
BACKGROUND-COLOR: #EEEECC;
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11;
|
||||
}
|
||||
|
||||
A.tabla_listados_sin:visited{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
A.tabla_listados_sin:link{
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
|
||||
.recuadros{
|
||||
BACKGROUND-COLOR: lightseagreen;
|
||||
BORDER-BOTTOM: teal solid;
|
||||
BORDER-LEFT: #b4e0d2 solid;
|
||||
BORDER-RIGHT: teal solid;
|
||||
BORDER-TOP: #b4e0d2 solid;
|
||||
COLOR: white;
|
||||
FONT-STYLE: italic
|
||||
}
|
||||
|
||||
.tabla_meses{
|
||||
}
|
||||
|
||||
.tabla_meses TH{
|
||||
BACKGROUND-COLOR: lightseagreen;
|
||||
COLOR: white;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
FONT-WEIGHT: 700;
|
||||
}
|
||||
|
||||
.tabla_meses TD{
|
||||
BACKGROUND-COLOR: #EEEECC;
|
||||
COLOR: #003300;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px;
|
||||
BORDER-BOTTOM:#000000 1px solid ;
|
||||
|
||||
}
|
||||
|
||||
.tabla_reservas{
|
||||
}
|
||||
|
||||
.tabla_reservas TH{
|
||||
BACKGROUND-COLOR: #B5DAAD;
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 10px;
|
||||
FONT-WEIGHT: 700;
|
||||
}
|
||||
|
||||
.tabla_reservas TD{
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 10px;
|
||||
|
||||
}
|
||||
.tabla_busquedas{
|
||||
}
|
||||
|
||||
.tabla_busquedas TH{
|
||||
BACKGROUND-COLOR: #5a86b5;
|
||||
COLOR: #ffffff;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
FONT-WEIGHT: 500;
|
||||
BORDER-BOTTOM:#000000 1px solid ;
|
||||
}
|
||||
|
||||
.tabla_busquedas TD{
|
||||
COLOR: #003300;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
|
||||
.tablaipes{
|
||||
BACKGROUND-COLOR: #b5daad;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 9px
|
||||
}
|
||||
|
||||
.estilodesple{
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px
|
||||
}
|
||||
|
||||
.cajatexto{
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px
|
||||
}
|
||||
|
||||
.cajacomandos{
|
||||
BACKGROUND-COLOR: #ffffff;
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px
|
||||
}
|
||||
.salidacomandos{
|
||||
BACKGROUND-COLOR: #000000;
|
||||
COLOR: #ffffff;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px
|
||||
}
|
||||
|
||||
.tabla_parametros{
|
||||
}
|
||||
|
||||
.tabla_parametros TH{
|
||||
BACKGROUND-COLOR: #D4D4D4;
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 12px;
|
||||
FONT-WEIGHT: 700;
|
||||
BORDER-BOTTOM:#000000 1px solid ;
|
||||
|
||||
}
|
||||
.tabla_parametros TD{
|
||||
BACKGROUND-COLOR: #B5DAAD;
|
||||
COLOR: #003300;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
BORDER-BOTTOM:#000000 1px solid;
|
||||
|
||||
}
|
||||
.opciones_ejecucion{
|
||||
BORDER-TOP: silver thin solid;
|
||||
BORDER-BOTTOM: silver thin solid;
|
||||
BORDER-LEFT: silver thin solid;
|
||||
BORDER-RIGHT: silver thin solid;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
|
||||
.tablaprogramacion TABLE{
|
||||
}
|
||||
|
||||
.tablaprogramacion TH{
|
||||
FONT-WEIGHT: bold;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
BORDER-LEFT: medium none;
|
||||
COLOR: white;
|
||||
BACKGROUND-COLOR: lightseagreen;
|
||||
TEXT-ALIGN: left;
|
||||
}
|
||||
|
||||
.tablaprogramacion TD{
|
||||
FONT-SIZE: 9pt;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
COLOR: #000000;
|
||||
|
||||
}
|
||||
|
||||
.botonprogramacion{
|
||||
BORDER-BOTTOM: #666666 1px solid;
|
||||
BORDER-TOP: #ffffff 1px solid;
|
||||
BORDER-LEFT: #ffffff 1px solid;
|
||||
BORDER-RIGHT: #666666 1px solid;
|
||||
BACKGROUND-COLOR: #EEEECC;
|
||||
FONT-SIZE: 9pt;
|
||||
COLOR: #000000;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.tabla_accesos{
|
||||
}
|
||||
|
||||
.tabla_accesos TH{
|
||||
BACKGROUND-COLOR: lightseagreen;
|
||||
COLOR: #ffffff;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
FONT-WEIGHT: 500;
|
||||
BORDER-BOTTOM:#000000 1px solid ;
|
||||
}
|
||||
|
||||
.tabla_accesos TD{
|
||||
COLOR: #003300;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 11px;
|
||||
}
|
||||
.mensajebrowser{
|
||||
BORDER-BOTTOM: #999999 1px solid;
|
||||
BORDER-LEFT: #999999 1px solid;
|
||||
BORDER-RIGHT: #999999 1px solid;
|
||||
BORDER-TOP: #999999 1px solid;
|
||||
BACKGROUND-COLOR: #FFFFFF;
|
||||
COLOR: #999999;
|
||||
FONT-FAMILY: Arial, Helvetica, sans-serif;
|
||||
FONT-SIZE: 14px;
|
||||
FONT-WEIGHT: 300;
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
<?
|
||||
// *******************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Diciembre-2003
|
||||
// Fecha Última modificación: Febrero-2005
|
||||
// Nombre del fichero: frames.php
|
||||
// Descripción :Este fichero implementa la distribución en frames de la aplicación
|
||||
// *******************************************************************************************************
|
||||
include_once("./includes/ctrlacc.php");
|
||||
include_once("./includes/constantes.php");
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<TITLE> Administración web de aulas</TITLE>
|
||||
</HEAD>
|
||||
<FRAMESET rows="25,*">
|
||||
<FRAME SRC="barramenu.php" frameborder=0 scrolling=no NAME="frame_menus" >
|
||||
<FRAMESET cols="30%,*">
|
||||
<?
|
||||
if($idtipousuario!=$SUPERADMINISTRADOR)
|
||||
echo '<FRAME SRC="./principal/aulas.php" frameborder=1 scrolling=auto NAME="frame_arbol" >';
|
||||
else{
|
||||
if($idtipousuario==$SUPERADMINISTRADOR)
|
||||
echo '<FRAME SRC="./principal/administracion.php" frameborder=1 scrolling=auto NAME="frame_arbol" >';
|
||||
}
|
||||
?>
|
||||
<FRAME SRC="nada.php" frameborder=1 NAME="frame_contenidos">
|
||||
</FRAMESET>
|
||||
</FRAMESET>
|
||||
</HTML>
|
|
@ -1,125 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicaci<63>n WEB: ogAdmWebCon
|
||||
// Autor: Jos<6F> Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creaci<63>n: A<>o 2003-2004
|
||||
// Fecha <20>ltima modificaci<63>n: Marzo-2005
|
||||
// Nombre del fichero: gestor_accionmenu.php
|
||||
// Descripci<63>n :
|
||||
// Gestiona el mantenimiento de la tabla de acciones_menus
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/opciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$opcion=0; // Inicializa parametros
|
||||
$idtipoaccion=0;
|
||||
$idmenu=0;
|
||||
$tipoaccion=0;
|
||||
$tipoitem=0;
|
||||
$idurlimg=0;
|
||||
$descripitem="";
|
||||
$orden=0;
|
||||
$idaccionmenu=0;
|
||||
|
||||
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
|
||||
if (isset($_GET["idtipoaccion"])) $idtipoaccion=$_GET["idtipoaccion"];
|
||||
if (isset($_GET["idmenu"])) $idmenu=$_GET["idmenu"];
|
||||
if (isset($_GET["tipoaccion"])) $tipoaccion=$_GET["tipoaccion"];
|
||||
if (isset($_GET["tipoitem"])) $tipoitem=$_GET["tipoitem"];
|
||||
if (isset($_GET["idurlimg"])) $idurlimg=$_GET["idurlimg"];
|
||||
if (isset($_GET["descripitem"])) $descripitem=$_GET["descripitem"];
|
||||
if (isset($_GET["orden"])) $orden=$_GET["orden"];
|
||||
if (isset($_GET["idaccionmenu"])) $idaccionmenu=$_GET["idaccionmenu"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona();
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
//________________________________________________________________________________________________________
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8"></HEAD>
|
||||
<BODY>
|
||||
<?
|
||||
$literal="";
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$literal="resultado_insertar_accionmenu";
|
||||
break;
|
||||
case $op_modificacion :
|
||||
$literal="resultado_modificar_accionmenu";
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$literal="resultado_eliminar_accionmenu";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">'.chr(13);
|
||||
if ($opcion==$op_alta )
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()."');".chr(13);
|
||||
else
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idtipoaccion.",".$idmenu.");".chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idmenu.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona(){
|
||||
global $cmd;
|
||||
global $opcion;
|
||||
global $idtipoaccion;
|
||||
global $idmenu;
|
||||
global $tipoaccion;
|
||||
global $tipoitem;
|
||||
global $idurlimg;
|
||||
global $descripitem;
|
||||
global $orden;
|
||||
global $idaccionmenu;
|
||||
global $op_alta;
|
||||
global $op_modificacion;
|
||||
global $op_eliminacion;
|
||||
|
||||
$cmd->CreaParametro("@idtipoaccion",$idtipoaccion,1);
|
||||
$cmd->CreaParametro("@idmenu",$idmenu,1);
|
||||
$cmd->CreaParametro("@tipoaccion",$tipoaccion,1);
|
||||
$cmd->CreaParametro("@tipoitem",$tipoitem,1);
|
||||
$cmd->CreaParametro("@idurlimg",$idurlimg,1);
|
||||
$cmd->CreaParametro("@descripitem",$descripitem,0);
|
||||
$cmd->CreaParametro("@orden",$orden,1);
|
||||
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$cmd->texto="INSERT INTO acciones_menus (idtipoaccion,idmenu,tipoaccion,tipoitem,idurlimg,descripitem,orden) VALUES (@idtipoaccion,@idmenu,@tipoaccion,@tipoitem,@idurlimg,@descripitem,@orden)";
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
case $op_modificacion :
|
||||
$cmd->texto='UPDATE acciones_menus set tipoitem=@tipoitem,idurlimg=@idurlimg,descripitem=@descripitem,orden=@orden WHERE idtipoaccion='.$idtipoaccion.' AND idmenu='.$idmenu.' AND tipoaccion='.$tipoaccion;;
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
if(!empty($idaccionmenu))
|
||||
$cmd->texto='DELETE FROM acciones_menus WHERE idaccionmenu='.$idaccionmenu;
|
||||
else
|
||||
$cmd->texto='DELETE FROM acciones_menus WHERE idtipoaccion='.$idtipoaccion.' AND idmenu='.$idmenu.' AND tipoaccion='.$tipoaccion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
?>
|
|
@ -1,91 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_dministradores_centros.php
|
||||
// Descripción :
|
||||
// Gestiona la asignación de administradores a las Unidades organizativas
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/opciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$opcion=0; // Inicializa parametros
|
||||
$idcentro=0;
|
||||
$idusuario=0;
|
||||
|
||||
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
|
||||
if (isset($_GET["idcentro"])) $idcentro=$_GET["idcentro"];
|
||||
if (isset($_GET["idusuario"])) $idusuario=$_GET["idusuario"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona();
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
$literal="";
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$literal="resultado_insertar_administradores_centros";
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$literal="resultado_eliminar_administradores_centros";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">'.chr(13);
|
||||
if ($opcion==$op_alta )
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idusuario.");".chr(13);
|
||||
else
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idusuario.");".chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idusuario.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona(){
|
||||
global $cmd;
|
||||
global $opcion;
|
||||
global $idusuario;
|
||||
global $idcentro;
|
||||
global $urlimgth;
|
||||
global $op_alta;
|
||||
global $op_eliminacion;
|
||||
|
||||
$cmd->CreaParametro("@idusuario",$idusuario,1);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$cmd->texto="INSERT INTO administradores_centros(idusuario,idcentro) VALUES (@idusuario,@idcentro)";
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$cmd->texto='DELETE FROM administradores_centros WHERE idusuario='.$idusuario.' AND idcentro='.$idcentro;
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
?>
|
|
@ -1,94 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_dministradores_centros.php
|
||||
// Descripción :
|
||||
// Gestiona la asignación de administradores a las Unidades organizativas
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/opciones.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$opcion=0; // Inicializa parametros
|
||||
$idcentro=0;
|
||||
$idusuario=0;
|
||||
|
||||
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
|
||||
|
||||
if (isset($_GET["idusuario"])) $idusuario=$_GET["idusuario"];
|
||||
if (isset($_GET["idcentro"])) $idcentro=$_GET["idcentro"];
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona();
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
$literal="";
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$literal="resultado_insertar_centros_administradores";
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$literal="resultado_eliminar_centros_administradores";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">'.chr(13);
|
||||
if ($opcion==$op_alta )
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idcentro.");".chr(13);
|
||||
else
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idcentro.");".chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idcentro.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
function Gestiona(){
|
||||
global $cmd;
|
||||
global $opcion;
|
||||
global $idusuario;
|
||||
global $idcentro;
|
||||
global $urlimgth;
|
||||
global $op_alta;
|
||||
global $op_eliminacion;
|
||||
|
||||
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@idusuario",$idusuario,1);
|
||||
|
||||
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$cmd->texto="INSERT INTO administradores_centros(idusuario,idcentro) VALUES (@idusuario,@idcentro)";
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$cmd->texto='DELETE FROM administradores_centros WHERE idusuario='.$idusuario.' AND idcentro='.$idcentro;
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
?>
|
|
@ -1,191 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_aulas.php
|
||||
// Descripción :
|
||||
// Gestiona el mantenimiento de la tabla de aulas
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../clases/XmlPhp.php");
|
||||
include_once("../clases/ArbolVistaXML.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("./relaciones/aulas_eliminacion.php");
|
||||
include_once("./relaciones/ordenadores_eliminacion.php");
|
||||
include_once("../includes/opciones.php");
|
||||
include_once("./relaciones/gruposordenadores_eliminacion.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$opcion=0; // Inicializa parametros
|
||||
|
||||
$idaula=0;
|
||||
$nombreaula="";
|
||||
$grupoid=0;
|
||||
$urlfoto="";
|
||||
$cagnon=false;
|
||||
$pizarra=false;
|
||||
$ubicacion="";
|
||||
$comentarios="";
|
||||
$puestos=0;
|
||||
$horaresevini=0;
|
||||
$horaresevfin=0;
|
||||
$idmenu=0;
|
||||
|
||||
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
|
||||
|
||||
if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"];
|
||||
if (isset($_GET["idaula"])) $idaula=$_GET["idaula"];
|
||||
if (isset($_GET["identificador"])) $idaula=$_GET["identificador"];
|
||||
|
||||
if (isset($_GET["nombreaula"])) $nombreaula=$_GET["nombreaula"];
|
||||
if (isset($_GET["urlfoto"])) $urlfoto=$_GET["urlfoto"];
|
||||
if (isset($_GET["cagnon"])) $cagnon=$_GET["cagnon"];
|
||||
if (isset($_GET["pizarra"])) $pizarra=$_GET["pizarra"];
|
||||
if (isset($_GET["ubicacion"])) $ubicacion=$_GET["ubicacion"];
|
||||
if (isset($_GET["comentarios"])) $comentarios=$_GET["comentarios"];
|
||||
if (isset($_GET["puestos"])) $puestos=$_GET["puestos"];
|
||||
if (isset($_GET["horaresevini"])) $horaresevini=$_GET["horaresevini"];
|
||||
if (isset($_GET["horaresevfin"])) $horaresevfin=$_GET["horaresevfin"];
|
||||
if (isset($_GET["idmenu"])) $idmenu=$_GET["idmenu"];
|
||||
|
||||
$tablanodo=""; // Arbol para nodos insertados
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona();
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
// *************************************************************************************************************************************************
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
$literal="";
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$literal="resultado_insertar_aulas";
|
||||
break;
|
||||
case $op_modificacion:
|
||||
$literal="resultado_modificar_aulas";
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$literal="resultado_eliminar_aulas";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
echo '<p><span id="arbol_nodo">'.$tablanodo.'</span></p>';
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">'.chr(13);
|
||||
echo 'var oHTML'.chr(13);
|
||||
echo 'var cTBODY=document.getElementsByTagName("TBODY");'.chr(13);
|
||||
echo 'o=cTBODY.item(1);'.chr(13);
|
||||
if ($opcion==$op_alta )
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idaula.",o.innerHTML);".chr(13);
|
||||
else
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ','".$nombreaula."');".chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idaula.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/**************************************************************************************************************************************************
|
||||
Inserta, modifica o elimina datos en la tabla aulas
|
||||
________________________________________________________________________________________________________*/
|
||||
function Gestiona(){
|
||||
global $cmd;
|
||||
global $opcion;
|
||||
|
||||
global $idcentro;
|
||||
global $grupoid;
|
||||
|
||||
global $idaula;
|
||||
global $nombreaula;
|
||||
global $urlfoto;
|
||||
global $cagnon;
|
||||
global $pizarra;
|
||||
global $ubicacion;
|
||||
global $comentarios;
|
||||
global $puestos;
|
||||
global $horaresevini;
|
||||
global $horaresevfin;
|
||||
global $idmenu;
|
||||
|
||||
global $op_alta;
|
||||
global $op_modificacion;
|
||||
global $op_eliminacion;
|
||||
global $tablanodo;
|
||||
|
||||
$cmd->CreaParametro("@grupoid",$grupoid,1);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
|
||||
$cmd->CreaParametro("@idaula",$idaula,1);
|
||||
$cmd->CreaParametro("@nombreaula",$nombreaula,0);
|
||||
$cmd->CreaParametro("@urlfoto",$urlfoto,0);
|
||||
$cmd->CreaParametro("@cagnon",$cagnon,1);
|
||||
$cmd->CreaParametro("@pizarra",$pizarra,1);
|
||||
$cmd->CreaParametro("@ubicacion",$ubicacion,0);
|
||||
$cmd->CreaParametro("@comentarios",$comentarios,0);
|
||||
$cmd->CreaParametro("@puestos",$puestos,1);
|
||||
$cmd->CreaParametro("@horaresevini",$horaresevini,1);
|
||||
$cmd->CreaParametro("@horaresevfin",$horaresevfin,1);
|
||||
$cmd->CreaParametro("@idmenu",$idmenu,1);
|
||||
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$cmd->texto="INSERT INTO aulas(idcentro,grupoid,nombreaula,urlfoto,cagnon,pizarra,ubicacion,comentarios,puestos,horaresevini,horaresevfin) VALUES (@idcentro,@grupoid,@nombreaula,@urlfoto,@cagnon,@pizarra,@ubicacion,@comentarios,@puestos,@horaresevini,@horaresevfin)";
|
||||
$resul=$cmd->Ejecutar();
|
||||
if ($resul){ // Crea una tabla nodo para devolver a la página que llamó ésta
|
||||
$idaula=$cmd->Autonumerico();
|
||||
$arbolXML=SubarbolXML_aulas($idaula,$nombreaula);
|
||||
$baseurlimg="../images/signos"; // Url de las imagenes de signo
|
||||
$clasedefault="texto_arbol"; // Hoja de estilo (Clase por defecto) del árbol
|
||||
$arbol=new ArbolVistaXML($arbolXML,0,$baseurlimg,$clasedefault);
|
||||
$tablanodo=$arbol->CreaArbolVistaXML();
|
||||
}
|
||||
break;
|
||||
case $op_modificacion:
|
||||
$cmd->texto="UPDATE aulas SET nombreaula=@nombreaula,urlfoto=@urlfoto,cagnon=@cagnon,pizarra=@pizarra,ubicacion=@ubicacion,comentarios=@comentarios,puestos=@puestos,horaresevini=@horaresevini,horaresevfin=@horaresevfin WHERE idaula=@idaula";
|
||||
$resul=$cmd->Ejecutar();
|
||||
if ($resul){ // Crea una tabla nodo para devolver a la página que llamó ésta
|
||||
if($idmenu>0){
|
||||
$cmd->texto="UPDATE ordenadores SET idmenu=@idmenu WHERE idaula=@idaula";
|
||||
$resul=$cmd->Ejecutar();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$resul=EliminaAulas($cmd,$idaula,"idaula");// Eliminación en cascada
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea un arbol XML para el nuevo nodo insertado
|
||||
________________________________________________________________________________________________________*/
|
||||
function SubarbolXML_aulas($idaula,$nombreaula){
|
||||
global $LITAMBITO_AULAS;
|
||||
$cadenaXML='<AULAS ';
|
||||
// Atributos
|
||||
$cadenaXML.=' clickcontextualnodo="menu_contextual(this,' ."'flo_".$LITAMBITO_AULAS."'" .')"';
|
||||
$cadenaXML.=' imagenodo="../images/iconos/aula.gif"';
|
||||
$cadenaXML.=' infonodo="'.$nombreaula.'"';
|
||||
$cadenaXML.=' nodoid='.$LITAMBITO_AULAS.'-'.$idaula;
|
||||
$cadenaXML.='>';
|
||||
$cadenaXML.='</AULAS>';
|
||||
return($cadenaXML);
|
||||
}
|
||||
?>
|
|
@ -1,159 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_centros.php
|
||||
// Descripción :
|
||||
// Gestiona el mantenimiento de la tabla de centros
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../clases/XmlPhp.php");
|
||||
include_once("../clases/ArbolVistaXML.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("./relaciones/centros_eliminacion.php");
|
||||
include_once("../includes/opciones.php");
|
||||
include_once("./relaciones/centros_eliminacion.php");
|
||||
include_once("./relaciones/aulas_eliminacion.php");
|
||||
include_once("./relaciones/ordenadores_eliminacion.php");
|
||||
include_once("./relaciones/gruposordenadores_eliminacion.php");
|
||||
|
||||
//________________________________________________________________________________________________________
|
||||
$opcion=0; // Inicializa parametros
|
||||
|
||||
$identidad=0;
|
||||
$idcentro=0;
|
||||
$nombrecentro="";
|
||||
$comentarios="";
|
||||
|
||||
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
|
||||
if (isset($_GET["identidad"])) $identidad=$_GET["identidad"];
|
||||
if (isset($_GET["idcentro"])) $idcentro=$_GET["idcentro"];
|
||||
if (isset($_GET["identificador"])) $idcentro=$_GET["identificador"];
|
||||
if (isset($_GET["nombrecentro"])) $nombrecentro=$_GET["nombrecentro"];
|
||||
if (isset($_GET["comentarios"])) $comentarios=$_GET["comentarios"];
|
||||
|
||||
|
||||
$tablanodo=""; // Arbol para nodos insertados
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona();
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
// *************************************************************************************************************************************************
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
$literal="";
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$literal="resultado_insertar_centros";
|
||||
break;
|
||||
case $op_modificacion:
|
||||
$literal="resultado_modificar_centros";
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$literal="resultado_eliminar_centros";
|
||||
break;
|
||||
case $op_movida :
|
||||
$literal="resultado_cambiar_centros";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
echo '<p><span id="arbol_nodo">'.$tablanodo.'</span></p>';
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">'.chr(13);
|
||||
echo 'var oHTML'.chr(13);
|
||||
echo 'var cTBODY=document.getElementsByTagName("TBODY");'.chr(13);
|
||||
echo 'o=cTBODY.item(1);'.chr(13);
|
||||
if ($opcion==$op_alta )
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idcentro.",o.innerHTML);".chr(13);
|
||||
else
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ','".$nombrecentro."');".chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idcentro.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/*________________________________________________________________________________________________________
|
||||
Inserta, modifica o elimina datos en la tabla centros
|
||||
________________________________________________________________________________________________________*/
|
||||
function Gestiona(){
|
||||
global $cmd;
|
||||
global $opcion;
|
||||
|
||||
global $idcentro;
|
||||
global $nombrecentro;
|
||||
global $comentarios;
|
||||
global $identidad;
|
||||
|
||||
global $op_alta;
|
||||
global $op_modificacion;
|
||||
global $op_eliminacion;
|
||||
global $op_movida;
|
||||
global $tablanodo;
|
||||
|
||||
$cmd->CreaParametro("@identidad",$identidad,1);
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@nombrecentro",$nombrecentro,0);
|
||||
$cmd->CreaParametro("@comentarios",$comentarios,0);
|
||||
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$cmd->texto="INSERT INTO centros(nombrecentro,comentarios,identidad) VALUES (@nombrecentro,@comentarios,@identidad)";
|
||||
$resul=$cmd->Ejecutar();
|
||||
if ($resul){ // Crea una tabla nodo para devolver a la página que llamó ésta
|
||||
$idcentro=$cmd->Autonumerico();
|
||||
$arbolXML=SubarbolXML_centros($idcentro,$nombrecentro);
|
||||
$baseurlimg="../images/signos"; // Url de las imagenes de signo
|
||||
$clasedefault="texto_arbol"; // Hoja de estilo (Clase por defecto) del árbol
|
||||
$arbol=new ArbolVistaXML($arbolXML,0,$baseurlimg,$clasedefault);
|
||||
$tablanodo=$arbol->CreaArbolVistaXML();
|
||||
}
|
||||
break;
|
||||
case $op_modificacion:
|
||||
$cmd->texto="UPDATE centros SET nombrecentro=@nombrecentro,comentarios=@comentarios WHERE idcentro=@idcentro";
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$resul=EliminaCentros($cmd,$idcentro,"idcentro");// Eliminación en cascada
|
||||
break;
|
||||
case $op_movida :
|
||||
$cmd->texto="UPDATE centros SET identidad=@identidad WHERE idcentro=@idcentro";
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea un arbol XML para el nuevo nodo insertado
|
||||
________________________________________________________________________________________________________*/
|
||||
function SubarbolXML_centros($idcentro,$nombrecentro){
|
||||
global $LITAMBITO_CENTROS;
|
||||
$cadenaXML='<CENTRO';
|
||||
// Atributos
|
||||
$cadenaXML.=' clickcontextualnodo="menu_contextual(this,' ."'flo_".$LITAMBITO_CENTROS."'" .')"';
|
||||
$cadenaXML.=' imagenodo="../images/iconos/centros.gif"';
|
||||
$cadenaXML.=' infonodo="'.$nombrecentro.'"';
|
||||
$cadenaXML.=' nodoid='.$LITAMBITO_CENTROS.'-'.$idcentro;
|
||||
$cadenaXML.='></CENTRO>';
|
||||
return($cadenaXML);
|
||||
}
|
||||
?>
|
|
@ -1,714 +0,0 @@
|
|||
<?
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../includes/TomanDatos.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/comunes.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/TomaDato.php");
|
||||
|
||||
$opcion=0; // Inicializa parametros
|
||||
$resultado="";
|
||||
$estado="";
|
||||
$idaccion=0;
|
||||
|
||||
$idnotificacion=0;
|
||||
$resultadoNot="";
|
||||
$idnotificador=0;
|
||||
|
||||
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
|
||||
if (isset($_GET["resultado"])) $resultado=$_GET["resultado"];
|
||||
if (isset($_GET["estado"])) $estado=$_GET["estado"];
|
||||
if (isset($_GET["idaccion"])) $idaccion=$_GET["idaccion"];
|
||||
|
||||
if (isset($_GET["idnotificacion"])) $idnotificacion=$_GET["idnotificacion"];
|
||||
if (isset($_GET["resultadoNot"])) $resultadoNot=$_GET["resultadoNot"];
|
||||
if (isset($_GET["idnotificador"])) $idnotificador=$_GET["idnotificador"];
|
||||
|
||||
$mulaccion="";
|
||||
if (isset($_GET["mulaccion"])) $mulaccion=$_GET["mulaccion"];
|
||||
|
||||
$op_modificar_resultado=1;
|
||||
$op_modificar_estado=2;
|
||||
$op_reiniciar_accion=3;
|
||||
$op_eliminar_accion=4;
|
||||
$op_modificar_resultado_notificacion=5;
|
||||
$op_reiniciar_notificacion=6;
|
||||
|
||||
$opcion_multiple=0;
|
||||
$op_eliminar_mulaccion=7;
|
||||
$op_modificar_mulresultado=8;
|
||||
$op_modificar_mulestado=9;
|
||||
$op_reiniciar_mulaccion=10;
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
if(empty($mulaccion))
|
||||
$resul=Gestiona($opcion);
|
||||
else
|
||||
$resul=GestionaMultiple($opcion);
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
// ************************************************************************************************
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
$literal="";
|
||||
switch($opcion){
|
||||
case $op_modificar_resultado :
|
||||
$literal="resultado_modificar_resultado";
|
||||
break;
|
||||
case $op_modificar_estado:
|
||||
$literal="resultado_modificar_estado";
|
||||
break;
|
||||
case $op_reiniciar_accion :
|
||||
$literal="resultado_reiniciar_accion";
|
||||
break;
|
||||
case $op_eliminar_accion :
|
||||
$literal="resultado_eliminar_accion";
|
||||
break;
|
||||
case $op_modificar_resultado_notificacion :
|
||||
$literal="resultado_modificar_resultado_notificacion";
|
||||
break;
|
||||
case $op_reiniciar_notificacion :
|
||||
$literal="resultado_reiniciar_notificacion";
|
||||
break;
|
||||
default :
|
||||
$literal="resultado_multipleaccion";
|
||||
break;
|
||||
}
|
||||
if(empty($mulaccion)){
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(1,'".$cmd->DescripUltimoError()."',".$idaccion.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idaccion.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
}
|
||||
else{
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(1,'".$cmd->DescripUltimoError()."')";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,' " .$cmd->DescripUltimoError()."')";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Inserta, modifica o elimina un grupo de servidores dhcp de la base de datos
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function GestionaMultiple($opcion){
|
||||
|
||||
global $idaccion;
|
||||
global $mulaccion;
|
||||
global $estado;
|
||||
global $resultado;
|
||||
|
||||
global $op_modificar_resultado;
|
||||
global $op_modificar_estado;
|
||||
global $op_reiniciar_accion;
|
||||
global $op_eliminar_accion;
|
||||
global $opcion_multiple;
|
||||
global $op_modificar_mulresultado;
|
||||
global $op_modificar_mulestado;
|
||||
global $op_reiniciar_mulaccion;
|
||||
global $op_eliminar_mulaccion;
|
||||
|
||||
global $ACCION_DETENIDA;
|
||||
global $ACCION_INICIADA;
|
||||
global $ACCION_FINALIZADA;
|
||||
|
||||
global $ACCION_TERMINADA; // Finalizada manualmente con indicacion de exito
|
||||
global $ACCION_ABORTADA; // Finalizada manualmente con indicacion de errores
|
||||
|
||||
$resul=true;
|
||||
$auxsplit=split(";",$mulaccion);
|
||||
for ($i=0;$i<sizeof($auxsplit)-1;$i++){
|
||||
$triada=split(":",$auxsplit[$i]);
|
||||
$idaccion=$triada[0];
|
||||
|
||||
switch($opcion){
|
||||
case $op_modificar_mulresultado:
|
||||
$acestado=$triada[1];
|
||||
$acresultado=$triada[2];
|
||||
if($acestado==$ACCION_INICIADA || $acestado==$ACCION_DETENIDA)
|
||||
$resul=Gestiona($op_modificar_resultado);
|
||||
/*if($acestado==$ACCION_FINALIZADA){
|
||||
if($acresultado==$ACCION_TERMINADA && $resultado==$ACCION_ABORTADA)
|
||||
$resul=Gestiona($op_modificar_resultado);
|
||||
if($acresultado==$ACCION_ABORTADA && $resultado==$ACCION_TERMINADA)
|
||||
$resul=Gestiona($op_modificar_resultado);
|
||||
}
|
||||
*/
|
||||
break;
|
||||
case $op_modificar_mulestado:
|
||||
$acestado=$triada[1];
|
||||
if($acestado==$ACCION_INICIADA && $estado==$ACCION_DETENIDA)
|
||||
$resul=Gestiona($op_modificar_estado);
|
||||
if($acestado==$ACCION_DETENIDA && $estado==$ACCION_INICIADA)
|
||||
$resul=Gestiona($op_modificar_estado);
|
||||
break;
|
||||
case $op_reiniciar_mulaccion :
|
||||
$resul=Gestiona($op_reiniciar_accion);
|
||||
break;
|
||||
case $op_eliminar_mulaccion :
|
||||
$resul=Gestiona($op_eliminar_accion);
|
||||
break;
|
||||
}
|
||||
if(!$resul) return(false);
|
||||
}
|
||||
$opcion=$opcion_multiple;
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Inserta, modifica o elimina un grupo de servidores dhcp de la base de datos
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function Gestiona($opcion){
|
||||
|
||||
global $ACCION_EXITOSA; // Finalizada con exito
|
||||
global $ACCION_FALLIDA; // Finalizada con errores
|
||||
global $ACCION_TERMINADA; // Finalizada manualmente con indicacion de exito
|
||||
global $ACCION_ABORTADA; // Finalizada manualmente con indicacion de errores
|
||||
global $ACCION_SINERRORES; // Activa y con algún error
|
||||
global $ACCION_CONERRORES; // Activa y sin error
|
||||
|
||||
global $ACCION_DETENIDA;
|
||||
global $ACCION_INICIADA;
|
||||
global $ACCION_FINALIZADA;
|
||||
|
||||
global $cmd;
|
||||
global $idaccion;
|
||||
global $resultado;
|
||||
global $estado;
|
||||
|
||||
global $idnotificacion;
|
||||
global $resultadoNot;
|
||||
|
||||
global $op_modificar_resultado;
|
||||
global $op_modificar_estado;
|
||||
global $op_reiniciar_accion;
|
||||
global $op_eliminar_accion;
|
||||
|
||||
global $op_modificar_resultado_notificacion;
|
||||
global $op_reiniciar_notificacion;
|
||||
|
||||
$cmd->CreaParametro("@idaccion",$idaccion,1);
|
||||
$cmd->CreaParametro("@idnotificacion",$idnotificacion,1);
|
||||
|
||||
switch($opcion){
|
||||
|
||||
case $op_modificar_resultado:
|
||||
$resul=modificar_resultado($cmd,$resultado,$idaccion);
|
||||
break;
|
||||
case $op_modificar_estado:
|
||||
$resul=modificar_estado($cmd,$estado,$idaccion);
|
||||
break;
|
||||
case $op_reiniciar_accion :
|
||||
$resul=reinicia_notificaciones($cmd,$idaccion); // Actualizaciones hacia abajo
|
||||
if($resul)
|
||||
$resul=reinicia_notificadores($cmd,$idaccion,0); // Actualizaciones hacia arriba
|
||||
break;
|
||||
case $op_eliminar_accion :
|
||||
$resul=delete_notificaciones($cmd,$idaccion); // Eliminaciones hacia abajo
|
||||
if ($resul){
|
||||
$resul=reinicia_notificadores($cmd,$idaccion,0); // Actualizaciones hacia arriba
|
||||
if($resul){
|
||||
$cmd->texto="DELETE FROM acciones WHERE idaccion=".$idaccion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case $op_modificar_resultado_notificacion:
|
||||
$cmd->texto="UPDATE notificaciones SET resultado=".$resultadoNot." WHERE idnotificacion=".$idnotificacion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
if($resul){
|
||||
$resul=modificar_resultado_notificacion($cmd,$idaccion); // Actualizaciones hacia arriba
|
||||
if ($resul)
|
||||
$resul=modificar_resultado_notificadores($cmd,$resultadoNot,$idnotificacion); // Actualizaciones hacia abajo
|
||||
}
|
||||
break;
|
||||
case $op_reiniciar_notificacion:
|
||||
$nwidaccion=TomaDato($cmd,0,'notificaciones',$idnotificacion,'idnotificacion','idaccion');
|
||||
if(!empty($nwidaccion)){
|
||||
$resul=reinicia_notificaciones($cmd,$nwidaccion); // Actualizaciones hacia abajo
|
||||
if($resul)
|
||||
$resul=reinicia_notificadores($cmd,$nwidaccion,0); // Actualizaciones hacia arriba
|
||||
}
|
||||
else{
|
||||
$resul=reinicia_notificadores($cmd,0,$idnotificacion); // Actualizaciones hacia arriba
|
||||
}
|
||||
break;
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de modificar el resultado de una notificación a Exitosa
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function modificar_resultado($cmd,$resultado,$idaccion){
|
||||
|
||||
global $ACCION_FINALIZADA;
|
||||
global $ACCION_TERMINADA;
|
||||
global $ACCION_ABORTADA;
|
||||
|
||||
$nombreliterales[0]="estado";
|
||||
$nombreliterales[1]="resultado";
|
||||
$nombreliterales[2]="idnotificador";
|
||||
$nombreliterales[3]="accionid";
|
||||
$Datos=TomanDatos($cmd,"acciones",$idaccion,"idaccion",$nombreliterales);
|
||||
$nwestado=$Datos["estado"];
|
||||
$nwresultado=$Datos["resultado"];
|
||||
$nwidnotificador=$Datos["idnotificador"];
|
||||
$nwaccionid=$Datos["accionid"];
|
||||
|
||||
if($nwestado<>$ACCION_FINALIZADA || $nwresultado==$ACCION_TERMINADA || $nwresultado==$ACCION_ABORTADA){
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$resultado."',estado='".$ACCION_FINALIZADA."' ,fechahorafin='".date("y/m/d h:i:s")."' WHERE idaccion=".$idaccion; // Actualiza resultado y estado de la acción
|
||||
$resul=$cmd->Ejecutar();
|
||||
if($resul && $nwaccionid>0)
|
||||
$resul=cuestion_raizernotificacion($cmd,$idaccion,$nwidnotificador,$nwaccionid,$resultado);
|
||||
}
|
||||
else
|
||||
$resul=false;
|
||||
if(!$resul) return(false);
|
||||
|
||||
$rs=new Recordset; // Recupero acciones anidadas
|
||||
$cmd->texto="SELECT idaccion FROM acciones WHERE accionid=".$idaccion." AND (estado<>'".$ACCION_FINALIZADA."' OR resultado='".$ACCION_TERMINADA."' OR resultado='".$ACCION_ABORTADA."')";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
while (!$rs->EOF){
|
||||
$resul=modificar_resultado($cmd,$resultado,$rs->campos["idaccion"]);
|
||||
if(!$resul) return(false);
|
||||
$rs->Siguiente();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de modificar el resultado de una notificación a Exitosa
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function cuestion_raizernotificacion($cmd,$idaccion,$idnotificador,$accionid,$resultado){
|
||||
|
||||
global $ACCION_EXITOSA;
|
||||
global $ACCION_FALLIDA;
|
||||
global $ACCION_TERMINADA;
|
||||
global $ACCION_ABORTADA;
|
||||
|
||||
$nombreliterales[0]="idnotificacion";
|
||||
$Datos=TomanDatos($cmd,"notificaciones",$idaccion,"idaccion",$nombreliterales);
|
||||
|
||||
if (empty($Datos)) // No existe notificación
|
||||
$resul=InsertaNotificaciones($cmd,$idaccion,$idnotificador,$accionid,$resultado);
|
||||
else{ // Existe modificacion y hay que modificar su resultado
|
||||
$LITTERMINADA="¡¡ Acción terminada manualmente !!";
|
||||
$LITABORTADA="¡¡ Acción abortada manualmente !!";
|
||||
|
||||
if($resultado==$ACCION_TERMINADA){
|
||||
$nwresultado=$ACCION_EXITOSA;
|
||||
$nwdescrinotificacion=$LITTERMINADA;
|
||||
}
|
||||
else{
|
||||
$nwresultado=$ACCION_FALLIDA;
|
||||
$nwdescrinotificacion=$LITABORTADA;
|
||||
}
|
||||
$cmd->texto="UPDATE notificaciones SET resultado=".$nwresultado.",descrinotificacion='".$nwdescrinotificacion."' WHERE idaccion=".$idaccion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
}
|
||||
if($resul)
|
||||
$resul=comprueba_resultados($cmd,$accionid,$resultado);
|
||||
|
||||
return($resul);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de modificar el resultado de una notificación a Exitosa
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function InsertaNotificaciones($cmd,$idaccion,$idnotificador,$accionid,$resultado){
|
||||
|
||||
global $ACCION_EXITOSA;
|
||||
global $ACCION_FALLIDA;
|
||||
global $ACCION_TERMINADA;
|
||||
global $ACCION_ABORTADA;
|
||||
|
||||
$LITTERMINADA="¡¡ Acción terminada manualmente !!";
|
||||
$LITABORTADA="¡¡ Acción abortada manualmente !!";
|
||||
|
||||
if($resultado==$ACCION_TERMINADA){
|
||||
$nwresultado=$ACCION_EXITOSA;
|
||||
$nwdescrinotificacion=$LITTERMINADA;
|
||||
}
|
||||
else{
|
||||
$nwresultado=$ACCION_FALLIDA;
|
||||
$nwdescrinotificacion=$LITABORTADA;
|
||||
}
|
||||
|
||||
$ntaccionid=$accionid;
|
||||
$ntidnotificador=$idnotificador;
|
||||
$ntfechahorareg=date("y/m/d h:i:s");
|
||||
$ntresultado=$nwresultado;
|
||||
$ntdescrinotificacion=$nwdescrinotificacion;
|
||||
$ntidaccion=$idaccion;
|
||||
|
||||
$cmd->texto="INSERT INTO notificaciones (accionid,idnotificador,fechahorareg,resultado,descrinotificacion,idaccion) VALUES (";
|
||||
$cmd->texto.=$ntaccionid.",".$ntidnotificador.",'".$ntfechahorareg."','".$ntresultado."','".$ntdescrinotificacion."',".$ntidaccion;
|
||||
$cmd->texto.=")";
|
||||
|
||||
$resul=$cmd->Ejecutar();
|
||||
return($resul);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de eliminar una notificación de una Acción
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function comprueba_resultados($cmd,$idaccion,$resultado){
|
||||
|
||||
global $ACCION_FINALIZADA;
|
||||
global $ACCION_EXITOSA;
|
||||
global $ACCION_FALLIDA;
|
||||
global $ACCION_SINERRORES;
|
||||
global $ACCION_CONERRORES;
|
||||
|
||||
//if($idaccion==0) return(true); // Se ha llegado a la raiz
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) as numfallidas FROM notificaciones WHERE resultado='".$ACCION_FALLIDA."' AND accionid=".$idaccion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
if($rs->EOF) return(false);
|
||||
$numfallidas=$rs->campos["numfallidas"];
|
||||
|
||||
$nombreliterales[0]="estado";
|
||||
$nombreliterales[1]="resultado";
|
||||
$nombreliterales[2]="accionid";
|
||||
$Datos=TomanDatos($cmd,"acciones",$idaccion,"idaccion",$nombreliterales);
|
||||
$nwestado=$Datos["estado"];
|
||||
$nwresultado=$Datos["resultado"];
|
||||
$nwaccionid=$Datos["accionid"];
|
||||
|
||||
// Si el nuevo resultado es el mismo y la acción había finalizado ya, el evento se corta aquí
|
||||
if($nwresultado==$resultado && $nwestado==$ACCION_FINALIZADA) return(true);
|
||||
|
||||
if($nwestado==$ACCION_FINALIZADA){ // La acción había finalizado
|
||||
if($numfallidas>0)
|
||||
$finalaccion=$ACCION_FALLIDA;
|
||||
else
|
||||
$finalaccion=$ACCION_EXITOSA;
|
||||
}
|
||||
else{ // La acción NO había finalizado luego se convierte en sinerrores
|
||||
if($numfallidas>0)
|
||||
$finalaccion=$ACCION_CONERRORES;
|
||||
else
|
||||
$finalaccion=$ACCION_SINERRORES;
|
||||
}
|
||||
|
||||
// Actualiza acción
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$finalaccion."' WHERE idaccion=".$idaccion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
if (!$resul) return(false);
|
||||
|
||||
// Si ya existía notificación, se modifica su estado
|
||||
if($nwestado==$ACCION_FINALIZADA){
|
||||
if($numfallidas>0)
|
||||
$cmd->texto="UPDATE notificaciones SET resultado='".$ACCION_FALLIDA."' WHERE idaccion=".$idaccion;
|
||||
else
|
||||
$cmd->texto="UPDATE notificaciones SET resultado='".$ACCION_EXITOSA."' WHERE idaccion=".$idaccion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
if($resul && $nwaccionid>0 )
|
||||
return(comprueba_resultados($cmd,$nwaccionid,$resultado));
|
||||
}
|
||||
else{
|
||||
// Comprueba si ha finalizado esta acción e inserta su notificador correspondiente
|
||||
$resul=comprueba_finalizada($cmd,$idaccion,$nwaccionid,$resultado);
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de modificar el resultado de una notificación a Exitosa
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function comprueba_finalizada($cmd,$idaccion,$accionid,$resultado){
|
||||
|
||||
global $EJECUCION_COMANDO;
|
||||
global $EJECUCION_TAREA;
|
||||
global $EJECUCION_TRABAJO;
|
||||
|
||||
global $ACCION_FINALIZADA;
|
||||
global $ACCION_EXITOSA;
|
||||
global $ACCION_FALLIDA;
|
||||
global $ACCION_TERMINADA;
|
||||
global $ACCION_ABORTADA;
|
||||
global $ACCION_SINERRORES;
|
||||
global $ACCION_CONERRORES;
|
||||
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) as numnotificaciones FROM notificaciones WHERE accionid=".$idaccion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
if($rs->EOF) return(false);
|
||||
$numnotificaciones=$rs->campos["numnotificaciones"];
|
||||
|
||||
$nombreliterales[0]="tipoaccion";
|
||||
$nombreliterales[1]="parametros";
|
||||
$nombreliterales[2]="idnotificador";
|
||||
$Datos=TomanDatos($cmd,"acciones",$idaccion,"idaccion",$nombreliterales);
|
||||
$nwtipoaccion=$Datos["tipoaccion"];
|
||||
$nwparametros=$Datos["parametros"];
|
||||
$nwidnotificador=$Datos["idnotificador"];
|
||||
|
||||
$ValorParametros=extrae_parametros($nwparametros,chr(13),'=');
|
||||
switch($nwtipoaccion){
|
||||
case $EJECUCION_COMANDO :
|
||||
$cadenanot=$ValorParametros["iph"];
|
||||
break;
|
||||
case $EJECUCION_TAREA :
|
||||
$cadenanot=$ValorParametros["cmd"];
|
||||
break;
|
||||
case $EJECUCION_TRABAJO :
|
||||
$cadenanot=$ValorParametros["tsk"];
|
||||
break;
|
||||
default:
|
||||
return(false);
|
||||
}
|
||||
$cont=1;
|
||||
for($i=0;$i<strlen($cadenanot);$i++){
|
||||
if(substr($cadenanot,$i,1)==';') $cont++;
|
||||
}
|
||||
|
||||
if($numnotificaciones==$cont){
|
||||
if($resultado==$ACCION_ABORTADA)
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$ACCION_FALLIDA."', estado='".$ACCION_FINALIZADA."' ,fechahorafin='".date("y/m/d h:i:s")."' WHERE idaccion=".$idaccion;
|
||||
else
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$ACCION_EXITOSA."', estado='".$ACCION_FINALIZADA."' ,fechahorafin='".date("y/m/d h:i:s")."' WHERE idaccion=".$idaccion;
|
||||
|
||||
$resul=$cmd->Ejecutar();
|
||||
if ($resul){
|
||||
if($accionid>0){
|
||||
$resul=InsertaNotificaciones($cmd,$idaccion,$nwidnotificador,$accionid,$resultado);
|
||||
if($resul)
|
||||
return(comprueba_resultados($cmd,$accionid,$resultado));
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
$resul=true;
|
||||
|
||||
return($resul);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de modificar el resultado de una notificación a Exitosa
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function modificar_estado($cmd,$estado,$idaccion){
|
||||
|
||||
global $ACCION_FINALIZADA;
|
||||
|
||||
$cmd->texto="UPDATE acciones SET estado='".$estado."' WHERE idaccion=".$idaccion." AND estado<>'".$ACCION_FINALIZADA."'"; // Actualiza estado de la acción
|
||||
$resul=$cmd->Ejecutar();
|
||||
if(!$resul) return(false);
|
||||
|
||||
$rs=new Recordset; // Recupero acciones anidadas
|
||||
$cmd->texto="SELECT idaccion FROM acciones WHERE accionid=".$idaccion." AND estado<>'".$ACCION_FINALIZADA."'";
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
while (!$rs->EOF){
|
||||
$resul=modificar_estado($cmd,$estado,$rs->campos["idaccion"]);
|
||||
if(!$resul) return(false);
|
||||
$rs->Siguiente();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de eliminar una notificación de una Acción
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function reinicia_notificaciones($cmd,$idaccion){
|
||||
|
||||
global $ACCION_SINERRORES;
|
||||
global $ACCION_INICIADA;
|
||||
|
||||
$cmd->texto="DELETE FROM notificaciones WHERE accionid=".$idaccion; // Elimina notificación
|
||||
$resul=$cmd->Ejecutar();
|
||||
if($resul){
|
||||
$cmd->texto="UPDATE acciones SET resultado=".$ACCION_SINERRORES.",estado=".$ACCION_INICIADA." ,fechahorafin=null WHERE idaccion=".$idaccion; // Actualiza resultado y estado de la acción como consecuencia de la eliminación de la notificación
|
||||
$resul=$cmd->Ejecutar();
|
||||
}
|
||||
if(!$resul) return(false);
|
||||
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT idaccion FROM acciones WHERE accionid=".$idaccion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
while (!$rs->EOF){
|
||||
$resul=reinicia_notificaciones($cmd,$rs->campos["idaccion"]); // Eliminación recursiva
|
||||
if(!$resul) return($resul);
|
||||
$rs->Siguiente();
|
||||
}
|
||||
return(true);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de eliminar una notificación de una Acción
|
||||
Parametros:
|
||||
- cmd:Un comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function reinicia_notificadores($cmd,$idaccion,$idnotificacion){
|
||||
|
||||
global $ACCION_INICIADA;
|
||||
global $ACCION_SINERRORES;
|
||||
global $ACCION_CONERRORES;
|
||||
global $ACCION_FALLIDA;
|
||||
|
||||
if($idaccion>0){
|
||||
$cmd->texto="DELETE FROM notificaciones WHERE idaccion=".$idaccion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
if(!$resul) return(false);
|
||||
$nwidaccion=TomaDato($cmd,0,'acciones',$idaccion,'idaccion','accionid');
|
||||
}
|
||||
else{
|
||||
$nwidaccion=TomaDato($cmd,0,'notificaciones',$idnotificacion,'idnotificacion','accionid');
|
||||
$cmd->texto="DELETE FROM notificaciones WHERE idnotificacion=".$idnotificacion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
if(!$resul) return(false);
|
||||
}
|
||||
if (empty($nwidaccion)) return(true);
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) as numfallidas FROM notificaciones WHERE resultado='".$ACCION_FALLIDA."' AND accionid=".$nwidaccion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
if($rs->EOF) return(true);
|
||||
if($rs->campos["numfallidas"]>0)
|
||||
$nwresultado=$ACCION_CONERRORES;
|
||||
else
|
||||
$nwresultado=$ACCION_SINERRORES;
|
||||
$rs->Cerrar();
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$nwresultado."',estado='".$ACCION_INICIADA."' ,fechahorafin=null WHERE idaccion=".$nwidaccion;
|
||||
$resul=$cmd->Ejecutar();
|
||||
if (!$resul) return(false);
|
||||
|
||||
return(reinicia_notificadores($cmd,$nwidaccion,0));
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de eliminar una notificación de una Acción
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function delete_notificaciones($cmd,$idaccion){
|
||||
|
||||
global $ACCION_SINERRORES;
|
||||
global $ACCION_INICIADA;
|
||||
|
||||
$cmd->texto="DELETE FROM notificaciones WHERE accionid=".$idaccion; // Elimina notificación
|
||||
$resul=$cmd->Ejecutar();
|
||||
if(!$resul) return(false);
|
||||
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT idaccion FROM acciones WHERE accionid=".$idaccion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
if($rs->EOF) return(true);
|
||||
|
||||
while (!$rs->EOF){
|
||||
$resul=delete_notificaciones($cmd,$rs->campos["idaccion"]); // Eliminación recursiva
|
||||
if(!$resul) return($resul);
|
||||
$rs->Siguiente();
|
||||
}
|
||||
if($resul){
|
||||
$cmd->texto="DELETE FROM acciones WHERE accionid=".$idaccion; // Elimina acciones
|
||||
$resul=$cmd->Ejecutar();
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de eliminar una notificación de una Acción
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function modificar_resultado_notificacion($cmd,$idaccion){
|
||||
|
||||
global $ACCION_FINALIZADA;
|
||||
global $ACCION_EXITOSA;
|
||||
global $ACCION_FALLIDA;
|
||||
global $ACCION_SINERRORES;
|
||||
global $ACCION_CONERRORES;
|
||||
|
||||
$rs=new Recordset;
|
||||
$cmd->texto="SELECT COUNT(*) as numfallidas FROM notificaciones WHERE resultado='".$ACCION_FALLIDA."' AND accionid=".$idaccion;
|
||||
$rs->Comando=&$cmd;
|
||||
if (!$rs->Abrir()) return(false); // Error al abrir recordset
|
||||
if($rs->EOF) return(true);
|
||||
$numfallidas=$rs->campos["numfallidas"];
|
||||
|
||||
$nombreliterales[0]="estado";
|
||||
$nombreliterales[1]="accionid";
|
||||
$Datos=TomanDatos($cmd,"acciones",$idaccion,"idaccion",$nombreliterales);
|
||||
$nwestado=$Datos["estado"];
|
||||
$nwaccionid=$Datos["accionid"];
|
||||
|
||||
if($nwestado==$ACCION_FINALIZADA){ // La acción había finalizado
|
||||
if($numfallidas>0)
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$ACCION_FALLIDA."' WHERE idaccion=".$idaccion;
|
||||
else
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$ACCION_EXITOSA."' WHERE idaccion=".$idaccion;
|
||||
}
|
||||
else{ // La acción NO había finalizado luego se convierte en sinerrores
|
||||
if($numfallidas>0)
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$ACCION_CONERRORES."' WHERE idaccion=".$idaccion;
|
||||
else
|
||||
$cmd->texto="UPDATE acciones SET resultado='".$ACCION_SINERRORES."' WHERE idaccion=".$idaccion;
|
||||
}
|
||||
$resul=$cmd->Ejecutar();
|
||||
if (!$resul) return(false);
|
||||
|
||||
if($nwestado==$ACCION_FINALIZADA){
|
||||
if($numfallidas>0)
|
||||
$cmd->texto="UPDATE notificaciones SET resultado='".$ACCION_FALLIDA."' ,fechahorareg='".date("y/m/d h:i:s")."' WHERE idaccion=".$idaccion;
|
||||
else
|
||||
$cmd->texto="UPDATE notificaciones SET resultado='".$ACCION_EXITOSA."' ,fechahorareg='".date("y/m/d h:i:s")."' WHERE idaccion=".$idaccion;
|
||||
$resul=modificar_resultado_notificacion($cmd,$nwaccionid);
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
/* -------------------------------------------------------------------------------------------
|
||||
Consecuencias de eliminar una notificación de una Acción
|
||||
Parametros:
|
||||
- cmd:Una comando ya operativo (con conexión abierta)
|
||||
---------------------------------------------------------------------------------------------*/
|
||||
function modificar_resultado_notificadores($cmd,$resultadoNot,$idnotificacion){
|
||||
|
||||
global $ACCION_EXITOSA;
|
||||
global $ACCION_TERMINADA;
|
||||
global $ACCION_ABORTADA;
|
||||
|
||||
if($resultadoNot==$ACCION_EXITOSA)
|
||||
$resultado=$ACCION_TERMINADA;
|
||||
else
|
||||
$resultado=$ACCION_ABORTADA;
|
||||
|
||||
$nwidaccion=TomaDato($cmd,0,'notificaciones',$idnotificacion,'idnotificacion','idaccion');
|
||||
if (!empty($nwidaccion))
|
||||
return(modificar_resultado($cmd,$resultado,$nwidaccion));
|
||||
|
||||
return(true);
|
||||
|
||||
}
|
||||
?>
|
|
@ -1,169 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_componentehardwares.php
|
||||
// Descripción :
|
||||
// Gestiona el mantenimiento de la tabla de hardwares
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../clases/XmlPhp.php");
|
||||
include_once("../clases/ArbolVistaXML.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/TomaDato.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/opciones.php");
|
||||
include_once("./relaciones/hardwares_eliminacion.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$opcion=0; // Inicializa parametros
|
||||
|
||||
$idhardware=0;
|
||||
$descripcion="";
|
||||
$idtipohardware=0;
|
||||
$grupoid=0;
|
||||
|
||||
$urlimgth=""; // Url de la imagen del tipo de hardware al que pertenece el componente
|
||||
|
||||
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
|
||||
|
||||
if (isset($_GET["idhardware"])) $idhardware=$_GET["idhardware"];
|
||||
if (isset($_GET["descripcion"])) $descripcion=$_GET["descripcion"];
|
||||
if (isset($_GET["idtipohardware"])) $idtipohardware=$_GET["idtipohardware"];
|
||||
if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"];
|
||||
if (isset($_GET["identificador"])) $idhardware=$_GET["identificador"];
|
||||
|
||||
$tablanodo=""; // Arbol para nodos insertados
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona();
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
// *************************************************************************************************************************************************
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
$literal="";
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$literal="resultado_insertar_componentehardwares";
|
||||
break;
|
||||
case $op_modificacion:
|
||||
$literal="resultado_modificar_componentehardwares";
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$literal="resultado_eliminar_componentehardwares";
|
||||
break;
|
||||
case $op_movida :
|
||||
$literal="resultado_mover";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
echo '<p><span id="arbol_nodo">'.$tablanodo.'</span></p>';
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">'.chr(13);
|
||||
echo 'var oHTML'.chr(13);
|
||||
echo 'var cTBODY=document.getElementsByTagName("TBODY");'.chr(13);
|
||||
echo 'o=cTBODY.item(1);'.chr(13);
|
||||
if ($opcion==$op_alta )
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idhardware.",o.innerHTML);".chr(13);
|
||||
else
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ','".$descripcion."');".chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idhardware.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/**************************************************************************************************************************************************
|
||||
Inserta, modifica o elimina datos en la tabla hardwares
|
||||
________________________________________________________________________________________________________*/
|
||||
function Gestiona(){
|
||||
global $cmd;
|
||||
global $opcion;
|
||||
|
||||
global $idcentro;
|
||||
global $idhardware;
|
||||
global $descripcion;
|
||||
global $idtipohardware;
|
||||
global $grupoid;
|
||||
|
||||
global $urlimgth;
|
||||
|
||||
global $op_alta;
|
||||
global $op_modificacion;
|
||||
global $op_eliminacion;
|
||||
global $op_movida;
|
||||
|
||||
global $tablanodo;
|
||||
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@idhardware",$idhardware,1);
|
||||
$cmd->CreaParametro("@descripcion",$descripcion,0);
|
||||
$cmd->CreaParametro("@idtipohardware",$idtipohardware,1);
|
||||
$cmd->CreaParametro("@grupoid",$grupoid,1);
|
||||
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$cmd->texto="INSERT INTO hardwares (descripcion,idtipohardware,idcentro,grupoid) VALUES (@descripcion,@idtipohardware,@idcentro,@grupoid)";
|
||||
$resul=$cmd->Ejecutar();
|
||||
if ($resul){ // Crea una tabla nodo para devolver a la página que llamó ésta
|
||||
$idhardware=$cmd->Autonumerico();
|
||||
$arbolXML=SubarbolXML_ComponenteHardwares($cmd,$idhardware,$descripcion,$idtipohardware);
|
||||
$baseurlimg="../images/signos"; // Url de las imagenes de signo
|
||||
$clasedefault="texto_arbol"; // Hoja de estilo (Clase por defecto) del árbol
|
||||
$arbol=new ArbolVistaXML($arbolXML,0,$baseurlimg,$clasedefault);
|
||||
$tablanodo=$arbol->CreaArbolVistaXML();
|
||||
}
|
||||
break;
|
||||
case $op_modificacion:
|
||||
$cmd->texto="UPDATE hardwares SET descripcion=@descripcion,idtipohardware=@idtipohardware WHERE idhardware=@idhardware";
|
||||
$resul=$cmd->Ejecutar();
|
||||
if ($resul) // Toma la imagen del tipo de componente hardware
|
||||
$urlimgth=TomaDato($cmd,0,'tipohardwares',$idtipohardware,'idtipohardware','urlimg');
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$resul=EliminaHardwares($cmd,$idhardware,"idhardware");
|
||||
break;
|
||||
case $op_movida :
|
||||
$cmd->texto="UPDATE hardwares SET grupoid=@grupoid WHERE idhardware=@idhardware";
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea un arbol XML para el nuevo nodo insertado
|
||||
________________________________________________________________________________________________________*/
|
||||
function SubarbolXML_ComponenteHardwares($cmd,$idhardware,$descripcion,$idtipohardware){
|
||||
global $LITAMBITO_COMPONENTESHARD;
|
||||
$urlimg=TomaDato($cmd,0,'tipohardwares',$idtipohardware,'idtipohardware','urlimg');
|
||||
$cadenaXML='<COMPONENTEHARDWARES';
|
||||
// Atributos
|
||||
if (!empty($urlimg))
|
||||
$cadenaXML.=' imagenodo="'.$urlimg.'"';
|
||||
else
|
||||
$cadenaXML.=' imagenodo="../images/iconos/confihard.gif"';
|
||||
$cadenaXML.=' infonodo="'.$descripcion.'"';
|
||||
$cadenaXML.=' nodoid='.$LITAMBITO_COMPONENTESHARD.'-'.$idhardware;
|
||||
$cadenaXML.=' clickcontextualnodo="menu_contextual(this,' ."'flo_".$LITAMBITO_COMPONENTESHARD."'" .')"';
|
||||
$cadenaXML.='>';
|
||||
$cadenaXML.='</COMPONENTEHARDWARES>';
|
||||
return($cadenaXML);
|
||||
}
|
||||
?>
|
|
@ -1,173 +0,0 @@
|
|||
<?
|
||||
// *************************************************************************************************************************************************
|
||||
// Aplicación WEB: ogAdmWebCon
|
||||
// Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla
|
||||
// Fecha Creación: Año 2003-2004
|
||||
// Fecha Última modificación: Marzo-2005
|
||||
// Nombre del fichero: gestor_componentesoftwares.php
|
||||
// Descripción :
|
||||
// Gestiona el mantenimiento de la tabla de softwares
|
||||
// *************************************************************************************************************************************************
|
||||
include_once("../includes/ctrlacc.php");
|
||||
include_once("../clases/AdoPhp.php");
|
||||
include_once("../clases/XmlPhp.php");
|
||||
include_once("../clases/ArbolVistaXML.php");
|
||||
include_once("../includes/CreaComando.php");
|
||||
include_once("../includes/TomaDato.php");
|
||||
include_once("../includes/constantes.php");
|
||||
include_once("../includes/opciones.php");
|
||||
include_once("./relaciones/softwares_eliminacion.php");
|
||||
//________________________________________________________________________________________________________
|
||||
$opcion=0; // Inicializa parametros
|
||||
|
||||
$idsoftware=0;
|
||||
$descripcion="";
|
||||
$idtiposoftware=0;
|
||||
$idtiposo=0;
|
||||
$grupoid=0;
|
||||
|
||||
$urlimgth=""; // Url de la imagen del tipo de software al que pertenece el componente
|
||||
|
||||
if (isset($_GET["opcion"])) $opcion=$_GET["opcion"]; // Recoge parametros
|
||||
|
||||
if (isset($_GET["idsoftware"])) $idsoftware=$_GET["idsoftware"];
|
||||
if (isset($_GET["descripcion"])) $descripcion=$_GET["descripcion"];
|
||||
if (isset($_GET["idtiposoftware"])) $idtiposoftware=$_GET["idtiposoftware"];
|
||||
if (isset($_GET["idtiposo"])) $idtiposo=$_GET["idtiposo"];
|
||||
if (isset($_GET["grupoid"])) $grupoid=$_GET["grupoid"];
|
||||
if (isset($_GET["identificador"])) $idsoftware=$_GET["identificador"];
|
||||
|
||||
$tablanodo=""; // Arbol para nodos insertados
|
||||
|
||||
$cmd=CreaComando($cadenaconexion); // Crea objeto comando
|
||||
$resul=false;
|
||||
if ($cmd){
|
||||
$resul=Gestiona();
|
||||
$cmd->Conexion->Cerrar();
|
||||
}
|
||||
// *************************************************************************************************************************************************
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
||||
<BODY>
|
||||
<?
|
||||
$literal="";
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$literal="resultado_insertar_componentesoftwares";
|
||||
break;
|
||||
case $op_modificacion:
|
||||
$literal="resultado_modificar_componentesoftwares";
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$literal="resultado_eliminar_componentesoftwares";
|
||||
break;
|
||||
case $op_movida :
|
||||
$literal="resultado_mover";
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
echo '<p><span id="arbol_nodo">'.$tablanodo.'</span></p>';
|
||||
if ($resul){
|
||||
echo '<SCRIPT language="javascript">'.chr(13);
|
||||
echo 'var oHTML'.chr(13);
|
||||
echo 'var cTBODY=document.getElementsByTagName("TBODY");'.chr(13);
|
||||
echo 'o=cTBODY.item(1);'.chr(13);
|
||||
if ($opcion==$op_alta )
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ',".$idsoftware.",o.innerHTML);".chr(13);
|
||||
else
|
||||
echo 'window.parent.'.$literal."(1,'".$cmd->DescripUltimoError()." ','".$descripcion."');".chr(13);
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
else{
|
||||
echo '<SCRIPT language="javascript">';
|
||||
echo " window.parent.".$literal."(0,'".$cmd->DescripUltimoError()."',".$idsoftware.")";
|
||||
echo '</SCRIPT>';
|
||||
}
|
||||
?>
|
||||
</BODY>
|
||||
</HTML>
|
||||
<?
|
||||
/**************************************************************************************************************************************************
|
||||
Inserta, modifica o elimina datos en la tabla softwares
|
||||
________________________________________________________________________________________________________*/
|
||||
function Gestiona(){
|
||||
global $cmd;
|
||||
global $opcion;
|
||||
|
||||
global $idcentro;
|
||||
global $idsoftware;
|
||||
global $descripcion;
|
||||
global $idtiposoftware;
|
||||
global $idtiposo;
|
||||
global $grupoid;
|
||||
|
||||
global $urlimgth;
|
||||
|
||||
global $op_alta;
|
||||
global $op_modificacion;
|
||||
global $op_eliminacion;
|
||||
global $op_movida;
|
||||
|
||||
global $tablanodo;
|
||||
|
||||
$cmd->CreaParametro("@idcentro",$idcentro,1);
|
||||
$cmd->CreaParametro("@idsoftware",$idsoftware,1);
|
||||
$cmd->CreaParametro("@descripcion",$descripcion,0);
|
||||
$cmd->CreaParametro("@idtiposoftware",$idtiposoftware,1);
|
||||
$cmd->CreaParametro("@idtiposo",$idtiposo,1);
|
||||
$cmd->CreaParametro("@grupoid",$grupoid,1);
|
||||
|
||||
switch($opcion){
|
||||
case $op_alta :
|
||||
$cmd->texto="INSERT INTO softwares (descripcion,idtiposoftware,idtiposo,idcentro,grupoid) VALUES (@descripcion,@idtiposoftware,@idtiposo,@idcentro,@grupoid)";
|
||||
$resul=$cmd->Ejecutar();
|
||||
if ($resul){ // Crea una tabla nodo para devolver a la página que llamó ésta
|
||||
$idsoftware=$cmd->Autonumerico();
|
||||
$arbolXML=SubarbolXML_Componentesoftwares($cmd,$idsoftware,$descripcion,$idtiposoftware);
|
||||
$baseurlimg="../images/signos"; // Url de las imagenes de signo
|
||||
$clasedefault="texto_arbol"; // Hoja de estilo (Clase por defecto) del árbol
|
||||
$arbol=new ArbolVistaXML($arbolXML,0,$baseurlimg,$clasedefault);
|
||||
$tablanodo=$arbol->CreaArbolVistaXML();
|
||||
}
|
||||
break;
|
||||
case $op_modificacion:
|
||||
$cmd->texto="UPDATE softwares SET descripcion=@descripcion,idtiposoftware=@idtiposoftware,idtiposo=@idtiposo WHERE idsoftware=@idsoftware";
|
||||
$resul=$cmd->Ejecutar();
|
||||
if ($resul) // Toma la imagen del tipo de componente software
|
||||
$urlimgth=TomaDato($cmd,0,'tiposoftwares',$idtiposoftware,'idtiposoftware','urlimg');
|
||||
break;
|
||||
case $op_eliminacion :
|
||||
$resul=EliminaSoftwares($cmd,$idsoftware,"idsoftware");
|
||||
break;
|
||||
case $op_movida :
|
||||
$cmd->texto="UPDATE softwares SET grupoid=@grupoid WHERE idsoftware=@idsoftware";
|
||||
$resul=$cmd->Ejecutar();
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
return($resul);
|
||||
}
|
||||
/*________________________________________________________________________________________________________
|
||||
Crea un arbol XML para el nuevo nodo insertado
|
||||
________________________________________________________________________________________________________*/
|
||||
function SubarbolXML_Componentesoftwares($cmd,$idsoftware,$descripcion,$idtiposoftware){
|
||||
global $LITAMBITO_COMPONENTESSOFT;
|
||||
$urlimg=TomaDato($cmd,0,'tiposoftwares',$idtiposoftware,'idtiposoftware','urlimg');
|
||||
$cadenaXML='<COMPONENTESOFTWARES';
|
||||
// Atributos
|
||||
if (!empty($urlimg))
|
||||
$cadenaXML.=' imagenodo="'.$urlimg.'"';
|
||||
else
|
||||
$cadenaXML.=' imagenodo="../images/iconos/confisoft.gif"';
|
||||
$cadenaXML.=' infonodo="'.$descripcion.'"';
|
||||
$cadenaXML.=' nodoid='.$LITAMBITO_COMPONENTESSOFT.'-'.$idsoftware;
|
||||
$cadenaXML.=' clickcontextualnodo="menu_contextual(this,' ."'flo_".$LITAMBITO_COMPONENTESSOFT."'" .')"';
|
||||
$cadenaXML.='>';
|
||||
$cadenaXML.='</COMPONENTESOFTWARES>';
|
||||
return($cadenaXML);
|
||||
}
|
||||
?>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue