Results 1 to 4 of 4

Thread: [RESOLVED] unknown variable

Threaded View

  1. #1
    Join Date
    Jun 2011

    resolved [RESOLVED] unknown variable

    On the how many input box in red, I'm going to allow a user to enter any specific number... based on that number it needs to calculate whatever the $seconds variable is equal too at the time. Than the output should echo the seconds, minutes, hours fields. I hope that makes sense... Any help would be greatly appreciated. Thanks in advance.

    PHP Code:

    $results = sql::clean_row("
        sum(quantity) as quantity,
        (sum(duration_minutes) * 60) + sum(duration_seconds) as duration_seconds
    from event.dbo.process_data
    where process_id=$process_id");

    //echo $results['duration_minutes'] . " " . $results['duration_seconds'] . " " . $results['quantity'] . "<br />";

    $seconds = floor($results['duration_seconds'] / $results['quantity']);
    $minutes = $seconds/60;

    echo "<br />Quantity  " . $results['quantity']. "&nbsp;&nbsp;&nbsp; |&nbsp;&nbsp;&nbsp;  time in seconds ($seconds) / 60 = total time in minutes ($minutes)";

    <form action="<?php echo matry::here(array('page'=> 'cal')); ?>" method="POST">    
    <tr><td><?php inp('how_many'); ?></td><td> * <?php echo $seconds?></td></tr>
    <tr><td>This many Seconds:</td></tr> 
    <tr><td>This many Minutes:</td></tr>
    <tr><td>This many Hours:</td></tr>
    <tr><td>This many FTE:</td></tr>
    <tr><td><input type="submit" value="Calculate" name="submit" /></td></tr>
    Last edited by Supplement; 11-06-2012 at 05:56 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center