$val) { if ($val['0'] == $id) { return $key; } } return null; } function wildcard_in_array ($string, $array = array ()){ foreach ($array as $key => $value) { unset ($array[$key]); if (strpos($value, $string) !== false) { $array[$key] = $value; } } return $array; } function keyforAllergen($id, $array, $allergenposition) { foreach ($array as $key => $val) { if ($val['0'] == $id) { return $val[$allergenposition]; } } return null; } # $Allergenid = searchforAllergen($IngredientFieldName, $AllergensListName); } ?> Packaging 1

Packaging Name: ".$Packaging1_FreeText."

Packaging Material: ".$ClosureCommonName1."

Manufactured by: ".$PackagingManufacturer1.", ".$PackagingAddress1."

".$PackagingPhrase1.""; } if ($Closure1_Material){ $FinalPackaging=$FinalPackaging."

Closure Type & Colour: ".$Closure1_FreeText."

Closure Material: ".$ClosureCommonName1."

Manufactured by: ".$ClosureManufacturer1.", ".$ClosureAddress1."

".$ClosurePhrase1.""; } if ($Packaging2){ $FinalPackaging=$FinalPackaging."

Packaging 2

".$ProductName." is also packaged in...

Packaging Type & Colour: ".$PackagingType2.", ".$PackagingColour2."

Manufactured by: ".$PackagingManufacturer2.", ".$PackagingAddress2."

".$PackagingData2.""; } if ($Closure2){ $FinalPackaging=$FinalPackaging."

Closure Type & Colour: ".$ClosureType2.", ".$ClosureColour1."

Manufactured by: ".$ClosureManufacturer2.", ".$ClosureAddress2."

".$ClosureData2.""; } if ($Packaging3){ $FinalPackaging=$FinalPackaging."

Packaging 3

".$ProductName." is also packaged in...

Packaging Type & Colour: ".$PackagingType3.", ".$PackagingColour2."

Manufactured by: ".$PackagingManufacturer3.", ".$PackagingAddress3."

".$PackagingData3.""; } if ($Closure3){ $FinalPackaging=$FinalPackaging."

Closure Type & Colour: ".$ClosureType3.", ".$ClosureColour1."

Manufactured by: ".$ClosureManufacturer3.", ".$ClosureAddress3."

".$ClosureData3.""; } if ($Packaging4){ $FinalPackaging=$FinalPackaging."

Packaging 4

".$ProductName." is also packaged in...

Packaging Type & Colour: ".$PackagingType3.", ".$PackagingColour2."

Manufactured by: ".$PackagingManufacturer4.", ".$PackagingAddress4."

".$PackagingData4.""; } if ($Closure4){ $FinalPackaging=$FinalPackaging."

Closure Type & Colour: ".$ClosureType4.", ".$ClosureColour1."

Manufactured by: ".$ClosureManufacturer4.", ".$ClosureAddress4."

".$ClosureData4.""; } if ($Packaging5){ $FinalPackaging=$FinalPackaging."

Packaging 5

".$ProductName." is also packaged in...

Packaging Type & Colour: ".$PackagingType3.", ".$PackagingColour2."

Manufactured by: ".$PackagingManufacturer5.", ".$PackagingAddress5."

".$PackagingData5.""; } if ($Closure5){ $FinalPackaging=$FinalPackaging."

Closure Type & Colour: ".$ClosureType5.", ".$ClosureColour1."

Manufactured by: ".$ClosureManufacturer5.", ".$ClosureAddress5."

".$ClosureData5.""; } # GET THE STABILITY RESULS $StabilityTest="SELECT * FROM StabilityTest WHERE ProductBarcode LIKE $pb"; $StabilityTestResult=mysql_query($StabilityTest); $StabilityTestResultNum=mysql_numrows($StabilityTestResult); $StabilityTestResultRow = mysql_fetch_row($StabilityTestResult); if ($StabilityTestResultNum > 0){ $TestResultPhrase=mysql_result($StabilityTestResult,0,"TestResultPhrase"); $StabilityTestResultQuantity=mysql_result($StabilityTestResult,0,"AmountTested"); } $StabilityTestResult= $TestResultPhrase; # GET THE MICRO RESULS $MicroTest="SELECT * FROM MicrobiologicalTest WHERE ProductBarcode LIKE $pb"; $MicroTestTestResult=mysql_query($MicroTest); $MicroTestTestResultNum=mysql_numrows($MicroTestTestResult); $MicroTestTestResultRow = mysql_fetch_row($MicroTestTestResult); if ($MicroTestTestResultNum > 0){ $MicroResultPhrase=mysql_result($MicroTestTestResult,0,"MicroResultPhrase"); $A2dResult=mysql_result($MicroTestTestResult,0,"2dResult"); $A7dResult=mysql_result($MicroTestTestResult,0,"7dResult"); $A14dResult=mysql_result($MicroTestTestResult,0,"14dResult"); $A28dResult=mysql_result($MicroTestTestResult,0,"28dResult"); } $MicroTestTable=""; $MicroTestResult= $MicroResultPhrase; # IF THE ADDRESS FOR THE PRODUCT IS EMPTY, THEN POPULATE WITH NATURALLYTHINKING DETAILS if (!$ProductAddress){ $ProductAddress="

Danny Stanzl
Naturallythinking
The Tramsheds
Coomber Way
Croydon
Surrey
CR0 4TQ

Tel: 020 8689 6489
Web: www.naturallythinking.com
Email: support@naturallythinking.eu

