Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Auth; use..

Decoded Output download

<?php 
 
 namespace App\Http\Controllers; 
 use Illuminate\Http\Request; 
 use Auth; 
 use App\Alumno; 
 use App\AlumnoOps; 
 use App\Setting_globals; 
 use App\ProgramacionOps; 
 use App\LibretaOps; 
 use App\ValoresDetalles; 
 use App\Asignatura; 
 use App\Matriculas; 
 use App\Programaciones; 
 use App\Pensum; 
 use App\Persona; 
 use App\Libreta_Regular; 
 use App\MontoInscripcion; 
 use App\Docentes; 
 use App\Mesa; 
 use App\CargaHoraria; 
 use App\Libreta_Verano; 
 use App\AsignaturaDocente; 
 use App\Http\Controllers\AlumnoAntiguoController; 
 class VeranosController extends Controller { 
 public function estado_verano($id) { 
 try { 
 $dato = Alumno::select("tipo_alumno", "matriculado", "alumnos.id as alumno_id", "curso_numeral", "plan_id", "alumnos.nivel as grado_a", "personas.nombre", "apellidos", "ci_persona", "genero", "activated", "ru_reg", "ra", "alumnos.gestion", "alumnos.fecha as fecha_alumno", "nombre_area", "nombre_carrera", "nombre_extension", "year", "carrera_paralela", "tipo_inscripcion", "alumnos.curso", "cambio", "tipo_alumno", "reprogramado", "reprogramado", "modalidad_titulacion_id", "convenio_id", "modalidad_activa", "programacion_activa", "alumnos.carrera_id")->join("personas", "personas.id", "=", "alumnos.persona_id")->join("areas", "areas.id", "=", "alumnos.area_id")->join("carreras", "carreras.id", "=", "alumnos.carrera_id")->join("extensiones", "extensiones.id", "=", "alumnos.extension_id")->join("users", "users.persona_id", "=", "personas.id")->join("pensums", "pensums.id", "=", "alumnos.plan_id")->where("alumnos.bloqueado_cambio", "NO")->where("ru_reg", Alumno::find($id)->ru_reg)->orderBy("alumnos.id", "asc")->get(); 
 $datos = $dato->where("cumplido", 0)->last(); 
 $setting_verano = Setting_globals::select("gestion_verano", "cantidad_materia_verano")->first(); 
 if ($datos->tipo_alumno == "nuevo" && $datos->matriculado == "NO") { 
 return redirect()->to("estado_alumno/" . $datos->alumno_id); 
 } 
 $cu = array(); 
 $alumno_id = array(); 
 foreach ($dato as $key => $value) { 
 $cu[] = $value->curso_numeral; 
 $alumno_id[] = $value->alumno_id; 
 } 
 $ultimo_curso = max($cu); 
 $alumno_ops_verano = AlumnoOps::where("gestion", Setting_globals::find(1)->gestion_verano)->where("ru_reg", $datos->ru_reg)->where("observacion", "VERANO")->first(); 
 if ($alumno_ops_verano != null) { 
 $materias_verano = ProgramacionOps::where("alumno_ops_id", $alumno_ops_verano->id)->where("programacion_ops.observacion", "VERANO")->where("estado", 1)->where("cancelado", "NO")->count(); 
 $valor = ValoresDetalles::join("valores", "valores.id", "=", "valores_detalles.valor_id")->where("valores.concepto", "Matricula Verano")->first(); 
 $costo = $valor->costo * $materias_verano; 
 $programacion_veranos = ProgramacionOps::select("programacion_ops.alumno_ops_id", "programacion_ops.gestion", "programacion_ops.etapa", "alumno_ops.re_programado")->join("alumno_ops", "alumno_ops.id", "=", "programacion_ops.alumno_ops_id")->where("alumno_ops.ru_reg", $datos->ru_reg)->where("alumno_ops.observacion", "VERANO")->groupBy("programacion_ops.alumno_ops_id", "programacion_ops.gestion", "programacion_ops.etapa", "alumno_ops.re_programado")->orderBy("programacion_ops.gestion", "desc")->orderBy("programacion_ops.etapa", "desc")->get(); 
 $matricula_veranos = Matriculas::select("matriculas.*", "alumnos.etapa")->join("alumnos", "alumnos.id", "=", "matriculas.alumno_id")->whereIn("alumnos.id", $alumno_id)->where("tipo_matricula", "Matricula Verano")->orderBy("matriculas.gestion", "desc")->orderBy("alumnos.etapa", "desc")->get(); 
 return view("verano.estado", compact("datos", "programacion_veranos", "alumno_ops_verano", "valor", "costo", "matricula_veranos", "ultimo_curso", "setting_verano")); 
 } 
 $resultado = (new AlumnoAntiguoController())->control_materias_general($datos, $alumno_id, null, "nota_verano"); 
 $materias_aprobadas = $resultado[0]; 
 $materias_reprobadas = $resultado[1]; 
 $optativas = $resultado[2]; 
 $asignaturas_mension = $resultado[3]; 
 $materias_control_ops = $resultado[5]; 
 $asignaturas = Programaciones::select("asignaturas.id", "asignaturas.nivel", "asignaturas.nombre", "asignaturas.paralelo", "asignaturas.id as asignatura_id", "nota_final", "alumnos.carrera_id")->join("alumnos", "alumnos.id", "=", "programaciones.alumno_id")->join("asignaturas", "asignaturas.id", "=", "programaciones.asignatura_id")->join("libreta_regular", "libreta_regular.programacion_id", "=", "programaciones.id")->whereNotIn("asignaturas.id", array_merge($materias_aprobadas, $optativas, $asignaturas_mension, $materias_control_ops))->where("pensum_id", $datos->plan_id)->whereIn("programaciones.alumno_id", $alumno_id)->where("programaciones.estado", 1)->where(function ($query) use($datos) { 
 if ($datos->grado_a == "LICENCIATURA") { 
 $query->where("asignaturas.grado_licenciatura", "SI"); 
 } 
 elseif ($datos->grado_a == "TECNICO SUPERIOR") { 
 $query->where("asignaturas.grado_tecnico_superior", "SI"); 
 } 
 elseif ($datos->grado_a == "TECNICO MEDIO") { 
 $query->where("asignaturas.grado_tecnico_medio", "SI"); 
 } 
 elseif ($datos->grado_a == "AUXILIAR") { 
 $query->where("asignaturas.grado_auxiliar", "SI"); 
 } 
 elseif ($datos->grado_a == "MANO DE OBRA CALIFICADA") { 
 $query->where("asignaturas.grado_modular", "SI"); 
 } 
 $query->where("asignaturas.grado_titulacion", "NO"); 
 } 
)->where("programaciones.gestion", $setting_verano->gestion_verano)->orderby("asignaturas.nivel_numero", "asc")->orderBy("asignaturas.tipo", "asc")->orderBy("asignaturas.id", "asc")->get(); 
 $asignaturas_adelantar = Asignatura::select("id", "nivel", "nombre", "paralelo", "asignaturas.id as asignatura_id")->whereNotIn("id", array_merge($materias_aprobadas, $optativas, $asignaturas_mension))->where("pensum_id", $datos->plan_id)->where("nivel_numero", "=", $ultimo_curso + 1)->where("lista", 0)->where(function ($query) use($datos) { 
 if ($datos->grado_a == "LICENCIATURA") { 
 $query->where("asignaturas.grado_licenciatura", "SI"); 
 } 
 elseif ($datos->grado_a == "TECNICO SUPERIOR") { 
 $query->where("asignaturas.grado_tecnico_superior", "SI"); 
 } 
 elseif ($datos->grado_a == "TECNICO MEDIO") { 
 $query->where("asignaturas.grado_tecnico_medio", "SI"); 
 } 
 elseif ($datos->grado_a == "AUXILIAR") { 
 $query->where("asignaturas.grado_auxiliar", "SI"); 
 } 
 elseif ($datos->grado_a == "MANO DE OBRA CALIFICADA") { 
 $query->where("asignaturas.grado_modular", "SI"); 
 } 
 $query->where("asignaturas.grado_titulacion", "NO"); 
 } 
)->orderby("nivel_numero", "asc")->orderBy("asignaturas.tipo", "asc")->orderBy("asignaturas.id", "asc")->get(); 
 return view("verano.estado", compact("datos", "asignaturas", "asignaturas_adelantar", "ultimo_curso", "setting_verano", "materias_control_ops")); 
 } 
 catch (\Exception $e) { 
 return view("errors.404"); 
 } 
 } 
 public function programar(Request $request) { 
 \DB::beginTransaction(); 
 try { 
 if (!isset($request->asignatura) || count($request->asignatura) == 0) { 
 return redirect()->back()->with("infoerror", "SELECCIONE ALGUNA ASIGNATURA!!!"); 
 } 
 if (count($request->asignatura) > Setting_globals::find(1)->cantidad_materia_verano) { 
 return redirect()->back()->with("infoerror", "SELECCIONE SOLO " . Setting_globals::find(1)->cantidad_materia_verano . " ASIGNATURAS!!!"); 
 } 
 $adelantar = null; 
 if (isset($request->adelantar)) { 
 $adelantar = $request->adelantar; 
 } 
 $alumno = Alumno::find($request->alumno); 
 $alumno_ops = new AlumnoOps(); 
 $alumno_ops->ra = $alumno->ra; 
 $alumno_ops->ru_reg = $alumno->ru_reg; 
 $alumno_ops->gestion = Setting_globals::find(1)->gestion_verano; 
 $alumno_ops->fecha = date("Y-m-d"); 
 $alumno_ops->observacion = "VERANO"; 
 $alumno_ops->persona_id = $alumno->persona_id; 
 $alumno_ops->alumno_id = $alumno->id; 
 $alumno_ops->user_registro = Auth::user()->id; 
 if (isset($request->ultimo_curso) && $request->ultimo_curso != null) { 
 $alumno_ops->curso_ops = $request->ultimo_curso; 
 } 
 if ($request->registro_p != null) { 
 $alumno_ops->programacion_activa = "SI"; 
 } 
 $alumno_ops->save(); 
 $asignaturas = Asignatura::whereIn("id", $request->asignatura)->get(); 
 $contado_paralelos = count($request->paralelo); 
 foreach ($asignaturas as $key => $value) { 
 $programacion = new ProgramacionOps(); 
 for ($i = 0; 
 $i < $contado_paralelos; 
 $i++) { 
 $array_paralelo = explode("-", $request->paralelo[$i]); 
 if (in_array($value->id, $array_paralelo)) { 
 $programacion->paralelo = $array_paralelo[1]; 
 } 
 } 
 $programacion->fecha = date("Y-m-d"); 
 $programacion->alumno_ops_id = $alumno_ops->id; 
 $programacion->asignatura_id = $value->id; 
 $programacion->user_id = Auth::user()->id; 
 $programacion->observacion = "VERANO"; 
 if ($adelantar != null) { 
 if (in_array($value->id, $adelantar)) { 
 $programacion->verano_adelantar = "SI"; 
 $programacion->gestion = $alumno_ops->gestion + 1; 
 $alumno_ops->verano_adelantar = "SI"; 
 } 
 else { 
 $programacion->gestion = $alumno_ops->gestion; 
 } 
 } 
 else { 
 $programacion->gestion = $alumno_ops->gestion; 
 } 
 $programacion->save(); 
 $libreta = new LibretaOps(); 
 $libreta->programacion_ops_id = $programacion->id; 
 $libreta->save(); 
 } 
 $alumno_ops->programado = "SI"; 
 $alumno_ops->update(); 
 \DB::commit(); 
 return redirect()->to("imprimir_programacion/" . $alumno_ops->id . "/V"); 
 } 
 catch (\Exception $e) { 
 \DB::rollback(); 
 return view("errors.404"); 
 } 
 } 
 public function re_programar_estado($alumno_ops_id) { 
 try { 
 $alumno_ops = AlumnoOps::find($alumno_ops_id); 
 $programacion_verano = ProgramacionOps::select("asignaturas.id as asignatura_id", "cancelado")->join("asignaturas", "asignaturas.id", "=", "programacion_ops.asignatura_id")->where("alumno_ops_id", $alumno_ops_id)->where("programacion_ops.observacion", "VERANO")->get(); 
 $asignatura_verano = array(); 
 foreach ($programacion_verano as $value) { 
 $asignatura_verano[] = $value->asignatura_id . "-" . $value->cancelado; 
 } 
 $setting_verano = Setting_globals::select("gestion_verano", "cantidad_materia_verano")->first(); 
 $datos = Alumno::select("tipo_alumno", "matriculado", "alumnos.id as alumno_id", "curso_numeral", "plan_id", "alumnos.nivel as grado_a", "personas.nombre", "apellidos", "ci_persona", "genero", "activated", "ru_reg", "ra", "alumnos.gestion", "alumnos.fecha as fecha_alumno", "nombre_area", "nombre_carrera", "nombre_extension", "year", "carrera_paralela", "tipo_inscripcion", "alumnos.curso", "cambio", "tipo_alumno", "reprogramado", "reprogramado", "modalidad_titulacion_id", "convenio_id", "modalidad_activa", "alumnos.carrera_id")->join("personas", "personas.id", "=", "alumnos.persona_id")->join("areas", "areas.id", "=", "alumnos.area_id")->join("carreras", "carreras.id", "=", "alumnos.carrera_id")->join("extensiones", "extensiones.id", "=", "alumnos.extension_id")->join("users", "users.persona_id", "=", "personas.id")->join("pensums", "pensums.id", "=", "alumnos.plan_id")->where("alumnos.bloqueado_cambio", "NO")->where("alumnos.id", $alumno_ops->alumno_id)->orderBy("alumnos.id", "asc")->first(); 
 $alm_dato = Alumno::select("curso_numeral", "alumnos.id as alumno_id")->where("ru_reg", Alumno::find($alumno_ops->alumno_id)->ru_reg)->get(); 
 if ($datos->tipo_alumno == "nuevo" && $datos->matriculado == "NO") { 
 return redirect()->to("estado_alumno/" . $datos->alumno_id); 
 } 
 $cu = array(); 
 $alumno_id = array(); 
 foreach ($alm_dato as $key => $value) { 
 $cu[] = $value->curso_numeral; 
 $alumno_id[] = $value->alumno_id; 
 } 
 $resultado = (new AlumnoAntiguoController())->control_materias_general($datos, $alumno_id, null, "nota_verano"); 
 $materias_aprobadas = $resultado[0]; 
 $materias_reprobadas = $resultado[1]; 
 $optativas = $resultado[2]; 
 $asignaturas_mension = $resultado[3]; 
 $materias_control_ops = $resultado[5]; 
 $asignaturas = Asignatura::select("id", "nivel", "nombre", "paralelo", "asignaturas.id as asignatura_id")->whereNotIn("id", array_merge($materias_aprobadas, $optativas, $asignaturas_mension, $materias_control_ops))->where("pensum_id", $datos->plan_id)->where("nivel_numero", "<=", $alumno_ops->curso_ops)->where("lista", 0)->where(function ($query) use($datos) { 
 if ($datos->grado_a == "LICENCIATURA") { 
 $query->where("asignaturas.grado_licenciatura", "SI"); 
 } 
 elseif ($datos->grado_a == "TECNICO SUPERIOR") { 
 $query->where("asignaturas.grado_tecnico_superior", "SI"); 
 } 
 elseif ($datos->grado_a == "TECNICO MEDIO") { 
 $query->where("asignaturas.grado_tecnico_medio", "SI"); 
 } 
 elseif ($datos->grado_a == "AUXILIAR") { 
 $query->where("asignaturas.grado_auxiliar", "SI"); 
 } 
 elseif ($datos->grado_a == "MANO DE OBRA CALIFICADA") { 
 $query->where("asignaturas.grado_modular", "SI"); 
 } 
 $query->where("asignaturas.grado_titulacion", "NO"); 
 } 
)->orderby("nivel_numero", "asc")->orderBy("asignaturas.tipo", "asc")->orderBy("asignaturas.id", "asc")->get(); 
 return view("verano.estado_re_programar", compact("datos", "asignaturas", "asignatura_verano", "alumno_ops", "setting_verano", "materias_control_ops")); 
 } 
 catch (\Exception $e) { 
 return view("errors.404"); 
 } 
 } 
 public function re_programar_update(Request $request) { 
 \DB::beginTransaction(); 
 try { 
 $alumno_ops = AlumnoOps::find($request->alumno_ops); 
 if ($alumno_ops->re_programado == "SI") { 
 return redirect()->back()->with("infoerror", "LAS ASIGNATURAS YA FUERON RE-PROGRAMADOS!!!"); 
 } 
 if (!isset($request->asignatura) || count($request->asignatura) == 0) { 
 return redirect()->back()->with("infoerror", "SELECCIONE ALGUNA ASIGNATURA!!!"); 
 } 
 if (count($request->asignatura) > Setting_globals::find(1)->cantidad_materia_verano) { 
 return redirect()->back()->with("infoerror", "SELECCIONE SOLO " . Setting_globals::find(1)->cantidad_materia_verano . " ASIGNATURAS!!!"); 
 } 
 $asignaturas = $request->asignatura; 
 $asig_m = ProgramacionOps::select("programacion_ops.id as prog_id", "asignaturas.id as asignatura_id", "cancelado")->join("asignaturas", "asignaturas.id", "=", "programacion_ops.asignatura_id")->where("alumno_ops_id", $alumno_ops->id)->where("programacion_ops.observacion", "VERANO")->get(); 
 $id_destroy = array(); 
 $id_no_destroy = array(); 
 foreach ($asig_m as $value) { 
 $po = ProgramacionOps::find($value->prog_id); 
 if ($asignaturas !== null) { 
 if (in_array($value->asignatura_id, $asignaturas)) { 
 if (($clave = array_search($value->asignatura_id, $asignaturas)) !== false) { 
 unset($asignaturas[$clave]); 
 } 
 } 
 else { 
 $id_destroy[] = $value->prog_id; 
 } 
 } 
 } 
 $asig_m_libreta = LibretaOps::select("libreta_ops.id as id_lib", "programacion_ops.id as programacion_id")->join("programacion_ops", "programacion_ops.id", "=", "libreta_ops.programacion_ops_id")->whereIn("programacion_ops_id", $id_destroy)->get(); 
 $id_destroy_libreta = array(); 
 $id_destroy_programacion = array(); 
 foreach ($asig_m_libreta as $value_libreta) { 
 $id_destroy_libreta[] = $value_libreta->id_lib; 
 $id_destroy_programacion[] = $value_libreta->programacion_id; 
 } 
 LibretaOps::destroy($id_destroy_libreta); 
 ProgramacionOps::destroy($id_destroy_programacion); 
 $alumno_ops->re_programado = "SI"; 
 $alumno_ops->update(); 
 \DB::commit(); 
 if (!isset($asignaturas) || count($asignaturas) == 0 || $asignaturas == null) { 
 return redirect()->to("estado_verano/" . $alumno_ops->alumno_id)->with("info", "Las asignaturas fueron reprogramadas con exito!!"); 
 } 
 $asignaturas_p = Asignatura::whereIn("id", $asignaturas)->get(); 
 $contado_paralelos = count($request->paralelo); 
 foreach ($asignaturas_p as $key => $value) { 
 $programacion = new ProgramacionOps(); 
 for ($i = 0; 
 $i < $contado_paralelos; 
 $i++) { 
 $array_paralelo = explode("-", $request->paralelo[$i]); 
 if (in_array($value->id, $array_paralelo)) { 
 $programacion->paralelo = $array_paralelo[1]; 
 } 
 } 
 $programacion->gestion = $alumno_ops->gestion; 
 $programacion->fecha = date("Y-m-d"); 
 $programacion->alumno_ops_id = $alumno_ops->id; 
 $programacion->asignatura_id = $value->id; 
 $programacion->user_id = Auth::user()->id; 
 $programacion->observacion = "VERANO"; 
 $programacion->save(); 
 $libreta = new LibretaOps(); 
 $libreta->programacion_ops_id = $programacion->id; 
 $libreta->save(); 
 } 
 if ($alumno_ops->matriculado == "SI") { 
 $alumno_ops->matriculado = "NO"; 
 } 
 if ($request->registro_p != null) { 
 $alumno_ops->programacion_activa = "SI"; 
 } 
 else { 
 $alumno_ops->programacion_activa = "NO"; 
 } 
 $alumno_ops->update(); 
 \DB::commit(); 
 return redirect()->to("estado_verano/" . $alumno_ops->alumno_id)->with("info", "Las asignaturas fueron reprogramadas con exito!!"); 
 } 
 catch (\Exception $e) { 
 \DB::rollback(); 
 return redirect()->back(); 
 } 
 } 
 } 
 ?>

