7) $l1--; if ($l2 > 7) $l2--; // convert grid letters into 100km-square indexes from false origin (grid square SV): $e = (($l1-2)%5)*5 + ($l2%5); $n = 19 - (floor($l1/5)*5) - floor($l2/5); $easting = $e * 100000 + ($gridRef[2]) * 10000 + $gridRef[3] * 1000 + $gridRef[4] *100; $northing = $n * 100000 + ($gridRef[5]) * 10000 + $gridRef[6] * 1000 + $gridRef[7] *100; } //handling Northern Ireland else{ if ($gridRef[1] == 'C') { $e = 2; $n = 4; } if ($gridRef[1] == 'D') { $e = 3; $n = 4; } if ($gridRef[1] == 'G') { $e = 1; $n = 3; } if ($gridRef[1] == 'H') { $e = 2; $n = 3; } if ($gridRef[1] == 'J') { $e = 3; $n = 3; } $easting = $e * 100000 + ($gridRef[2]) * 10000 + $gridRef[3] * 1000 + $gridRef[4] *100; $northing = $n * 100000 + ($gridRef[5]) * 10000 + $gridRef[6] * 1000 + $gridRef[7] *100; // converting NI grid square to UK grid square (metres) $easting=intval((0.5+$easting)/1000); $northing=intval((0.5+$northing)/1000); $eastingConv= (-213.3 + (0.997185*$easting) + (0.0749787*$northing))*1000; $northingConv= (183.19 - (0.074987*$easting) + (0.997185*$northing))*1000; // reposition grid square to the SW corner of the 1km square i.e. lose the decimal places $easting=1000*intval((0.5+$eastingConv)/1000); $northing=1000*intval((0.5+$northingConv)/1000); } //get the SW corner $eastMeter = 1000*intval($easting/1000); $northMeter = 1000*intval($northing/1000); // if ($polOz == true) { // $eastValue = intval($eastMeter/1000); // $northValue = intval($northMeter/1000); // } // else if ($polAcid == true) { $eastValue1 = intval($eastMeter/1000)*1000+500; $northValue1 = intval($northMeter/1000*1000+500); $eastValue = (5*intval($eastMeter/5000))*1000+2500; $northValue = (5*intval($northMeter/5000))*1000+2500; $eastValueOz = $eastMeter/1000; $northValueOz = $northMeter/1000; // } // else { // $eastValue = 5*intval($eastMeter/5000); // $northValue = 5*intval($northMeter/5000); // } } // UK OS grid else { //split location in east and north $array = explode(",",$gridRef); $easting = $array[0]; $northing = $array[1]; if ($gridType == 'NiOS') { // converting NI grid square to UK grid square (metres) $easting=intval((0.5+$easting)/1000); $northing=intval((0.5+$northing)/1000); $eastingConv= (-213.3 + (0.997185*$easting) + (0.0749787*$northing))*1000; $northingConv= (183.19 - (0.074987*$easting) + (0.997185*$northing))*1000; // reposition grid square to the SW corner of the 1km square i.e. lose the decimal places $easting=1000*intval((0.5+$eastingConv)/1000); $northing=1000*intval((0.5+$northingConv)/1000); } //get the SW corner $eastMeter = 1000*intval($easting/1000); $northMeter = 1000*intval($northing/1000); // if ($polOz == true) { // $eastValue = intval($eastMeter/1000); // $northValue = intval($northMeter/1000); // } // else if ($polAcid == true) { $eastValue1 = intval($eastMeter/1000)*1000+500; $northValue1 = intval($northMeter/1000*1000+500); $eastValue = (5*intval($eastMeter/5000))*1000+2500; $northValue = (5*intval($northMeter/5000))*1000+2500; $eastValueOz = $eastMeter/1000; $northValueOz = $northMeter/1000; // } // else { // $eastValue = 5*intval($eastMeter/5000); // $northValue = 5*intval($northMeter/5000); // } } // SHOW GRID REFERENCE echo '

Habitat: '.$habitat.'

'; echo '

Grid Reference: '.$gridRef.'

'; echo '

Grid Easting: '.$eastValue1.' to the 1km mid point (metres)

'; echo '

Grid Northing: '.$northValue1.' to the 1km mid point (metres)

