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 App\Convenio..

Decoded Output download

<?php 
 
namespace App\Http\Controllers; 
 
use Illuminate\Http\Request; 
use App\Convenio; 
use App\Pensum; 
use App\Carrera; 
use App\Persona; 
use App\Postulante; 
use Validator; 
use App\Setting_globals; 
use Auth; 
use DB; 
use App\User; 
use App\ModalidadesIngresos; 
use Hash; 
use App\Requisito_postulantes; 
use Illuminate\Support\Facades\Crypt; 
use Caffeinated\Shinobi\Models\Role; 
use App\Http\Controllers\PersonaController; 
 
class ConvenioController extends Controller 
{ 
    public function index() 
    { 
        try { 
            $convenios = Convenio::orderBy("nombre_convenio", "asc")->orderBy("id", "asc")->get(); 
            return view("convenio.index", compact("convenios")); 
        } catch (\Exception $e) { 
            return view("errors.404"); 
        } 
    } 
    public function create() 
    { 
        try { 
            return view("convenio.create"); 
        } catch (\Exception $e) { 
            return redirect()->back()->with("errorinfo", "Ups!! Ocurrio un error al registrar"); 
        } 
    } 
    public function store(Request $request) 
    { 
        DB::beginTransaction(); 
        try { 
            $rules = array("nombre_convenio" => array("required"), "resolucion" => array("required", "min:3", "max:300"), "gestion" => array("required", "min:4", "max:4"), "vacantes" => array("required", "min:1", "max:3")); 
            $validation = Validator::make($request->all(), $rules); 
            if ($validation->fails()) { 
                return redirect()->back()->withInput()->withErrors($validation); 
            } 
            $convenio = new Convenio(); 
            $convenio->nombre_convenio = strtoupper(trim($request->nombre_convenio)); 
            $convenio->gestion = trim($request->gestion); 
            $convenio->resolucion = trim($request->resolucion); 
            $convenio->vacantes = trim($request->vacantes); 
            $convenio->save(); 
            DB::commit(); 
            return redirect()->to("convenio")->with("info", "REGISTRO REALIZADO CON EXITO!!"); 
        } catch (\Exception $e) { 
            DB::rollback(); 
            return redirect()->back()->with("errorinfo", "UPS!! OCURRIO UN ERROR AL REGISTRAR CONVENIO."); 
        } 
    } 
    public function edit($id) 
    { 
        try { 
            $convenio = Convenio::find($id); 
            return view("convenio.edit", compact("convenio")); 
        } catch (\Exception $e) { 
            return view("errors.404"); 
        } 
    } 
    public function update(Request $request, $id) 
    { 
        DB::beginTransaction(); 
        try { 
            $rules = array("nombre_convenio" => array("required"), "resolucion" => array("required", "min:3", "max:300"), "gestion" => array("required", "min:4", "max:4"), "vacantes" => array("required", "min:1", "max:3")); 
            $validation = Validator::make($request->all(), $rules); 
            if ($validation->fails()) { 
                return redirect()->back()->withInput()->withErrors($validation); 
            } 
            $convenio = Convenio::find($id); 
            $convenio->nombre_convenio = strtoupper(trim($request->nombre_convenio)); 
            $convenio->gestion = trim($request->gestion); 
            $convenio->resolucion = trim($request->resolucion); 
            $convenio->vacantes = trim($request->vacantes); 
            $convenio->update(); 
            DB::commit(); 
            return redirect()->to("convenio")->with("info", "REGISTRO ACTUALIZADO CON EXITO!!"); 
        } catch (\Exception $e) { 
            DB::rollback(); 
            return redirect()->back()->with("errorinfo", "UPS!! OCURRIO UN ERROR AL ACTULIZAR."); 
        } 
    } 
    public function convenio_integrante(Request $request, $id = null) 
    { 
        $gestion = null; 
        if (isset($request->id) && isset($request->gestion)) { 
            $id = $request->id; 
            $gestion = $request->gestion; 
        } else { 
            $gestion = Setting_globals::where("id", 1)->first()->gestion_admision; 
        } 
        try { 
            $gestiones = Postulante::select("gestion")->orderBy("gestion", "desc")->where("gestion", "!=", null)->distinct()->get(); 
            $postulantes = Postulante::select("nombre", "apellidos", "ci_persona", "ru_pre", "postulantes.gestion", "certificacion_convenio", "requisito_postulantes.id as requisito_id", "postulantes.id", "carrera_id")->join("personas", "personas.id", "=", "postulantes.persona_id")->join("convenio", "convenio.id", "=", "postulantes.convenio_id")->join("requisito_postulantes", "requisito_postulantes.postulante_id", "=", "postulantes.id")->where("tipo_inscripcion", "like", "%CONVENIO%")->where("postulantes.gestion", $gestion)->where("convenio_id", $id)->where("postulantes.desistir", 0)->get(); 
            $convenio = Convenio::find($id); 
            return view("postulante_especial.convenio.index", compact("postulantes", "convenio", "gestiones", "gestion")); 
        } catch (\Exception $e) { 
            return view("errors.404"); 
        } 
    } 
    public function convenio_integrante_create($id) 
    { 
        try { 
            $convenio = Convenio::find($id); 
            return view("postulante_especial.convenio.create", compact("convenio")); 
        } catch (\Exception $e) { 
            return view("errors.404"); 
        } 
    } 
    public function convenio_integrante_store(Request $request) 
    { 
        \DB::beginTransaction(); 
        try { 
            $rules = array("nombre" => array("required", "min:3", "max:300"), "apellidos" => array("required", "min:3", "max:300"), "ci_persona" => "required|unique:personas", "genero" => "required"); 
            $validation = Validator::make($request->all(), $rules); 
            if ($validation->fails()) { 
                return redirect()->back()->withErrors($validation)->withInput(); 
            } 
            $gestion_admision = Setting_globals::where("id", 1)->first()->gestion_admision; 
            $digits = 1; 
            $digits_pass = 1; 
            $ru_alm = (new PersonaController())->persona_ru($request->ci_persona); 
            $result = (new PersonaController())->nombre_apellido($request->nombre, $request->apellidos); 
            $nombre = $result[0]; 
            $apellidos = $result[1]; 
            $persona = new Persona(); 
            $persona->ci_persona = trim($request->ci_persona); 
            $persona->ci_expedido = $request->ci_expedido; 
            $persona->nombre = trim($nombre); 
            $persona->apellidos = trim($apellidos); 
            $persona->genero = strtoupper(trim($request->genero)); 
            $persona->tipo_documento = "ci"; 
            $persona->save(); 
            $postulante = new Postulante(); 
            $postulante->ra = $gestion_admision . "-" . rand(pow(10, $digits - 1), pow(10, $digits) - 1) . $persona->id; 
            $postulante->ru_pre = $ru_alm; 
            $postulante->gestion = $gestion_admision; 
            $postulante->fecha = date("Y-m-d"); 
            $postulante->tipo_inscripcion = "CONVENIO"; 
            $postulante->usuario_registro = Auth::user()->id; 
            $postulante->convenio_id = $request->convenio; 
            $postulante->persona_id = $persona->id; 
            $postulante->save(); 
            $user = new User(); 
            $user->username = rand(10, 99) . $persona->id . rand(100, 999); 
            $pass = rand(100, 999) . $postulante->id . rand(10, 99); 
            $user->password = Hash::make($pass); 
            $user->cappe = Crypt::encrypt($pass); 
            $user->tipo = "postulante"; 
            $user->activated = 1; 
            $user->persona_id = $persona->id; 
            $user->save(); 
            $user->roles()->sync(array(6)); 
            $requisitos = new Requisito_postulantes(); 
            $requisitos->postulante_id = $postulante->id; 
            $requisitos->certificacion_convenio = $request->certificado !== null ? "SI" : "NO"; 
            $requisitos->save(); 
            \DB::commit(); 
            return redirect()->to("convenio/integrante/" . $request->convenio)->with("info", "POSTULANTE FUE REGISTRADO CORRECTAMENTE."); 
        } catch (\Exception $e) { 
            \DB::rollback(); 
            return view("errors.404"); 
        } 
    } 
    public function convenio_integrante_edit($id) 
    { 
        try { 
            $convenios = Convenio::orderBy("nombre_convenio", "asc")->orderBy("id", "asc")->get(); 
            $postulante = Postulante::select("nombre", "apellidos", "ci_persona", "genero", "certificacion_convenio", "convenio_id", "postulantes.id", "ci_expedido")->join("personas", "personas.id", "=", "postulantes.persona_id")->join("requisito_postulantes", "requisito_postulantes.postulante_id", "=", "postulantes.id")->where("postulantes.id", $id)->first(); 
            $convenio = Convenio::find($postulante->convenio_id); 
            return view("postulante_especial.convenio.edit", compact("postulante", "convenios", "convenio")); 
        } catch (\Exception $e) { 
            return view("errors.404"); 
        } 
    } 
    public function convenio_integrante_update(Request $request) 
    { 
        DB::beginTransaction(); 
        try { 
            $postulante = Postulante::find($request->postulante); 
            $persona = Persona::find($postulante->persona_id); 
            $rules = array("nombre" => array("required", "min:3", "max:150"), "apellidos" => array("required", "min:3", "max:150"), "ci_persona" => "unique:personas,ci_persona," . $persona->id); 
            $validation = Validator::make($request->all(), $rules); 
            if ($validation->fails()) { 
                return redirect()->back()->withInput()->withErrors($validation); 
            } 
            $postulante->convenio_id = $request->convenio; 
            if (count(explode("-", $postulante->ru_pre)) == 2) { 
                $postulante->ru_pre = trim($request->ci_persona) . "-" . explode("-", $postulante->ru_pre)[1]; 
            } else { 
                $postulante->ru_pre = trim($request->ci_persona); 
            } 
            $postulante->update(); 
            $result = (new PersonaController())->nombre_apellido($request->nombre, $request->apellidos); 
            $nombre = $result[0]; 
            $apellidos = $result[1]; 
            $persona->nombre = $nombre; 
            $persona->apellidos = $apellidos; 
            $persona->ci_persona = trim($request->ci_persona); 
            $persona->ci_expedido = $request->ci_expedido; 
            $persona->genero = $request->genero; 
            $persona->update(); 
            $requisito = Requisito_postulantes::where("postulante_id", $postulante->id)->first(); 
            $requisito->certificacion_convenio = $request->certificado !== null ? "SI" : "NO"; 
            $requisito->save(); 
            DB::commit(); 
            return redirect()->to("convenio/integrante/" . $request->convenio)->with("info", "LOS DATOS DEL POSTULANTE SE ACTUALIZARON CON EXITO"); 
        } catch (\Exception $e) { 
            DB::rollback(); 
            return redirect()->back()->with("infoerror", "UPS!! OCURRIO UN ERROR AL ACTUALIZAR LOS DATOS"); 
        } 
    } 
    public function lista_convenio(Request $request) 
    { 
        try { 
            $array = array(); 
            $convenios = Convenio::where("gestion", $request->get("gestion_convenio"))->get(); 
            foreach (Convenio::all() as $value) { 
                $array[] = $value->gestion; 
            } 
            $gestiones = array_map("unserialize", array_unique(array_map("serialize", $array))); 
            rsort($gestiones); 
            return view("administrativo.admision_especial.convenio.index", compact("convenios", "gestiones")); 
        } catch (\Exception $e) { 
            return redirect()->back()->with("errorinfo", "Ocurrio un error al registrar."); 
        } 
    } 
    public function show($id) 
    { 
    } 
    public function destroy($id) 
    { 
    } 
} 
 ?>

