Ejemplo n.º 1
0
 public function getImportOfertas()
 {
     $oldOfertas = DB::connection("mysql_old")->table("ofertas")->get();
     foreach ($oldOfertas as $oldOferta) {
         $empresaId = Empresa::where("old_id", "=", $oldOfertas['empresas_id'])->pluck("id");
         $newOferta = array("old_id" => $oldOferta['id'], "empresa_id" => $empresaId, "fecha_alta" => $oldOferta['ofertas_FechaCreacion'], "puesto" => $oldOferta['ofertas_Nombre'], "plazas" => $oldOferta['ofertas_Plazas'], "experienciav" => $oldOferta['id'], "jornada_laboral" => $oldOferta['id'], "horario_laboral" => $oldOferta['id'], "contrato_id" => $oldOferta['id'], "meses_contrato" => $oldOferta['id'], "fecha_caducidad" => $oldOferta['id'], "salario" => $oldOferta['id'], "perfil_edad_min" => $oldOferta['id'], "perfil_edad_max" => $oldOferta['id'], "calle" => $oldOferta['id'], "cp" => $oldOferta['id'], "estudio_id" => $oldOferta['id'], "provincia_id" => $oldOferta['id'], "municipio_id" => $oldOferta['id'], "created_at" => $oldOferta['id'], "vupdated_at" => $oldOferta['id'], "deleted_at" => $oldOferta['id'], "activo" => $oldOferta['id']);
     }
 }
 public function getIndex()
 {
     $dataModule['empresa'] = Empresa::where('activa', 1)->get();
     $dataModule['plan_pago'] = PlanPago::orderby('created_at')->get();
     $dataModule['nota_credito'] = Cupon::all();
     $dataModule['productos'] = Producto::where('activo', 1)->get();
     $dataModule['departamentos'] = Departamento::all();
     return View::make($this->department . ".main", $this->data)->nest('child', 'sistemas.main_configuracion', $dataModule);
 }
Ejemplo n.º 3
0
 function putFoto(Request $request, Response $response)
 {
     $response = $response->withHeader('Content-type', 'application/json');
     $email = $request->getAttribute('email');
     $data = $request->getBody();
     try {
         $fp = fopen($email . '_E.jpg', 'wb');
         fwrite($fp, $data);
         fclose($fp);
         $empresa = Empresa::where('email', '=', $email)->first();
         $empresa->foto = $rutaServidor . "fotos/" . $email . "_E.jpg";
         $empresa->save();
         $respuesta = json_encode(array('msg' => "Guardado correctamente", "std" => 1, "obj" => $data));
         $response = $response->withStatus(200);
     } catch (Exception $err) {
         $respuesta = json_encode(array('msg' => "Error al guardar foto empresa", "std" => 0, "err" => $err->getMessage()));
         $response = $response->withStatus(404);
     }
     $response->getBody()->write($respuesta);
     return $response;
 }
Ejemplo n.º 4
0
 public function getNuevaOferta()
 {
     if (!$this->checkLoggedEmpresa()) {
         return $this->redirect;
     }
     for ($i = 1; $i <= 12; $i++) {
         $meses[$i] = $i . " " . Lang::choice('forms.mes', $i);
     }
     $meses[] = "<1 " . Lang::choice('forms.mes', 1);
     $salarios[] = "< " . number_format(Config::get('app.minSalario'), 0, '', '.') . "€";
     for ($i = Config::get('app.minSalario'); $i <= Config::get('app.maxSalario') - 5000; $i += 5000) {
         $salarios[] = trans('forms.salarios', array('menor' => number_format($i, 0, '', '.') . '€', 'mayor' => number_format($i + 5000, 0, '', '.') . '€'));
     }
     $salarios[] = '> ' . number_format(Config::get('app.maxSalario'), 0, '', '.') . '€';
     $provincia_array = $this->provincias();
     $empresas = new Empresa();
     $selected_pro = $empresas->where('id', '=', Session::get('id_empresa'))->firstOrFail();
     $selected_pro = $selected_pro->provincia;
     $sxe = new SimpleXMLElement(public_path() . '/xml/municipios.xml', NULL, true);
     $i = 0;
     foreach ($sxe->municipios[0]->row as $municipio) {
         if ($municipio->CPRO == $selected_pro) {
             $cod_municipio = $municipio[0]->id;
             $cod_municipio = (string) $cod_municipio;
             $municipio_array[$cod_municipio] = $municipio[0]->NOMBRE;
             $i++;
         }
     }
     $selected_mun = $empresas->where('id', '=', Session::get('id_empresa'))->firstOrFail()->municipio;
     $id = Session::get('id_empresa');
     $calle = $empresas->getEmpresa($id)->direccion;
     $cp = $empresas->getEmpresa($id)->cod_postal;
     $anyos[] = trans('forms.sinExperiencia');
     $anyos[] = '< 1 ' . Lang::choice('forms.anyo', 1);
     for ($i = 1; $i <= Config::get('app.maxAnyosExpLaboral'); $i++) {
         $anyos[] = $i . " " . Lang::choice('forms.anyo', $i);
     }
     $anyos[] = '> ' . ($i - 1) . " " . Lang::choice('forms.anyo', $i);
     $formacionTitulaciones[0] = 'Seleccione nivel formativo...';
     foreach (trans('forms.nivelesFormativos') as $key => $value) {
         if ($key > 2) {
             $formacionTitulaciones[$key] = $value;
         }
     }
     return View::make('empresa/nuevaOferta', array('mesesContrato' => $meses, 'salarios' => $salarios, 'provincias' => $provincia_array, 'municipios' => $municipio_array, 'selected_mun' => $selected_mun, 'selected_pro' => $selected_pro, 'calle' => $calle, 'cp' => $cp, 'anyosExp' => $anyos, 'areasEmpleo' => $this->listaAreas(), 'formacionTitulos' => $formacionTitulaciones));
 }