'; echo $temp; /***** *BEFORE THE ROUTINES ***/ //database connection //get the username/passw etc require_once("/sites/default/get_passw.php"); $con = oci_connect("$username","$passwurd","$database"); if (!$con) { die('Could not connect: ' . oci_error()); } //create Arrays $names=array(); $val=array(); /***** *GET NAMES * @param eastValue * @param northValue * @return names[] Array with the values of query2, unit_pollutant, con, exceed ***/ //Acid Deposition function getNames_Acid ($habitat, $eastValue1, $northValue1) { $names=array(); //query2 if($habitat == "Broadleaved, Mixed and Yew Woodland" OR $habitat == "Coniferous woodland" OR $habitat == "Hedgerows" OR $habitat == "Wood-Pasture & Parkland") { $names[0] = "Select NO2_NO3_F+NH3_NH4_F, SO2_SO4_NM_F, CA_MG_NM_F, Mid_Year from CBED_1KM_2024 where Easting='$eastValue1' and Northing='$northValue1' and Mid_Year= (select max(Mid_Year) from CBED_1KM_2024)"; } else { $names[0] = "Select NO2_NO3_M+NH3_NH4_M, SO2_SO4_NM_M, CA_MG_NM_M, Mid_Year from CBED_1KM_2024 where Easting='$eastValue1' and Northing='$northValue1' and Mid_Year= (select max(Mid_Year) from CBED_1KM_2024)"; } //unit_pollutant $names[1] = ""; //critLev $names[2] = "Critical Load Class & Values"; //conc $names[3] = "Deposition"; //exceed $names[4] = "Exceedance"; //Data Year $names[5] = "Data Year"; return $names; } //Ammonia function getNames_Amm ($eastValue1, $northValue1) { $names=array(); //query2 $names[0] = "Select NH3_CONC, Mid_Year from CBED_1KM_2024 where Easting='$eastValue1' and Northing='$northValue1' and Mid_Year= (select max(Mid_Year) from CBED_1KM_2024)"; //unit_pollutant $names[1] = "µg m-3"; //critLev $names[2] = "Critical Level"; //conc $names[3] = "Concentration"; //exceed $names[4] = "Exceedance"; //Data Year $names[5] = "Data Year"; return $names; } //N Deposition function getNames_NDep ($habitat, $eastValue1, $northValue1) { $names=array(); //query2 if($habitat == "Broadleaved, Mixed and Yew Woodland" OR $habitat == "Coniferous woodland" OR $habitat == "Hedgerows" OR $habitat == "Wood-Pasture & Parkland") { $names[0] = "Select NO2_NO3_F+NH3_NH4_F, SO2_SO4_NM_F, CA_MG_NM_F, Mid_Year from CBED_1KM_2024 where Easting='$eastValue1' and Northing='$northValue1' and Mid_Year= (select max(Mid_Year) from CBED_1KM_2024)"; } else { $names[0] = "Select NO2_NO3_M+NH3_NH4_M, SO2_SO4_NM_M, CA_MG_NM_M, Mid_Year from CBED_1KM_2024 where Easting='$eastValue1' and Northing='$northValue1' and Mid_Year= (select max(Mid_Year) from CBED_1KM_2024)"; } //unit_pollutant $names[1] = ""; //critLev $names[2] = "Critical Load Range"; //conc $names[3] = "Deposition"; //exceed $names[4] = "Exceedance Ranges"; //Data Year $names[5] = "Data Year"; return $names; } //Nitrogen Oxides function getNames_NO ($eastValue1, $northValue1) { $names=array(); //query2 $names[0] = "Select NOX_CONC, MidYear from PCM_CONCENTRATIONS_2024 where Easting='$eastValue1' and Northing='$northValue1' and MidYear= (select max(MidYear) from PCM_CONCENTRATIONS_2024)"; //unit_pollutant $names[1] = "µg NOx (as NO2) m-3"; //critLev $names[2] = "Critical Level"; //conc $names[3] = "Concentration"; //exceed $names[4] = "Exceedance"; //Data Year $names[5] = "Data Year"; return $names; } //Ozone function getNames_Oz ($habitat, $eastValueOz, $northValueOz) { $names=array(); //query2 if($habitat == "Broadleaved, Mixed and Yew Woodland" OR $habitat == "Coniferous woodland" OR $habitat == "Hedgerows" OR $habitat == "Wood-Pasture & Parkland") { $query2 = "Select FOREST from OZONE where Easting='$eastValueOz' and Northing='$northValueOz'"; $names[6] = "(6 months growing season April to September)"; } elseif ($habitat == "Arable & Horticultural") { $query2 = "Select CROP from OZONE where Easting='$eastValueOz' and Northing='$northValueOz'"; $names[6] = "(3 months growing season June to August)"; } else { $query2 = "Select PERENIAL from OZONE where Easting='$eastValueOz' and Northing='$northValueOz'"; $names[6] = "(based on(Semi-)natural vegetation communities dominated by perennials, 6 month growing season mid April- mid October)"; } $names[0] = $query2; //unit_pollutant $names[1] = "ppb hours"; //critLev $names[2] = "Critical Level"; //conc $names[3] = "Exposure"; //exceed $names[4] = "Exceedance"; //Data Year $names[5] = "Data Year"; // $names[6] = "(based on(Semi-)natural vegetation communities dominated by perennials)"; return $names; } //Sulphur Dioxide function getNames_SO2 ($eastValue1, $northValue1) { $names=array(); //query2 $names[0] = "Select SO2_CONC, MidYear from PCM_CONCENTRATIONS_2024 where Easting='$eastValue1' and Northing='$northValue1' and MidYear= (select max(MidYear) from PCM_CONCENTRATIONS_2024)"; //unit_pollutant $names[1] = "µg m-3"; //critLev $names[2] = "Critical Level"; //conc $names[3] = "Concentration"; //exceed $names[4] = "Exceedance"; //Data Year $names[5] = "Data Year"; return $names; } /***** * PARSE STATEMENT 2 * @param con * @param statement2 * @return row ***/ function parseStatement2($con, $query2) { $statement2 = oci_parse($con,$query2); oci_execute ($statement2); $row = oci_fetch_array($statement2, OCI_BOTH); return $row; } /***** * GET CONCENTRATION * @param row * @return concentration ***/ function getConcentration ($row) { $conc = array(); $concentration= $row[0]; $concentration = round($concentration,2); $midyear = ($row[1]-1); $midyear .= " - ".($row[1]+1); $conc[0] = $concentration; $conc[1] = $midyear; return $conc; } function getConcentration_NDep ($row) { $ndep = array(); $concentration = ""; $concentration .= round($row[0]*14,2); $midyear = ($row[3]-1); $midyear .= " - ".($row[3]+1); //concentration $ndep[0] = $concentration; //mid year $ndep[1] = $midyear; return $ndep; } //only for Acid Deposition function getConcentration_Acid ($row) { $adep = array(); $concentration = ""; $concentration .= round((($row[0] + $row[1]) - $row[2]),2)." (N: "; $concentration .= round($row[0],2)." | S: "; $concentration .= round($row[1],2).") (keq/ha/yr) "; $midyear = ($row[3]-1); $midyear .= " - ".($row[3]+1); //concentration $adep[0] = $concentration; //depn $adep[1] = $row[0]; //deps $adep[2] = $row[1]; //mid year $adep[3] = $midyear; return $adep; } /***** * GET THE OTHER VALUES * @param habitat * @param con * @param concentration * @return val Array with the values of critical_level, concentration, exceedance, (clmaxs, clminn, clmaxn) ***/ //Acid deposition function getValues_Acid($habitat, $con, $concentration, $eastValue1, $northValue1) { $val=array(); if($habitat == "Acid grassland") $habID = 35; if($habitat == "Arable & Horticultural") $habID = 36; if($habitat == "Bogs") $habID = 37; if($habitat == "Broadleaved, Mixed and Yew Woodland") $habID = 38; if($habitat == "Calcareous grassland") $habID = 39; if($habitat == "Coastal and Floodplain Grazing Marsh") $habID = 40; if($habitat == "Coastal saltmarsh") $habID = 41; if($habitat == "Coniferous woodland") $habID = 42; if($habitat == "Dunes, Shingle & Machair") $habID = 43; if($habitat == "Dwarf Shrub Heath") $habID = 44; if($habitat == "Fen, Marsh and Swamp") $habID = 45; if($habitat == "Hedgerows") $habID = 46; if($habitat == "Improved Grassland") $habID = 47; if($habitat == "Inland Rock & Scree") $habID = 48; if($habitat == "Maritime Cliff and Slopes") $habID = 49; if($habitat == "Montane Habitats") $habID = 50; if($habitat == "Neutral Grassland") $habID = 51; if($habitat == "Rivers and Streams") $habID = 52; if($habitat == "Standing Open Water and Canals") $habID = 53; if($habitat == "Wood-Pasture & Parkland") $habID = 54; //get the ACCode $query3 = "Select ACCode from tblHabitats where HABITATID ='$habID'"; $statement3 = oci_parse($con,$query3); oci_execute($statement3); $row = oci_fetch_array($statement3, OCI_BOTH); $ACCode= $row[0]; oci_free_statement($statement3); //get the critical load class with the help of the ACCode $query4 = "Select acidityClass from zlut_acidity_habitat where accode='$ACCode'"; $statement4 = oci_parse($con,$query4); oci_execute($statement4); $row = oci_fetch_array($statement4, OCI_BOTH); $loadClass= $row[0]; oci_free_statement($statement4); //use the ACCode to get the critical level if($ACCode == 'BO') { $query1 = "Select MXNBGP, MXSBGP, MNNBGP from UKCLoads2010 where Easting='$eastValue1' and Northing='$northValue1'"; } if($ACCode == 'AG') { $query1 = "Select MXNACG, MXSACG, MNNACG from UKCLoads2010 where Easting='$eastValue1' and Northing='$northValue1'"; } if($ACCode == 'CDW') { $query1 = "Select MXNUMW, MXSUMW, MNNUMW from UKCLoads2010 where Easting='$eastValue1' and Northing='$northValue1'"; } if($ACCode == 'MO') { $query1 = "Select MXNMON, MXSMON, MNNMON from UKCLoads2010 where Easting='$eastValue1' and Northing='$northValue1'"; } if($ACCode == 'CA') { $query1 = "Select MXNDSH, MXSDSH, MNNDSH from UKCLoads2010 where Easting='$eastValue1' and Northing='$northValue1'"; } if($ACCode == 'CG') { $query1 = "Select MXNCG, MXSCG, MNNCG from UKCLoads2010 where Easting='$eastValue1' and Northing='$northValue1'"; } if($ACCode == 'CGC') { $query1 = "Select MXNCG4, MXSCG4, MNNCG4 from UKCLoads2010 where Easting='$eastValue1' and Northing='$northValue1'"; } if ($ACCode == 'NA') { $critical_level = "There is no comparable acid critical load class for which the CL function in calculated. The soil base empirical CL (based on the dominant soil) for grid square is 4.00 (keq/ha/yr)"; } else if ($ACCode == 'NS') { $critical_level = "This habitat is not sensitive to acidity"; } else { $statement1 = oci_parse($con,$query1); oci_execute($statement1); $row = oci_fetch_array ($statement1, OCI_BOTH); $critical_level = "
Class: " .$loadClass; $critical_level .= "
CLmaxS: ".round($row[1],3)." CLminN: "; $critical_level .= round($row[2],3)." CLmaxN: "; $critical_level .= round($row[0],3)." (keq/ha/yr)"; $clmaxs = $row[1]; $clminn = $row[2]; $clmaxn = $row[0]; oci_free_statement($statement1); } $val[0] = $critical_level; $val[3] = $clmaxs; $val[4] = $clminn; $val[5] = $clmaxn; return $val; } //Ammonia function getValues_Amm($habitat, $con, $concentration) { $val=array(); $query1 = "Select NH3Value from tblHabitatsCL where Habitat='$habitat'"; $statement1 = oci_parse($con,$query1); oci_execute($statement1); $critical_level = ""; $exceedance = ""; $temp = '1.0'; //concentration $val[1] = round($concentration,2); while ($row = oci_fetch_array ($statement1, OCI_BOTH)) { $critical_level .= $temp." - "; $critical_level .= $row[0]; $exceedance .= "[" .round($concentration-$temp,2)."] to ["; $exceedance .= round($concentration-$row[0],2)."] "; } $val[0] = $critical_level; $val[1] = $concentration; $val[2] = $exceedance; return $val; } //N Deposition function getValues_NDep($habitat, $con, $concentration) { $val=array(); $query1 = "SELECT NCLCLASS,CLMIN_NUTN,CLMAX_NUTN FROM ZLUT_NITROGEN_HABITAT,tbljunctionhabitatncload,tblhabitats WHERE habitatcname = '$habitat' AND tbljunctionhabitatncload.habitatid = tblhabitats.habitatid AND tbljunctionhabitatncload.ncloadid = ZLUT_NITROGEN_HABITAT.nclcode"; $statement1 = oci_parse($con,$query1); oci_execute($statement1); $critical_level = ""; $exceedance = ""; while ($row = oci_fetch_array ($statement1, OCI_BOTH)) { $critical_level .= "
".$row[0].": "; $critical_level .= $row[1]." - "; $critical_level .= $row[2]." Kg N/ha/year"; $exceedance .= "
".$row[0]." ["; $exceedance .= $concentration-$row[1]."] to ["; $exceedance .= $concentration-$row[2]."] Kg N/ha/year"; } $concentration .= " Kg N/ha/year"; $val[0] = $critical_level; $val[1] = $concentration; $val[2] = $exceedance; return $val; } //Nitrogen Oxides function getValues_NO($habitat, $con, $concentration) { $val=array(); $query1 = "Select NOxValue from tblHabitatsCL where Habitat='$habitat'"; $statement1 = oci_parse($con,$query1); oci_execute($statement1); $row = oci_fetch_array($statement1, OCI_BOTH); //critical_level $critical_level = $row[0]; $val[0] = $critical_level; $exceedance = $concentration - $critical_level; //concentration $val[1] = round($concentration,2); //exceedance $val[2] = round($exceedance,2); return $val; } //Ozone function getValues_Oz($habitat, $con, $concentration) { $val=array(); $query1 = "Select O3Value from tblHabitatsCL where Habitat='$habitat'"; $statement1 = oci_parse($con,$query1); oci_execute($statement1); $row = oci_fetch_array($statement1, OCI_BOTH); //critical_level $critical_level = $row[0]; $val[0] = $critical_level; $exceedance = $concentration - $critical_level; //concentration $val[1] = round($concentration,2); //exceedance $val[2] = round($exceedance,2); return $val; } //Sulphur Dioxide function getValues_SO2($habitat, $con, $concentration) { $val=array(); $query1 = "Select SO2Value from tblHabitatsCL where Habitat='$habitat'"; $statement1 = oci_parse($con,$query1); oci_execute($statement1); $row = oci_fetch_array($statement1, OCI_BOTH); //critical_level $critical_level = $row[0]; $val[0] = $critical_level; $exceedance = $concentration - $critical_level; //concentration $val[1] = round($concentration,2); //exceedance $val[2] = round($exceedance,2); return $val; } function printResults ($pollutant, $critLev, $critical_level, $unit_pollutant, $conclabel, $concentration, $exceed, $exceedance, $datayear, $yearaverage, $poll, $extra_text = null) { $urlClevel = "popup/".$poll."_clevel"; $urlConc = "popup/".$poll."_conc"; $pollutant_title = str_replace(" ","_",$pollutant); $titleClevel = "Critical_Levels_of_".$pollutant_title."_data_source"; $titleConc = "Concentration_".$pollutant_title; echo "

