From 3a6c6b00eb4c62b24c5e5ca670142ac5a00d7847 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Tue, 18 Jun 2024 22:46:31 +0100 Subject: o --- index.php | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 index.php (limited to 'index.php') diff --git a/index.php b/index.php new file mode 100644 index 0000000..840d987 --- /dev/null +++ b/index.php @@ -0,0 +1,188 @@ + [], + 1 => ["brocolli" => .5, + "passata" => 1, + "spaghetti" => .3], + 2 => ["brocolli" => .5, + "passata" => 1, + "rice" => .3], + 3 => [], + 4 => ["kale" => .3, + "pak choi" => .5, + "brocolli" => .5, + "rice" => .3, + "sweetcorn" => .5, + "mangetout" => .5], + 5 => ["potatoes" => 5, + "beans" => 2], + 6 => ["potatoes" => 5, + "peas" => .3], + 7 => ["egg" => 2, + "vesto" => .5, + "black beans" => 1, + "spaghetti" => .2], + 8 => ["instant ramen" => 2, + "brocolli" => .5, + "sweetcorn" => .5], + 9 => ["noodles" => .5, + "pak choi" => .5, + "brocolli" => .5, + "chilli" => .5, + "sweetcorn" => .5, + "mangetout" => .5, + "garlic" => 1 + ], + 10 => ["tinned tomatoes" => 3, + "coconut milk" => 1, + "garlic" => .5], + 11 => ["squash" => 1, + "onion" => 1, + "garlic" => .5, + "vegetable stock" => .15, + "coconut milk" => 1], + 12 => ["onion" => 1, + "garlic" => .5, + "pepper" => 1, + "black beans" => 3, + "tinned tomatoes" => 1, + "vegetable stock" => .15, + "lime" => 1], + 13 => ["bean burger"=>2, + "minced meat" => .25, + "chips" => 1, + "egg" => 1, + "bun" => 4], + 14 => ["brocolli" => .5, + "passata" => 1, + "penne" => .5], + 15 => ["chickpea" => 2, + "chopped tomato" => 2, + "lemon" => 1, + "onion" => 2, + "garlic" => .5, + "ginger" => .5, + "chilli" => 1] +]; + +$GLOBALS["ingredientsList"] = []; +$GLOBALS["ingredients"] = []; + + +$GLOBALS["allowance"] = [999,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2]; + +for($i =0;$i<14;$i++){ + if ($_POST[$i]==""){ + $_POST[$i]=0; + } + $GLOBALS["allowance"][$_POST[$i]]-=1; +} + + +function genSel($dayNum,$meal){ + $p = (int)$_POST[$dayNum*2+$meal]; + $dm = $dayNum*2 + $meal; + $o = ""; +} + +function genRow($dayNum){ + return "" . $GLOBALS["days"][($dayNum+5) % 7] . "" . genSel($dayNum,0) . "" . genSel($dayNum,1) . ""; +} + +for($i =0;$i<14;$i++){ + foreach($GLOBALS["mealingredients"][$_POST[$i]] as $key => $val){ + if(isset($GLOBALS["ingredients"][$key])){ + $GLOBALS["ingredients"][$key] += $val; + }else{ + $GLOBALS["ingredients"][$key] = $val; + } + } +} + +?> + + + + + + Food solver + + + + + + + + + +
+ + + + + + + +
\LunchDinner
+ + +
+ IngredientQty"; + + foreach($GLOBALS["ingredients"] as $key => $val){ + echo "" . $key . "" . $val . ""; + } + + echo ""; + } + ?> + + -- cgit v1.2.3