uid; else $userid = -1; $sbNombre = str_replace('\'', '',$_POST['nombre']); $sbJornada = str_replace('\'', '',$_POST['jornada']); $sbDuracion = str_replace('\'', '',$_POST['duracion']); $sbCodigo = str_replace('\'', '',$_POST['codigo']); $sbObjetivos = str_replace('\'', '',$_POST['objetivos']); $sbJustificacion = str_replace('\'', '',$_POST['justificacion']); $sbDescripcion = str_replace('\'', '',$_POST['descripcion']); $sbDepartamento = $_POST['tel_departamento_id']; $obTbPrograma = new TBprograma(); $nuLastIndex = $obTbPrograma->fnuInsertRecord($sbNombre, $sbDescripcion, $sbDepartamento, $userid, $sbJornada, $sbDuracion, $sbCodigo, $sbObjetivos, $sbJustificacion); if ($nuLastIndex != NULL) { pCommit(); drupal_goto('telematica/ver_programa/'.$nuLastIndex); } return $output; } catch (Exception $e) { pRollback(); return t($e->getMessage()); } } function programa_editado() { try { global $user; $userid = NULL; if ( $user ) $userid = $user->uid; else $userid = -1; $sbId = $_POST['id']; $sbNombre = str_replace('\'', '',$_POST['nombre']); $sbJornada = str_replace('\'', '',$_POST['jornada']); $sbDuracion = str_replace('\'', '',$_POST['duracion']); $sbCodigo = str_replace('\'', '',$_POST['codigo']); $sbObjetivos = str_replace('\'', '',$_POST['objetivos']); $sbJustificacion = str_replace('\'', '',$_POST['justificacion']); $sbDescripcion = str_replace('\'', '',$_POST['descripcion']); $sbDepartamento = $_POST['tel_departamento_id']; $obTbPrograma = new TBprograma(); $nuLastIndex = $obTbPrograma->fnuUpdateRecord($sbId, $sbNombre, $sbDescripcion, $sbDepartamento, $userid, $sbJornada, $sbDuracion, $sbCodigo, $sbObjetivos, $sbJustificacion); if ($nuLastIndex != NULL) { pCommit(); drupal_goto('telematica/ver_programa/'.$sbId); } return $output; } catch (Exception $e) { pRollback(); form_set_error( 'Error', t($e->getMessage())); } } function listado_programas(){ try { $listPrograma = new IFACEprograma(); $output = $listPrograma->listado_programas(); return $output; } catch (Exception $e) { pRollback(); return t($e->getMessage()); } } function ver_programa($IdPrograma) { try { $obIFACEPrograma = new IFACEprograma(); $output = $obIFACEPrograma->ver_programa($IdPrograma); return $output; } catch (Exception $e) { return t($e->getMessage()); } } function add_integrantes() { try { $nuIdPrograma = $_GET['programa']; $nuIdTipo = $_GET['tipo']; $obIFACEPrograma = new IFACEprograma(); if($nuIdTipo=='i') $output = $obIFACEPrograma->add_integrantes($nuIdPrograma,'tel_estudiante'); else $output = $obIFACEPrograma->add_integrantes($nuIdPrograma,'tel_profesor'); return $output; } catch (Exception $e) { return t($e->getMessage()); } } function regist_integr_programa(){ try { global $user; $userid = NULL; if ( $user ) $userid = $user->uid; else $userid = -1; $arrayIntegrantes = $_POST['integrantes']; $nuIdPrograma = $_POST['programa']; $nuIdTipo = $_POST['tipo']; $obIntegPrograma = new TBprograma(); if ($arrayIntegrantes) { if($nuIdTipo=='E'){ foreach($arrayIntegrantes as $nuIdIntegrante) { $semestre = $_POST['cohorte'.$nuIdIntegrante]; $anio = $_POST['anio'.$nuIdIntegrante]; $obIntegPrograma->fnuInsertRecordIntegrante($nuIdPrograma, $nuIdIntegrante, $userid, $semestre, $anio); } }else{ foreach($arrayIntegrantes as $nuIdIntegrante) { $obIntegPrograma->fnuInsertRecordDirector($nuIdPrograma, $nuIdIntegrante, $userid); } } } pCommit(); drupal_goto('telematica/ver_programa/'.$nuIdPrograma); } catch (Exception $e) { pRollback(); return t($e->getMessage()); } } function elim_integ_programa() { try { $nuIdPrograma = $_GET['programa']; $nuIdIntIntegrante = $_GET['integrante']; $nuIdTipo = $_GET['tipo']; $obTBIntPrograma = new TBprograma(); if($nuIdTipo=='I') $obTBIntPrograma->fdeleteRecordIntegrante($nuIdIntIntegrante, $nuIdPrograma); else $obTBIntPrograma->fdeleteRecordDirector($nuIdIntIntegrante, $nuIdPrograma); pCommit(); drupal_goto('telematica/ver_programa/'.$nuIdPrograma); } catch (Exception $e) { return t($e->getMessage()); } } function eliminar_programa() { try { $nuIdPrograma = $_GET['idprograma']; $obTBIntPrograma = new TBprograma(); $obTBIntPrograma->fdeleteRecord($nuIdPrograma); $obTBIntPrograma->fdeleteRecordEstudiantes($nuIdPrograma); $obTBIntPrograma->fdeleteRecordDirectores($nuIdPrograma); $obTBIntPrograma->fdeleteRecordAsignaturas($nuIdPrograma); $obTBIntPrograma->fdeleteRecordTesis($nuIdPrograma); pCommit(); drupal_goto('telematica/ver_programas'); } catch (Exception $e) { return t($e->getMessage()); } } function plan_estudios($IdPrograma) { try { $obTbPrograma = new TBprograma(); $row = $obTbPrograma->frowRecord($IdPrograma); $obIFACEPrograma = new IFACEprograma(); $output = $obIFACEPrograma->plan_estudios($IdPrograma, $row->nombre); return $output; } catch (Exception $e) { return t($e->getMessage()); } } function calificar_asignatura($IdPrograma) { try { $obTbPrograma = new TBprograma(); $row = $obTbPrograma->frowRecord($IdPrograma); $obIFACEPrograma = new IFACEprograma(); $output = $obIFACEPrograma->calificar_asignatura($IdPrograma, $row->nombre); return $output; } catch (Exception $e) { return t($e->getMessage()); } } function lista_estudiantes($IdPrograma) { try { $obTbPrograma = new TBprograma(); $row = $obTbPrograma->frowRecord($IdPrograma); $obIFACEPrograma = new IFACEprograma(); $output = $obIFACEPrograma->listado_estudiantes($IdPrograma, $row->nombre); return $output; } catch (Exception $e) { return t($e->getMessage()); } } function lista_tesis($IdPrograma) { try { $obTbPrograma = new TBprograma(); $row = $obTbPrograma->frowRecord($IdPrograma); $obIFACEPrograma = new IFACEprograma(); $output = $obIFACEPrograma->listado_tesis($IdPrograma, $row->nombre); return $output; } catch (Exception $e) { return t($e->getMessage()); } } function lista_publicaciones($IdPrograma) { try { $obTbPrograma = new TBprograma(); $row = $obTbPrograma->frowRecord($IdPrograma); $obIFACEPrograma = new IFACEprograma(); $output = $obIFACEPrograma->listado_publicaciones($IdPrograma, $row->nombre); return $output; } catch (Exception $e) { return t($e->getMessage()); } }