Commit ec58f02d by Luis Perez

Vista menus saludables conectada con la API

quitados elementos de composer 'vendor/...'
parent fa55853d
fuel/app/cache/
.idea/
fuel/app/logs/2018/
fuel/vendor/
......@@ -49,6 +49,7 @@ class Controller_Menussaludables_Lista_Index extends \Controller_App{
//Pasar la leyenda para la info funcionamiento de la página
$view->leyenda = "Te proponemos los siguientes menús saludables";
$view->items = $this->ws_get('generic');
return Response::forge($view);
}
......
......@@ -33,7 +33,8 @@ class Controller_Menussaludables_Menu_Index extends \Controller_App{
parent::before();
}
public function action_index(){
public function action_index($id){
$view = View::forge('menussaludables/menu/index.twig');
......@@ -49,8 +50,23 @@ class Controller_Menussaludables_Menu_Index extends \Controller_App{
//Pasar la leyenda para la info funcionamiento de la página
$view->leyenda = "Disfruta de este menú";
$view->items = $this->ws_get("generic/$id");
$view->week_days = array(
'monday' => 'lunes',
'tuesday' => 'martes',
'wednesday' => 'miercoles',
'thursday' => 'jueves',
'friday' => 'viernes',
'saturday' => 'sábado',
'sunday' => 'domingo',
);
$view->auto_filter(false);
Log::error(print_r( $view->items,true));
return Response::forge($view);
return Response::forge($view);
}
}
\ No newline at end of file
......@@ -111,31 +111,28 @@ trait Trait_InutraliaWS {
public function ws_article_get(){
return json_decode($this->request_generic('article'));
return $this->ws_get('article');
}
public function ws_recipe_get($id = null){
if(!$id){
return json_decode($this->request_generic('recipe'));
}else{
return json_decode($this->request_generic('recipe/'.$id));
}
return $this->ws_get('recipe'.(($id!=null)?"/$id":""));
}
public function ws_options_get(){
return json_decode($this->request_generic('options'));
}
public function ws_options_get(){
return $this->ws_get('options');
}
public function ws_options_post(){
return json_decode($this->request_generic('options'));
}
public function ws_get($url)
{
return json_decode($this->request_generic($url));
}
}
\ No newline at end of file
......@@ -27,7 +27,7 @@
// Url redirect a DEL SUPER --> "https://delsuper.es/inutralia?ids=";
$domain = "http://inutralia20back";
$domain = "http://inutralia/";
$V1 = '/api/v1/';
// PARAMETERS
......
......@@ -8,7 +8,7 @@ return array(
'connection' => array(
'dsn' => 'mysql:host=127.0.0.1;dbname=inutralia_webapp',
'username' => 'root',
'password' => 'socket',
'password' => '123456',
),
),
);
......@@ -19,9 +19,9 @@ return array(
'usuarios/active' => 'administracion/usuarios/index/active',
'usuarios/profile' => 'administracion/usuarios/index/profile',
'grupos' =>'administracion/grupos/index',
'grupos/update' =>'administracion/grupos/index/update',
'grupos/show/:id' =>'administracion/grupos/index/show/$1',
'grupos' => 'administracion/grupos/index',
'grupos/update' => 'administracion/grupos/index/update',
'grupos/show/:id' => 'administracion/grupos/index/show/$1',
/*HOME*/
'dashboard' => 'dashboard/index',
......@@ -31,27 +31,27 @@ return array(
'perfil/update' => 'perfil/index/update',
// MENU PERSONALIZADO
'menupersonalizado' =>'menupersonalizado/index',
'menupersonalizado' => 'menupersonalizado/index',
// MENU SALUDABLES
'menussaludables' =>'menussaludables/lista/index',
'menussaludables-menu' =>'menussaludables/menu/index',
'menussaludables' => 'menussaludables/lista/index',
'menussaludables-menu/:id' => 'menussaludables/menu/index/index/$1',
// RECETA
'receta-detalle' =>'receta/index',
'receta-detalle/update/:id' =>'receta/index/update/$1',
'receta-detalle' => 'receta/index',
'receta-detalle/update/:id' => 'receta/index/update/$1',
// RECETARIO
'recetario' =>'recetario/index',
'recetario' => 'recetario/index',
// BOLETIN SALUDABLE
'boletin-saludable' =>'boletinsaludable/index',
'boletin-saludable/ver' =>'boletinsaludable/index/ver',
'boletin-saludable' => 'boletinsaludable/index',
'boletin-saludable/ver' => 'boletinsaludable/index/ver',
// ARTICULO
'articulo-detalle' =>'articulo/index',
'articulo-detalle' => 'articulo/index',
'lista-compra' =>'listacompra/index',
'lista-compra' => 'listacompra/index',
......
......@@ -16,10 +16,10 @@
</div>
<div class="container mt20" >
{% for i in 0..5 %}
<a href="menussaludables-menu">
{% for i in items %}
<a href={{ "menussaludables-menu/"~ i.id }}>
<div class="row item-list-style">
<div class="col-xs-11"> Menú tipo {{ i }}</div>
<div class="col-xs-11"> Menú {{ i.ds }}</div>
<div class="col-xs-1"><i class="fa fa-angle-right"></i></div>
</div>
</a>
......
......@@ -12,7 +12,18 @@
</div>
<div class="content text-center pb40">
Texto recomendaciones resto del día
<strong>DESAYUNO </strong>
<br>{{ items.recBreakfastBase |raw }}<br>
{{ items.recBreakfastExt |raw}}
<strong>Media Mañana</strong>
<br>{{ items.recMorningBase |raw}}<br>
{{ items.recMorningExt |raw}}
<strong>Merienda </strong>
<br> {{ items.recAfternoonBase |raw}}<br>{{ items.recAfternoonExt |raw}}
<strong>Consejos Generales</strong>
<br>{{ items.recGeneralBase |raw}}
<br>{{ items.recGeneralExt |raw}}
</div>
</div>
......
<?php
// autoload.php @generated by Composer
require_once __DIR__ . '/composer/autoload_real.php';
return ComposerAutoloaderInitb8199cd60e690a51db649fb05371acf6::getLoader();
Copyright (c) Nils Adermann, Jordi Boggiano
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is furnished
to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
<?php
// autoload_classmap.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
);
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Twig_' => array($vendorDir . '/twig/twig/lib'),
'Monolog' => array($vendorDir . '/monolog/monolog/src'),
'Fuel\\Upload' => array($vendorDir . '/fuelphp/upload/src'),
);
<?php
// autoload_psr4.php @generated by Composer
$vendorDir = dirname(dirname(__FILE__));
$baseDir = dirname(dirname($vendorDir));
return array(
'Psr\\Log\\' => array($vendorDir . '/psr/log/Psr/Log'),
);
<?php
// autoload_real.php @generated by Composer
class ComposerAutoloaderInitb8199cd60e690a51db649fb05371acf6
{
private static $loader;
public static function loadClassLoader($class)
{
if ('Composer\Autoload\ClassLoader' === $class) {
require __DIR__ . '/ClassLoader.php';
}
}
public static function getLoader()
{
if (null !== self::$loader) {
return self::$loader;
}
spl_autoload_register(array('ComposerAutoloaderInitb8199cd60e690a51db649fb05371acf6', 'loadClassLoader'), true, true);
self::$loader = $loader = new \Composer\Autoload\ClassLoader();
spl_autoload_unregister(array('ComposerAutoloaderInitb8199cd60e690a51db649fb05371acf6', 'loadClassLoader'));
$useStaticLoader = PHP_VERSION_ID >= 50600 && !defined('HHVM_VERSION') && (!function_exists('zend_loader_file_encoded') || !zend_loader_file_encoded());
if ($useStaticLoader) {
require_once __DIR__ . '/autoload_static.php';
call_user_func(\Composer\Autoload\ComposerStaticInitb8199cd60e690a51db649fb05371acf6::getInitializer($loader));
} else {
$map = require __DIR__ . '/autoload_namespaces.php';
foreach ($map as $namespace => $path) {
$loader->set($namespace, $path);
}
$map = require __DIR__ . '/autoload_psr4.php';
foreach ($map as $namespace => $path) {
$loader->setPsr4($namespace, $path);
}
$classMap = require __DIR__ . '/autoload_classmap.php';
if ($classMap) {
$loader->addClassMap($classMap);
}
}
$loader->register(true);
return $loader;
}
}
<?php
// autoload_static.php @generated by Composer
namespace Composer\Autoload;
class ComposerStaticInitb8199cd60e690a51db649fb05371acf6
{
public static $prefixLengthsPsr4 = array (
'P' =>
array (
'Psr\\Log\\' => 8,
),
);
public static $prefixDirsPsr4 = array (
'Psr\\Log\\' =>
array (
0 => __DIR__ . '/..' . '/psr/log/Psr/Log',
),
);
public static $prefixesPsr0 = array (
'T' =>
array (
'Twig_' =>
array (
0 => __DIR__ . '/..' . '/twig/twig/lib',
),
),
'M' =>
array (
'Monolog' =>
array (
0 => __DIR__ . '/..' . '/monolog/monolog/src',
),
),
'F' =>
array (
'Fuel\\Upload' =>
array (
0 => __DIR__ . '/..' . '/fuelphp/upload/src',
),
),
);
public static function getInitializer(ClassLoader $loader)
{
return \Closure::bind(function () use ($loader) {
$loader->prefixLengthsPsr4 = ComposerStaticInitb8199cd60e690a51db649fb05371acf6::$prefixLengthsPsr4;
$loader->prefixDirsPsr4 = ComposerStaticInitb8199cd60e690a51db649fb05371acf6::$prefixDirsPsr4;
$loader->prefixesPsr0 = ComposerStaticInitb8199cd60e690a51db649fb05371acf6::$prefixesPsr0;
}, null, ClassLoader::class);
}
}
[
{
"name": "fuelphp/upload",
"version": "2.0.1",
"version_normalized": "2.0.1.0",
"source": {
"type": "git",
"url": "https://github.com/fuelphp/upload.git",
"reference": "6310108de98ffdbf1083612db5b15411fc140c90"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/fuelphp/upload/zipball/6310108de98ffdbf1083612db5b15411fc140c90",
"reference": "6310108de98ffdbf1083612db5b15411fc140c90",
"shasum": ""
},
"require": {
"php": ">=5.3"
},
"require-dev": {
"mockery/mockery": "0.7.*"
},
"time": "2013-10-11T21:42:58+00:00",
"type": "library",
"installation-source": "dist",
"autoload": {
"psr-0": {
"Fuel\\Upload": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "FuelPHP Development Team",
"email": "team@fuelphp.com"
}
],
"description": "Uploaded file processing.",
"homepage": "https://github.com/fuelphp/upload",
"keywords": [
"file uploads",
"upload"
]
},
{
"name": "monolog/monolog",
"version": "1.5.0",
"version_normalized": "1.5.0.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "583618d5cd2115a52101694aca87afb182b3e567"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/583618d5cd2115a52101694aca87afb182b3e567",
"reference": "583618d5cd2115a52101694aca87afb182b3e567",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
"require-dev": {
"doctrine/couchdb": "dev-master",
"mlehner/gelf-php": "1.0.*",
"raven/raven": "0.3.*"
},
"suggest": {
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
"mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server",
"raven/raven": "Allow sending log messages to a Sentry server"
},
"time": "2013-04-23T10:09:48+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.4.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Monolog": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
"homepage": "http://seld.be",
"role": "Developer"
}
],
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
"homepage": "http://github.com/Seldaek/monolog",
"keywords": [
"log",
"logging",
"psr-3"
]
},
{
"name": "psr/log",
"version": "dev-master",
"version_normalized": "9999999-dev",
"source": {
"type": "git",
"url": "https://github.com/php-fig/log.git",
"reference": "c4421fcac1edd5a324fda73e589a5cf96e52ffd0"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/php-fig/log/zipball/c4421fcac1edd5a324fda73e589a5cf96e52ffd0",
"reference": "c4421fcac1edd5a324fda73e589a5cf96e52ffd0",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"time": "2018-11-21T13:42:00+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.1.x-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-4": {
"Psr\\Log\\": "Psr/Log/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "PHP-FIG",
"homepage": "http://www.php-fig.org/"
}
],
"description": "Common interface for logging libraries",
"homepage": "https://github.com/php-fig/log",
"keywords": [
"log",
"psr",
"psr-3"
]
},
{
"name": "twig/twig",
"version": "v1.14.1",
"version_normalized": "1.14.1.0",
"source": {
"type": "git",
"url": "https://github.com/twigphp/Twig.git",
"reference": "8873d7593ad7c120004f177c0fd01459b383c9cb"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/twigphp/Twig/zipball/8873d7593ad7c120004f177c0fd01459b383c9cb",
"reference": "8873d7593ad7c120004f177c0fd01459b383c9cb",
"shasum": ""
},
"require": {
"php": ">=5.2.4"
},
"time": "2013-10-15T19:17:38+00:00",
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.14-dev"
}
},
"installation-source": "dist",
"autoload": {
"psr-0": {
"Twig_": "lib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com",
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
},
{
"name": "Armin Ronacher",
"email": "armin.ronacher@active-4.com",
"role": "Project Founder"
}
],
"description": "Twig, the flexible, fast, and secure template language for PHP",
"homepage": "http://twig.sensiolabs.org",
"keywords": [
"templating"
]
}
]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment