Jump to content

Newbie with question


Scott_Enriquez

Recommended Posts

As the title says, I'm very new to PHP.  This is from a scheduling system, the system is designed to ask the customer for a preferred time from a list of available times.  There will always only be one time available.  I'm trying to hide the option to select a time and have the one option automatically selected.

 

I was able to display the time using:

 

<?php echo $preferredTimesOptions [0] [0] ?>

 

But I can't figure out how, or even really where this value needs to be stored.  I've tried as many things as I could think of with my limited PHP knowledge to acheive this, but I'm at a loss.  I'm not sure if more code is needed to figure this out.  Any suggestions would be greatly appreciated.

 

 

<?php     if( $preferredTimes) : ?>
        <tr>
        <th>
        <?php /* echo M('Preferred Time'); */ ?>
        </th>
<?php
        $preferredTimesOptions = array();
        $t->setDateDb(20110516);
        $startDay = $t->getStartDay();
        foreach( $preferredTimes as $pt ){
            $t->setTimestamp( $startDay + $pt );
            $ptView = $t->formatTime();
            $preferredTimesOptions[] = array( $pt, $ptView );
            }
?>
        <td>
<?php         
echo $this->makeInput (
/* type */
    'select',
/* attributes */
    array(
        'id'        => 'preferred-time',
        'options'    => $preferredTimesOptions,
        'attr'        => array(
            ),
        )
    );
?>
        </td>
        </tr>
<?php     endif; ?>

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.