3 function get_unit($db,$param) {
6 'select u.id,u.unit_group from st_parameters st,units u where st.id='.$param.' and st.st_unit=u.id'
10 while ($row = $qug -> fetch(PDO::FETCH_ASSOC)) {
11 $from_unit = $row['id'];
12 $unit_group = $row['unit_group'];
15 if (!empty($_COOKIE['unit_'.$unit_group])) {
16 $to_unit=intval($_COOKIE['unit_'.$unit_group]);
22 'select u.name_short from units u where u.id='.$to_unit
26 while ($row = $qu -> fetch(PDO::FETCH_ASSOC)) {
27 $param_unit = $row['name_short'];
38 function convert_unit($db,$value,$from,$to) {
47 'select round(unitconv('.$value.','.$from.','.$to.'),2) res'
51 while ($row = $qv -> fetch(PDO::FETCH_ASSOC)) {