Registrerade event

Här lägger vi upp alla registrerade event, som tävlar om Almedalens klimatsmartaste mat – med information om maten som serveras. Information om det klimatavtryck maten har kommer inom kort!
 

[insert_php]

//Initiera variabler
$contact_orgs = ””;
$event_header = ””;
$event_date_time_start = ””;
$event_date_time_end = ””;
$event_address = ””;
$event_description = ””;
$event_url = ””;
$food_description = ””;

$food_type = ””;
$climate_value1 = 0;
$climate_link = ””;
$climate_description = ””;
$comp = 0;
$change = 0;

$vegetarian = ””;
$vegan = ””;
$plastic = ””;
$waste = ””;
$plastic_description = ””;
$waste_description = ””;

// connect to the database
$db = mysqli_connect(’s687.loopia.se’, ’powerran@s230980’, ’L8Z=!}Rp:qk6(9yc’, ’smartklimatmat_se_db_1′);

$query_events = ”SELECT * FROM events WHERE published=’1’ AND published_mod=’1′”;
$result_events = mysqli_query($db, $query_events);

while ($row = mysqli_fetch_assoc($result_events)) {

$contact_orgs = $row[’contact_orgs’];
$event_header = $row[’event_header’];
$event_date_time_start = $row[’event_date_time_start’];
$event_date_time_end = $row[’event_date_time_end’];
$event_address = $row[’event_address’];
$event_description = $row[’event_description’];
$event_url = $row[’event_url’];
$food_description = $row[’food_description’];

$food_type = $row[’food_type’];
$climate_value1 = $row[’climate_value1’];
$climate_link = $row[’climate_link’];
$climate_description = $row[’climate_description’];

$plastic_description = $row[’plastic_description’];
$waste_description = $row[’waste_description’];

if ($row[”vegetarian”]==1) {
$vegetarian = ”Ja”;
} else {
$vegetarian = ”Nej”;
}

if ($row[”vegan”]==1) {
$vegan = ”Ja”;
} else {
$vegan = ”Nej”;
}

if ($row[”plastic”]==1) {
$plastic = ”Ja”;
} else {
$plastic = ”Nej”;
}
if ($row[”waste”]==1) {
$waste = ”Ja”;
} else {
$waste = ”Nej”;
}

echo ”

\n”;
echo ”

\n”;
echo ”

Starttid: $event_date_time_start
\n”;
echo ”Sluttid: $event_date_time_end
\n”;
echo ”Plats: $event_address
\n”;
echo ”Arrangör: $contact_orgs
\n”;
echo ”Beskrivning av eventet: $event_description
\n”;
echo ”Beskrivning av maten: $food_description
\n”;

if ($food_type==1) {
echo ”Typ av mat: Frukost
\n”;
$comp = 158;
}
elseif ($food_type==2) {
echo ”Typ av mat: Lunch
\n”;
$comp = 142;
}
elseif ($food_type==3) {
echo ”Typ av mat: Mingelmat
\n”;
$comp = 265;
}
elseif ($food_type==4) {
echo ”Typ av mat: Övrigt
\n”;
}

if ($climate_value1!=0) {
echo ”Matens utsläpp: $climate_value1 CO2e/100g”;
if ($comp!=0) {
$change = (1-($climate_value1/$comp))*100;
$change = round($change, 1);
if ($change < 1) { $change = 0-$change; echo " (+ $change jämfört med standardmenyn)
\n”;
}
elseif ($change > 1) {
echo ” (– $change jämfört med standardmenyn)
\n”;
}
else {
echo ” (samma som standardmenyn)
\n”;
}
}
}
if ($climate_link != ””) {
echo ”Länk: Klimatberäknad meny
\n”;
}
if ($climate_description != ””) {
echo ”Övrigt om klimattänket bakom maten: $climate_description
\n”;
}

echo ”Vegetarisk mat finns: $vegetarian
\n”;
echo ”Vegansk mat finns: $vegan
\n”;
echo ”Arrangören minimerar avfall: $plastic
\n”;
if ($plastic_description != ””) {
echo ”$plastic_description
\n”;
}
echo ”Arrangören minimerar matsvinn: $waste
\n”;
if ($waste_description != ””) {
echo ”$waste_description
\n”;
}
echo ”

\n”;
}

[/insert_php]

 
Veganpizza