当前位置: 首页>>代码示例>>PHP>>正文


PHP SibdietHelper::age方法代码示例

本文整理汇总了PHP中SibdietHelper::age方法的典型用法代码示例。如果您正苦于以下问题:PHP SibdietHelper::age方法的具体用法?PHP SibdietHelper::age怎么用?PHP SibdietHelper::age使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SibdietHelper的用法示例。


在下文中一共展示了SibdietHelper::age方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

          <?php 
echo $this->form->getInput('city', 'profile');
?>
          <?php 
echo $this->form->getLabel('birthday', 'profile');
?>
          <?php 
echo $this->form->getInput('birthday', 'profile');
?>
          <span class="age hasTooltip" title="<?php 
echo JText::_('COM_SIBDIET_AGE');
?>
">
          <?php 
if (!empty($this->item->profile->birthday)) {
    $age = SibdietHelper::age($this->item->profile->birthday, $this->item->created);
    echo $age->y . '.' . $age->m;
}
?>
          </span>
          <?php 
echo $this->form->getInput('email', 'profile');
?>
          <?php 
$canDo = SibdietHelper::getActions();
?>
          <?php 
if ($canDo->get('room.1')) {
    echo $this->form->getInput('room1');
}
?>
开发者ID:smhnaji,项目名称:sdnet,代码行数:31,代码来源:edit.php

示例2: JRegistry

    ?>
	<?php 
    // Convert the body field to an array.
    $registry = new JRegistry();
    $registry->loadString($item->body);
    $item->body = $registry->toArray();
    $item->weight = $item->body['weight'];
    $item->stature = $item->body['stature'];
    $item->wrist = $item->body['wrist'];
    // Convert the body field to an array.
    $registry = new JRegistry();
    $registry->loadString($item->first_body);
    $item->first_body = $registry->toArray();
    $item->first_weight = $item->first_body['weight'];
    $item->first_stature = $item->first_body['stature'];
    $item->age = SibdietHelper::age($item->birthday, $item->created);
    $age = $item->age->y . '.' . $item->age->m;
    $item->bmi = SibdietHelper::bmi($item->weight, $item->stature);
    $overweight_amount = $item->weight - $item->ideal_weight;
    $item->body_fat = SibdietHelper::BodyFat($item->age, $item->gender, $item->bmi);
    $body_fat_text = $item->body_fat['fat'] . ' (' . JText::_('COM_SIBDIET_BODY_FAT_STATUS_' . $item->body_fat['status']) . ')';
    $item->obesity_degree = SibdietHelper::ObesityDegree($item->gender, $item->weight, $item->stature);
    $foods_program = SibdietHelper::FoodsProgram($item->breakfasts, $item->lunchs, $item->dinners, $item->morning_snack_id, $item->evening_snack_id);
    $item->profiles_id = $item->profiles_id + 200000;
    $item->body_size = SibdietHelper::BodySizeGrouping($item->age, $item->gender, $item->stature, $item->wrist);
    $dietSupplementNotice = JText::sprintf('COM_SIBDIET_PRINT_SUPPLEMENT_NOTICE', $item->period);
    if ($age <= 17) {
        $item->bmi = $body_fat_text = $overweight_amount_text = JText::_('COM_SIBDIET_BODY_SIZE_GROUPING_' . $item->body_size);
    }
    ?>
		<div id="diet<?php 
开发者ID:smhnaji,项目名称:sdnet,代码行数:31,代码来源:default.php