Did this file decode correctly?

Original Code

<?php

 namespace App\Http\Controllers;
 use Illuminate\Http\Request;
 use Auth;
 use App\Alumno;
 use App\AlumnoOps;
 use App\Setting_globals;
 use App\ProgramacionOps;
 use App\LibretaOps;
 use App\ValoresDetalles;
 use App\Asignatura;
 use App\Matriculas;
 use App\Programaciones;
 use App\Pensum;
 use App\Persona;
 use App\Libreta_Regular;
 use App\MontoInscripcion;
 use App\Docentes;
 use App\Mesa;
 use App\CargaHoraria;
 use App\Libreta_Verano;
 use App\AsignaturaDocente;
 use App\Http\Controllers\AlumnoAntiguoController;
 class VeranosController extends Controller {
 public function estado_verano($id) {
 try {
 $dato = Alumno::select("\164\x69\160\x6f\x5f\141\154\165\x6d\x6e\x6f", "\155\x61\164\x72\151\143\x75\x6c\x61\144\x6f", "\x61\x6c\165\155\156\x6f\x73\56\151\144\x20\x61\x73\x20\141\x6c\165\155\x6e\157\137\x69\x64", "\143\x75\162\163\157\x5f\x6e\x75\x6d\x65\162\141\x6c", "\x70\154\141\x6e\137\x69\x64", "\x61\154\165\x6d\x6e\157\163\x2e\x6e\151\166\x65\x6c\x20\141\x73\40\x67\x72\x61\x64\157\137\x61", "\160\145\162\x73\157\156\141\163\x2e\x6e\157\x6d\x62\x72\x65", "\141\x70\145\154\154\x69\x64\157\x73", "\x63\x69\137\x70\145\162\163\157\x6e\x61", "\147\145\x6e\x65\x72\157", "\141\143\x74\x69\166\141\164\x65\x64", "\162\165\x5f\162\x65\147", "\x72\141", "\x61\x6c\165\155\156\157\x73\56\147\145\x73\x74\x69\x6f\156", "\x61\x6c\165\155\x6e\157\x73\x2e\146\145\143\x68\x61\40\141\x73\40\x66\145\143\x68\x61\137\x61\154\x75\x6d\x6e\x6f", "\x6e\x6f\x6d\x62\162\x65\137\141\x72\145\x61", "\x6e\157\155\x62\x72\145\137\x63\x61\x72\162\145\x72\141", "\156\x6f\155\142\162\x65\137\x65\170\x74\x65\x6e\x73\151\157\156", "\171\x65\141\162", "\143\141\162\162\145\162\x61\137\160\141\x72\x61\154\145\x6c\x61", "\164\x69\x70\x6f\137\151\x6e\163\x63\162\151\160\143\x69\x6f\x6e", "\x61\154\165\155\x6e\157\x73\x2e\143\165\x72\163\157", "\143\141\155\142\x69\157", "\164\151\160\x6f\x5f\x61\x6c\x75\x6d\156\x6f", "\162\x65\160\x72\x6f\x67\x72\x61\155\141\x64\x6f", "\x72\145\x70\x72\157\x67\162\141\155\141\144\x6f", "\155\x6f\144\x61\154\151\144\x61\144\137\x74\151\x74\x75\154\141\x63\x69\x6f\x6e\137\151\x64", "\x63\157\x6e\x76\145\156\x69\x6f\137\151\x64", "\x6d\x6f\144\141\154\x69\144\141\144\137\x61\x63\x74\151\x76\x61", "\x70\x72\x6f\147\162\141\155\x61\x63\x69\157\156\x5f\x61\x63\x74\x69\x76\x61", "\x61\154\165\155\156\157\x73\56\143\x61\x72\162\x65\x72\141\x5f\x69\144")->join("\160\x65\x72\x73\157\156\x61\x73", "\160\x65\x72\x73\157\156\141\x73\56\x69\x64", "\75", "\x61\154\x75\x6d\156\157\163\56\160\x65\162\163\157\x6e\141\137\151\x64")->join("\141\162\145\141\163", "\x61\x72\145\141\x73\x2e\151\144", "\x3d", "\141\x6c\x75\x6d\x6e\157\163\56\x61\x72\x65\x61\137\x69\x64")->join("\143\x61\x72\162\x65\x72\x61\163", "\x63\141\x72\x72\145\162\x61\x73\56\151\x64", "\75", "\x61\154\x75\155\x6e\x6f\x73\56\143\x61\162\x72\x65\x72\x61\137\x69\x64")->join("\x65\170\x74\x65\x6e\163\151\157\x6e\x65\163", "\145\x78\164\x65\x6e\163\151\157\156\x65\x73\56\x69\144", "\x3d", "\x61\154\165\155\156\157\x73\56\x65\x78\164\145\x6e\163\151\x6f\x6e\x5f\x69\x64")->join("\165\163\145\162\x73", "\165\163\145\x72\x73\x2e\160\145\162\163\x6f\x6e\x61\x5f\x69\x64", "\75", "\160\145\x72\x73\x6f\156\141\x73\56\151\x64")->join("\x70\145\x6e\163\165\155\163", "\x70\145\156\x73\165\155\x73\x2e\x69\144", "\x3d", "\x61\x6c\165\155\x6e\x6f\163\56\160\154\x61\156\x5f\x69\144")->where("\141\x6c\x75\x6d\156\x6f\163\56\142\154\x6f\x71\x75\145\x61\144\157\x5f\143\141\155\142\151\157", "\116\117")->where("\162\x75\137\x72\x65\x67", Alumno::find($id)->ru_reg)->orderBy("\x61\x6c\165\155\x6e\157\x73\56\151\x64", "\141\x73\x63")->get();
 $datos = $dato->where("\x63\x75\155\x70\x6c\x69\144\x6f", 0)->last();
 $setting_verano = Setting_globals::select("\147\x65\163\164\151\x6f\156\137\x76\145\162\141\156\x6f", "\x63\141\x6e\164\x69\144\141\144\137\x6d\x61\x74\145\x72\x69\x61\x5f\x76\145\x72\141\x6e\157")->first();
 if ($datos->tipo_alumno == "\x6e\165\x65\x76\x6f" && $datos->matriculado == "\116\x4f") {
 return redirect()->to("\x65\x73\x74\141\144\x6f\137\141\x6c\165\155\x6e\157\57" . $datos->alumno_id);
 }
 $cu = array();
 $alumno_id = array();
 foreach ($dato as $key => $value) {
 $cu[] = $value->curso_numeral;
 $alumno_id[] = $value->alumno_id;
 }
 $ultimo_curso = max($cu);
 $alumno_ops_verano = AlumnoOps::where("\x67\x65\163\164\x69\x6f\x6e", Setting_globals::find(1)->gestion_verano)->where("\162\x75\137\162\145\147", $datos->ru_reg)->where("\x6f\142\163\x65\162\x76\141\143\151\x6f\x6e", "\126\x45\x52\x41\116\117")->first();
 if ($alumno_ops_verano != null) {
 $materias_verano = ProgramacionOps::where("\141\x6c\x75\155\x6e\157\x5f\x6f\160\x73\137\x69\x64", $alumno_ops_verano->id)->where("\160\162\x6f\147\162\141\x6d\x61\143\x69\157\x6e\x5f\x6f\160\163\56\157\x62\x73\145\x72\x76\141\x63\151\x6f\x6e", "\x56\x45\122\101\x4e\x4f")->where("\x65\x73\164\141\x64\x6f", 1)->where("\143\x61\156\143\x65\154\x61\144\x6f", "\x4e\x4f")->count();
 $valor = ValoresDetalles::join("\166\x61\x6c\157\162\x65\163", "\166\141\x6c\x6f\x72\145\x73\56\x69\144", "\75", "\166\141\154\157\x72\145\163\137\x64\x65\x74\x61\154\154\x65\163\56\x76\141\x6c\x6f\x72\x5f\151\x64")->where("\x76\141\154\x6f\162\x65\x73\x2e\x63\157\x6e\x63\x65\160\164\x6f", "\115\x61\x74\x72\151\143\165\154\141\40\x56\145\x72\x61\156\157")->first();
 $costo = $valor->costo * $materias_verano;
 $programacion_veranos = ProgramacionOps::select("\x70\162\157\x67\x72\141\155\141\x63\x69\157\156\137\x6f\160\x73\x2e\141\x6c\165\155\x6e\157\137\x6f\160\x73\x5f\x69\x64", "\160\162\157\147\x72\x61\155\141\143\x69\157\156\x5f\157\160\163\x2e\147\x65\x73\x74\151\x6f\156", "\x70\x72\157\147\162\141\x6d\141\x63\151\x6f\156\137\x6f\160\x73\x2e\145\164\x61\160\141", "\141\x6c\x75\155\156\x6f\x5f\157\x70\x73\x2e\162\145\137\160\162\x6f\x67\162\x61\155\141\x64\157")->join("\x61\x6c\x75\x6d\156\x6f\137\x6f\x70\x73", "\141\x6c\x75\155\x6e\x6f\137\x6f\x70\x73\56\151\144", "\75", "\x70\x72\x6f\147\x72\141\x6d\141\143\x69\157\x6e\137\x6f\x70\x73\56\141\x6c\x75\x6d\x6e\157\137\157\x70\163\x5f\151\x64")->where("\x61\x6c\x75\x6d\156\x6f\x5f\x6f\160\x73\56\x72\x75\x5f\162\145\147", $datos->ru_reg)->where("\141\x6c\x75\x6d\156\x6f\137\157\160\163\56\157\x62\163\145\162\x76\141\143\x69\157\x6e", "\126\x45\x52\101\x4e\117")->groupBy("\x70\162\x6f\147\162\141\x6d\141\143\x69\157\x6e\x5f\157\160\163\56\141\x6c\165\155\x6e\157\x5f\x6f\160\x73\137\151\144", "\160\x72\157\x67\x72\141\155\141\143\151\157\156\137\x6f\x70\163\x2e\x67\x65\163\164\151\157\156", "\160\x72\x6f\x67\162\x61\155\141\143\x69\157\x6e\137\x6f\x70\163\56\x65\x74\141\160\x61", "\x61\x6c\165\155\x6e\x6f\137\157\160\163\56\162\145\137\x70\162\x6f\x67\x72\x61\155\x61\144\x6f")->orderBy("\160\162\x6f\x67\162\x61\155\141\143\151\157\156\137\157\x70\163\x2e\147\145\x73\164\151\157\156", "\144\145\x73\x63")->orderBy("\160\x72\x6f\147\162\x61\155\141\143\x69\x6f\156\x5f\157\x70\163\56\145\x74\141\x70\141", "\144\x65\163\143")->get();
 $matricula_veranos = Matriculas::select("\155\141\164\x72\x69\143\165\154\141\163\56\52", "\141\x6c\x75\x6d\x6e\157\x73\56\x65\164\141\160\141")->join("\141\154\x75\155\156\157\163", "\141\154\x75\x6d\156\x6f\x73\56\151\x64", "\75", "\x6d\x61\x74\x72\151\x63\x75\154\x61\163\x2e\x61\x6c\165\x6d\x6e\x6f\137\x69\x64")->whereIn("\141\154\165\155\156\157\x73\56\x69\x64", $alumno_id)->where("\164\151\160\x6f\137\x6d\141\x74\x72\x69\x63\x75\154\x61", "\x4d\x61\164\x72\151\x63\165\x6c\x61\x20\126\x65\162\141\x6e\157")->orderBy("\155\141\164\x72\151\143\165\x6c\141\163\56\147\x65\163\x74\x69\157\156", "\144\x65\x73\x63")->orderBy("\141\x6c\x75\x6d\156\157\x73\x2e\145\164\141\160\141", "\144\145\x73\143")->get();
 return view("\166\x65\x72\x61\x6e\157\x2e\x65\163\164\x61\144\x6f", compact("\144\x61\x74\157\x73", "\160\x72\157\x67\162\141\x6d\x61\x63\151\x6f\x6e\137\166\145\x72\x61\156\157\x73", "\x61\x6c\x75\x6d\x6e\x6f\x5f\x6f\x70\163\137\166\145\x72\141\x6e\x6f", "\166\x61\154\x6f\x72", "\x63\x6f\163\x74\x6f", "\x6d\141\164\162\x69\143\165\x6c\x61\x5f\166\x65\x72\141\156\x6f\163", "\165\154\164\x69\155\x6f\x5f\x63\165\162\163\157", "\x73\x65\x74\164\151\x6e\147\137\166\145\162\141\156\157"));
 }
 $resultado = (new AlumnoAntiguoController())->control_materias_general($datos, $alumno_id, null, "\156\157\164\141\x5f\x76\145\x72\x61\x6e\x6f");
 $materias_aprobadas = $resultado[0];
 $materias_reprobadas = $resultado[1];
 $optativas = $resultado[2];
 $asignaturas_mension = $resultado[3];
 $materias_control_ops = $resultado[5];
 $asignaturas = Programaciones::select("\x61\x73\151\147\x6e\x61\x74\165\x72\x61\x73\x2e\151\x64", "\141\x73\x69\x67\x6e\141\x74\165\x72\141\x73\56\x6e\x69\166\145\154", "\141\x73\x69\x67\156\x61\x74\165\x72\141\163\56\156\x6f\155\142\162\x65", "\x61\x73\x69\147\x6e\141\164\165\x72\141\163\56\x70\141\x72\141\x6c\x65\154\x6f", "\x61\x73\x69\147\x6e\141\x74\165\x72\141\163\56\151\x64\x20\x61\x73\x20\x61\163\151\147\156\141\x74\x75\162\x61\x5f\x69\x64", "\x6e\157\164\x61\137\146\151\x6e\141\154", "\x61\154\165\155\156\x6f\163\56\143\x61\x72\x72\x65\x72\x61\137\x69\144")->join("\141\154\165\155\x6e\x6f\x73", "\141\x6c\165\x6d\x6e\x6f\163\56\151\x64", "\75", "\x70\162\x6f\147\162\x61\x6d\x61\x63\151\x6f\156\145\x73\56\141\x6c\x75\155\x6e\157\137\x69\144")->join("\141\x73\151\147\x6e\141\x74\x75\162\x61\163", "\141\x73\x69\147\x6e\141\164\x75\x72\x61\163\x2e\x69\144", "\x3d", "\160\x72\157\147\162\x61\x6d\x61\143\x69\x6f\x6e\x65\163\56\x61\x73\151\x67\x6e\141\x74\x75\x72\141\137\151\144")->join("\x6c\151\x62\x72\x65\164\141\137\162\145\x67\x75\154\141\x72", "\154\151\x62\162\x65\164\x61\x5f\162\x65\x67\165\154\x61\x72\x2e\160\162\x6f\147\x72\141\155\141\x63\151\157\156\x5f\x69\x64", "\75", "\x70\x72\x6f\x67\162\141\x6d\141\x63\x69\157\156\x65\163\x2e\x69\x64")->whereNotIn("\141\x73\151\x67\156\141\x74\165\x72\141\x73\x2e\x69\x64", array_merge($materias_aprobadas, $optativas, $asignaturas_mension, $materias_control_ops))->where("\x70\145\156\163\165\x6d\137\x69\144", $datos->plan_id)->whereIn("\x70\x72\157\147\x72\141\x6d\x61\x63\x69\x6f\156\x65\x73\56\141\154\x75\155\156\157\x5f\151\x64", $alumno_id)->where("\x70\x72\157\147\x72\141\x6d\141\143\x69\157\x6e\x65\x73\x2e\145\x73\x74\141\144\157", 1)->where(function ($query) use($datos) {
 if ($datos->grado_a == "\x4c\111\x43\105\116\103\x49\x41\x54\x55\x52\x41") {
 $query->where("\141\x73\x69\x67\156\141\x74\x75\x72\141\163\x2e\x67\162\x61\144\x6f\x5f\x6c\151\143\x65\x6e\143\151\x61\x74\165\x72\x61", "\x53\x49");
 }
 elseif ($datos->grado_a == "\124\x45\x43\116\111\x43\117\x20\x53\125\120\x45\122\x49\117\x52") {
 $query->where("\x61\163\151\x67\x6e\x61\164\165\x72\141\x73\x2e\147\x72\x61\x64\157\137\x74\145\143\156\x69\x63\157\137\163\x75\160\x65\162\151\x6f\162", "\x53\x49");
 }
 elseif ($datos->grado_a == "\x54\105\x43\x4e\111\x43\x4f\40\115\105\x44\111\x4f") {
 $query->where("\x61\x73\151\x67\156\141\x74\165\162\x61\163\56\147\x72\141\144\x6f\x5f\164\x65\143\x6e\x69\143\x6f\137\155\145\x64\151\157", "\123\x49");
 }
 elseif ($datos->grado_a == "\101\x55\x58\111\114\x49\101\x52") {
 $query->where("\141\x73\151\x67\156\x61\164\165\x72\141\x73\56\x67\162\x61\144\x6f\137\x61\x75\170\x69\154\x69\141\162", "\x53\x49");
 }
 elseif ($datos->grado_a == "\115\x41\x4e\x4f\40\104\x45\x20\117\102\x52\x41\x20\x43\x41\114\111\106\111\103\101\104\x41") {
 $query->where("\141\163\151\x67\x6e\141\x74\165\162\141\x73\56\x67\x72\x61\144\157\137\155\157\144\x75\x6c\x61\162", "\x53\x49");
 }
 $query->where("\x61\x73\x69\147\156\x61\x74\x75\x72\x61\163\x2e\147\162\141\144\157\137\x74\x69\164\165\x6c\141\143\x69\157\x6e", "\116\x4f");
 }
)->where("\x70\x72\x6f\147\x72\x61\155\141\143\151\157\156\x65\163\x2e\147\x65\163\x74\151\157\156", $setting_verano->gestion_verano)->orderby("\141\163\151\147\x6e\x61\164\x75\162\141\163\56\x6e\151\166\145\x6c\137\x6e\x75\x6d\145\x72\157", "\141\163\143")->orderBy("\141\x73\x69\x67\x6e\x61\x74\165\162\141\x73\56\x74\151\x70\x6f", "\x61\x73\143")->orderBy("\x61\163\x69\147\156\141\x74\x75\162\x61\163\56\151\144", "\141\163\x63")->get();
 $asignaturas_adelantar = Asignatura::select("\151\x64", "\156\151\166\145\154", "\156\x6f\155\x62\162\145", "\x70\x61\162\x61\x6c\x65\x6c\157", "\141\163\x69\147\156\x61\x74\165\x72\141\163\x2e\x69\x64\x20\141\163\40\x61\163\x69\x67\156\141\164\165\162\x61\137\x69\144")->whereNotIn("\151\x64", array_merge($materias_aprobadas, $optativas, $asignaturas_mension))->where("\x70\x65\x6e\x73\165\x6d\x5f\151\x64", $datos->plan_id)->where("\x6e\151\x76\145\x6c\x5f\x6e\165\x6d\145\162\157", "\75", $ultimo_curso + 1)->where("\x6c\151\x73\164\141", 0)->where(function ($query) use($datos) {
 if ($datos->grado_a == "\114\111\x43\x45\x4e\x43\x49\x41\x54\125\x52\x41") {
 $query->where("\x61\x73\x69\147\156\x61\x74\165\x72\x61\163\56\147\162\141\144\157\x5f\x6c\151\x63\145\156\x63\x69\141\x74\165\x72\x61", "\x53\x49");
 }
 elseif ($datos->grado_a == "\x54\x45\103\x4e\111\103\117\x20\123\x55\120\105\122\111\x4f\122") {
 $query->where("\x61\x73\151\x67\x6e\141\x74\x75\x72\141\x73\x2e\147\x72\141\144\x6f\x5f\x74\145\143\x6e\x69\x63\x6f\x5f\x73\165\x70\145\x72\x69\157\162", "\x53\111");
 }
 elseif ($datos->grado_a == "\124\105\103\116\111\103\x4f\x20\115\105\104\111\117") {
 $query->where("\x61\x73\x69\147\x6e\141\x74\165\162\141\x73\x2e\147\x72\141\x64\x6f\137\164\145\x63\x6e\151\143\157\x5f\x6d\145\x64\151\x6f", "\x53\x49");
 }
 elseif ($datos->grado_a == "\101\x55\130\x49\114\111\101\x52") {
 $query->where("\x61\x73\x69\x67\x6e\141\x74\x75\162\141\x73\x2e\147\162\x61\144\157\x5f\x61\165\x78\x69\x6c\x69\x61\x72", "\123\x49");
 }
 elseif ($datos->grado_a == "\115\x41\x4e\117\x20\104\x45\x20\x4f\102\122\101\40\x43\x41\x4c\x49\x46\x49\x43\101\x44\101") {
 $query->where("\x61\163\151\x67\x6e\141\x74\165\x72\141\x73\56\x67\x72\141\144\157\137\155\x6f\x64\x75\154\141\162", "\x53\111");
 }
 $query->where("\141\x73\151\147\156\x61\164\165\x72\141\163\x2e\x67\162\x61\x64\x6f\137\x74\x69\x74\x75\x6c\x61\x63\151\x6f\x6e", "\x4e\117");
 }
)->orderby("\156\x69\x76\145\154\137\156\x75\155\145\x72\157", "\x61\163\x63")->orderBy("\x61\163\x69\x67\x6e\141\x74\x75\162\141\x73\x2e\164\151\160\157", "\141\x73\x63")->orderBy("\141\x73\151\147\x6e\x61\164\165\x72\x61\x73\56\151\144", "\x61\x73\143")->get();
 return view("\x76\x65\162\141\x6e\x6f\x2e\145\163\164\141\144\157", compact("\x64\141\164\157\163", "\x61\x73\151\x67\156\141\164\165\162\141\x73", "\x61\x73\151\147\x6e\141\x74\x75\162\x61\163\137\141\x64\145\x6c\x61\x6e\x74\x61\162", "\x75\154\164\x69\155\157\137\x63\x75\x72\x73\157", "\x73\145\x74\x74\x69\x6e\x67\137\x76\145\x72\141\x6e\157", "\155\141\x74\145\x72\x69\x61\163\137\x63\157\x6e\164\162\x6f\154\x5f\x6f\x70\x73"));
 }
 catch (\Exception $e) {
 return view("\x65\162\162\x6f\x72\163\x2e\x34\x30\x34");
 }
 }
 public function programar(Request $request) {
 \DB::beginTransaction();
 try {
 if (!isset($request->asignatura) || count($request->asignatura) == 0) {
 return redirect()->back()->with("\x69\156\146\157\145\162\x72\x6f\162", "\123\x45\114\x45\x43\x43\x49\117\116\x45\40\101\x4c\107\125\x4e\x41\x20\101\x53\x49\107\116\101\124\125\x52\101\41\41\41");
 }
 if (count($request->asignatura) > Setting_globals::find(1)->cantidad_materia_verano) {
 return redirect()->back()->with("\x69\156\146\157\x65\162\x72\x6f\162", "\x53\105\114\105\103\103\111\117\x4e\x45\x20\123\117\114\117\40" . Setting_globals::find(1)->cantidad_materia_verano . "\40\x41\123\111\x47\116\x41\124\x55\x52\101\x53\41\41\x21");
 }
 $adelantar = null;
 if (isset($request->adelantar)) {
 $adelantar = $request->adelantar;
 }
 $alumno = Alumno::find($request->alumno);
 $alumno_ops = new AlumnoOps();
 $alumno_ops->ra = $alumno->ra;
 $alumno_ops->ru_reg = $alumno->ru_reg;
 $alumno_ops->gestion = Setting_globals::find(1)->gestion_verano;
 $alumno_ops->fecha = date("\x59\x2d\155\55\x64");
 $alumno_ops->observacion = "\x56\105\x52\x41\116\x4f";
 $alumno_ops->persona_id = $alumno->persona_id;
 $alumno_ops->alumno_id = $alumno->id;
 $alumno_ops->user_registro = Auth::user()->id;
 if (isset($request->ultimo_curso) && $request->ultimo_curso != null) {
 $alumno_ops->curso_ops = $request->ultimo_curso;
 }
 if ($request->registro_p != null) {
 $alumno_ops->programacion_activa = "\123\x49";
 }
 $alumno_ops->save();
 $asignaturas = Asignatura::whereIn("\x69\144", $request->asignatura)->get();
 $contado_paralelos = count($request->paralelo);
 foreach ($asignaturas as $key => $value) {
 $programacion = new ProgramacionOps();
 for ($i = 0;
 $i < $contado_paralelos;
 $i++) {
 $array_paralelo = explode("\55", $request->paralelo[$i]);
 if (in_array($value->id, $array_paralelo)) {
 $programacion->paralelo = $array_paralelo[1];
 }
 }
 $programacion->fecha = date("\x59\55\x6d\55\144");
 $programacion->alumno_ops_id = $alumno_ops->id;
 $programacion->asignatura_id = $value->id;
 $programacion->user_id = Auth::user()->id;
 $programacion->observacion = "\126\x45\x52\101\116\117";
 if ($adelantar != null) {
 if (in_array($value->id, $adelantar)) {
 $programacion->verano_adelantar = "\123\x49";
 $programacion->gestion = $alumno_ops->gestion + 1;
 $alumno_ops->verano_adelantar = "\123\x49";
 }
 else {
 $programacion->gestion = $alumno_ops->gestion;
 }
 }
 else {
 $programacion->gestion = $alumno_ops->gestion;
 }
 $programacion->save();
 $libreta = new LibretaOps();
 $libreta->programacion_ops_id = $programacion->id;
 $libreta->save();
 }
 $alumno_ops->programado = "\x53\111";
 $alumno_ops->update();
 \DB::commit();
 return redirect()->to("\x69\155\x70\162\151\155\151\162\137\x70\162\157\147\x72\141\155\x61\143\x69\x6f\156\57" . $alumno_ops->id . "\x2f\126");
 }
 catch (\Exception $e) {
 \DB::rollback();
 return view("\x65\x72\x72\157\x72\x73\x2e\64\60\x34");
 }
 }
 public function re_programar_estado($alumno_ops_id) {
 try {
 $alumno_ops = AlumnoOps::find($alumno_ops_id);
 $programacion_verano = ProgramacionOps::select("\141\x73\x69\x67\156\141\x74\165\x72\x61\163\x2e\151\144\x20\x61\163\40\x61\x73\151\147\156\x61\164\165\x72\x61\x5f\151\x64", "\143\141\156\x63\145\154\x61\144\157")->join("\x61\163\151\147\156\x61\x74\x75\x72\141\x73", "\x61\x73\151\x67\x6e\x61\164\165\x72\x61\163\x2e\151\144", "\x3d", "\160\x72\157\x67\x72\141\x6d\141\x63\151\157\156\137\x6f\x70\163\56\141\x73\x69\x67\156\141\x74\165\162\x61\137\x69\144")->where("\x61\154\x75\x6d\156\157\x5f\157\160\x73\137\151\x64", $alumno_ops_id)->where("\x70\x72\157\147\x72\x61\155\141\143\151\157\156\x5f\x6f\160\163\x2e\x6f\x62\x73\x65\x72\x76\141\143\x69\157\x6e", "\x56\x45\122\101\116\x4f")->get();
 $asignatura_verano = array();
 foreach ($programacion_verano as $value) {
 $asignatura_verano[] = $value->asignatura_id . "\55" . $value->cancelado;
 }
 $setting_verano = Setting_globals::select("\147\145\x73\164\151\x6f\x6e\x5f\166\x65\x72\x61\x6e\157", "\143\x61\156\x74\151\144\141\x64\x5f\155\141\164\x65\x72\151\141\137\x76\145\162\141\156\x6f")->first();
 $datos = Alumno::select("\164\151\160\157\x5f\x61\154\x75\155\x6e\x6f", "\155\x61\164\162\151\x63\x75\154\x61\144\157", "\x61\154\165\x6d\x6e\x6f\x73\x2e\x69\x64\x20\141\x73\x20\141\154\x75\155\x6e\x6f\137\151\x64", "\143\165\x72\163\x6f\x5f\156\165\155\145\162\x61\154", "\160\x6c\141\x6e\x5f\151\x64", "\x61\154\x75\155\x6e\x6f\163\56\156\x69\166\x65\x6c\x20\141\163\x20\x67\162\x61\x64\x6f\137\141", "\160\x65\162\x73\x6f\x6e\x61\163\x2e\x6e\x6f\155\x62\162\x65", "\x61\160\x65\154\x6c\151\x64\157\x73", "\x63\x69\137\160\145\162\x73\157\156\141", "\x67\145\156\145\x72\157", "\141\x63\164\151\166\141\x74\145\144", "\162\165\137\x72\145\147", "\162\x61", "\x61\154\165\155\156\x6f\163\56\x67\x65\x73\x74\151\x6f\x6e", "\141\154\x75\x6d\x6e\x6f\x73\x2e\x66\145\x63\150\x61\40\x61\x73\40\x66\145\x63\150\x61\137\141\154\x75\155\156\157", "\156\x6f\x6d\x62\x72\x65\x5f\x61\x72\x65\141", "\x6e\157\x6d\x62\x72\145\137\143\x61\x72\x72\145\x72\141", "\156\157\155\142\x72\145\x5f\x65\170\x74\x65\156\163\151\157\x6e", "\x79\145\x61\x72", "\x63\141\x72\162\145\162\141\x5f\x70\x61\162\141\154\145\154\141", "\164\x69\x70\x6f\137\151\156\163\x63\x72\151\x70\x63\x69\x6f\x6e", "\x61\x6c\165\155\x6e\x6f\163\56\143\165\162\x73\157", "\x63\x61\155\x62\x69\157", "\164\x69\160\x6f\137\x61\154\x75\155\156\157", "\162\145\160\x72\157\x67\162\x61\x6d\x61\144\157", "\x72\x65\x70\162\157\x67\162\x61\155\x61\144\157", "\x6d\x6f\144\x61\154\151\x64\x61\144\x5f\164\151\x74\x75\x6c\141\143\151\x6f\x6e\x5f\x69\x64", "\x63\157\156\x76\145\x6e\x69\157\x5f\151\144", "\155\157\x64\141\154\x69\x64\141\x64\137\x61\143\164\x69\166\141", "\x61\x6c\x75\155\x6e\x6f\x73\x2e\x63\141\x72\162\x65\162\141\x5f\x69\144")->join("\160\145\x72\163\157\x6e\141\x73", "\160\145\x72\x73\157\x6e\141\163\x2e\x69\x64", "\x3d", "\141\x6c\x75\x6d\x6e\x6f\163\56\160\x65\x72\x73\157\x6e\x61\x5f\x69\144")->join("\x61\162\x65\141\x73", "\141\162\x65\x61\x73\56\x69\x64", "\x3d", "\141\x6c\x75\x6d\x6e\157\163\56\141\162\145\x61\x5f\151\144")->join("\143\141\162\162\x65\x72\141\x73", "\143\141\162\162\x65\x72\x61\163\56\151\x64", "\75", "\141\154\165\x6d\156\157\163\56\x63\x61\x72\x72\x65\x72\141\137\x69\144")->join("\145\x78\164\x65\x6e\163\151\x6f\156\x65\x73", "\145\170\x74\x65\156\x73\x69\157\156\x65\163\56\151\144", "\x3d", "\x61\154\165\x6d\156\157\163\x2e\x65\170\164\x65\156\163\x69\x6f\156\137\151\x64")->join("\x75\163\x65\162\x73", "\x75\163\145\x72\x73\x2e\x70\145\162\163\x6f\156\x61\137\151\144", "\75", "\x70\145\x72\163\157\156\141\x73\x2e\x69\x64")->join("\160\145\x6e\163\165\155\x73", "\160\x65\156\x73\x75\x6d\x73\x2e\151\144", "\x3d", "\141\x6c\165\155\156\157\163\56\160\154\x61\156\x5f\x69\144")->where("\x61\x6c\x75\155\156\x6f\163\x2e\x62\x6c\x6f\x71\x75\x65\x61\144\x6f\137\x63\141\155\142\x69\x6f", "\x4e\x4f")->where("\x61\154\165\155\156\157\163\56\151\x64", $alumno_ops->alumno_id)->orderBy("\x61\154\165\x6d\x6e\x6f\x73\56\151\x64", "\x61\163\x63")->first();
 $alm_dato = Alumno::select("\143\165\162\x73\x6f\137\x6e\165\x6d\x65\162\141\154", "\141\x6c\x75\x6d\x6e\157\163\x2e\x69\x64\x20\141\x73\x20\141\x6c\165\x6d\156\157\137\151\144")->where("\162\165\x5f\162\145\147", Alumno::find($alumno_ops->alumno_id)->ru_reg)->get();
 if ($datos->tipo_alumno == "\156\165\145\x76\157" && $datos->matriculado == "\116\x4f") {
 return redirect()->to("\x65\163\164\141\x64\x6f\137\x61\154\x75\155\x6e\x6f\57" . $datos->alumno_id);
 }
 $cu = array();
 $alumno_id = array();
 foreach ($alm_dato as $key => $value) {
 $cu[] = $value->curso_numeral;
 $alumno_id[] = $value->alumno_id;
 }
 $resultado = (new AlumnoAntiguoController())->control_materias_general($datos, $alumno_id, null, "\156\x6f\164\x61\137\x76\145\162\x61\156\157");
 $materias_aprobadas = $resultado[0];
 $materias_reprobadas = $resultado[1];
 $optativas = $resultado[2];
 $asignaturas_mension = $resultado[3];
 $materias_control_ops = $resultado[5];
 $asignaturas = Asignatura::select("\151\144", "\x6e\x69\x76\x65\x6c", "\156\157\155\142\x72\x65", "\x70\141\162\x61\154\145\x6c\157", "\x61\163\151\147\x6e\x61\164\165\162\141\x73\x2e\151\x64\40\141\x73\40\x61\x73\151\147\x6e\141\x74\x75\x72\x61\137\x69\144")->whereNotIn("\x69\x64", array_merge($materias_aprobadas, $optativas, $asignaturas_mension, $materias_control_ops))->where("\x70\x65\x6e\x73\x75\x6d\137\x69\144", $datos->plan_id)->where("\x6e\x69\x76\145\x6c\137\x6e\165\x6d\145\x72\x6f", "\x3c\x3d", $alumno_ops->curso_ops)->where("\154\151\x73\x74\x61", 0)->where(function ($query) use($datos) {
 if ($datos->grado_a == "\114\x49\103\105\x4e\103\x49\x41\124\x55\122\101") {
 $query->where("\x61\x73\x69\x67\x6e\141\164\165\x72\x61\163\56\x67\x72\141\144\x6f\137\x6c\151\x63\x65\x6e\x63\151\x61\164\165\x72\141", "\x53\x49");
 }
 elseif ($datos->grado_a == "\124\105\x43\x4e\111\x43\117\x20\123\x55\120\105\x52\111\117\122") {
 $query->where("\x61\163\151\147\x6e\x61\164\165\x72\141\163\56\147\162\x61\x64\157\137\164\145\143\156\151\x63\157\x5f\163\165\x70\x65\x72\x69\x6f\x72", "\123\x49");
 }
 elseif ($datos->grado_a == "\x54\105\x43\x4e\111\x43\x4f\40\115\x45\x44\x49\117") {
 $query->where("\141\163\x69\x67\x6e\x61\x74\165\162\141\163\56\x67\x72\141\x64\157\x5f\164\x65\143\156\151\143\157\137\155\145\144\x69\157", "\123\111");
 }
 elseif ($datos->grado_a == "\x41\125\x58\x49\114\111\101\x52") {
 $query->where("\x61\x73\151\147\x6e\141\164\165\162\x61\x73\56\147\x72\x61\144\x6f\x5f\141\165\x78\151\154\151\141\x72", "\x53\x49");
 }
 elseif ($datos->grado_a == "\x4d\x41\116\x4f\x20\x44\x45\40\117\102\x52\101\x20\x43\101\x4c\x49\x46\111\x43\x41\x44\x41") {
 $query->where("\141\x73\151\x67\156\x61\x74\x75\x72\x61\163\56\147\162\x61\x64\x6f\137\155\157\144\x75\154\141\162", "\123\111");
 }
 $query->where("\x61\163\151\x67\x6e\141\x74\165\x72\x61\x73\56\x67\162\x61\144\x6f\137\x74\151\164\165\154\x61\x63\151\x6f\x6e", "\116\117");
 }
)->orderby("\x6e\151\166\x65\154\x5f\x6e\x75\x6d\145\x72\x6f", "\x61\163\x63")->orderBy("\141\x73\151\x67\156\141\164\165\162\x61\x73\56\164\x69\x70\x6f", "\141\163\143")->orderBy("\141\x73\151\x67\156\141\x74\x75\162\141\163\56\151\x64", "\141\163\143")->get();
 return view("\x76\145\162\141\x6e\x6f\x2e\x65\x73\x74\x61\144\157\137\162\x65\x5f\x70\x72\157\x67\x72\141\155\141\162", compact("\144\x61\x74\x6f\163", "\x61\x73\x69\x67\x6e\141\x74\165\x72\x61\x73", "\x61\163\x69\147\x6e\141\164\x75\162\141\x5f\x76\145\x72\141\156\157", "\141\x6c\x75\155\156\x6f\137\x6f\160\163", "\x73\145\x74\164\x69\x6e\x67\137\x76\145\x72\141\156\x6f", "\155\x61\x74\x65\x72\x69\141\x73\x5f\143\157\x6e\164\162\157\x6c\137\x6f\x70\x73"));
 }
 catch (\Exception $e) {
 return view("\x65\162\x72\157\162\x73\56\64\60\x34");
 }
 }
 public function re_programar_update(Request $request) {
 \DB::beginTransaction();
 try {
 $alumno_ops = AlumnoOps::find($request->alumno_ops);
 if ($alumno_ops->re_programado == "\x53\x49") {
 return redirect()->back()->with("\x69\156\x66\x6f\145\162\x72\157\x72", "\114\101\x53\40\101\123\x49\x47\116\101\124\125\x52\101\x53\40\131\x41\40\106\125\105\x52\117\116\40\122\x45\55\120\122\117\107\x52\101\115\x41\104\117\123\41\41\41");
 }
 if (!isset($request->asignatura) || count($request->asignatura) == 0) {
 return redirect()->back()->with("\151\156\146\157\x65\x72\x72\x6f\162", "\123\105\x4c\105\x43\103\x49\117\116\x45\40\101\114\x47\x55\116\x41\40\x41\x53\111\x47\x4e\x41\x54\125\122\101\x21\41\41");
 }
 if (count($request->asignatura) > Setting_globals::find(1)->cantidad_materia_verano) {
 return redirect()->back()->with("\151\156\x66\x6f\x65\x72\x72\157\162", "\x53\x45\114\x45\x43\x43\111\117\116\105\40\x53\117\x4c\x4f\x20" . Setting_globals::find(1)->cantidad_materia_verano . "\x20\x41\x53\x49\107\116\x41\x54\125\122\x41\123\41\41\x21");
 }
 $asignaturas = $request->asignatura;
 $asig_m = ProgramacionOps::select("\160\x72\x6f\147\162\x61\155\141\143\151\157\156\137\x6f\160\x73\x2e\151\x64\x20\x61\163\40\160\x72\x6f\147\137\x69\144", "\x61\x73\151\x67\x6e\x61\x74\165\x72\x61\x73\x2e\x69\x64\40\141\x73\x20\x61\163\151\x67\x6e\x61\x74\x75\x72\x61\137\x69\x64", "\143\141\x6e\143\x65\x6c\141\144\x6f")->join("\141\x73\151\x67\x6e\141\x74\165\162\141\x73", "\141\163\x69\x67\x6e\141\x74\x75\162\141\x73\x2e\x69\x64", "\75", "\160\162\x6f\147\x72\x61\155\x61\143\151\x6f\156\x5f\157\x70\x73\x2e\141\x73\x69\147\156\x61\x74\165\x72\141\137\151\144")->where("\141\x6c\165\155\156\157\137\x6f\160\163\137\x69\144", $alumno_ops->id)->where("\160\x72\x6f\147\162\x61\x6d\x61\x63\x69\157\x6e\x5f\x6f\x70\x73\x2e\157\142\x73\x65\x72\x76\x61\143\x69\157\156", "\126\x45\x52\101\x4e\117")->get();
 $id_destroy = array();
 $id_no_destroy = array();
 foreach ($asig_m as $value) {
 $po = ProgramacionOps::find($value->prog_id);
 if ($asignaturas !== null) {
 if (in_array($value->asignatura_id, $asignaturas)) {
 if (($clave = array_search($value->asignatura_id, $asignaturas)) !== false) {
 unset($asignaturas[$clave]);
 }
 }
 else {
 $id_destroy[] = $value->prog_id;
 }
 }
 }
 $asig_m_libreta = LibretaOps::select("\x6c\x69\142\x72\x65\164\141\x5f\x6f\x70\163\x2e\151\x64\40\141\x73\x20\151\144\x5f\x6c\151\142", "\x70\x72\157\147\162\141\x6d\141\x63\151\157\x6e\x5f\157\160\163\x2e\151\144\40\141\x73\40\160\x72\x6f\x67\162\141\x6d\141\143\x69\x6f\156\137\x69\144")->join("\x70\x72\157\x67\162\141\155\141\143\151\x6f\156\x5f\x6f\160\x73", "\160\162\x6f\x67\162\x61\x6d\141\x63\x69\157\156\x5f\x6f\160\163\x2e\151\x64", "\75", "\x6c\151\142\x72\x65\164\x61\x5f\x6f\160\x73\56\x70\x72\x6f\x67\162\141\x6d\x61\143\x69\x6f\156\137\157\160\x73\x5f\x69\144")->whereIn("\x70\162\x6f\x67\162\x61\x6d\x61\143\x69\x6f\156\x5f\x6f\160\163\137\x69\x64", $id_destroy)->get();
 $id_destroy_libreta = array();
 $id_destroy_programacion = array();
 foreach ($asig_m_libreta as $value_libreta) {
 $id_destroy_libreta[] = $value_libreta->id_lib;
 $id_destroy_programacion[] = $value_libreta->programacion_id;
 }
 LibretaOps::destroy($id_destroy_libreta);
 ProgramacionOps::destroy($id_destroy_programacion);
 $alumno_ops->re_programado = "\x53\x49";
 $alumno_ops->update();
 \DB::commit();
 if (!isset($asignaturas) || count($asignaturas) == 0 || $asignaturas == null) {
 return redirect()->to("\x65\x73\x74\x61\x64\x6f\137\166\145\162\141\x6e\157\x2f" . $alumno_ops->alumno_id)->with("\x69\156\146\x6f", "\114\x61\163\40\141\x73\x69\147\x6e\x61\164\x75\x72\141\x73\x20\x66\165\x65\x72\x6f\x6e\40\162\x65\x70\x72\157\147\162\141\155\141\144\x61\x73\40\143\x6f\156\x20\145\x78\x69\x74\157\41\41");
 }
 $asignaturas_p = Asignatura::whereIn("\x69\144", $asignaturas)->get();
 $contado_paralelos = count($request->paralelo);
 foreach ($asignaturas_p as $key => $value) {
 $programacion = new ProgramacionOps();
 for ($i = 0;
 $i < $contado_paralelos;
 $i++) {
 $array_paralelo = explode("\x2d", $request->paralelo[$i]);
 if (in_array($value->id, $array_paralelo)) {
 $programacion->paralelo = $array_paralelo[1];
 }
 }
 $programacion->gestion = $alumno_ops->gestion;
 $programacion->fecha = date("\131\x2d\155\x2d\x64");
 $programacion->alumno_ops_id = $alumno_ops->id;
 $programacion->asignatura_id = $value->id;
 $programacion->user_id = Auth::user()->id;
 $programacion->observacion = "\x56\105\122\101\x4e\x4f";
 $programacion->save();
 $libreta = new LibretaOps();
 $libreta->programacion_ops_id = $programacion->id;
 $libreta->save();
 }
 if ($alumno_ops->matriculado == "\123\x49") {
 $alumno_ops->matriculado = "\x4e\117";
 }
 if ($request->registro_p != null) {
 $alumno_ops->programacion_activa = "\123\x49";
 }
 else {
 $alumno_ops->programacion_activa = "\116\x4f";
 }
 $alumno_ops->update();
 \DB::commit();
 return redirect()->to("\x65\163\164\141\x64\157\137\166\x65\x72\x61\x6e\157\57" . $alumno_ops->alumno_id)->with("\x69\x6e\x66\157", "\x4c\x61\x73\x20\x61\x73\151\147\156\141\x74\165\162\141\x73\40\146\x75\x65\162\x6f\156\x20\x72\x65\x70\x72\157\147\162\141\x6d\141\144\141\163\40\x63\x6f\156\x20\145\170\x69\x74\157\x21\41");
 }
 catch (\Exception $e) {
 \DB::rollback();
 return redirect()->back();
 }
 }
 }

Function Calls

None

Variables

None

Stats

MD5 1b962aa67624378c4d8972c235e47c50
Eval Count 0
Decode Time 121 ms