public static function Convert($value, $measureFrom, $measureTo = "G") { if (!is_numeric($value)) { return false; } if (!($arMeasurementsTable = CSaleMeasure::GetList())) { return false; } if (is_set($arMeasurementsTable, $measureFrom) && is_set($arMeasurementsTable, $measureTo)) { return $value * $arMeasurementsTable[$measureFrom]['KOEF'] / $arMeasurementsTable[$measureTo]['KOEF']; } else { return false; } }
<td align="center" colspan="2"><?php echo GetMessage("SMO_PAR_SITE_PARAMETERS"); ?> </td> </tr> <tr> <td width="40%" class="adm-detail-content-cell-l"><?php echo GetMessage("SMO_PAR_SITE_WEIGHT_UNIT_SALE"); ?> </td> <td width="60%" class="adm-detail-content-cell-r"><select name="weight_unit_tmp[<?php echo $siteList[$i]["ID"]; ?> ]" OnChange="setWeightValue(this)"> <option selected="selected"></option><?php $arUnitList = CSaleMeasure::GetList("W"); foreach ($arUnitList as $key => $arM) { $selectedWeightUnit = COption::GetOptionString($module_id, "weight_unit", trim($siteList[$i]["ID"])); ?> <option value="<?php echo floatval($arM["KOEF"]); ?> " <?php echo $selectedWeightUnit == $arM["NAME"] ? "selected" : ""; ?> ><?php echo htmlspecialcharsbx($arM["NAME"]); ?> </option> <?php }