-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathhorario.php
executable file
·116 lines (105 loc) · 4.4 KB
/
horario.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php defined('INTRANET_DIRECTORY') OR exit('No direct script access allowed'); ?>
<h4><span class="fa fa-clock-o fa-fw"></span> Horario</h4>
<table class="table table-bordered table-condensed table-striped table-centered">
<thead>
<tr>
<th width="20"> </th>
<th width="20">L</th>
<th width="20">M</th>
<th width="20">X</th>
<th width="20">J</th>
<th width="20">V</th>
</tr>
</thead>
<tbody>
<?php
// Horas del día
$t_hora = mysqli_query($db_con,"select hora, hora_inicio, hora_fin from tramos");
while($todas_horas=mysqli_fetch_array($t_hora)){
$n_hora = $todas_horas[0];
$hora_inicio = $todas_horas[1];
$nombre = $hora_inicio;
$algo = 0;
for($i = 1; $i < 6; $i ++) {
$hay_algo = mysqli_query($db_con, "SELECT distinct c_asig, a_asig, a_grupo, asig FROM horw where prof = '$pr' and dia = '$i' and hora = '$n_hora' ORDER BY a_grupo" );
if (mysqli_num_rows($hay_algo)) {
$algo = 1;
}
}
if ($algo) {
echo '<tr><th>'.$nombre.'</th>';
//Días
for($z = 1; $z < 6; $z ++) {
?>
<td>
<?php
if (! (empty ( $z ) and ! ($n_hora))) {
$extra = "and dia = '$z' and hora = '$n_hora'";
}
$asignatur1 = mysqli_query($db_con, "SELECT distinct c_asig, a_asig, a_grupo, asig FROM horw where prof = '$pr' $extra ORDER BY a_grupo" );
$rowasignatur1 = mysqli_fetch_row ( $asignatur1 );
$act_seneca = mysqli_query($db_con, "SELECT * FROM actividades_seneca where idactividad = '$rowasignatur1[0]' and nomactividad not like 'TUT%' and idactividad not like '21'" );
$asig_seneca = mysqli_query($db_con, "SELECT * FROM asignaturas where codigo = '$rowasignatur1[0]'" );
if(mysqli_num_rows($act_seneca)>0 and ! ($rowasignatur1 [0] == "25" or $rowasignatur1 [0] == "44")){
echo "<span class='label label-default' data-bs='tooltip' title='".$rowasignatur1[3]."'>" . $rowasignatur1 [1] . "</span><br />";
}
elseif (mysqli_num_rows($asig_seneca)>0 and ! ($rowasignatur1 [0] == "25" or $rowasignatur1 [0] == "44")) {
echo "<span class='label label-info' data-bs='tooltip' title='".$rowasignatur1[3]."'>" . $rowasignatur1 [1] . "</span><br />";
}
elseif (empty ( $rowasignatur1 [2] ) and ! ($rowasignatur1 [0] == "25" or $rowasignatur1 [0] == "44")) {
echo "<span class='label label-warning' data-bs='tooltip' title='".$rowasignatur1[3]."'>" . $rowasignatur1 [1] . "</span><br />";
}
elseif ($rowasignatur1 [1]=="GUCON") {
echo "<a href='//".$config['dominio']."/intranet/admin/fechorias/convivencia.php' style='text-decoration: none;'><span class='label label-danger' data-bs='tooltip' title='".$rowasignatur1[3]."'>".$rowasignatur1[1]."</span>";
}
elseif ((($rowasignatur1 [0] == "25" and $rowasignatur1 [1]!=="GUCON") or $rowasignatur1 [0] == "44") and $config['mod_asistencia']) {
if (strstr($_SESSION ['cargo'],"1")==TRUE and $rowasignatur1 [0] == "44") {
echo "<a href='//".$config['dominio']."/intranet/admin/fechorias/admin.php' style='text-decoration: none;'><span class='label label-success' data-bs='tooltip' title='".$rowasignatur1[3]."'>".$rowasignatur1[1]."</span>";
}
else{
echo "<a href='//".$config['dominio']."/intranet/admin/guardias/index.php?diasem=$z&hora=$n_hora' style='text-decoration: none;'><span class='label label-danger' data-bs='tooltip' title='".$rowasignatur1[3]."'>" . $rowasignatur1 [1] . "</span></a>";
}
}
// Recorremos los grupos a los que da en ese hora.
$rep_grupo = "";
$cont = 1;
$asignaturas1 = mysqli_query($db_con, "SELECT distinct c_asig, a_grupo FROM horw where prof = '$pr' and dia = '$z' and hora = '$n_hora' ORDER BY a_grupo" );
while ( $rowasignaturas1 = mysqli_fetch_array ( $asignaturas1 ) ) {
$grupo = $rowasignaturas1 [1];
echo "<a href='//".$config['dominio']."/intranet/cuaderno.php?dia=$z&hora=$n_hora&curso=$grupo&asignatura=$rowasignatur1[0]' style='font-size:0.8em'>";
if (is_numeric ( substr ( $grupo, 0, 1 ) )) {
if ($grupo != $rep_grupo) {
if($cont > 1) {
if (stristr($grupo, '-') == TRUE) {
$exp_grupo = explode('-', $grupo);
echo "/".$exp_grupo[1];
}
elseif (stristr($grupo, 'º') == TRUE) {
$exp_grupo = explode('º', $grupo);
echo "/".$exp_grupo[1];
}
else {
echo $grupo.'<br>';
}
}
else {
echo $grupo;
}
}
}
echo "</a>";
$rep_grupo = $grupo;
$cont++;
}
?>
</span>
</td>
<?php
}
}
?></tr><?php
}
?>
</tbody>
</table>
<a class="btn btn-sm btn-default" href="xml/jefe/horarios/index.php">Modificar horario</a>