"; } # PRODUCE INGREDIENT ARRAY WITH QUANTITIES $IngredientArray=array($RawIngredientInci0=>$RawIngredientQty0,$RawIngredientInci1=>$RawIngredientQty1,$RawIngredientInci2=>$RawIngredientQty2,$RawIngredientInci3=>$RawIngredientQty3,$RawIngredientInci4=>$RawIngredientQty4,$RawIngredientInci5=>$RawIngredientQty5,$RawIngredientInci6=>$RawIngredientQty6,$RawIngredientInci7=>$RawIngredientQty7,$RawIngredientInci8=>$RawIngredientQty8,$RawIngredientInci9=>$RawIngredientQty9,$RawIngredientInci10=>$RawIngredientQty10,$RawIngredientInci11=>$RawIngredientQty11,$RawIngredientInci12=>$RawIngredientQty12,$RawIngredientInci13=>$RawIngredientQty13,$RawIngredientInci14=>$RawIngredientQty14,$RawIngredientInci15=>$RawIngredientQty15,$RawIngredientInci16=>$RawIngredientQty16,$RawIngredientInci17=>$RawIngredientQty17,$RawIngredientInci18=>$RawIngredientQty18,$RawIngredientInci19=>$RawIngredientQty19,$RawIngredientInci20=>$RawIngredientQty20,); arsort($IngredientArray); # PRODUCE INGREDIENT ARRAY WITHOUT QUANTITIES $IngredientFinalArray=array($RawIngredientInci0,$RawIngredientInci1,$RawIngredientInci2,$RawIngredientInci3,$RawIngredientInci4,$RawIngredientInci5,$RawIngredientInci6,$RawIngredientInci7,$RawIngredientInci8,$RawIngredientInci9,$RawIngredientInci10,$RawIngredientInci11,$RawIngredientInci12,$RawIngredientInci13,$RawIngredientInci14,$RawIngredientInci15,$RawIngredientInci16,$RawIngredientInci17,$RawIngredientInci18,$RawIngredientInci19,$RawIngredientInci20); arsort($IngredientFinalArray); foreach($IngredientArray as $ia=>$ia_value) { if (!empty($ia)) { $IngredientArrayInci=$IngredientArrayInci.$ia." (".$ia_value."), "; } } foreach($IngredientArray as $iab=>$iab_value) { if (!empty($iab)) { $IngredientFinalInci=$IngredientFinalInci.$iab.", "; } } //echo "IngredientFinalInci: ".$RawIngredientInci0."
"; # BUILD THE INGREDIENT INGREDIENT QUANTATIVE AND QUALITIVE COMPOSITION # DRAW THE BOX OUTLINE $CompositionBox = " "; # DRAW THE INDENTITY OF INGREDIENTS BOX $IdentityIngredientBox = "
Inci Trade Name Cas Einecs Function Concentration
"; # DRAW THE ASSESSORS REASONING BOX $AssessorReasoningBox = "
Inci Cas Einecs Molecular Formula Molecular Weight (Daltons) Function
"; # DRAW THE MARGIN OF SAFETY BOX $MosBox = "
Inci Function Conc(% w/w) Relevant Data
"; $IngredientCompositioni=0; #echo "ingredientcomposition: ".$IngredientCompositioni; while ($IngredientCompositioni < 24) { #echo "ingredientcomposition: ".$IngredientCompositioni; if (${RawIngredientInci.$IngredientCompositioni}){ #check to see whether it has data in field $CurrentComposition=${RawIngredientInci.$IngredientBatchesi}; $CurrentCompositionBarcode=${RawIngredientBarcode.$IngredientCompositioni}; $IngredientTechnical="SELECT * FROM RawIngredients WHERE IngredientBarcode LIKE '$CurrentCompositionBarcode'"; $IngredientTechnicalResult=mysql_query($IngredientTechnical); $IngredientTechnicalInci=mysql_result($IngredientTechnicalResult,0,"Inci"); $IngredientTechnicalCas=mysql_result($IngredientTechnicalResult,0,"Cas"); $IngredientTechnicalEinecs=mysql_result($IngredientTechnicalResult,0,"Einecs"); $IngredientTechnicalFunction=mysql_result($IngredientTechnicalResult,0,"Function"); if (strpos($IngredientTechnicalFunction,'Preservative') !== false) { $PreservativeList=$PreservativeList.$IngredientTechnicalInci; } if (strpos($IngredientTechnicalFunction,'Antioxidant') !== false) { $AntiOxidantList=$AntiOxidantList.", ".$IngredientTechnicalInci; } if ($band!="YES"){ $IngredientTechnicalQuantity=${RawIngredientQty.$IngredientCompositioni}; } if ($band=="YES"){ $IngredientTechnicalQuantity=${RawIngredientQty.$IngredientCompositioni}; if ($IngredientTechnicalQuantity <= 1){ $IngredientTechnicalQuantityMin=$IngredientTechnicalQuantity*0.5; $IngredientTechnicalQuantityMax=$IngredientTechnicalQuantity*1.3; } else { $IngredientTechnicalQuantityMin=$IngredientTechnicalQuantity*0.85; $IngredientTechnicalQuantityMax=$IngredientTechnicalQuantity*1.15; } If ($IngredientTechnicalQuantityMax >= 100) { $IngredientTechnicalQuantityMax="99.9"; } If ($IngredientTechnicalQuantityMax <= 0.2) { $IngredientTechnicalQuantityMax="0.5"; } If ($IngredientTechnicalQuantityMin <= 0.1) { $IngredientTechnicalQuantityMin="0.1"; } $IngredientTechnicalQuantityMin = number_format($IngredientTechnicalQuantityMin, 1, '.', ''); $IngredientTechnicalQuantityMax = number_format($IngredientTechnicalQuantityMax, 1, '.', ''); $IngredientTechnicalQuantity=$IngredientTechnicalQuantityMin." - ".$IngredientTechnicalQuantityMax; } ${ITIngredientName.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"IngredientName"); ${ITInci.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Inci"); ${ITCas.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Cas"); #echo ${ITCas.$IngredientCompositioni}."
"; ${ITEinecs.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Einecs"); ${ITApplication.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Application"); ${ITHazards.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Hazards"); ${ITType.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Type"); ${ITFirstAid.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"FirstAid"); ${ITFire.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Fire"); ${ITAccidental.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Accidental"); ${ITHandling.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Handling"); ${ITExposure.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Exposure"); ${ITPhsyical.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Physical"); ${ITStability.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Stability"); ${ITToxicological.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Toxicological"); ${ITEcological.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Ecological"); ${ITDisposal.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Disposal"); ${ITTransport.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Transport"); ${ITRegulatory.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Regulatory"); ${ITOther.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Other"); ${ITPackaging.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Packaging"); ${ITQC.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"QC"); ${ITRevisions.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Revisions"); ${ITFunction.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Function"); ${ITMolecularWeight.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"MolecularWeight"); ${ITMolecularFormula.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"MolecularFormula"); ${ITBotanicalName.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"BotanicalName"); ${ITBotanicalFamily.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"BotanicalFamily"); ${ITLabelling.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Labelling"); ${ITMaxUse.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"MaxUse"); ${ITDermalAbsorption.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"DermalAbsorption"); ${ITNoael.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Noael"); ${ITDAP.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"DAP"); ${ITNoael.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Noael"); ${ITAcuteDermalToxicity.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"AcuteDermalToxicity"); ${ITLocalSkinToxicity.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"LocalSkinToxicity"); ${ITLocalEyeToxicity.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"LocalEyeToxicity"); ${ITSkinSensitisation.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"SkinSensitisation"); ${ITPhotoInducedToxicity.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"PhotoInducedToxicity"); ${ITMutagenicity.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Mutagenicity"); ${ITRepeatedDose.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"RepeatedDose"); ${ITCarcinogenicity.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Carcinogenicity"); ${IT1_1_A_Water.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"1_1_A_Water"); ${IT1_1_B_ShelfLife.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"1_1_B_ShelfLife"); ${IT1_2_MarginSafety.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"1_2_MarginSafety"); ${IT1_3_SafetyData.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"1_3_SafetyData"); ${IT1_4_ReportedComplaints.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"1_4_ReportedComplaints"); ${IT4_ToxicologicalData.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"4_ToxicologicalData"); ${IT5_Exposure.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"5_Exposure"); ${ITOralToxicity.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"OralToxicity"); ${ITRestriction.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Restriction"); ${ITRelevantData.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"RelevantData"); ${ITAdditionalData.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"Additional"); ${ITInciExtra.$IngredientCompositioni}=mysql_result($IngredientTechnicalResult,0,"InciExtra"); # POPULATE THE COMPOSITION BOX $CompositionBox=$CompositionBox." "; # POPULATE THE TECHNICAL BOX $IdentityIngredientBox=$IdentityIngredientBox." "; # POPULATE THE ASSESSOR REASONING BOX $AssessorReasoningBox=$AssessorReasoningBox." "; } #end if $IngredientCompositioni++; } #FINISH DRAWING THE BOX $IdentityIngredientBox=$IdentityIngredientBox."
Inci Estimated Daily Exposure mg/kg bw/day Conc(% w/w) Dermal Absorbption (DAp)% Systematic Exposure Dosage (SED) mg/kg bw/day NOAEL mg/kg bw/day Margin of Safety (MoS)
".$IngredientTechnicalInci." ".$IngredientTechnicalInci." ".$IngredientTechnicalCas." ".$IngredientTechnicalEinecs." ".$IngredientTechnicalFunction." ".$IngredientTechnicalQuantity."
".$IngredientTechnicalInci." ".$IngredientTechnicalCas." ".$IngredientTechnicalEinecs." ".${ITMolecularFormula.$IngredientCompositioni}." ".${ITMolecularWeight.$IngredientCompositioni}." ".$IngredientTechnicalFunction."
".$IngredientTechnicalInci." ".$IngredientTechnicalFunction." ".$IngredientTechnicalQuantity." ".${ITRelevantData.$IngredientCompositioni}."
"; $CompositionBox=$CompositionBox." "; $AssessorReasoningBox=$AssessorReasoningBox." "; # echo '
IngredientFinalArrayInci ';
#    print_r ($IngredientFinalInci);
#    echo '
'; # echo '
';
#    print_r ($IngredientArray);
#    echo '
'; $i++; } # PRODUCE ALLERGEN ARRAY $Allergens="SELECT * FROM Allergens"; $AllergensResult=mysql_query($Allergens); $AllergensNum=mysql_numrows($AllergensResult); $AllergensI=0; while ($AllergensI < $AllergensNum) { $AllergensRow = mysql_fetch_row($AllergensResult); $AllergensList[] = $AllergensRow; // Inside while loop $AllergensListName[$AllergensRow[0]] = $AllergensRow; // Inside while loop $AllergensI++; } # echo '
';
#  print_r ($AllergensListName);
#   echo '
'; # CHECK EACH INGREDIENT AGAINST OUR ALLERGEN TABLE - IF THE INGREDIENT EXISTS, THEN BULD UP A NEW ARRAY WITH ALLERGENS AND QUANTITIES $IngredientBatchesi=0; while ($IngredientBatchesi < 21) { if (${RawIngredientBatch.$IngredientBatchesi}){ $CurrentBatch=${RawIngredientBatch.$IngredientBatchesi}; $CurrentIngredient=${RawIngredientBarcode.$IngredientBatchesi}; $CurrentCas=${ITCas.$IngredientBatchesi}; #echo "CurrentCas: ".$CurrentCas."
"; ${ITBACurrentCas.$IngredientBatchesi}=${ITCas.$IngredientBatchesi}; #echo "ITBACurrentCas: ".${ITBACurrentCas.$IngredientBatchesi}."
"; //echo "Current Batch: ".$CurrentBatch."
";; //echo "Ingredient Barcode Batch: ".$IngredientBarcodeBatch."
";; //echo "Current Ingredient: ".$CurrentIngredient."
"; //echo $CurrentIngredient."
"; //echo $CurrentBatch."
"; $IngredientBatches="SELECT * FROM IngredientBatches WHERE BatchNo LIKE '$CurrentBatch' AND IngredientBarcodeBatch LIKE $CurrentIngredient"; $IngredientBatchesResult=mysql_query($IngredientBatches); $IngredientBatchesnum=mysql_numrows($IngredientBatchesResult); $IngredientsBatchesRow = mysql_fetch_row($IngredientBatchesResult); #BUILD ALL THE DATA ON THE INGREDIENT BATCH FOR TECHNICAL REPORT ${ITBASupplier.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Supplier"); ${ITBAInci.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Inci"); ${ITBATradeName.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"TradeName"); ${ITBABatchNo.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"BatchNo"); ${ITBAGoodsIn.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"GoodsIn"); ${ITBAGoodsLive.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"GoodsLive"); ${ITBAGoodsDead.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"GoodsDead"); ${ITBAAppearance.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Appearance"); ${ITBABoilingPoint.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"BoilingPoint"); ${ITBAScent.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Scent"); ${ITBADensity.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Density"); ${ITBAPka.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Pka"); ${ITBAViscosity.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Viscosity"); ${ITBASolubilityInWater.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"SolubilityInWater"); ${ITBASolubilityInAlcohol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"SolubilityInAlcohol"); ${ITBASolubilityInOil.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"SolubilityInOil"); ${ITBAPartitionCoefficient.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"PartitionCoefficient"); ${ITBAComposition.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Composition"); ${ITBAMicrobiologicalCharacteristic.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"MicrobiologicalCharacteristic"); ${ITBAPartUsed.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"PartUsed"); ${ITBAPh.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Ph"); ${ITBAPh.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Viscosity"); ${ITBAStability.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Stability"); ${ITBAPurity.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Purity"); ${ITBASupplier.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Supplier"); ${ITBASpecificGravity.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"SpecificGravity"); ${ITBARefractiveIndex.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"RefractiveIndex"); ${ITBAAcidValue.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"AcidValue"); ${ITBAIodineValue.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"ITBAIodineValue"); ${ITBAMicrobiologicalCharacteristic.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"MicrobiologicalCharacteristic"); ${ITBADescription.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Description"); ${ITBAComposition.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Composition"); ${ITBASupplierAddress.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"SupplierAddress"); ${ITBAAmylCinnamal.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"AmylCinnamal"); ${ITBABenzylAlcohol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"BenzylAlcohol"); ${ITBACinnamylAlcohol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"CinnamylAlcohol"); ${ITBACitral.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Citral"); ${ITBAEugenol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Eugenol"); ${ITBAHydroxyCitronellal.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"HydroxyCitronellal"); ${ITBAIsoeugenol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Isoeugenol"); ${ITBAAmylCinnamylAlcohol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"AmylCinnamylAlcohol"); ${ITBABenzylSalicylate.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"BenzylSalicylate"); ${ITBAAmylCinnamal.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"AmylCinnamal"); ${ITBACinnamal.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Cinnamal"); ${ITBACourmain.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Courmain"); ${ITBAGeraniol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Geraniol"); ${ITBAAmylCinnamal.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"AmylCinnamal"); ${ITBABenzylCinnamate.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"BenzylCinnamate"); ${ITBAFarnesol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Farnesol"); ${ITBAButylPhenylMethylpropional.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"ButylPhenylMethylpropional"); ${ITBALinalool.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Linalool"); ${ITBABenzylBenzoate.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"BenzylBenzoate"); ${ITBACitronellol.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Citronellol"); ${ITBAHexylCinnamal.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"HexylCinnamal"); ${ITBALimonene.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Limonene"); ${ITBAMethy.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Methy"); ${ITBAAlpha.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Alpha"); ${ITBAEverniaPrunastri.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"EverniaPrunastri"); ${ITBAEverniaFufuracea.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"EverniaFufuracea"); ${ITBAManufactureDate.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Manufacture Date"); ${ITBARetestDate.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Retest Date"); ${ITBAExpiryDate.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"Expiry Date"); ${ITBAOleicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"OleicAcid"); ${ITBALinoleicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"LinoleicAcid"); ${ITBAPaliticAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"PaliticAcid"); ${ITBAStearicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"StearicAcid"); ${ITBAArchidicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"ArchidicAcid"); ${ITBAGadoleicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"GadoleicAcid"); ${ITBABehenicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"BehenicAcid"); ${ITBAMiristicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"MiristicAcid"); ${ITBAPentadecanoicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"PentadecanoicAcid"); ${ITBAPalmitoleicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"PalmitoleicAcid"); ${ITBAHeptadecanoicAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"HeptadecanoicAcid"); ${ITBAFreeFattyAcid.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"FreeFattyAcid"); ${ITBAPeroxideValue.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"PeroxideValue"); ${ITBAWaterContent.$IngredientBatchesi}=@mysql_result($IngredientBatchesResult,0,"WaterContent"); ### INGREDIENT LAYOUT if (${ITBAInci.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