____________________________________________________________________________________

"; echo "

Pollutant: ".$pollutant."

"; echo "

".$critLev.": ".$critical_level." ".$unit_pollutant." "; if ($poll == "ozone") { echo $extra_text; } echo "

"; if ($poll == "ndep" && !empty ($extra_text)) { echo "

".$extra_text."

"; } echo "

".$conclabel.": ".$concentration." ".$unit_pollutant .""; echo ""; if ($poll == "ndep" && !empty ($extra_text) || $poll == "acid") { //echo " (Find out about method changes to CBED model 2013)"; } echo "

"; echo "

".$conc." ".$datayear.": ".$yearaverage."

"; echo "

".$exceed.": ".$exceedance." ".$unit_pollutant."

"; } function drawGraph_Acid ($clmaxs,$clminn,$clmaxn,$depn,$deps) { $graphArray=array(); //pass values to the graph file $A_CLgraph=urlencode('/sites/default/scripts/acidity_cl_graph.php?clmaxs='.$clmaxs.'&clminn='.$clminn.'&clmaxn='.$clmaxn.'&depn='.$depn.'&deps='.$deps.''); $graphID = "acid_cl_graph"; $graphArray[0]=$A_CLgraph; $graphArray[1]=$graphID; return $graphArray; } /***** * ROUTINES ***/ if ($polAmm == true) { $pollutant = 'Ammonia'; $names=getNames_Amm($eastValue1, $northValue1); $unit_pollutant = $names[1]; $critLev = $names[2]; $conclabel = $names[3]; $exceed = $names[4]; $datayear = $names[5]; $row=parseStatement2($con, $names[0]); $conc=array(); $conc=getConcentration($row); $concentration=$conc[0]; $yearaverage=$conc[1]; $val=getValues_Amm($habitat, $con, $concentration); $critical_level = $val[0]; $concentration = $val[1]; $exceedance = $val[2]; printResults($pollutant, $critLev, $critical_level, $unit_pollutant, $conclabel, $concentration, $exceed, $exceedance, $datayear, $yearaverage, "nh3"); } if ($polNDep == true) { $pollutant = 'N Deposition'; $names=getNames_NDep($habitat, $eastValue1, $northValue1); $unit_pollutant = $names[1]; $critLev = $names[2]; $conclabel = $names[3]; $exceed = $names[4]; $datayear = $names[5]; $row=parseStatement2($con, $names[0]); $ndep=array(); $ndep=getConcentration_Ndep($row); $concentration=$ndep[0]; $yearaverage=$ndep[1]; $val=getValues_NDep($habitat, $con, $concentration); $critical_level = $val[0]; $concentration = $val[1]; $exceedance = $val[2]; printResults($pollutant, $critLev, $critical_level, $unit_pollutant, $conclabel, $concentration, $exceed, $exceedance, $datayear, $yearaverage, "ndep",$indicative_Nloads); } if ($polNO == true) { $pollutant = 'Nitrogen Oxides'; $names=getNames_NO($eastValue1, $northValue1); $unit_pollutant = $names[1]; $critLev = $names[2]; $conclabel = $names[3]; $exceed = $names[4]; $datayear = $names[5]; $row=parseStatement2($con, $names[0]); $conc=array(); $conc=getConcentration($row); $concentration=$conc[0]; $yearaverage=$conc[1]; $val=getValues_NO($habitat, $con, $concentration); $critical_level = $val[0]; $concentration = $val[1]; $exceedance = $val[2]; printResults($pollutant, $critLev, $critical_level, $unit_pollutant, $conclabel, $concentration, $exceed, $exceedance, $datayear, $yearaverage, "no"); } if ($polOz == true) { $pollutant = 'Ozone'; $names=getNames_Oz($habitat, $eastValueOz, $northValueOz); $unit_pollutant = $names[1]; $critLev = $names[2]; $conclabel = $names[3]; $exceed = $names[4]; $datayear = $names[5]; $ozone_text = $names[6]; $row=parseStatement2($con, $names[0]); $conc=array(); $conc=getConcentration($row); $concentration=$conc[0]; $yearaverage="2007 - 2012"; $val=getValues_Oz($habitat, $con, $concentration); $critical_level = $val[0]; $concentration = $val[1]; $exceedance = $val[2]; printResults($pollutant, $critLev, $critical_level, $unit_pollutant, $conclabel, $concentration, $exceed, $exceedance, $datayear, $yearaverage, "ozone", $ozone_text); } if ($polSO2== true) { $pollutant = 'Sulphur Dioxide'; $names=getNames_SO2($eastValue1, $northValue1); $unit_pollutant = $names[1]; $critLev = $names[2]; $conclabel = $names[3]; $exceed = $names[4]; $datayear = $names[5]; $row=parseStatement2($con, $names[0]); $conc=array(); $conc=getConcentration($row); $concentration=$conc[0]; $yearaverage=$conc[1]; $val=getValues_SO2($habitat, $con, $concentration); $critical_level = $val[0]; $concentration = $val[1]; $exceedance = $val[2]; printResults($pollutant, $critLev, $critical_level, $unit_pollutant, $conclabel, $concentration, $exceed, $exceedance, $datayear, $yearaverage, "so2"); } if ($polAcid == true) { $pollutant = 'Acid Deposition'; $names=getNames_Acid($habitat, $eastValue1, $northValue1); $unit_pollutant = $names[1]; $critLev = $names[2]; $conclabel = $names[3]; $exceed = $names[4]; $datayear = $names[5]; $row=parseStatement2($con, $names[0]); $adep=array(); $adep=getConcentration_Acid($row); $concentration=$adep[0]; $depn=$adep[1]; $deps=$adep[2]; $yearaverage=$adep[3]; $val=getValues_Acid($habitat, $con, $concentration, $eastValue1, $northValue1); $critical_level = $val[0]; $clmaxs = $val[3]; $clminn = $val[4]; $clmaxn = $val[5]; $exceedance = ""; printResults($pollutant, $critLev, $critical_level, $unit_pollutant, $conclabel, $concentration, $exceed, $exceedance, $datayear, $yearaverage, "acid"); $graphArray=array(); $graphArray=drawGraph_Acid($clmaxs,$clminn,$clmaxn,$depn,$deps); $A_CLgraph=$graphArray[0]; $graphID=$graphArray[1]; } //oci_free_statement($statement1); //oci_free_statement($statement2); //oci_close($con); ?>