Commit c20a78d1 authored by Reko Meriö's avatar Reko Meriö

Merge

parents 5d8eab2e f44d0d59
......@@ -29,7 +29,7 @@ class LocationController extends Controller
return $locations;
}
public function pullclothes(Request $request){
/* public function pullclothes(Request $request){
$age = $request->input('age');
$temperature = $request->input('temperature');
if(!empty($request->input('gender'))){
......@@ -41,6 +41,26 @@ class LocationController extends Controller
$vaatteet = DB::select( DB::raw("select vaate.vaate,tyyppi.tyyppi from vaate inner join tyyppi on tyyppi.id=vaate.tyyppi_id where vaate.id in (select vaatecomp.vaate_id from vaatecomp where vaatecomp.age_id = (select id from age where minage<= :age and maxage >= :age2 and gender = :gender) and vaatecomp.temperature_id = (select id from temperature where mintemperature <= :temperature and maxtemperature >= :temperature2))"),array('age' => $age, 'age2' => $age, 'gender' => $gender, 'temperature' => $temperature, 'temperature2' => $temperature));
return $vaatteet;
}*/
public function pullclothes(Request $request){
$age = $request->input('age');
$temperature = $request->input('temperature');
if(!empty($request->input('gender'))){
$gender = $request->input('gender');
}
else {
$gender = "B";
}
$a =array([]);
for($i=1; $i <=6; $i++) {
$vaatteet = DB::select( DB::raw("select vaate.vaate,tyyppi.tyyppi from vaate inner join tyyppi on tyyppi.id=vaate.tyyppi_id where vaate.id in (select vaatecomp.vaate_id from vaatecomp where vaatecomp.age_id = (select id from age where minage<= :age and maxage >= :age2 and gender = :gender) and vaatecomp.temperature_id = :tempid)"),array('age' => $age, 'age2' => $age, 'gender' => $gender, 'tempid' => $i));
array_push($a,$vaatteet);
}
//return json_encode($a);
return $a;
// return $vaatteet;
}
public function populatedb(){
......
......@@ -2962,6 +2962,8 @@ __webpack_require__.r(__webpack_exports__);
//
//
//
//
//
......@@ -43903,7 +43905,7 @@ var render = function() {
var _c = _vm._self._c || _h
return _c(
"v-flex",
{ attrs: { xs12: "", md6: "", "pa-2": "" } },
{ attrs: { xs12: "", md12: "", "pa-2": "" } },
[
_c(
"v-card",
......@@ -44008,22 +44010,29 @@ var render = function() {
"v-layout",
{ attrs: { row: "", wrap: "" } },
[
_c("Locations", {
attrs: { id: "locations" },
on: { pushWeatherData: _vm.pushData }
}),
_vm._v(" "),
_c("Clothes", { attrs: { temperature: _vm.temperature } }),
_c(
"v-flex",
{ attrs: { xs12: "", md6: "" } },
[
_c("Locations", {
attrs: { id: "locations" },
on: { pushWeatherData: _vm.pushData }
}),
_vm._v(" "),
_c("Weather", {
attrs: {
id: "weather",
values: _vm.values,
weatherData: _vm.weatherData,
kunta: _vm.selectedKunta
},
on: { pushTemperature: _vm.pullTemperature }
})
],
1
),
_vm._v(" "),
_c("Weather", {
attrs: {
id: "weather",
values: _vm.values,
weatherData: _vm.weatherData,
kunta: _vm.selectedKunta
},
on: { pushTemperature: _vm.pullTemperature }
})
_c("Clothes", { attrs: { temperature: _vm.temperature } })
],
1
)
......@@ -44100,7 +44109,7 @@ var render = function() {
var _c = _vm._self._c || _h
return _c(
"v-flex",
{ attrs: { xs12: "", md6: "", "pa-2": "" } },
{ attrs: { xs12: "", md12: "", "pa-2": "" } },
[
_c(
"v-card",
<template>
<v-flex xs12 md6 pa-2>
<v-flex xs12 md12 pa-2>
<v-card color="transparent" flat>
<v-card-text>
<v-autocomplete color="light-green accent-4" v-model="selectedKunta" :items="kunnat" hide-no-data hide-selected item-text="Description" item-value="API" label="Paikkakunta" placeholder="" prepend-icon="mdi-database-search" clearable return-object></v-autocomplete>
......
<template>
<div>
<v-layout row wrap>
<v-flex xs12 md6>
<Locations id="locations" @pushWeatherData="pushData" />
<Clothes :temperature="temperature" />
<Weather id="weather" @pushTemperature="pullTemperature" :values="values" :weatherData="weatherData" :kunta="selectedKunta"/>
</v-flex>
<Clothes :temperature="temperature" />
</v-layout>
</div>
......
<template>
<v-flex xs12 md6 pa-2>
<v-card flat>
<v-layout row wrap>
<v-card-title>
<div id="location" class="left">{{ kunta }}</div>
<v-flex xs3>
<div class="label">Lämpötila</div>
<div class="left">{{ currentTemp }}°C</div>
<div class="label">Feels like</div>
<div id="feels-like" class="left">{{ feelsLike }}°C</div>
</v-flex>
<v-flex xs9>
<WeatherChart id="chart" :hours="hours" :values="temperatures" :labels="temperaturesWithC" />
</v-flex>
<div id="summary">{{ summary }}</div>
<div id="wind">Tuuli: {{ wind }} m/s</div>
</v-card-title>
<v-card-text>
<div class="label">Päivä</div>
<v-slider v-model="date" :tick-labels="dateLabels" :max="96" step="24" ticks="always" tick-size="4" color="light-blue accent-4" thumb-color="light-blue accent-4" track-color="light-blue accent-1"></v-slider>
<div class="label">Tunti</div>
<v-slider v-model="hour" :tick-labels="hourLabels" :max="max" :step="interval" ticks="always" tick-size="4" color="light-blue accent-4" thumb-color="light-blue accent-4" track-color="light-blue accent-1"></v-slider>
<v-layout row wrap justify-space-between>
<v-flex class="time-stamp" xs1 v-for="(icon,index) in icons" :key="index"><img class="icon" :src="icon"></v-flex>
</v-layout>
</v-card-text>
</v-layout>
<v-flex xs12 md12 pa-2>
<v-card flat>
<v-layout row wrap>
<v-card-title>
<div id="location" class="left">{{ kunta }}</div>
<v-flex xs3>
<div class="label">Lämpötila</div>
<div class="left">{{ currentTemp }}°C</div>
<div class="label">Feels like</div>
<div id="feels-like" class="left">{{ feelsLike }}°C</div>
</v-flex >
<v-flex xs9>
<WeatherChart id="chart" :hours="hours" :values="temperatures" :labels="temperaturesWithC" />
</v-flex>
<div id="summary">{{ summary }}</div>
<div id="wind">Tuuli: {{ wind }} m/s</div>
</v-card-title>
<v-card-text>
<div class="label">Päivä</div>
<v-slider v-model="date" :tick-labels="dateLabels" :max="96" step="24" ticks="always" tick-size="4" color="light-blue accent-4" thumb-color="light-blue accent-4" track-color="light-blue accent-1"></v-slider>
<div class="label">Tunti</div>
<v-slider v-model="hour" :tick-labels="hourLabels" :max="max" :step="interval" ticks="always" tick-size="4" color="light-blue accent-4" thumb-color="light-blue accent-4" track-color="light-blue accent-1"></v-slider>
<v-layout row wrap justify-space-between>
<v-flex class="time-stamp" xs1 v-for="(icon,index) in icons" :key="index"><img class="icon" :src="icon"></v-flex>
</v-layout>
</v-card-text>
</v-layout>
</v-card>
</v-flex>
......
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