".${ITBAInci.$IngredientBatchesi}."


"; } # START THE INSET FORMATTING $IngredientListLayout=$IngredientListLayout."
"; $IngredientListLayout=$IngredientListLayout."

Physiochemical Properties:

"; # START THE PHYSIOCHEMICAL PROPERTIES TO SEE WHICH FIELDS ARE APPLICABLE TO THE INGREDIENT USED if (${$ITBATradeName.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

TradeName: ".${$ITBATradeName.$IngredientBatchesi}."

"; } if (${ITBotanicalName.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Botanical Name: ".${ITBotanicalName.$IngredientBatchesi}."

"; } if (${ITBotanicalFamily.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Botanical Family: ".${ITBotanicalFamily.$IngredientBatchesi}."

"; } if (${ITBAInci.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Inci: ".${ITBAInci.$IngredientBatchesi}."

"; } if (${ITBASupplier.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Supplier: ".${ITBASupplier.$IngredientBatchesi}."

"; } if (${ITBADescription.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Description: ".${ITBADescription.$IngredientBatchesi}."

"; } if (${ITBAAppearance.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Appearance: ".${ITBAAppearance.$IngredientBatchesi}."

"; } if (${ITBABoilingPoint.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Boiling Point: ".${ITBABoilingPoint.$IngredientBatchesi}."

