Displaying reports with PHP

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Agent M

    Displaying reports with PHP

    Hi

    I want to create a two column table in php. On the left column is my
    navigation buttons. Each botton generates a report. I want to display this
    report
    in the right column. Each time I click a different button a different report
    will
    be displayed. How do I do this?

    THANKS!



  • Pedro Graca

    #2
    Re: Displaying reports with PHP

    Agent M wrote:[color=blue]
    > I want to create a two column table in php. On the left column is my
    > navigation buttons. Each botton generates a report. I want to display this
    > report
    > in the right column. Each time I click a different button a different report
    > will
    > be displayed. How do I do this?[/color]

    Here's a way, adapt it to your liking


    [code]
    <?php
    function do_report1() { echo '<p>report one</p>'; }
    function do_report2() { echo '<p>report two</p>'; }
    ###
    ?>
    <html>
    ....
    <table border="1"><tr>
    <td>
    <?php // column 1 (for buttons)

    // the form action should be a full URL -- but this works for tests
    echo '<form action="" method="post">' ;

    // later will use the button value to know what to report
    echo '<input type="submit" name="btn" value="one"><br/>';
    echo '<input type="submit" name="btn" value="two"><br/>';
    ###
    echo '<input type="submit" name="something _else" value="TRY ME TOO">';
    ?>
    </form></td><td>
    <?php // column 2 (for reports)
    if (isset($_POST['btn'])) {
    switch ($_POST['btn']) {
    case 'one' : do_report1(); break;
    case 'two' : do_report2(); break;
    ###
    default: echo '<p>No! No! Not that one :)</p>';
    } else {
    echo '<p>Please select a report from the left</p>';
    }
    }
    ?>
    </td></tr</table>
    ....
    </html>
    [code]
    --
    --= my mail box only accepts =--
    --= Content-Type: text/plain =--
    --= Size below 10001 bytes =--

    Comment

    • Jochen Daum

      #3
      Re: Displaying reports with PHP

      Hi nameless person!

      On Thu, 12 Feb 2004 19:05:40 GMT, "Agent M" <henk@woodenpal ette.com>
      wrote:
      [color=blue]
      >Hi
      >
      >I want to create a two column table in php. On the left column is my
      >navigation buttons. Each botton generates a report. I want to display this
      >report
      >in the right column. Each time I click a different button a different report
      >will
      >be displayed. How do I do this?[/color]


      Use a table with two columns to display each side. Use a templating
      system (PEAR, Smarty, FastTemplate) to build the parts and insert them
      there.

      HTH, Jochen
      --
      Jochen Daum - Cabletalk Group Ltd.
      PHP DB Edit Toolkit -- PHP scripts for building
      database editing interfaces.
      Download PHP DB Edit Toolkit for free. PHP DB Edit Toolkit is a set of PHP classes makes the generation of database edit interfaces easier and faster. The main class builds tabular and form views based on a data dictionary and takes over handling of insert/update/delete and user input.

      Comment

      • Agent M

        #4
        Re: Displaying reports with PHP

        Thanks for the help so far

        Henk


        "Agent M" <henk@woodenpal ette.com> wrote in message
        news:62334896b5 423d3605adc571f cfa475a@news.cy clonews.com...[color=blue]
        > Hi
        >
        > I want to create a two column table in php. On the left column is my
        > navigation buttons. Each botton generates a report. I want to display this
        > report
        > in the right column. Each time I click a different button a different[/color]
        report[color=blue]
        > will
        > be displayed. How do I do this?
        >
        > THANKS!
        >
        >
        >[/color]


        Comment

        Working...