Exemplo n.º 1
0
    function render_controls()
    {
        global $button_interfaces;
        global $input_interfaces;
        global $span_interfaces;
        $h5 = '';
        echo '
<section id="controls" class="context-menu-' . $this->_diff . '-' . $this->_is_secondary . '-' . $this->_partner_dob . '-' . $this->_lang_code . '">
	<h5>' . $this->_controls_h5 . (date('m-d', time() + 86400 * $this->_diff) == date('m-d', strtotime($this->_dob)) ? ' <i class="icon-birthday-cake"></i>' : '') . '</h5>
	<div class="helper changeable"><i class="icon-circle-question-mark icon-white"></i></div>
	<ul>
		<li class="rhythm changeable"><span class="translate" data-lang-ja="平均する:" data-lang-zh="平均:" data-lang-es="Promedio:" data-lang-ru="Средний:" data-lang-en="Average:" data-lang-vi="Trung bình:"></span><span class="value">' . percent_average_bio_count($this->_dob, date('Y-m-d', time() + 86400 * $this->_diff), $this->_rhythms) . '</span><i class="icon-white icon-' . (average_bio_count($this->_dob, date('Y-m-d', time() + 86400 * ($this->_diff - 1)), $this->_rhythms) < average_bio_count($this->_dob, date('Y-m-d', time() + 86400 * $this->_diff), $this->_rhythms) ? 'up' : 'down') . '-arrow"></i><i class="rhythm_toggle" data-rhythm-id="0" class="icon-white"></i></li>';
        foreach ($this->_rhythms as $rhythm) {
            echo '<li class="rhythm changeable' . ($rhythm['is_secondary'] == 1 ? ' secondary' : '') . '"><span class="translate" data-lang-ja="' . $rhythm['description_ja'] . ':" data-lang-zh="' . $rhythm['description_zh'] . ':" data-lang-es="' . $rhythm['description_es'] . ':" data-lang-ru="' . $rhythm['description_ru'] . ':" data-lang-en="' . $rhythm['description_en'] . ':" data-lang-vi="' . $rhythm['name'] . ':"></span><span class="value">' . percent_bio_count($this->_dob, date('Y-m-d', time() + 86400 * $this->_diff), $rhythm['scale']) . '</span><i class="icon-white icon-' . (bio_count($this->_dob, date('Y-m-d', time() + 86400 * ($this->_diff - 1)), $rhythm['scale']) < bio_count($this->_dob, date('Y-m-d', time() + 86400 * $this->_diff), $rhythm['scale']) ? 'up' : 'down') . '-arrow"></i><i class="rhythm_toggle" data-rhythm-id="' . $rhythm['rid'] . '" class="icon-white"></i></li>';
        }
        echo '
	</ul>
	<input type="hidden" id="dt_curr" value="' . date('Y-m-d', time() + 86400 * $this->_diff) . '" />
	<label class="m-checkbox m-wrap" for="is_secondary">
		<i id="checkbox_icon" class="icon-' . ($this->_is_secondary == 1 ? 'check' : 'unchecked') . '"></i>
		<span class="translate" data-lang-ja="表示セカンダリ・リズム" data-lang-zh="示第二性韵律" data-lang-es="Mostrar secundario ritmos" data-lang-ru="Показать вторичные ритмы" data-lang-en="Show secondary rhythms" data-lang-vi="Hiện nhịp sinh học phụ"></span>
		<input class="m-wrap" type="checkbox" name="is_secondary" id="is_secondary" value="1" ' . ($this->_is_secondary == 1 ? 'checked' : '') . ' />
	</label>
	<div class="m-input-prepend">
		<span data-lang-ja="日付を表示す:" data-lang-zh="查看日期:" data-lang-es="Ver la fecha:" data-lang-ru="Посмотреть дата:" data-lang-en="View date:" data-lang-vi="Xem ngày:" class="add-on translate" id="dt_change_label"></span>
		<input readonly data-lang-ja="' . $input_interfaces['dt_change']['ja'] . '" data-lang-zh="' . $input_interfaces['dt_change']['zh'] . '" data-lang-es="' . $input_interfaces['dt_change']['es'] . '" data-lang-ru="' . $input_interfaces['dt_change']['ru'] . '" data-lang-en="' . $input_interfaces['dt_change']['en'] . '" data-lang-vi="' . $input_interfaces['dt_change']['vi'] . '" class="m-wrap required" placeholder="' . $input_interfaces['dt_change'][$this->_lang_code] . '" id="dt_change" type="text" name="dt_change" size="42" maxlength="128" value="' . ($this->_dt_change == date('Y-m-d') ? 'YYYY-MM-DD' : $this->_dt_change) . '" />
	</div>
	<div class="m-btn-group">
		<a class="m-btn green" id="today" title="[S] | [K]"><i class="icon-calendar icon-white"></i><span class="translate" data-lang-ja="' . $button_interfaces['today']['ja'] . '" data-lang-zh="' . $button_interfaces['today']['zh'] . '" data-lang-es="' . $button_interfaces['today']['es'] . '" data-lang-ru="' . $button_interfaces['today']['ru'] . '" data-lang-en="' . $button_interfaces['today']['en'] . '" data-lang-vi="' . $button_interfaces['today']['vi'] . '">' . $button_interfaces['today'][$this->_lang_code] . '</span></a>
		<a class="m-btn blue button_changeable" id="prev" title="[A] | [J]"><i class="icon-backward icon-white"></i><span class="translate" data-lang-ja="' . $button_interfaces['prev']['ja'] . '" data-lang-zh="' . $button_interfaces['prev']['zh'] . '" data-lang-es="' . $button_interfaces['prev']['es'] . '" data-lang-ru="' . $button_interfaces['prev']['ru'] . '" data-lang-en="' . $button_interfaces['prev']['en'] . '" data-lang-vi="' . $button_interfaces['prev']['vi'] . '">' . $button_interfaces['prev'][$this->_lang_code] . '</span></a>
		<a class="m-btn blue button_changeable" id="next" title="[D] | [L]"><span class="translate" data-lang-ja="' . $button_interfaces['next']['ja'] . '" data-lang-zh="' . $button_interfaces['next']['zh'] . '" data-lang-es="' . $button_interfaces['next']['es'] . '" data-lang-ru="' . $button_interfaces['next']['ru'] . '" data-lang-en="' . $button_interfaces['next']['en'] . '" data-lang-vi="' . $button_interfaces['next']['vi'] . '">' . $button_interfaces['next'][$this->_lang_code] . '</span><i class="icon-forward icon-white"></i></a>
	</div>
	<div class="clear"></div>
</section>';
    }
Exemplo n.º 2
0
function percent_average_bio_count($dob, $date, $rhythms)
{
    return average_bio_count($dob, $date, $rhythms) . ' %';
}