Ejemplo n.º 1
0
function fillOptions(&$id, $level, $maxLevel)
{
    $max = rand(1, 9);
    $result = array();
    for ($i = 0; $i <= $max; $i++) {
        $option = array();
        $option['id'] = $id++;
        $option['name'] = 'Level ' . $level . ' Option ' . $i;
        if ($level < $maxLevel) {
            $option['final'] = rand(0, 1);
        } else {
            $option['final'] = 1;
        }
        if (!$option['final']) {
            $option['options'] = fillOptions($id, $level + 1, $maxLevel);
        }
        $result[$i] = $option;
    }
    return $result;
}
Ejemplo n.º 2
0
>
                <?php 
fillOptions($hours24, is_array($tpl_book_values) ? $tpl_book_values['end-hour-24'] : null);
?>
            </select>
            <select name="end-minute" size="1">
                <?php 
fillOptions($minutesArray, is_array($tpl_book_values) ? $tpl_book_values['end-minute'] : null);
?>
            </select>
            <select name="end-meridiem" size="1"<?php 
hideIfEmpty($tpl_book_hour_mode == \Application\EmpItem::MODE_DAY_12);
?>
>
                <?php 
fillOptions($meridiemArray, is_array($tpl_book_values) ? $tpl_book_values['end-meridiem'] : null);
?>
            </select>
            <div class="book-input-error-message" <?php 
\Utility\HtmlHelper::HideIfEmptyOrNull($tpl_book_errors, 'time');
?>
><?php 
\Utility\HtmlHelper::EchoIfPresent($tpl_book_errors, 'time');
?>
</div>
        <br><br>
        4. Enter the specifics for the meeting. (This will be what people see when the click on an event link.)<br>
            <textarea name="notes" wrap="soft" rows="3" cols="40" required><?php 
\Utility\HtmlHelper::EchoIfPresent($tpl_book_values, 'notes');
?>
</textarea>