Did this file decode correctly?

Original Code

<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use App\Convenio;
use App\Pensum;
use App\Carrera;
use App\Persona;
use App\Postulante;
use Validator;
use App\Setting_globals;
use Auth;
use DB;
use App\User;
use App\ModalidadesIngresos;
use Hash;
use App\Requisito_postulantes;
use Illuminate\Support\Facades\Crypt;
use Caffeinated\Shinobi\Models\Role;
use App\Http\Controllers\PersonaController;

class ConvenioController extends Controller
{
    public function index()
    {
        try {
            $convenios = Convenio::orderBy("\x6e\157\x6d\x62\162\145\137\143\x6f\156\x76\x65\156\151\157", "\x61\x73\143")->orderBy("\151\144", "\x61\x73\x63")->get();
            return view("\x63\x6f\x6e\166\145\156\x69\157\x2e\x69\156\x64\145\170", compact("\x63\157\156\x76\x65\x6e\151\157\x73"));
        } catch (\Exception $e) {
            return view("\x65\162\x72\x6f\x72\163\56\64\60\x34");
        }
    }
    public function create()
    {
        try {
            return view("\143\157\156\x76\145\156\x69\157\x2e\143\162\145\141\x74\145");
        } catch (\Exception $e) {
            return redirect()->back()->with("\x65\162\162\x6f\162\x69\156\146\157", "\125\x70\163\41\41\40\x4f\143\x75\x72\162\151\x6f\x20\x75\156\x20\145\162\162\x6f\x72\40\x61\x6c\40\x72\x65\x67\151\163\164\x72\x61\x72");
        }
    }
    public function store(Request $request)
    {
        DB::beginTransaction();
        try {
            $rules = array("\156\157\x6d\142\162\145\137\x63\157\156\x76\x65\156\x69\x6f" => array("\162\145\161\x75\x69\x72\x65\144"), "\162\x65\163\x6f\x6c\x75\x63\151\157\x6e" => array("\162\x65\x71\165\151\x72\x65\x64", "\x6d\x69\x6e\x3a\x33", "\155\x61\170\x3a\x33\60\x30"), "\147\145\163\x74\x69\x6f\x6e" => array("\162\x65\x71\x75\151\162\145\x64", "\x6d\151\x6e\x3a\64", "\x6d\x61\170\x3a\x34"), "\x76\141\x63\x61\156\x74\x65\x73" => array("\162\145\x71\165\151\162\145\x64", "\x6d\x69\156\72\61", "\x6d\141\170\x3a\x33"));
            $validation = Validator::make($request->all(), $rules);
            if ($validation->fails()) {
                return redirect()->back()->withInput()->withErrors($validation);
            }
            $convenio = new Convenio();
            $convenio->nombre_convenio = strtoupper(trim($request->nombre_convenio));
            $convenio->gestion = trim($request->gestion);
            $convenio->resolucion = trim($request->resolucion);
            $convenio->vacantes = trim($request->vacantes);
            $convenio->save();
            DB::commit();
            return redirect()->to("\143\157\x6e\166\145\x6e\151\x6f")->with("\151\156\146\157", "\x52\x45\107\111\x53\124\x52\x4f\40\x52\105\x41\x4c\111\132\x41\104\117\40\x43\x4f\116\40\105\x58\111\124\117\41\41");
        } catch (\Exception $e) {
            DB::rollback();
            return redirect()->back()->with("\x65\x72\162\157\162\151\156\146\x6f", "\x55\120\x53\x21\41\x20\117\x43\x55\x52\122\111\x4f\x20\x55\116\40\x45\x52\122\x4f\x52\x20\x41\x4c\x20\x52\105\x47\111\x53\124\x52\101\x52\40\x43\x4f\116\126\105\116\111\117\56");
        }
    }
    public function edit($id)
    {
        try {
            $convenio = Convenio::find($id);
            return view("\143\x6f\x6e\166\145\156\151\x6f\x2e\x65\144\x69\x74", compact("\x63\x6f\x6e\x76\x65\156\151\157"));
        } catch (\Exception $e) {
            return view("\x65\x72\x72\x6f\162\x73\56\x34\60\x34");
        }
    }
    public function update(Request $request, $id)
    {
        DB::beginTransaction();
        try {
            $rules = array("\x6e\x6f\x6d\142\x72\x65\x5f\x63\x6f\156\x76\x65\x6e\151\x6f" => array("\162\145\x71\x75\x69\x72\x65\144"), "\162\x65\x73\x6f\154\165\x63\151\157\156" => array("\x72\145\x71\x75\x69\x72\x65\x64", "\155\x69\x6e\x3a\63", "\x6d\x61\170\x3a\x33\60\60"), "\147\145\x73\164\x69\x6f\x6e" => array("\162\x65\x71\x75\x69\x72\145\x64", "\155\x69\x6e\72\x34", "\155\141\170\x3a\x34"), "\166\141\x63\141\156\164\x65\x73" => array("\x72\145\161\165\x69\x72\x65\x64", "\155\151\156\x3a\61", "\155\x61\170\72\63"));
            $validation = Validator::make($request->all(), $rules);
            if ($validation->fails()) {
                return redirect()->back()->withInput()->withErrors($validation);
            }
            $convenio = Convenio::find($id);
            $convenio->nombre_convenio = strtoupper(trim($request->nombre_convenio));
            $convenio->gestion = trim($request->gestion);
            $convenio->resolucion = trim($request->resolucion);
            $convenio->vacantes = trim($request->vacantes);
            $convenio->update();
            DB::commit();
            return redirect()->to("\143\x6f\x6e\x76\x65\x6e\151\x6f")->with("\151\x6e\146\x6f", "\x52\x45\x47\111\123\124\x52\117\x20\101\x43\124\125\101\114\111\132\101\104\x4f\40\x43\117\116\40\105\130\111\x54\x4f\x21\41");
        } catch (\Exception $e) {
            DB::rollback();
            return redirect()->back()->with("\145\162\x72\157\162\151\156\x66\157", "\125\120\123\41\41\40\x4f\103\125\x52\x52\111\117\40\125\x4e\40\105\x52\122\x4f\122\x20\x41\114\40\101\103\x54\125\114\x49\x5a\101\x52\56");
        }
    }
    public function convenio_integrante(Request $request, $id = null)
    {
        $gestion = null;
        if (isset($request->id) && isset($request->gestion)) {
            $id = $request->id;
            $gestion = $request->gestion;
        } else {
            $gestion = Setting_globals::where("\x69\144", 1)->first()->gestion_admision;
        }
        try {
            $gestiones = Postulante::select("\147\x65\x73\x74\x69\157\x6e")->orderBy("\x67\x65\163\164\151\157\x6e", "\x64\145\163\x63")->where("\x67\145\x73\164\x69\x6f\156", "\41\x3d", null)->distinct()->get();
            $postulantes = Postulante::select("\156\x6f\x6d\x62\x72\x65", "\x61\160\145\x6c\154\x69\x64\157\163", "\143\151\137\x70\145\162\163\157\x6e\141", "\x72\x75\x5f\160\162\145", "\x70\x6f\x73\x74\x75\x6c\x61\x6e\164\x65\x73\x2e\x67\145\x73\164\x69\x6f\156", "\x63\145\162\x74\151\146\x69\x63\141\x63\x69\x6f\156\x5f\x63\x6f\x6e\166\x65\x6e\151\157", "\x72\145\161\x75\151\x73\151\x74\x6f\x5f\160\157\x73\x74\x75\154\x61\x6e\x74\145\x73\56\x69\144\40\141\x73\40\x72\145\x71\x75\x69\x73\151\164\157\137\151\x64", "\x70\157\x73\164\x75\x6c\141\156\x74\x65\x73\56\x69\x64", "\143\141\162\x72\145\162\141\x5f\x69\144")->join("\x70\145\x72\x73\x6f\x6e\141\x73", "\160\145\162\163\157\156\141\163\56\x69\x64", "\x3d", "\x70\157\x73\x74\165\154\x61\156\164\145\163\56\160\145\162\163\x6f\156\141\x5f\x69\x64")->join("\x63\157\x6e\x76\x65\x6e\151\x6f", "\143\x6f\156\x76\145\x6e\151\157\56\151\144", "\x3d", "\160\157\x73\164\x75\154\x61\156\x74\x65\x73\56\143\x6f\x6e\x76\x65\156\151\157\137\x69\144")->join("\162\145\x71\x75\151\x73\x69\x74\x6f\137\160\x6f\x73\x74\165\x6c\141\156\x74\x65\163", "\x72\x65\x71\x75\151\x73\151\164\x6f\x5f\160\157\163\164\165\154\141\x6e\164\x65\x73\x2e\x70\x6f\x73\164\165\154\x61\x6e\x74\145\x5f\151\x64", "\75", "\x70\157\163\x74\165\x6c\x61\x6e\164\145\163\x2e\151\x64")->where("\x74\x69\160\x6f\137\x69\156\163\x63\162\x69\x70\x63\151\x6f\156", "\154\151\153\145", "\x25\103\117\x4e\x56\x45\116\x49\117\45")->where("\x70\157\163\164\x75\154\141\156\x74\145\x73\x2e\147\x65\163\164\151\x6f\156", $gestion)->where("\143\x6f\156\166\145\156\151\157\x5f\151\x64", $id)->where("\160\x6f\163\x74\165\154\141\x6e\x74\x65\x73\56\144\145\163\x69\x73\164\x69\162", 0)->get();
            $convenio = Convenio::find($id);
            return view("\x70\x6f\x73\164\165\154\141\x6e\164\145\137\x65\x73\160\x65\143\151\x61\154\x2e\x63\157\156\x76\x65\156\x69\157\56\x69\x6e\144\x65\x78", compact("\x70\x6f\x73\x74\165\x6c\x61\156\164\x65\x73", "\143\157\x6e\166\145\156\151\157", "\147\x65\x73\x74\x69\157\x6e\x65\163", "\x67\145\163\x74\x69\157\156"));
        } catch (\Exception $e) {
            return view("\145\162\x72\157\162\x73\x2e\x34\x30\x34");
        }
    }
    public function convenio_integrante_create($id)
    {
        try {
            $convenio = Convenio::find($id);
            return view("\160\157\163\164\x75\x6c\141\x6e\164\x65\x5f\145\163\x70\x65\x63\x69\141\154\56\x63\x6f\x6e\166\145\156\x69\157\56\x63\x72\x65\141\x74\145", compact("\143\157\x6e\x76\145\x6e\151\157"));
        } catch (\Exception $e) {
            return view("\145\x72\x72\x6f\162\163\x2e\64\60\x34");
        }
    }
    public function convenio_integrante_store(Request $request)
    {
        \DB::beginTransaction();
        try {
            $rules = array("\x6e\x6f\x6d\x62\x72\145" => array("\162\x65\161\165\x69\162\x65\x64", "\x6d\x69\x6e\x3a\x33", "\155\141\170\x3a\x33\60\x30"), "\x61\x70\145\x6c\x6c\x69\x64\157\x73" => array("\x72\145\161\x75\151\x72\145\x64", "\x6d\x69\x6e\x3a\x33", "\x6d\141\170\x3a\63\60\60"), "\x63\x69\x5f\160\x65\x72\163\157\x6e\x61" => "\162\x65\161\165\x69\162\x65\x64\x7c\165\156\151\x71\165\145\x3a\x70\145\x72\x73\157\x6e\x61\x73", "\x67\145\x6e\x65\x72\157" => "\x72\x65\x71\x75\x69\162\145\x64");
            $validation = Validator::make($request->all(), $rules);
            if ($validation->fails()) {
                return redirect()->back()->withErrors($validation)->withInput();
            }
            $gestion_admision = Setting_globals::where("\151\x64", 1)->first()->gestion_admision;
            $digits = 1;
            $digits_pass = 1;
            $ru_alm = (new PersonaController())->persona_ru($request->ci_persona);
            $result = (new PersonaController())->nombre_apellido($request->nombre, $request->apellidos);
            $nombre = $result[0];
            $apellidos = $result[1];
            $persona = new Persona();
            $persona->ci_persona = trim($request->ci_persona);
            $persona->ci_expedido = $request->ci_expedido;
            $persona->nombre = trim($nombre);
            $persona->apellidos = trim($apellidos);
            $persona->genero = strtoupper(trim($request->genero));
            $persona->tipo_documento = "\x63\151";
            $persona->save();
            $postulante = new Postulante();
            $postulante->ra = $gestion_admision . "\x2d" . rand(pow(10, $digits - 1), pow(10, $digits) - 1) . $persona->id;
            $postulante->ru_pre = $ru_alm;
            $postulante->gestion = $gestion_admision;
            $postulante->fecha = date("\x59\55\x6d\x2d\x64");
            $postulante->tipo_inscripcion = "\103\x4f\x4e\x56\x45\116\x49\x4f";
            $postulante->usuario_registro = Auth::user()->id;
            $postulante->convenio_id = $request->convenio;
            $postulante->persona_id = $persona->id;
            $postulante->save();
            $user = new User();
            $user->username = rand(10, 99) . $persona->id . rand(100, 999);
            $pass = rand(100, 999) . $postulante->id . rand(10, 99);
            $user->password = Hash::make($pass);
            $user->cappe = Crypt::encrypt($pass);
            $user->tipo = "\x70\157\x73\x74\165\154\x61\x6e\x74\145";
            $user->activated = 1;
            $user->persona_id = $persona->id;
            $user->save();
            $user->roles()->sync(array(6));
            $requisitos = new Requisito_postulantes();
            $requisitos->postulante_id = $postulante->id;
            $requisitos->certificacion_convenio = $request->certificado !== null ? "\x53\x49" : "\116\117";
            $requisitos->save();
            \DB::commit();
            return redirect()->to("\x63\157\156\x76\x65\156\151\157\x2f\x69\x6e\164\145\x67\162\141\x6e\x74\145\x2f" . $request->convenio)->with("\151\x6e\146\x6f", "\x50\117\123\124\x55\x4c\x41\x4e\x54\x45\40\x46\125\x45\x20\122\105\x47\x49\123\x54\122\x41\104\117\40\x43\117\122\x52\x45\103\x54\101\115\105\x4e\x54\105\56");
        } catch (\Exception $e) {
            \DB::rollback();
            return view("\x65\162\x72\157\162\x73\x2e\64\60\x34");
        }
    }
    public function convenio_integrante_edit($id)
    {
        try {
            $convenios = Convenio::orderBy("\x6e\x6f\155\142\162\x65\137\143\x6f\156\166\x65\156\x69\157", "\x61\x73\x63")->orderBy("\x69\x64", "\141\x73\x63")->get();
            $postulante = Postulante::select("\x6e\x6f\x6d\x62\x72\x65", "\141\160\145\154\x6c\x69\x64\157\x73", "\x63\x69\x5f\160\x65\x72\163\157\x6e\x61", "\x67\x65\x6e\x65\x72\x6f", "\143\x65\162\x74\151\146\151\x63\x61\x63\151\157\156\137\x63\x6f\156\x76\145\156\151\157", "\143\x6f\x6e\x76\x65\156\x69\x6f\137\151\x64", "\160\157\163\x74\165\154\x61\156\164\x65\x73\56\x69\x64", "\x63\151\137\x65\170\160\145\x64\151\x64\157")->join("\160\145\162\163\157\x6e\141\x73", "\160\145\162\x73\x6f\x6e\141\x73\56\x69\x64", "\75", "\x70\157\163\164\165\x6c\141\156\164\x65\x73\56\160\x65\162\163\157\156\x61\x5f\151\x64")->join("\x72\x65\161\x75\151\x73\x69\164\157\x5f\160\157\163\x74\x75\154\141\156\x74\x65\163", "\x72\145\161\x75\x69\163\151\164\157\x5f\x70\157\x73\x74\165\154\x61\156\x74\x65\x73\56\160\157\163\164\165\154\x61\156\164\145\137\x69\144", "\x3d", "\160\x6f\163\164\x75\x6c\x61\156\164\x65\163\x2e\x69\x64")->where("\x70\x6f\x73\164\165\x6c\141\156\164\145\163\56\x69\144", $id)->first();
            $convenio = Convenio::find($postulante->convenio_id);
            return view("\x70\x6f\163\x74\x75\x6c\141\156\164\x65\x5f\145\x73\x70\145\143\151\141\x6c\56\143\157\156\166\145\156\151\x6f\x2e\145\144\151\x74", compact("\x70\157\x73\164\x75\154\141\x6e\x74\145", "\x63\x6f\x6e\166\x65\x6e\151\x6f\163", "\x63\x6f\x6e\x76\x65\156\x69\157"));
        } catch (\Exception $e) {
            return view("\x65\162\x72\157\x72\x73\56\64\60\64");
        }
    }
    public function convenio_integrante_update(Request $request)
    {
        DB::beginTransaction();
        try {
            $postulante = Postulante::find($request->postulante);
            $persona = Persona::find($postulante->persona_id);
            $rules = array("\x6e\x6f\x6d\142\162\145" => array("\x72\x65\161\x75\151\x72\x65\x64", "\x6d\151\x6e\x3a\x33", "\x6d\x61\x78\x3a\x31\x35\60"), "\141\x70\x65\x6c\x6c\x69\144\157\163" => array("\162\145\161\x75\151\x72\x65\144", "\155\x69\x6e\72\x33", "\155\141\x78\72\x31\65\x30"), "\x63\151\x5f\x70\145\x72\x73\157\x6e\141" => "\x75\156\x69\161\x75\145\x3a\x70\145\162\163\157\156\141\x73\54\143\x69\x5f\160\145\162\x73\x6f\156\141\54" . $persona->id);
            $validation = Validator::make($request->all(), $rules);
            if ($validation->fails()) {
                return redirect()->back()->withInput()->withErrors($validation);
            }
            $postulante->convenio_id = $request->convenio;
            if (count(explode("\x2d", $postulante->ru_pre)) == 2) {
                $postulante->ru_pre = trim($request->ci_persona) . "\x2d" . explode("\55", $postulante->ru_pre)[1];
            } else {
                $postulante->ru_pre = trim($request->ci_persona);
            }
            $postulante->update();
            $result = (new PersonaController())->nombre_apellido($request->nombre, $request->apellidos);
            $nombre = $result[0];
            $apellidos = $result[1];
            $persona->nombre = $nombre;
            $persona->apellidos = $apellidos;
            $persona->ci_persona = trim($request->ci_persona);
            $persona->ci_expedido = $request->ci_expedido;
            $persona->genero = $request->genero;
            $persona->update();
            $requisito = Requisito_postulantes::where("\160\157\x73\x74\x75\x6c\x61\x6e\164\x65\137\151\x64", $postulante->id)->first();
            $requisito->certificacion_convenio = $request->certificado !== null ? "\x53\x49" : "\116\117";
            $requisito->save();
            DB::commit();
            return redirect()->to("\143\157\x6e\x76\x65\156\x69\x6f\x2f\151\156\x74\145\147\162\141\156\164\x65\x2f" . $request->convenio)->with("\x69\156\x66\157", "\114\x4f\123\40\104\x41\124\117\x53\x20\x44\x45\114\x20\x50\x4f\123\x54\125\x4c\101\x4e\124\x45\x20\123\x45\40\x41\x43\x54\x55\101\114\x49\132\101\x52\117\116\40\x43\117\x4e\40\105\x58\x49\124\x4f");
        } catch (\Exception $e) {
            DB::rollback();
            return redirect()->back()->with("\x69\x6e\x66\157\145\162\162\x6f\162", "\x55\x50\x53\x21\41\40\x4f\103\x55\122\x52\x49\x4f\40\x55\116\x20\105\x52\122\117\122\x20\x41\x4c\40\101\x43\124\x55\x41\x4c\111\132\x41\122\x20\x4c\x4f\123\40\x44\101\x54\x4f\123");
        }
    }
    public function lista_convenio(Request $request)
    {
        try {
            $array = array();
            $convenios = Convenio::where("\147\145\x73\x74\x69\x6f\x6e", $request->get("\147\x65\163\x74\151\x6f\x6e\x5f\x63\x6f\x6e\x76\x65\156\151\x6f"))->get();
            foreach (Convenio::all() as $value) {
                $array[] = $value->gestion;
            }
            $gestiones = array_map("\x75\156\163\x65\162\151\141\154\x69\172\x65", array_unique(array_map("\163\145\x72\151\x61\154\x69\x7a\145", $array)));
            rsort($gestiones);
            return view("\141\x64\155\x69\x6e\151\163\x74\x72\x61\164\151\166\x6f\56\x61\x64\x6d\x69\163\151\x6f\x6e\137\x65\163\160\x65\x63\x69\x61\154\56\x63\x6f\x6e\x76\145\x6e\151\x6f\x2e\151\156\144\x65\x78", compact("\143\x6f\x6e\166\x65\x6e\151\157\x73", "\x67\145\163\164\151\157\x6e\x65\163"));
        } catch (\Exception $e) {
            return redirect()->back()->with("\x65\x72\x72\157\162\x69\x6e\146\157", "\x4f\x63\x75\162\x72\x69\x6f\40\x75\x6e\40\145\162\162\157\x72\40\141\154\x20\x72\145\x67\151\163\x74\162\141\162\56");
        }
    }
    public function show($id)
    {
    }
    public function destroy($id)
    {
    }
}

Function Calls

None

Variables

None

Stats

MD5 1484ff8f976f74ae2e6d85cd209cb715
Eval Count 0
Decode Time 74 ms