"; } $IngredientListLayout=$IngredientListLayout."

Taste & Smell: Typical

"; if (${ITBADensity.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Density: ".${ITBADensity.$IngredientBatchesi}."

"; } if (${ITBAViscosity.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Viscosity: ".${ITBAViscosity.$IngredientBatchesi}."

"; } if (${ITBAPka.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Pka: ".${ITBAPka.$IngredientBatchesi}."

"; } if (${ITBAScent.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Odour: ".${ITBAScent.$IngredientBatchesi}."

"; } if (${ITBAPartitionCoefficient.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Partition Coefficient: ".${ITBAPartitionCoefficient.$IngredientBatchesi}."

"; } if (${ITBABoilingPoint.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Boiling Point: ".${ITBABoilingPoint.$IngredientBatchesi}."

"; } if (${ITBASolubilityInWater.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Solubility in Water: ".${ITBASolubilityInWater.$IngredientBatchesi}."

"; } if (${ITBASolubilityInAlcohol.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Solubility in Alcohol: ".${ITBASolubilityInAlcohol.$IngredientBatchesi}."

"; } if (${ITBASolubilityInOil.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Solubility in Oil: ".${ITBASolubilityInOil.$IngredientBatchesi}."

"; } if (${ITBAPartUsed.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Part Used: ".${ITBAPartUsed.$IngredientBatchesi}."

"; } if (${ITBAPh.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

pH: ".${ITBAPh.$IngredientBatchesi}."

"; } if (${ITBASpecificGravity.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Specific Gravity: ".${ITBASpecificGravity.$IngredientBatchesi}."

"; } if (${ITBARefractiveIndex.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Refractive Index ".${ITBARefractiveIndex.$IngredientBatchesi}."

"; } if (${ITBAAcidValue.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Acid Value ".${ITBAAcidValue.$IngredientBatchesi}."

"; } if (${ITBAIodineValue.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Iodine Value ".${ITBAIodineValue.$IngredientBatchesi}."

"; } # COMPOSITION BOX - Is going to take what is written in the composition box, then if nec.. have a look at the allergens boxes and highlight them if need be if (${ITBAComposition.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Composition".${ITBAComposition.$IngredientBatchesi}."

