public function getMeanHypsodonty ($lid)
SELECT now_ls.lid, ROUND(SUM(CASE WHEN tht = "bra" THEN 1 WHEN tht = "mes" THEN 2 WHEN tht = "hyp" OR tht = "hys" THEN 3 ELSE 0 END) / COUNT(NULLIF(tht, "")), 2) AS mean_hypsodonty
FROM now_ls
LEFT JOIN com_species ON com_species.species_id = now_ls.species_id
WHERE lid=@lid AND order_name in ("Perissodactyla", "Artiodactyla", "Primates", "Proboscidea", "Hyracoidea", "Dinocerata", "Embrithopoda", "Notoungulata", "Astrapotheria", "Pyrotheria", "Litopterna", "Condylarthra", "Pantodonta")
GROUP BY now_ls.lid
Updates automatically the now_loc.hominin_skeletal_remains field and also displays the value on the screen
This field should be not editable when shown
public function getHomininSkeletalRemainsStatus($lid)
{
$count = 0;
$new = FALSE;
$current = $this->fetchValues("SELECT hominin_skeletal_remains FROM now_loc WHERE lid = @lid", array("lid" => $lid));
$current = intval(!empty($current) ? $current[0] : 0);
$species_ids = $this->fetchValues("SELECT species_id FROM now_ls WHERE lid = @lid", array("lid" => $lid));
if(!empty($species_ids))
{
$species_ids = join(",", $species_ids);
$where = $this->createHomininWhere();
$query = "SELECT COUNT(species_id) FROM com_species WHERE ($where) AND species_id IN ($species_ids)";
$count = intval($this->fetchValues($query, array())[0]);
}
if($count == 0 && $current == 0) // 0 0 nop
$new = FALSE;
else if($count == 0 && $current == 1) // 0 1 set 0
$new = 0;
else if($count == 0 && is_null($current)) // 0 NULL set 0
$new = 0;
else if($count > 0 && $current == 0) // 1 0 set 1
$new = 1;
else if($count > 0 && $current == 1) // 1 1 nop
$new = FALSE;
else if($count > 0 && is_null($current)) // 1 NULL set 1
$new = 1;
return array("current" => $current, "new" => $new, "count" => $count);
}
public function createHomininWhere()
{
global $hominins;
$query = "";
for($i = 0; $i < count($hominins); $i++)
$query .= ($query != "" ? " OR " : "") . "genus_name LIKE '${hominins[$i]}'";
return $query;
}
public function isHominin($genus_name)
{
global $hominins;
return in_array(strtolower($genus_name), $hominins);
}
$hominins = array(
"sahelanthropus",
"orrorin",
"ardipithecus",
"kenyanthropus",
"australopithecus",
"paranthropus",
"homo"
);
- [ ] Locality > Climate > **Pollen Record fields**
- must be a positive integer value between 0 and 100.
- The combined value of Arboreal pollen (AP%), Non-arboreal pollen (NAP%), and Other pollen (OP%) must be less than or equal to 100%.
- [ ] Age things: **Fractions etc.**
- [x] Species > Teeth > **Functional Crown Type**
CONCAT(
CASE WHEN fct_al IS NULL OR fct_al = "" THEN "-" ELSE fct_al END,
CASE WHEN fct_ol IS NULL OR fct_ol = "" THEN "-" ELSE fct_ol END,
CASE WHEN fct_sf IS NULL OR fct_sf = "" THEN "-" ELSE fct_sf END,
CASE WHEN fct_ot IS NULL OR fct_ot = "" THEN "-" ELSE fct_ot END,
CASE WHEN fct_cm IS NULL OR fct_cm = "" THEN "-" ELSE fct_cm END
) AS functional_crown_type,
- [x] Species > Teeth > **Developmental Crown Type**
CONCAT(
CASE WHEN cusp_shape IS NULL OR cusp_shape = "" THEN "-" ELSE cusp_shape END,
CASE WHEN cusp_count_buccal IS NULL OR cusp_count_buccal = "" THEN "-" ELSE cusp_count_buccal END,
CASE WHEN cusp_count_lingual IS NULL OR cusp_count_lingual = "" THEN "-" ELSE cusp_count_lingual END,
CASE WHEN loph_count_lon IS NULL OR loph_count_lon = "" THEN "-" ELSE loph_count_lon END,
CASE WHEN loph_count_trs IS NULL OR loph_count_trs = "" THEN "-" ELSE loph_count_trs END
) AS developmental_crown_type
- [x] Species > Teeth > **Normalized Score**
`// Normalized mesowear score: [0-100] -- Scale: max - min -- Display value is calculated (value - min) / scale * 100 => (value - min) / (max - min) * 100
`
- [ ] Locality > Locality: **Latitude, Longitude**
Jouni may provide the exact formula how to calculate the values between decimal decrees and dms. Below are some restrictions:
<b>Latitude dms</b> must be entered with positive numbers in format DD MM SS N or DD MM SS S where DD is 0 - 90, MM 0 - 59, SS 0 - 59 and N and S are compass directions for North or South.<br><br>
<b>Longitude dms</b> must be entered with positive numbers in format DDD MM SS E or DDD MM SS W where DDD is 0 - 180, MM 0 - 59 and SS 0 - 59 and E and W are compass directions for East or West.<br><br>
<b>Latitude dec</b> must be a positive or negative real number ranging from 0 to 90, northern latitudes are positive and southern latitudes are negative.<br><br>
<b>Longitude dec</b> must be a positive or negative real number ranging from 0 to 180, eastern longitudes are positive and western longitudes are negative.<br><br>
[x] Locality > Ecometrics tab > Mean hypsodonty
This field should be not editable when shown
[x] Locality > archaeology Tab > Hominin skeletal remains
Updates automatically the now_loc.hominin_skeletal_remains field and also displays the value on the screen
This field should be not editable when shown