1 | <?php |
---|
2 | include_once("../includes/ctrlacc.php"); |
---|
3 | include_once("../clases/AdoPhp.php"); |
---|
4 | include_once("../clases/XmlPhp.php"); |
---|
5 | include_once("../clases/MenuContextual.php"); |
---|
6 | include_once("../includes/constantes.php"); |
---|
7 | include_once("../includes/comunes.php"); |
---|
8 | include_once("../includes/CreaComando.php"); |
---|
9 | include_once("../idiomas/php/".$idioma."/aulas_".$idioma.".php"); |
---|
10 | |
---|
11 | $cmd=CreaComando($cadenaconexion); |
---|
12 | if (!$cmd) |
---|
13 | Header('Location: '.$pagerror.'?herror=2'); // Error de conexión con servidor B.D. |
---|
14 | //________________________________________________________________________________________________________ |
---|
15 | |
---|
16 | |
---|
17 | echo "<html>"; |
---|
18 | echo "<head>"; |
---|
19 | echo "<meta http-equiv='Refresh' content='1;URL=../principal/ubicarordenadores.php?idambito=". $_GET['idaula'] ."&nombreambito=" . $_GET['nombreambito'] . "&litambito=" . $_GET['litambito'] . "'>"; |
---|
20 | echo "<title> gestion de equipos </title>"; |
---|
21 | echo "<base target='principal'>"; |
---|
22 | echo "</head>"; |
---|
23 | echo "<body>"; |
---|
24 | |
---|
25 | |
---|
26 | |
---|
27 | #echo('litambito con valor: '. $_GET['litambito']); |
---|
28 | #echo ('idambito con valor: ' . $_GET['idaula']); |
---|
29 | #echo ('nombreambito con valor: ' . $_GET['nombreambito']); |
---|
30 | #echo "<br>"; |
---|
31 | |
---|
32 | $lista = explode(";",$_POST['listOfItems']); |
---|
33 | foreach ($lista as $sublista) { |
---|
34 | $elementos = explode("|",$sublista); |
---|
35 | $hostname=$elementos[1]; |
---|
36 | $grupo=$elementos[0]; |
---|
37 | ReubicarOrdenador($cmd,$hostname,$grupo); |
---|
38 | #echo $elementos[0] . $elementos[1]; |
---|
39 | #echo "<br>"; |
---|
40 | } |
---|
41 | echo " </body>"; |
---|
42 | echo " </html> "; |
---|
43 | |
---|
44 | function ReubicarOrdenador($cmd,$hostname,$grupo) |
---|
45 | { |
---|
46 | global $cmd; |
---|
47 | global $hostname; |
---|
48 | global $grupo; |
---|
49 | if ($grupo == "pxe") |
---|
50 | { |
---|
51 | $cmd->CreaParametro("@grupo","0",0); |
---|
52 | $cmd->CreaParametro("@hostname",$hostname,0); |
---|
53 | $cmd->texto="update ordenadores set grupoid=@grupo where nombreordenador=@hostname"; |
---|
54 | } |
---|
55 | else |
---|
56 | { |
---|
57 | $cmd->CreaParametro("@grupo",$grupo,0); |
---|
58 | $cmd->CreaParametro("@hostname",$hostname,0); |
---|
59 | #$cmd->texto="update ordenadores set grupoid=(Select idgrupo from gruposordenadores where nombregrupoordenador=@grupo) where nombreordenador=@hostname"; |
---|
60 | $cmd->texto="update ordenadores set grupoid=@grupo where nombreordenador=@hostname"; |
---|
61 | |
---|
62 | } |
---|
63 | $cmd->Ejecutar(); |
---|
64 | #Update ordenadores Set grupoid=(Select idgrupo From gruposordenadores Where nombregrupoordenador="subgrupo1") where nombreordenador="prueba1" |
---|
65 | } |
---|
66 | |
---|
67 | |
---|
68 | # <iframe src="frame_a.htm" name="frame1"></iframe> |
---|
69 | # <iframe src="frame_b.htm" name="frame2"></iframe> |
---|
70 | |
---|
71 | ?> |
---|
72 | |
---|
73 | <html> <head> |
---|
74 | <script language="javascript"> |
---|
75 | function actualiza_frame_principal(){ |
---|
76 | window.parent.frames[1].location="../principal/aulas.php" |
---|
77 | // window.location="../nada.php" |
---|
78 | } |
---|
79 | </script> |
---|
80 | </head> |
---|
81 | <body onunload="actualiza_frame_principal()"> </body> |
---|
82 | </html> |
---|
83 | |
---|
84 | |
---|
85 | |
---|