"; $compositiontitle="true"; } if ((${ITBAAmylCinnamal.$IngredientBatchesi})||(${ITBABenzylAlcohol.$IngredientBatchesi})||(${ITBACinnamylAlcohol.$IngredientBatchesi})||(${ITBACitral.$IngredientBatchesi})||(${ITBAEugenol.$IngredientBatchesi})||(${ITBAHydroxyCitronellal.$IngredientBatchesi})||(${ITBAIsoeugenol.$IngredientBatchesi})||(${ITBAAmylCinnamylAlcohol.$IngredientBatchesi})||(${ITBABenzylSalicylate.$IngredientBatchesi})||(${ITBACinnamal.$IngredientBatchesi})||(${ITBACourmain.$IngredientBatchesi})||(${ITBAGeraniol.$IngredientBatchesi})||(${ITBABenzylCinnamate.$IngredientBatchesi})||(${ITBAFarnesol.$IngredientBatchesi})||(${ITBAButylPhenylMethylpropional.$IngredientBatchesi})||(${ITBALinalool.$IngredientBatchesi})||(${ITBABenzylBenzoate.$IngredientBatchesi})||(${ITBACitronellol.$IngredientBatchesi})||(${ITBAHexylCinnamal.$IngredientBatchesi})||(${ITBALimonene.$IngredientBatchesi})||(${ITBAMethy.$IngredientBatchesi})||(${ITBAAlpha.$IngredientBatchesi})||(${ITBAEverniaPrunastri.$IngredientBatchesi})||(${ITBAEverniaFufuracea.$IngredientBatchesi})) { #echo ${ITBAInci.$IngredientBatchesi}; $AdditionalAllergensStatement="This product contains some substances listed as allergens which must comply with the applicable IFRA restrictions / recommendations."; if ($compositiontitle !="true"){ $IngredientListLayout=$IngredientListLayout."

Composition

"; } $compositiontitle="false"; $IngredientListLayout=$IngredientListLayout."

Declaration of allergens

"; $IngredientListLayout=$IngredientListLayout."
MATERIAL
ALLERGEN LEVEL IN INGREDIENT %
"; if (${ITBAAmylCinnamal.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
Amyl Cinnamal
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAAmylCinnamal.$IngredientBatchesi}."
"; } if (${ITBABenzylAlcohol.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
Benzyl Alcohol
"; $IngredientListLayout=$IngredientListLayout."
".${ITBABenzylAlcohol.$IngredientBatchesi}."
"; } if (${ITBACinnamylAlcohol.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."Cinnamyl Alcohol"; } #CITRAL DEFINITION if (${ITBACitral.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
CITRAL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBACitral.$IngredientBatchesi}."
"; } if (${ITBAEugenol.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
EUGENOL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAEugenol.$IngredientBatchesi}."
"; } if (${ITBAHydroxyCitronellal.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
CITRONELLOL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBACitronellol.$IngredientBatchesi}."
"; } if (${ITBAIsoeugenol.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
ISOEUGENOL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAIsoeugenol.$IngredientBatchesi}."
"; } if (${ITBAAmylCinnamylAlcohol.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
CINNAMYL ALCOHOL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBACinnamylAlcohol.$IngredientBatchesi}."
"; } if (${ITBACinnamal.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
CINNAMAL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBACinnamal.$IngredientBatchesi}."
"; } if (${ITBACourmain.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
COURMAIN
"; $IngredientListLayout=$IngredientListLayout."
".${ITBACourmain.$IngredientBatchesi}."
"; } if (${ITBABenzylCinnamate.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
BENZYL CINNAMATE
"; $IngredientListLayout=$IngredientListLayout."
".${ITBABenzylCinnamate.$IngredientBatchesi}."
"; } if (${ITBAFarnesol.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
FARNESOL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAFarnesol.$IngredientBatchesi}."
"; } if (${ITBAButylPhenylMethylpropional.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
BUTYLMETHYLPROPIONAL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAButylMethylPropional.$IngredientBatchesi}."
"; } if (${ITBALinalool.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
LINALOOL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBALinalool.$IngredientBatchesi}."
"; } if (${ITBABenzylBenzoate.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
BENZYL BENZOATE
"; $IngredientListLayout=$IngredientListLayout."
".${ITBABenzylBenzoate.$IngredientBatchesi}."
"; } if (${ITBACitronellol.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
CITRONELLOL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBACitronellol.$IngredientBatchesi}."
"; } if (${ITBAHexylCinnamal.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
HEXYL CINNAMAL
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAHexyCinnamal.$IngredientBatchesi}."
"; } if (${ITBALimonene.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
LIMONENE
"; $IngredientListLayout=$IngredientListLayout."
".${ITBALimonene.$IngredientBatchesi}."
"; } if (${ITBAMethy.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
METHY
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAMethy.$IngredientBatchesi}."
"; } if (${ITBAAlpha.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
ALPHA
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAAlphal.$IngredientBatchesi}."
"; } if (${ITBAEverniaPrunastri.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
EVERNIA PRUNASTRI
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAEverniaPrunastri.$IngredientBatchesi}."
"; } if (${ITBAEverniaFufuracea.$IngredientBatchesi}){ $IngredientListLayout=$IngredientListLayout."
EVERNIA FUFURACEA
"; $IngredientListLayout=$IngredientListLayout."
".${ITBAEverniaFufuracea.$IngredientBatchesi}."
"; } $IngredientListLayout=$IngredientListLayout."
"; } if (${ITBAMicrobiologicalCharacteristic.$IngredientBatchesi}) { $IngredientListLayout=$IngredientListLayout."

Microbiological Characteristics

".${ITBAMicrobiologicalCharacteristic.$IngredientBatchesi}."

"; } # END THE INSET FORMATTING $IngredientListLayout=$IngredientListLayout."
"; #echo "hello "; ##Create the Suppliers Table $SupplierBox=$SupplierBox."
".${ITBAInci.$IngredientBatchesi}."
"; $SupplierBox=$SupplierBox."
".${ITBASupplier.$IngredientBatchesi}."
"; $SupplierBox=$SupplierBox."
".${ITBASupplierAddress.$IngredientBatchesi}."
"; ###Build The Data for The Toxicological Assessment if (${ITInci.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

".${ITInci.$IngredientBatchesi}."


"; } if (${ITInciExtra.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Inci / Botanical: ".${ITInciExtra.$IngredientBatchesi}."

"; } if (${ITAcuteDermalToxicity.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Acute Toxicity:

".${ITAcuteDermalToxicity.$IngredientBatchesi}."

"; } if (${ITLocalSkinToxicity.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Skin irritation and corrosivity:

".${ITLocalSkinToxicity.$IngredientBatchesi}."

"; } if (${ITLocalEyeToxicity.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Eye irritation:

