Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

#23 oc_time control submitted for oohforms

open
nobody
5
2002-02-15
2002-02-15
Erik Norvelle
No

The attached file is an instantiation of a time input
control, derived from oc_calendar by Sanisoft.

Discussion

  • Erik Norvelle
    Erik Norvelle
    2002-02-15

    of_time.inc class file

     
    Attachments
  • Logged In: YES
    user_id=269695

    Cool!! and thanks will put it in the next release?!! of
    of_cal

    BUT of_cal is not a part of PHPlib as yet :-)

     
  • Logged In: NO

    The "extrahtml"-function is not provided in the actual
    version of of_time.inc. Replace the following function and
    it works:

    -----------------
    function self_get($val, $which, &$count) {
    $str = "";
    $count = 2;
    $val=trim($val);
    if(!empty($val)) {
    $this->value = $val;
    $val_arr = explode
    (":",$val);
    $this->hour = (int) $val_arr[0];
    $this->min = (int) $val_arr[1];
    }

    // Generate hour selector
    $str = "<select name='" . $this-
    >name . "_hour'";
    if ($this->extrahtml)
    $str .= " $this->extrahtml";
    $str.=">";
    for ($hour = 0; $hour <= 23; $hour++) {
    if ($hour < 10) { $prefix = "0"; }
    else { $prefix = ""; }
    $str .= "<option
    value='$prefix$hour'";
    if ($hour == $this->hour) {
    $str .= " selected"; }
    $str .= ">$prefix$hour";
    }
    $str .= "</select><b>:</b>";

    // Generate minute selector
    $str .= "<select name='" . $this-
    >name . "_min'";
    if ($this->extrahtml)
    $str .= " $this->extrahtml";
    $str.=">";
    for ($min = 0; $min < 60; $min++) {
    if ($min < 10) { $prefix = "0"; }
    else { $prefix = ""; }
    $str .= "<option
    value='$prefix$min'";
    if ($min == $this->min) { $str .= "
    selected"; }
    $str .= ">$prefix$min";
    }
    $str .= "</select>";
    //$str .= "<br>$val " . $this->hour . " " . $this->min;
    return $str;
    }