diff --git a/class/manda_correo.php b/class/manda_correo.php
index 9e6478e..c4e33b5 100644
--- a/class/manda_correo.php
+++ b/class/manda_correo.php
@@ -46,7 +46,7 @@ class MandaCorreos{
if($tipo & self::JEFE){
$correosJefe_rs = $db->querySingle("SELECT DISTINCT jefe.usuario_correo
FROM usuario jefe
- where :id_fac = ANY(jefe.facultad_id_array) AND rol_id = 11
+ where :id_fac = facultad_id AND rol_id = 11
and jefe.usuario_correo is not null and jefe.usuario_correo != ''",
[':id_fac' => $facultad] );
foreach($correosJefe_rs as $correo){
@@ -59,7 +59,7 @@ class MandaCorreos{
$correosProf_rs = $db->querySingle("SELECT DISTINCT prof.usuario_correo
FROM horario_profesor hs
inner join usuario prof on prof.usuario_id =hs.usuario_id
- where :id_fac = ANY(hs.facultad_id_array) and prof.usuario_id = :id_prof
+ where :id_fac = hs.facultad_id and prof.usuario_id = :id_prof
and prof.usuario_correo is not null and prof.usuario_correo != ''",
[':id_prof'=>$prof_id, ':id_fac' => $facultad] );
foreach($correosProf_rs as $correo){
diff --git a/rest/horarios.php b/rest/horarios.php
index 6679565..a3d7235 100644
--- a/rest/horarios.php
+++ b/rest/horarios.php
@@ -182,7 +182,7 @@ try{
//claves de carreras en el periodo
$arreglo_claves = array_map(function ($item) {
- return $item['clave_carrera'];
+ return intval($item['clave_carrera']);
}, $carreras_rs);
//print_r($selectedData); exit();
@@ -191,6 +191,9 @@ try{
//Recorre SGU y genera hash
foreach( $selectedData as $row ){
+ //if ($debug)
+ // echo trim($row["HoraInicio"]."|".($row["NombreMateria"])."|".(trim($row["ClaveProfesor"])==""?"000000":trim($row["ClaveProfesor"]))."|".$row["IdEspacio"]."|".$per["periodo_id"]."|".$row["Carrera"])."[{$row["ClaveCarrera"]}]|{$row["EsMateriaPorReposicion"]}*";
+
if(!$row["EsMateriaPorReposicion"]){
$carrera = $row["ClaveCarrera"];
if(is_null($carrera) || empty($carrera))
@@ -245,12 +248,15 @@ try{
//$areacomun = array();
foreach($sguHash as $sgu){
- if(in_array($sgu["data"]["ClaveCarrera"] , $arreglo_claves) /*&& !in_array($sgu["data"]["ClaveMateria"], $areacomun)*/){
+ //print_r($sgu["data"]);
+ //echo $sgu["data"]["NombreMateria"]. "[".intval($sgu["data"]["ClaveCarrera"])."] =".in_array( intval($sgu["data"]["ClaveCarrera"]) , $arreglo_claves)." ";
+ if(in_array( intval($sgu["data"]["ClaveCarrera"]) , $arreglo_claves) /*&& !in_array($sgu["data"]["ClaveMateria"], $areacomun)*/){
$horarios_sgu[] = $sgu;
}
}
+ //echo "