".${ITLocalEyeToxicity.$IngredientBatchesi}."

"; } if (${ITSkinSensitisation.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Skin Sensitisation:

".${ITSkinSensitisation.$IngredientBatchesi}."

"; } if (${ITMutagenicity.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Mutagenicity/Genotoxicity:

".${ITMutagenicity.$IngredientBatchesi}."

"; } if (${IT4_ToxicologicalData.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Toxicological Data:

".${IT4_ToxicologicalData.$IngredientBatchesi}."

"; } if (${ITPhotoInducedToxicity.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Photo Induced Toxicity:

".${ITPhotoInducedToxicity.$IngredientBatchesi}."

"; } if (${IT5_Exposure.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Exposure:

".${IT5_Exposure.$IngredientBatchesi}."

"; } if (${ITRepeatedDose.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Repeated Dose:

".${ITRepeatedDose.$IngredientBatchesi}."

"; } if (${ITCarcinogenicity.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Carcinogenicity:

".${ITCarcinogenicity.$IngredientBatchesi}."

"; } if (${ITOralToxicity.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Oral Toxicity:

".${ITOralToxicity.$IngredientBatchesi}."

"; } if (${ITRestriction.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Restriction:

".${ITRestriction.$IngredientBatchesi}."

"; } #if (${ITRelevantData.$IngredientBatchesi}) #{ #$ToxicologicalListLayout=$ToxicologicalListLayout."

Relevant Data: ".${ITRelevantData.$IngredientBatchesi}."

"; #} if (${ITAdditionalData.$IngredientBatchesi}) { $ToxicologicalListLayout=$ToxicologicalListLayout."

Additional:

".${ITAdditionalData.$IngredientBatchesi}."

"; } # HUNT FOR ANY RESTRICTED ITEMS, LOOK AT THEIR CATEGORY AND PRODUCT TYPE AND DETERMINE WHETHER THEY ARE ABOVE LEGAL LIMITS //$RestrictedID = searchforAllergen($CurrentCas, $AllergensListName); //$RestrictedID = wildcard_in_array(${ITBACurrentCas.$IngredientBatchesi}, $AllergensListName); // Example 1 $RestrictedPieces = explode("/", ${ITBACurrentCas.$IngredientBatchesi}); $RestrictedI=0; #Start of I Loop while ($RestrictedI < count($RestrictedPieces)){ $RestrictedID = searchforAllergen($RestrictedPieces[$RestrictedI], $AllergensListName); //echo "Product with Allergen:".$RestrictedPieces[$RestrictedI]." "."
"; if ($RestrictedID){ //echo "Restricted, Product Type:".$ProductType.", Product Category: ".$ProductCategory."
"; $RestrictedInformation="SELECT * FROM Allergens WHERE Allergen LIKE '$RestrictedPieces[$RestrictedI]'"; $RestrictedInformationResult=mysql_query($RestrictedInformation); # $IngredientBatchesnum=mysql_numrows($IngredientBatchesResult); # $IngredientsBatchesRow = mysql_fetch_row($IngredientBatchesResult); $LeaveOn=mysql_result($RestrictedInformationResult,0,"LeaveOnDeclare"); $RinseOff=mysql_result($RestrictedInformationResult,0,"RinseOffDeclare"); //echo "Rinse Off: ".$RinseOff."
"; $MaxUse=mysql_result($RestrictedInformationResult,0,"MaxUse"); $MaxCat1=mysql_result($RestrictedInformationResult,0,"MaxCat1"); $MaxCat2=mysql_result($RestrictedInformationResult,0,"MaxCat2"); $MaxCat3=mysql_result($RestrictedInformationResult,0,"MaxCat3"); $MaxCat4=mysql_result($RestrictedInformationResult,0,"MaxCat4"); $MaxCat5=mysql_result($RestrictedInformationResult,0,"MaxCat5"); //echo "Max 5: ".$MaxCat5."
"; $MaxCat6=mysql_result($RestrictedInformationResult,0,"MaxCat6"); $MaxCat7=mysql_result($RestrictedInformationResult,0,"MaxCat7"); $MaxCat8=mysql_result($RestrictedInformationResult,0,"MaxCat8"); $MaxCat9=mysql_result($RestrictedInformationResult,0,"MaxCat9"); $MaxCat10=mysql_result($RestrictedInformationResult,0,"MaxCat10"); $MaxCat11=mysql_result($RestrictedInformationResult,0,"MaxCat11"); if (($RinseOff=="100")&&($ProductType=="off")){ $RestrictedSkip="true"; } if ($RestrictedSkip!="true"){ $RestrictedIngredientQty=${RawIngredientQty.$IngredientBatchesi}; $RestrictedCheckSum=${MaxCat.$ProductCategory}; #echo "Restricted Ingredient Qty: ".$RestrictedIngredientQty; #echo " Category Number: ".$RestrictedCheckSum; $RestrictedIngredientQtyFinal=$RestrictedIngredientQtyFinal+$RestrictedIngredientQty; //echo "RestrictedI:".$RestrictedI." Checksum:".$RestrictedCheckSum."
"; // $RestrictedI=count($RestrictedPieces); if ($RestrictedIngredientQtyFinal > $RestrictedCheckSum){ $warning=$warning."ILLEGAL LEVEL OF RESTRICTED SUBSTANCE: ".$RestrictedID." in ".$CurrentCas." PLEASE ADJUST AS LEVEL IS: ".$RestrictedIngredientQtyFinal." AND THE TOTAL ALLOWED IS: ".$RestrictedCheckSum."".$ProductCategory."
"; } } } //echo "RestrictedI2:".$RestrictedI." Checksum:".$RestrictedCheckSum."
"; $RestrictedI++; } #end while loop $RestrictedID=""; # WE ARE IN THE LOOP TO COLLECT THE DIFFERENT ROW DATA NOW WE ARE GOING TO SEARCH INSIDE EACH ROW TO SEE WHETHER ANY ALLERGEN STORED IN THE ALLERGENS TABLE EXISTS # IF SO WE WILL MULTIPLY THE ALLRGENS LEVEL ACCORDING TO THE BATCH COA WITH THE QUANTITY SET IN THE INGREDIENTS LISTING, TO GET THE PERCENTAGE IN THE BLEND # COMPARE WITH THE ALLERGENS TABLE FOR MAX USAGE, IF IT REMAINS LEGAL THEN WE WILL ADD IT TO THE ALLERGENS FOR THE INCI LISTING $IngredientFieldsNum = mysql_num_fields($IngredientBatchesResult); $IngredientFieldNumi = 0; while ($IngredientFieldNumi < $IngredientFieldsNum) { $IngredientFieldName = mysql_field_name($IngredientBatchesResult,$IngredientFieldNumi); $IngredientBatchesQty=$IngredientsBatchesRow[$IngredientFieldNumi]; # LOOK AT THE ALLERGENS TABLE AND USING THE FUNCTION IN THE HEADER SEE IF THE ALLERGEN IN THE PRODUCT TABLE MATCHES THE ALLERGEN IN THE ALLERGENS TABLE # IF SO USING THE INGREDIENTBATCHESQTY VARIABLE ABOVE CALCULATE THE TOTAL PERCENTAGE, CHECK IT IS BELOW LEGAL LIMIT BY COMPARING THE MAX USE CHART # THE TYPE OF PRODUCT IT IS LEAVE ON LEAVE OFF AND THEN PREPARE IT FOR INCI LIST FORMATION $AllergensCount=1; $AllergensCompareI=0; while ($AllergensCompareI < $AllergensCount) { $Allergenid = searchforAllergen($IngredientFieldName, $AllergensListName); if (($Allergenid)&&($IngredientBatchesQty)) { $AllergensCalculateCount=count($AllergensListName); //echo "Allergens Calculate Count: ".$AllergensCalculateCount; $AllergenPosition=1; # CREATE ALLERGEN VARIABLE IF NOT EXIST AND THEN ADD ADDITIONAL ALLERGENS TO IT $IngredientBatchesix=$IngredientBatchesi-0; ${$Allergenidx.$Allergenid}=${$Allergenidx.$Allergenid}+(($IngredientBatchesQty/100)*${RawIngredientQty.$IngredientBatchesi}); while ($AllergenPosition < $AllergensCalculateCount) { if ($AllergenPosition==$ProductCategory+3){ $Allergenid1 = keyforAllergen($IngredientFieldName, $AllergensListName, $AllergenPosition); if (${$Allergenidx.$Allergenid} < $Allergenid1){ #echo "
PASS
"; if ($Allergenid1 !=100){ $AllergensText=$AllergensText."