示例3:

        ?>
							<div class="small hidden-phone">(
								<?php 
        echo JText::_('COM_SIBDIET_GENDER_' . $item->gender);
        ?>
 | 
								<?php 
        echo JText::_('COM_SIBDIET_MARITAL_' . $item->marital);
        ?>
 | 
								<?php 
        echo JText::_('COM_SIBDIET_EDUCATION_' . $item->education);
        ?>
 |
								<?php 
        echo SibdietHelper::age($item->birthday, $item->created)->ym;
        ?>
								<?php 
        if ($item->blood && $item->blood != 'NOT_KNOW') {
            echo ' | ' . JText::_('COM_SIBDIET_BLOOD_' . $item->blood) . ' ';
        }
        ?>
)
							</div>
						</td>
						<td class="center hidden-phone">
							<?php 
        if ($item->mobile) {
            ?>
								<div class="mobile"><?php 
            echo $item->mobile;
开发者ID:smhnaji,项目名称:sdnet,代码行数:31,代码来源:default.php

示例4: switch

    <div class="span3 plots">
      <div id="standardPlot" style="height:280px"></div>
      <div id="assetsPlot" style="height:280px"></div>
    </div>
  </div>
</div>
<?php 
// Calculate standardPlot
$this->item->body = (object) $this->item->body;
switch ($this->item->profile->gender) {
    case 'MALE':
        $bmr = 66 + 13.7 * $this->item->body->weight + 5 * $this->item->body->stature - 6.8 * SibdietHelper::age($this->item->profile->birthday)->ym;
        $calorie = $bmr * 1.7;
        break;
    case 'FEMALE':
        $bmr = 655 + 9.6 * $this->item->body->weight + 1.7 * $this->item->body->stature - 4.7 * SibdietHelper::age($this->item->profile->birthday)->ym;
        $calorie = $bmr * 1.6;
        break;
    default:
        $calorie = 0;
        break;
}
$carbCalorieS = round($calorie * 57 / 100, 2);
$fatCalorieS = round($calorie * 28 / 100, 2);
$proteinCalorieS = round($calorie * 15 / 100, 2);
if (!empty($allNutrients)) {
    // Calculate AssetsPlot
    $carbCalorieA = $allNutrients[35];
    $fatCalorieA = $allNutrients[38];
    $proteinCalorieA = $allNutrients[34];
    $script = "jQuery(document).ready(function()\n{\n  var assetsData = [\n    ['" . JText::_('COM_SIBDIET_CARB_CALORIE') . ": " . $carbCalorieS . "', " . $carbCalorieS . "],['" . JText::_('COM_SIBDIET_FAT_CALORIE') . ": " . $fatCalorieS . "', " . $fatCalorieS . "], ['" . JText::_('COM_SIBDIET_PROTEIN_CALORIE') . "" . $proteinCalorieS . "', " . $proteinCalorieS . "]\n  ];\n  assets_plot = jQuery.jqplot('assetsPlot', [assetsData],\n  {\n    title: '" . JText::_('COM_SIBDIET_STANDARD') . "',\n    seriesColors:['#efe4b0', '#fff200', '#ff7f27'],\n    seriesDefaults: {\n      renderer: jQuery.jqplot.PieRenderer,\n      rendererOptions: {\n        padding: 10,\n        showDataLabels: true\n      }\n    },\n    legend: { show:true, location: 'n' },\n  });\n\n  var standardData = [\n    ['" . JText::_('COM_SIBDIET_CARB_CALORIE') . ": " . $carbCalorieA . "', " . $carbCalorieA . "],['" . JText::_('COM_SIBDIET_FAT_CALORIE') . ": " . $fatCalorieA . "', " . $fatCalorieA . "], ['" . JText::_('COM_SIBDIET_PROTEIN_CALORIE') . "" . $proteinCalorieA . "', " . $proteinCalorieA . "]\n  ];\n  standard_plot = jQuery.jqplot('standardPlot', [standardData],\n  {\n    title: '" . JText::_('COM_SIBDIET_ASSETS') . "',\n    seriesColors:['#efe4b0', '#fff200', '#ff7f27'],\n    seriesDefaults: {\n      renderer: jQuery.jqplot.PieRenderer,\n      rendererOptions: {\n        padding: 10,\n        showDataLabels: true\n      }\n    },\n    legend: { show:true, location: 'n' },\n  });\n\n  window.onresize = function(event) {\n    assets_plot.replot();\n    standard_plot.replot();\n  }\n});";
开发者ID:smhnaji,项目名称:sdnet,代码行数:31,代码来源:calculation.php


注:本文中的SibdietHelper::age方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。