Commit f44d0d59 authored by G2700's avatar G2700

all weather data

parent 1bfa3f45
......@@ -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(){
......
This diff is collapsed.
<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" />
<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-flex xs12 md12 pa-2>
<v-card flat>
<v-layout row wrap>
......
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