".$Allergenid."

"."

Max. Allowed concentration in Category ".$ProductCategory." products: ".$Allergenid1."%

"; $AllergensText=$AllergensText."

This product is compliant with the IFRA restriction established for it, as the maximum concentration of ".$Allergenid." in the final product would be ".${$Allergenidx.$Allergenid}."

"; $Allergens12Text=$Allergens12Text."

This product is compliant with the IFRA restriction established for it, as the maximum concentration of ".$Allergenid." in the final product would be ".${$Allergenidx.$Allergenid}."

"; } if ($Allergenid1 ==100){ $AllergensText=$AllergensText."

".$Allergenid."

"."

According to IFRA ".$Allergenid." and natural products containing substantional amounts of it, should only be used when the level of peroxides is kept to the lowest practical level. Such products should have a peroxide value of less than 20 millimoles peroxides per litre. The recommendation is to contain an anti-oxidant, example: Tocopheryl actetae or Tocopherol.

"; $Allergens12Text=$Allergens12Text."

".$Allergenid."

"."

According to IFRA ".$Allergenid." and natural products containing substantional amounts of it, should only be used when the level of peroxides is kept to the lowest practical level. Such products should have a peroxide value of less than 20 millimoles peroxides per litre

"; } } else { #echo "ALLERGEN TEST FAILURE"; $warning=$warning."
THIS PRODUCT HAS FAILED THE ALLERGEN TEST AND THE ALLERGENS LEVELS ARE TOO HIGH FOR ".$Allergenid." WHICH ARE ".${$Allergenidx.$Allergenid}. " AND THE MAX LEVEL IS ".$Allergenid1." PLEASE CORRECT

"; } } $AllergenPosition++; } //echo "AllergenID: ".$Allergenid."
"; if (strpos($AllergenString,$Allergenid) !== false) { # } else { # $AllergenString=$AllergenString.$Allergenid.", "; $AllergenStringQty=$AllergenStringQty.$Allergenid." - ".${$Allergenidx.$Allergenid}."%
"; } substr_replace($AllergenString, "", -1); //echo "AllergenString: ".$AllergenString; //echo "
AllergenStringQty:
".$AllergenStringQty; //echo "
"; $Allergenid=""; $Allergen1=""; } $AllergensCompareI++; } #echo '
';
   			 #print_r ($AllergensList);
			 #echo '
'; $IngredientFieldNumi++; } } # Calculate the Margins of Safety if ((!${ITNoael.$IngredientBatchesi})&&(${ITInci.$IngredientBatchesi})){ $MarginRequired="No"; #echo "MarginRequired:".$MarginRequired."
Number:".$IngredientBatchesi."
"; $MOS_NotCalculatedText=$MOS_NotCalculatedText.(${ITInci.$IngredientBatchesi}).", "; } if ((${ITNoael.$IngredientBatchesi})&&(${ITInci.$IngredientBatchesi})){ $MarginRequired="Yes"; #echo "MarginRequired:".$MarginRequired."
Number:".$IngredientBatchesi."
"; ${MOS_Calculation.$IngredientBatchesi}=${MOS_Calculation.$IngredientBatchesi}.${MOS_Calculation.$IngredientBatchesi}." ".${ITInci.$IngredientBatchesi}.$ExposureEstimatedDailyAmount." ".${RawIngredientQty.$IngredientBatchesi}." ".${ITDAP.$IngredientBatchesi}.""; ${MOS_SED.$IngredientBatchesi}= (${ITNoael.$IngredientBatchesi}/((${RawIngredientQty.$IngredientBatchesi}/100)*$ExposureEstimatedDailyAmount)*(${ITDAP.$IngredientBatchesi}/100)); //echo "MOSFIELD: ".${$MOS_Calculation.$IngredientBatchesi}." MOS_SED: ".${$MOS_SED.$IngredientBatchesi}."
"; //echo "MOSFIELD: ".${MOS_Calculation.$IngredientBatchesi}."
MOSSED: ".${MOS_SED.$IngredientBatchesi}."
"; if (${MOS_SED.$IngredientBatchesi} < 100){ # Checks that doesn't fail mos, if it does populates warning for the section #echo "
WARNING WARNING WARNING FAILED MOS FAILED MOS
"; $warning=$warning."
WARNING THIS PRODUCT HAS A MOS NUMBER WHICH IS LOWER THAN 100, MANUALLY CHECK AND CORRECT
"; } # POPULATE THE TECHNICAL BOX $MosBox=$MosBox." ".${ITInci.$IngredientBatchesi}." ".$ExposureEstimatedDailyAmount." ".${RawIngredientQty.$IngredientBatchesi}." ".${ITDAP.$IngredientBatchesi}." ".round(((${RawIngredientQty.$IngredientBatchesi}/100)*$ExposureEstimatedDailyAmount)*(${ITDAP.$IngredientBatchesi}/100),2)." ".${ITNoael.$IngredientBatchesi}." ".round(${MOS_SED.$IngredientBatchesi},0)." "; } $IngredientBatchesi++; } # End The Calculated Margin of Safety Box $MosBox=$MosBox." "; # Work out Leave on / Rinse off Text Below if ($RinseOff){ $durationtext="

