This topic is locked

How to display a field twice in two different languages?

3/25/2011 5:06:46 PM
PHPRunner General questions
Z
Zaboor author

In Page "View Page" I have a field name: "Ext"
I would like to display this field twice in the page after applying these conditions
1- If the field is empty, then hide the field

2- If the field contains a value for example "4562" then I want to display the value of the field twice (Because the page contains two languages)
The first time in this form: "Ext.: 4562"

In the second time in this form: "Extern: 4562"
I apologize for my weakness in English
Thnaks

Sergey Kornilov admin 3/27/2011

I guess you can use 'View as' type 'Custom'. In your code you can check if field content is empty and either display nothing or display your custom message in two languages.

Z
Zaboor author 4/13/2011



I guess you can use 'View as' type 'Custom'. In your code you can check if field content is empty and either display nothing or display your custom message in two languages.


Thank you for your reply.
But, do not you think when I use the 'View as' type 'Custom' Will show the value of the field twice, but in one language.
Another point I want to inquire about

If the field is not empty how can display the value of the field in the new line by
I request you to kindly put practical example
Thank you

I hope not to be overwhelmed with my questions

J
Jane 4/14/2011

Hi,
here is just a sample:

if ($value)

$value = "Ext.: ".$value."
Extern: ".$value;
Z
Zaboor author 4/14/2011



Hi,
here is just a sample:

if ($value)

$value = "Ext.: ".$value."
Extern: ".$value;



Thank you for your reply
The way which you are graciously placed them valid if they were writing in the same place , but when I put it in another place for example: another table in the bottom of the page. Then would be useless
I have tried to use "Insert php code snippet" with this code:

$str = "select phone1,ext1 from Orphans where Orphan_ID='1'" ;

$rs = CustomQuery($str);

$data = db_fetch_array($rs);

echo "Phone: ".$data["phone1"];

echo "Ext.: ".$data["ext1"];


But I did not know how I put the dynamic primary key of record.
Thanks & Best Regards

Zaboor

Sergey Kornilov admin 4/14/2011

Zaboor,
the answer depends on which page we talking about and some other things.
I recommend to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.

Z
Zaboor author 4/15/2011



Zaboor,
the answer depends on which page we talking about and some other things.
I recommend to post your application to Demo Account and open a ticket at http://support.xlinesoft.com sending your Demo Account URL. 'Demo Account' button can be found on the last screen in the program.


Sergey,
I do not have a demo account.
After several attempts I succeeded to view the data by using this code (in orphan_view.php by php code snippet) :

$str = "select phone1,ext1 from Orphans where Orphan_ID='".$_SESSION["pageid"]."'" ;

$rs = CustomQuery($str);

$data = db_fetch_array($rs);

echo "
Phone: ".$data["phone1"];

echo " Ext.: ".$data["ext1"];


But when I put this condition:

if ($data["phone1"]=="" || $data["phone1"]==0)

echo "";

else

echo "
Phone1: ".$data["phone1"];


result of the condition is always true, Even if the field is not empty
Thanks & Best Regards

Zaboor