| Index
» Projekty
» phpMyEdit
» Fórum
» How can I open an other table in details view? We use PHP5 |
 |
silversurfer
Založený: 20.02.2006
Príspevky: 5
Zaslal: 2006-02-20 15:55
Návrat hore
Odpovedať s citátom
|
Hi.
In a table with persons I want to link to their companies to edit the company. But how is the right syntax to go in the edit view from the right company??
| Kód: |
$opts['fdd']['company_id'] = array(
'name' => 'Firma',
'select' => 'D',
'maxlen' => 10,
'default' => '0',
'sort' => true,
'URL' => 'company.php',
'values' => array(
'table' => 'company',
'column' => 'id',
'description' => 'name'
)
);
|
Thanks
Karsten
|
silversurfer
Založený: 20.02.2006
Príspevky: 5
Zaslal: 2006-02-23 17:31
Návrat hore
Odpovedať s citátom
|
OK, this is my code now
| Kód: |
$opts['fdd']['company_id'] = array(
'name' => 'Firma',
'select' => 'D',
'maxlen' => 10,
'default' => '0',
'sort' => true,
'URL' => 'company.php?PME_sys_operation=Change&PME_sys_rec=$value',
'values' => array(
'table' => 'company',
'column' => 'id',
'description' => 'name'
)
);
|
But now $value is the name from the company. And I need the company_id to select the correct row in table company.
I tested PME_sys_rec=$link but this didn´t work also.
Any idea????
Karsten
|
michal
Založený: 17.06.2003
Príspevky: 537
Bydlisko: Slovakia
Zaslal: 2006-03-01 10:49
Návrat hore
Odpovedať s citátom
|
for some reason, you cannot address other variables than $value and $key (primary key in the table)
however you can play with description as array as in http://opensource.platon.sk/projects/doc.php/phpMyEdit/html/configuration.input-restrictions.html#AEN964
|
mushroom
Založený: 14.05.2006
Príspevky: 8
Zaslal: 2006-06-04 22:52
Návrat hore
Odpovedať s citátom
|
| silversurfer Napísal: |
OK, this is my code now
| Kód: |
$opts['fdd']['company_id'] = array(
'name' => 'Firma',
'select' => 'D',
'maxlen' => 10,
'default' => '0',
'sort' => true,
'URL' => 'company.php?PME_sys_operation=Change&PME_sys_rec=$value',
'values' => array(
'table' => 'company',
'column' => 'id',
'description' => 'name'
)
);
|
But now $value is the name from the company. And I need the company_id to select the correct row in table company.
I tested PME_sys_rec=$link but this didn´t work also.
Any idea????
Karsten |
Try $key.
|
Skipper
Založený: 20.08.2009
Príspevky: 7
Zaslal: 2009-08-25 13:39
Návrat hore
Odpovedať s citátom
|
This is a serious question, while working with a normalized DB.
now you can either do a table look up or use the original value
a) value: some id like "5"
b) value: the result of the table lookup for 5 like "Peter"
is there a way to get both values at the same time, maybe having a value like $value_raw -- unmodified value
$value = Peter
$value_raw = 5
the issue to be solved
| Kód: |
$opts['fdd']['user_id'] = array(
'name' => 'User',
'select' => 'D',
'maxlen' => 6,
'URL|V' => 'tbl_user.php?PME_sys_fl=0&PME_sys_fm=0&PME_sys_sfn[0]=0&PME_sys_operation=PME_op_View&PME_sys_rec=$value', // but need $value_raw
'values' => array(
'table' => 'tbl_user',
'column' => 'id'
),
'sort' => true
);
$opts['fdd']['user_id']['values']['description']['columns'][0] = 'user';
$opts['fdd']['user_id']['values2|ACP'] = array("" => '--');
$opts['fdd']['user_id']['sqlw'] = 'IF($val_qas = "", NULL, $val_qas)';
|
|
|
Odoslať novú tému
Odpovedať na tému
|
|
|
|