KOKINIO - MANAGER
Edit File: helpers.php
<?php namespace App; class Helper { static function month($op) { $month = ""; switch ($op) { case 1: $month = "Enero"; break; case 2: $month = "Febrero"; break; case 3: $month = "Marzo"; break; case 4: $month = "Abril"; break; case 5: $month = "Mayo"; break; case 6: $month = "Junio"; break; case 7: $month = "Julio"; break; case 8: $month = "Agosto"; break; case 9: $month = "Septiembre"; break; case 10: $month = "Octubre"; break; case 11: $month = "Noviembre"; break; case 12: $month = "Diciembre"; break; default: $month = "Error"; break; } return $month; } public static function backColor($val){ $back = ""; if( $val >1 and $val < 4000){ $back = "#fbf8a0"; } if( $val > 4000){ $back = "white"; } if($val == 0){ $back = "#dd4b39"; } return $back; } public static function Color($val){ $back = "black"; if($val == 0){ $back = "white"; } return $back; } static function getRol(){ return "fc00e180-57a3-11e8-b882-991ab8fbf4e1"; } static function getRolOp(){ return "219e8c00-c92a-11e9-824c-19cf12d8b4be"; } static function getSabores($data) { $sabores = []; if ($data->vainilla) { array_push($sabores, ['sabor' => 'Vainilla', 'cantidad' => $data->vainilla]); } if ($data->fresa) { array_push($sabores, ['sabor' => 'Fresa', 'cantidad' => $data->fresa]); } if ($data->natural) { array_push($sabores, ['sabor' => 'Natural', 'cantidad' => $data->natural]); } if ($data->chocolate) { array_push($sabores, ['sabor' => 'Chocolate', 'cantidad' => $data->chocolate]); } if ($data->eucament) { array_push($sabores, ['sabor' => 'Eucament', 'cantidad' => $data->eucament]); } return $sabores; } static function getTipoPago($data) { $tipoPago = []; if ($data->efectivo) { array_push($tipoPago, ['tipo_pago' => 'Efectivo', 'cantidad' => $data->efectivo]); } if ($data->pedimento) { array_push($tipoPago, ['tipo_pago' => 'Pedimento', 'cantidad' => $data->pedimento]); } if ($data->deposito) { array_push($tipoPago, ['tipo_pago' => 'Deposito', 'cantidad' => $data->deposito]); } if ($data->transferencia) { array_push($tipoPago, ['tipo_pago' => 'Transferencia', 'cantidad' => $data->transferencia]); } if ($data->tarjeta) { array_push($tipoPago, ['tipo_pago' => 'Tarjeta', 'cantidad' => $data->tarjeta]); } return $tipoPago; } static function fullName($nombre = "", $ape_p = "", $ape_m = "") { $fullName = $nombre." ".$ape_p." ".$ape_m; return $fullName; } static function getClass($estatus) { $color = 'default'; switch ($estatus) { case 'Entregado': $color = 'primary'; break; case 'Enviado': $color = 'success'; break; case 'Pendiente': case 'Reenviado': $color = 'warning'; break; default: # code... break; } return $color; } }