This topic is locked

Print Details & more

10/10/2006 4:27:22 AM
PHPRunner General questions
A
albo author

Hi,

what i must do to be able to print the details of one record in the view page?

I need 2 kinds of print where in 1 there will be some fields and in the other one some others, but i need em on the view page for every single record.

And to add the delete link directly in the view page?

Same for the edit link.

Thx.

J
Jane 10/10/2006

Hi,
please see my answers below:

  1. to print only one record you can simply print VIEW page of this record.

    To use two or more custom print modes you can create some custom VIEW pages and then place links to these custom pages on the main VIEW page using ViewOnLoad event.
  2. To add edit link to the VIEW page use ViewOnLoad event.

    Here is a sample code:
    function ViewOnLoad()

    {

    echo "<a href=\"TableName_edit.php?".$_SERVER["QUERY_STRING"]."\">Edit page</a>";

    echo "<a href=\"View1_view.php?".$_SERVER["QUERY_STRING"]."\">Print form 1</a>";

    echo "<a href=\"View2_view.php?".$_SERVER["QUERY_STRING"]."\">Print form 2</a>";

    }



where TableName is your actual table name.
To add delete link you should edit generated ..._view.php file manually.

Unfortunately we don't have a ready to go solution for this.

A
albo author 10/16/2006

it's not complete <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11856&image=1&table=forumreplies' class='bbc_emoticon' alt=':P' />
in every *_view.php page must edit the line

$smarty->display("*_view.htm");



and rename the template in the template folder <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=11856&image=2&table=forumreplies' class='bbc_emoticon' alt=':)' />

A
albo author 10/16/2006

and... another noob question :|
how to put spaces in this code between links?

function ViewOnLoad()

{

echo "<a href=\"TableName_edit.php?".$_SERVER["QUERY_STRING"]."\">Edit page</a>";

echo "<a href=\"View1_view.php?".$_SERVER["QUERY_STRING"]."\">Print form 1</a>";

echo "<a href=\"View2_view.php?".$_SERVER["QUERY_STRING"]."\">Print form 2</a>";

}
J
Jane 10/17/2006

Albo,
use
or &nbsp;:

echo "<a href=\"TableName_edit.php?".$_SERVER["QUERY_STRING"]."\">Edit page</a>
";

echo "<a href=\"View1_view.php?".$_SERVER["QUERY_STRING"]."\">Print form 1</a>&nbsp;";

echo "<a href=\"View2_view.php?".$_SERVER["QUERY_STRING"]."\">Print form 2</a>";

A
albo author 10/17/2006

omg... i was very noob putting tge tag
after ; .... thx jane