49 $imported = 0; |
49 $imported = 0; |
50 $yeasts = simplexml_load_file($target_file); |
50 $yeasts = simplexml_load_file($target_file); |
51 |
51 |
52 foreach ($yeasts->YEAST as $yeast) { |
52 foreach ($yeasts->YEAST as $yeast) { |
53 |
53 |
54 $sql = "INSERT INTO inventory_yeasts SET name='" . mysqli_real_escape_string($db, $yeast->NAME); |
54 $uuid = str_replace("\n", "", file_get_contents('/proc/sys/kernel/random/uuid')); |
55 |
55 $sql = "INSERT INTO inventory_yeasts SET uuid='" . $uuid; |
|
56 $sql .= "', name='" . mysqli_real_escape_string($db, $yeast->NAME); |
56 if ($yeast->TYPE == 'Lager') |
57 if ($yeast->TYPE == 'Lager') |
57 $sql .= "', type='0"; |
58 $sql .= "', type='0"; |
58 else if ($yeast->TYPE == 'Ale') |
59 else if ($yeast->TYPE == 'Ale') |
59 $sql .= "', type='1"; |
60 $sql .= "', type='1"; |
60 else if ($yeast->TYPE == 'Wheat') |
61 else if ($yeast->TYPE == 'Wheat') |