| 1 | <? | 
|---|
| 2 | // ************************************************************************************************************************************************* | 
|---|
| 3 | // Aplicación WEB: ogAdmWebCon | 
|---|
| 4 | // Autor: José Manuel Alonso (E.T.S.I.I.) Universidad de Sevilla | 
|---|
| 5 | // Fecha Creación: Año 2009 | 
|---|
| 6 | // Fecha Última modificación: Octubre-2009 | 
|---|
| 7 | // Nombre del fichero: menumliente.php | 
|---|
| 8 | // Descripción : | 
|---|
| 9 | //              Pagina del menu del cliente. Éste la solicita a través de su browser local | 
|---|
| 10 | // ************************************************************************************************************************************************* | 
|---|
| 11 | include_once("../includes/ctrlacc.php"); | 
|---|
| 12 | include_once("../clases/AdoPhp.php"); | 
|---|
| 13 | include_once("../includes/CreaComando.php"); | 
|---|
| 14 | include_once("../includes/constantes.php"); | 
|---|
| 15 | include_once("../includes/opciones.php"); | 
|---|
| 16 | include_once("../includes/TomaDato.php"); | 
|---|
| 17 | //________________________________________________________________________________________________________ | 
|---|
| 18 | $iph="0.0.0.0"; | 
|---|
| 19 | $idt="0"; | 
|---|
| 20 |  | 
|---|
| 21 | if (isset($_GET["iph"])) $iph=$_GET["iph"]; | 
|---|
| 22 | if (isset($_GET["idt"])) $idt=$_GET["idt"]; | 
|---|
| 23 | //________________________________________________________________________________________________________ | 
|---|
| 24 | $cmd=CreaComando($cadenaconexion); | 
|---|
| 25 | if (!$cmd) | 
|---|
| 26 | Header('Location: '.$pagerror.'?herror=2');  // Error de conexión con servidor B.D. | 
|---|
| 27 | //________________________________________________________________________________________________________ | 
|---|
| 28 | $rs=new Recordset; | 
|---|
| 29 | $cmd->texto="SELECT acciones_menus.tipoaccion, acciones_menus.idtipoaccion, | 
|---|
| 30 | procedimientos.descripcion as procedimiento, tareas.descripcion as tarea | 
|---|
| 31 | FROM acciones_menus | 
|---|
| 32 | LEFT OUTER JOIN procedimientos ON procedimientos.idprocedimiento=acciones_menus.idtipoaccion | 
|---|
| 33 | LEFT OUTER JOIN tareas ON tareas.idtarea=acciones_menus.idtipoaccion | 
|---|
| 34 | WHERE acciones_menus.idaccionmenu=".$idt; | 
|---|
| 35 |  | 
|---|
| 36 | $rs->Comando=&$cmd; | 
|---|
| 37 | $resul=$rs->Abrir(); | 
|---|
| 38 | if (!$rs->Abrir()) die("NO SE HA PODIDO RECUPERAR EL ITEM PARA SER EJECUTADO"); | 
|---|
| 39 | if ($rs->EOF) die("EL ITEM PARA SER EJECUTADO NO EXISTE"); | 
|---|
| 40 |  | 
|---|
| 41 | $tipoaccion=$rs->campos["tipoaccion"]; | 
|---|
| 42 | $idtipoaccion=$rs->campos["idtipoaccion"]; | 
|---|
| 43 |  | 
|---|
| 44 | switch($tipoaccion){ | 
|---|
| 45 | case $EJECUCION_PROCEDIMIENTO : | 
|---|
| 46 | $ambito=$AMBITO_ORDENADORES; | 
|---|
| 47 | $idambito=TomaDato($cmd,0,'ordenadores',$iph,'ip','idordenador',0); | 
|---|
| 48 | $wurl="../gestores/gestor_ejecutaracciones.php"; | 
|---|
| 49 | $prm="?swc=1&opcion=".$EJECUCION_PROCEDIMIENTO."&ambito=".$ambito."&idambito=".$idambito; | 
|---|
| 50 | $prm.="&idprocedimiento=".$idtipoaccion."&descriprocedimiento=".UrlEncode($rs->campos["procedimiento"]); | 
|---|
| 51 | Header('Location: '.$wurl.$prm);  // Ejecución procedimiento | 
|---|
| 52 | break; | 
|---|
| 53 | case $EJECUCION_TAREA : | 
|---|
| 54 | $wurl="../gestores/gestor_ejecutaracciones.php"; | 
|---|
| 55 | $prm="?swc=1&opcion=".$EJECUCION_TAREA; | 
|---|
| 56 | $prm.="&idtarea=".$idtipoaccion."&descritarea=".UrlEncode($rs->campos["tarea"]); | 
|---|
| 57 | Header('Location: '.$wurl.$prm);  // Ejecución procedimiento | 
|---|
| 58 | break; | 
|---|
| 59 | } | 
|---|
| 60 | die("HA HABIDO ALGÚN ERROR AL PROCESAR EL ITEM"); | 
|---|
| 61 | ?> | 
|---|