You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This public function checks to see if all the stems of a tree have the same quadrat
Cloud
All stems of a tree should be located within the same quadrat.
$tempTableName = 'TempNewPlants';
$tempTableName = 'TempOldTrees';
$tempTableName = 'TempMultiStems';
publicfunctionscreenDuplQuad ($fileName)
{
//This public function checks to see if all the stems of a tree have the same quadrat$q1 = "SELECT Tag,COUNT(Tag) AS cnt FROM (SELECT DISTINCT Tag, QuadratName, Errors FROM ".$fileName." GROUP BY Tag,QuadratName UNION SELECT DISTINCT Tag, QuadratName, Errors FROM ".$fileName."Error GROUP BY Tag, QuadratName) AS t2 WHERE Errors<>'NONE' GROUP BY Tag HAVING cnt>1";
$runQ1 = $this->screeningdb->query($q1);
if ($runQ1->num_rows() > 0)
{
foreach($runQ1->result() as$row)
{
$q2 = 'UPDATE '.$fileName.' SET Errors = CONCAT(TRIM(Errors),";>1 Quadrat") WHERE Tag = "'.$row->Tag.'" AND Errors <> "" AND Errors IS NOT NULL';
$q3 = 'UPDATE '.$fileName.' SET Errors = ">1 Quadrat" WHERE Tag ="'.$row->Tag.'" AND (Errors = "" OR ISNULL(Errors))';
$runQ3 = $this->screeningdb->query($q2);
$runQ4 = $this->screeningdb->query($q3);
}
}
}
Here is an updated procedure to run this and mark its errors in the CMVErrors table! Function's been reviewed with GPT so it should work as intended, but full testing is still pending:
See "instructions for writing a validation function". Below are notes from the spec, the original validation function (in the PHP language), and the SQL table structure.
The text was updated successfully, but these errors were encountered: