Skip to content

Commit

Permalink
Hotfix: Traduccion Club ONGs - Implementacion ClubsTrait
Browse files Browse the repository at this point in the history
  • Loading branch information
elyambay committed Oct 24, 2018
1 parent 961e4a5 commit b49e5ba
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 73 deletions.
4 changes: 4 additions & 0 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@
use Auth;
use App\Cabecera_encuesta;
use App\beneficios_cabecera_encuesta;
use App\Traits\ClubsTrait;

class HomeController extends Controller
{
use ClubsTrait;
/**
* Create a new controller instance.
*
Expand Down Expand Up @@ -46,7 +48,9 @@ public function index()
$dbEncuestas = Cabecera_encuesta::where('empresa_id', $dbEmpresa->id)->orderBy('id', 'DESC')->get();
$dbEncuesta = $dbEncuestas->first();
$dbEncuestaAnt = $dbEncuestas->get(1);
$club = $this->club($dbEmpresa->rubro_id);
return view('clientes.home')->with('dbEmpresa', $dbEmpresa)
->with('club', $club)
->with('dbEncuesta', $dbEncuesta)
->with('dbEncuestaAnt' , $dbEncuestaAnt);

Expand Down
67 changes: 4 additions & 63 deletions app/Http/Controllers/ReporteController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use App\Cargo_en;
use App\Rubro;
use App\User;
use App\Traits\ClubsTrait;
use Hash;
use DB;
use Auth;
Expand All @@ -25,9 +26,9 @@



class ReporteController extends Controller
class ReporteController extends Controller
{

use ClubsTrait;
/**
* Display a listing of the resource.
*
Expand Down Expand Up @@ -89,67 +90,7 @@ public function show($id)
->with('locale', $locale);
}

private function club($rubro, $getImagen = null){
if($this->getIdioma() == "en"){
switch ($rubro) {
case 1:
$imagen = "images/caratula-bancos.PNG";
$club = "Banking";
break;
case 2:
$imagen = "images/caratula-agro-en.PNG";
$club = "Agribusiness";
break;
case 3:
$imagen = "images/caratula-autos.PNG";
$club = 'Car and Machine';
break;
case 4:
$imagen = "images/caratula-naviera-en.PNG";
$club = "Shipping";
break;
case 6:
$imagen = "images/caratula-bancos.PNG";
$club = "Non Governmental Organizations";
break;
default:
$imagen = "images/caratula-bancos.PNG";
$club = "de Bancos";
break;
}
}else{
switch ($rubro) {
case 1:
$imagen = "images/caratula-bancos.PNG";
$club = "- Bancos de Paraguay";
break;
case 2:
$imagen = "images/caratula-agro.PNG";
$club = "- Empresas de Agronegocios - Paraguay";
break;
case 3:
$imagen = "images/caratula-autos.PNG";
$club = '- Empresas del Sector Automotriz, Maquinarias y Utilitarios';
break;
case 4:
$imagen = "images/caratula-naviera.PNG";
$club = "- Navieras de Paraguay";
break;
case 6:
$imagen = "images/caratula-bancos.PNG";
$club = "- Organizaciones No Gubernamentales";
break;
default:
$imagen = "images/caratula-bancos.PNG";
$club = "de Bancos";
break;
}
}
if($getImagen){
return $imagen;
}
return $club;
}

public function lista($id){
$dbEmpresa = $id;
$empresa = Empresa::find($id);
Expand Down
67 changes: 67 additions & 0 deletions app/Traits/ClubsTrait.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?php

Namespace App\Traits;

trait ClubsTrait{
public function club($rubro, $getImagen = null){
if(app()->getLocale() == "en"){
switch ($rubro) {
case 1:
$imagen = "images/caratula-bancos.PNG";
$club = "Banking Club";
break;
case 2:
$imagen = "images/caratula-agro-en.PNG";
$club = "Agribusiness Club";
break;
case 3:
$imagen = "images/caratula-autos.PNG";
$club = 'Car and Machine Club';
break;
case 4:
$imagen = "images/caratula-naviera-en.PNG";
$club = "Shipping Club";
break;
case 6:
$imagen = "images/caratula-bancos.PNG";
$club = "Club: Survey of Non-Governmental Organizations";
break;
default:
$imagen = "images/caratula-bancos.PNG";
$club = "de Bancos";
break;
}
}else{
switch ($rubro) {
case 1:
$imagen = "images/caratula-bancos.PNG";
$club = "Club - Bancos de Paraguay";
break;
case 2:
$imagen = "images/caratula-agro.PNG";
$club = "Club - Empresas de Agronegocios - Paraguay";
break;
case 3:
$imagen = "images/caratula-autos.PNG";
$club = 'Club - Empresas del Sector Automotriz, Maquinarias y Utilitarios';
break;
case 4:
$imagen = "images/caratula-naviera.PNG";
$club = "Club - Navieras de Paraguay";
break;
case 6:
$imagen = "images/caratula-bancos.PNG";
$club = "Club - Encuesta de Organizaciones No Gubernamentales";
break;
default:
$imagen = "images/caratula-bancos.PNG";
$club = "Club de Bancos";
break;
}
}
if($getImagen){
return $imagen;
}
return $club;
}
}
2 changes: 1 addition & 1 deletion resources/views/clientes/home.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="row">
<div class="browser-window">
<div class="top-bar">
<h4>{{ $dbEmpresa->rubro->descripcion}}</h4>
<h4>{{ $club }}</h4>
</div>
<div class="content">
<table id="Listado" class="highlight" data-step="1" data-intro="<p class='intro-title'><strong>DATOS DE SU EMPRESA/BANCO</strong></p> En la pantalla principal Ud. podrá visualizar los datos básicos</br> de su organización y los comandos que contiene la plataforma." >
Expand Down
12 changes: 3 additions & 9 deletions resources/views/report/title.blade.php
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
@if ($locale == "en")
<div class="col s8">
<h4>{!! $club !!} Club</h4>
</div>
@else
<div class="col s8">
<h4>Club {!! $club !!}</h4>
</div>
@endif
<div class="col s8">
<h4>{!! $club !!}</h4>
</div>

<div class="col s4">
<img class="hoverable bordered" align="right" style="width:60%; margin-top: 1em;display: block;" src="{{URL::asset('/images/logo.jpg')}}"/>
Expand Down

0 comments on commit b49e5ba

Please sign in to comment.