$root="/usr/home/deb3977n3/domains/morechemistry.com/public_html";
include("${root}/includes/layout_page.php");
layout_load();
include("${root}/food-additives/includes/foods_menu.php");
require_once("${root}/food-additives/includes/config.php");
menu_load("food-additives");
$dbhost="localhost";
$dbuname="deb3977n3_reader";
$dbpass="reader";
$language=$_REQUEST["language"];
$searchstr=$_REQUEST["searchstr"];
// makes a list for all e-number divided per functional group and with one english name per substance
if ($language=="") { $language="any"; }
$for_nl="names_nl like '%${searchstr}%'";
$for_uk="names_uk like '%${searchstr}%'";
$for_fr="names_fr like '%${searchstr}%'";
$for_de="names_de like '%${searchstr}%'";
if ($language=="any") { $any_selected="selected"; $my_lang="$for_nl OR $for_uk OR $for_fr OR $for_de";} else { $any_selected=""; }
if ($language=="nl") { $nl_selected="selected"; $my_lang=$for_nl; } else { $nl_selected=""; }
if ($language=="uk") { $uk_selected="selected"; $my_lang=$for_uk; } else { $uk_selected=""; }
if ($language=="fr") { $fr_selected="selected"; $my_lang=$for_fr; } else { $fr_selected=""; }
if ($language=="de") { $de_selected="selected"; $my_lang=$for_de; } else { $de_selected=""; }
$title_plus="";
$advice="";
if (strlen($searchstr)>2)
{
$db=mysql_connect($dbhost, $dbuname, $dbpass) or die ("MySQL verbinding mislukt");
$dbid = "deb3977n3_foodstuff";
mysql_select_db($dbid, $db) or die ("Database verbinding mislukt");
$query="SELECT * FROM additives where $my_lang ORDER BY sortindex";
$additives_data = mysql_query($query);
$no_records=mysql_num_rows($additives_data);
if ($no_records==0) { $advice="No results for '${searchstr}' were found."; }
if ($no_records==1) { $advice="Search string '${searchstr}' was found in 1 additives."; }
if ($no_records>1) { $advice="Search string '${searchstr}' was found in ${no_records} different additives."; }
$title_plus=", search results for ${searchstr}";
}
else
{
if (strlen($searchstr)>0) { $advice="Search string '${searchstr}' is too short."; }
}
// begin of story
$story=$menu;
$story.=<<
E-numbers search page${title_plus}
#GOOGLEFORFOOD#
Use this search page if you want to find food additives by part (at least 3 characters) of their names.
If the number of results is too high either search for additive names in a single language (currently English and Dutch) or enter a larger part of the name.
The list of results is divided per functional group.
$advice
ADDITIVE_INTRO;
// additiional option must wait
//
//