The ingredients may remain in contact with the skin for some time altough they product is rinsed off

The frequency of application for this product is ".$ExposureApplicationFrequency.". Although it is used on a regular and repeated basis, it is not expected to cause any acture or chronic toxicity symptoms."; } if ($LeaveOn){ $durationtext="

The ingredients may remain in contact with the skin for some time as this product is a leave on product.

The frequency of application for this product is ".$ExposureApplicationFrequency.". Although it is used on a regular and repeated basis, it is not expected to cause any acture or chronic toxicity symptoms."; } # Work out the Text for the Oral Consumption if (($ProductCategory!=1)&&($ProductCategory!=6)&&($ProductCategory!=7)){ $oraltext="

The reasonably foreseeable route of exposure to this product is through dermal absorption

"; } else { $oraltext="

Need text from Maria

"; } # Work out whether the product is for hair or skin if (($ProductCategory!=1)&&($ProductCategory!=6)&&($ProductCategory!=8)&&($ProductCategory!=9)&&($ProductCategory!=10)&&($ProductCategory!=11)){ $targettext="skin"; $secondarytext="

The possibility of secondary exposure by routes other than dermal absorption resulting from direct application on the skin is unlikely. If the product comes in contact with eyes rinse thoroughly.

"; } if (($ProductCategory==8)||($ProductCategory==9)){ $targettext="hair"; $secondarytext="

The possibility of secondary exposure by routes other than dermal absorption resulting from direct application on the skin is unlikely. If the product comes in contact with eyes rinse thoroughly.

"; } if ($ProductCategory==1){ $targettext="lips"; $secondarytext="

The possibility of secondary exposure by routes other than dermal absorption resulting from direct application on the skin is possible through oral consumption. If the product is internally ingested drink plenty of water and do not induce vomitting. If symptoms persist, contact a doctor. If the product comes in contact with eyes rinse thoroughly.

"; } if ($ProductCategory==6){ $targettext="mouth"; $secondarytext="

The possibility of secondary exposure by routes other than dermal absorption resulting from direct application on the skin is possible through oral consumption. If the product is internally ingested drink plenty of water and do not induce vomitting. If symptoms persist, contact a doctor. If the product comes in contact with eyes rinse thoroughly.

"; } if ($ProductCategory==10){ $targettext="surface"; $secondarytext="

The possibility of secondary exposure by routes other than dermal absorption resulting from direct application on the skin is unlikely. If the product comes in contact with eyes rinse thoroughly.

"; } $ProductExposureData=$ProductExposureData."

Sites of application

It is expected to be applied on the ".$ExposureProductArea."

"; $ProductExposureData=$ProductExposureData."

Surface area of application

The skin surface area involved for this product is ".$ExposureRVIM_SurfaceArea."cm2

"; $ProductExposureData=$ProductExposureData."

Typical amount of product applied

The estimated daily amount of product applied is ".$ExposureEstimatedDailyAmount."g, being the retention factor ".$ExposureRetentionFactor." and the calculated relative daily exposure ".$ExposureCalculatedDailyExposure."mg/kg bw/day

"; $ProductExposureData=$ProductExposureData."

Duration & Frequency of Use

".$durationtext; $ProductExposureData=$ProductExposureData."

Normal and reasonably forseeable exposure route

".$oraltext; if ($ProductCategory!=11){ #Not for Candles $ProductExposureData=$ProductExposureData."

Targeted and or/or exposed population(s)

This product is suitable of use on all ".$targettext." types."; } $ProductExposureData=$ProductExposureData."

Potential Secondary Exposure

".$secondarytext; #Do Some Final Loooking at Fields and Default Populating them with default data if it finds no content or certain conditions # The Following Populates the Toxicologal Data for Testing if there is none if (!$ProductToxicologicalData) { $ProductToxicologicalDataPart2="Yes"; $ProductToxicologicalData = "

No data available

No data available

No data available

None available.

"; } # The following setups up me (Danny) to be the responsible person and address if there is none if (!$ResponsiblePerson){ $ResponsiblePerson="Danny Stanzl"; } if (!$ResonsibleAddress){ $ResponsibleAddress="

Naturallythinking
The Tramsheds
Coomber Way
Croydon
Surrey
CR0 4TQ

"; } # The following puts the default Micro Test Data Text in, if it has passed the Micro Test if ($MicroTestData=="Yes"){ $MicroTestData="are the preservatives employed to protect the cosmetic product against microbial spoilage. The results obtained in the preservation challenge test show that the preservative system is appropriate and effective as it has met the acceptance criteria fixed for the test. According to the results of the preservation challenge test and the microbiological inspections, it can be concluded that the microbiological quality of the cosmetic product is appropriate."; } if ($MicroTestData=="No"){ $MicroTestData="This product does not contain water and therefore a Microbiological Preservative Test is not required."; } # The following creates the relevant Antioxidant Statement on Peroxides (if there are allergens we need an antioxidant) if ($AllergenString){ if ($AntiOxidantList){ $AntioxidantStatement="Allergens are present in this formulation and therefore a suitable antioxidant should be present in the formulation to ensure peroxides do not form within the product. This product contains ".$AntiOxidantList." and therefore is adequately protected from the formation of peroxides."; } if (!$AntiOxidantList){ $AntioxidantStatement="

THERE IS NO ANTIOXIDANT IN THIS FORMULA AND THERE IS THE PRESENCE OF ALLERGENS, THIS PRODUCT DOES NOT PASS

"; } } #Make the statement about preservatives being within the legal limits if there is a preservative list. if ($PreservativeList){ $PreservativeStatement=$PreservativeList." are used within the legel limits outlined in Annex V of EU Regulaton 1223/2009."; } ### START OF LAYOUT OF PRODUCTS THE ACTUAL REPORT # ECHO PROCESS WARNINGS DURING COMPILATION if ($audience=="toxreport"){ ?>