Platon Technologies
neprihlásený Prihlásiť Registrácia
SlovakEnglish
open source software development oslavujeme 10 rokov vývoja otvoreného softvéru! Streda, 25. november 2026
O nás
Magazín
Otvorený softvér
CVS
Služby
Index  »  Projekty  »  phpMyEdit  »  Fórum  »  Adding records - persistant data

phpMyEdit General     Adding records - persistant data
Odoslať novú tému   Odpovedať na tému    
 
harrinp1     Založený: 03.06.2004   Príspevky: 1  
Príspevok Zaslal: 2004-06-03 21:42
Návrat hore  Odpovedať s citátom     

Just starting using the great software.

When adding records and clinking "more" is it
possible to keep the data from the previous entry
rather than reseting the form?

Tia

Paul

 
hbernard     Založený: 23.03.2003   Príspevky: 159   Bydlisko: FRANCE
Príspevok Zaslal: 2004-06-11 08:57
Návrat hore  Odpovedať s citátom     

harrinp1 Napísal:
Just starting using the great software.

When adding records and clinking "more" is it
possible to keep the data from the previous entry
rather than reseting the form?

Tia

Paul


This is not a built-in pme feature.
However, you may emulate this by :
- using an after insert trigger (which will check if we are doing a moreadd operation, and in this case fill a global array of future default values.
- Then, if defined, use this array in pme calling script.

_________________
hbernard - phpMyEdit updater.
 
lapinr     Založený: 03.11.2004   Príspevky: 9  
Príspevok Zaslal: 2005-02-23 00:36
Návrat hore  Odpovedať s citátom     

hbernard Napísal:
harrinp1 Napísal:
Just starting using the great software.

When adding records and clinking "more" is it
possible to keep the data from the previous entry
rather than reseting the form?

Tia

Paul


This is not a built-in pme feature.
However, you may emulate this by :
- using an after insert trigger (which will check if we are doing a moreadd operation, and in this case fill a global array of future default values.
- Then, if defined, use this array in pme calling script.


I need to do this exact thing, keep some fields from one add to the next, but I'm so new at this, there is not enough detail for me to follow the solution. Would one of you be so kind as to send or post some actual code illustrating the technique??
Thank you,
ROBERT

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2005-02-23 00:44
Návrat hore  Odpovedať s citátom     

something like

'default' => isset($_POST[$opts['prefix']['data'].'_colname']) ? $_POST[$opts['prefix']['data'].'colname'] : 'default value',

should do the job.

(correct me with the prefix variable, i'm almost asleep, but traveling tomorrow)

 
lapinr     Založený: 03.11.2004   Príspevky: 9  
Príspevok Zaslal: 2005-02-24 00:36
Návrat hore  Odpovedať s citátom     

michal Napísal:
something like

'default' => isset($_POST[$opts['prefix']['data'].'_colname']) ? $_POST[$opts['prefix']['data'].'colname'] : 'default value',

should do the job.

(correct me with the prefix variable, i'm almost asleep, but traveling tomorrow)


THANKS VERY MUCH MICHAL,
I have worked on this some more. I can see the $_POST arrary variables. I am so new at this that I do not know where to place this code. In fact, I don't fully understand the structure of the statement. The exact name of the field that I want to carry over on "addmore" is "SEQUENCE".
Perhaps you could make the statement more specific for me and indicate exactly where it is to be coded.

I have also worked with the trigger pieces. In my triggers, I can see the value of "SEQUENCE" and even manipulated it. But, as indicated by the other member, this doesn't change the value in the form when it displays.
ROBERT

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2005-02-27 22:09
Návrat hore  Odpovedať s citátom     

well the general idea is that you make the default value (which is only in add mode) depended on whether something was added last time. (so the answer is that put this in the calling script)

 
mgarav@tiscali.it     Založený: 20.01.2005   Príspevky: 3  
Príspevok Zaslal: 2005-03-05 10:40
Návrat hore  Odpovedať s citátom     

Help, please.
I tryed to use, but I have error:
Notice: Undefined index: XXXX in D:\Inetpub\wwwroot\myedit\aa.php on line 52

where XXX is:

$opts['fdd']['aa'] = array(
'default' => (isset($_POST[$opts['fdd']['0'].'aa']) ? $_POST[$opts['fdd']['xxx'].'aa'] :'pippo'),
'select' => 'T',
'required' => true,
'sort' => false,
);


I tried with different names: "values",Values2",...

What is the correct name where data are in?

BTW, in this way, giving error, it works.
If I cancel the xxx index, $_POST[$opts['fdd'].'aa']
no error, but it not works.

(I am a end user, no knowledge of anything)!

Thanks

 
hbernard     Založený: 23.03.2003   Príspevky: 159   Bydlisko: FRANCE
Príspevok Zaslal: 2005-03-05 11:08
Návrat hore  Odpovedať s citátom     

try

Kód:
global $_POST;


at the beginning of your script.

_________________
hbernard - phpMyEdit updater.
 
mgarav@tiscali.it     Založený: 20.01.2005   Príspevky: 3  
Príspevok Zaslal: 2005-03-15 16:26
Návrat hore  Odpovedať s citátom     

no, is not the solution.

at the end works in this way:

$opts['fdd']['cod_op'] = array(
'name' => 'Cod op',
'select' => 'D',
'default' => (isset($_POST['cod_op']) ? $_POST['cod_op'] :''),


simply with the name

Thanks

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2005-03-15 18:39
Návrat hore  Odpovedať s citátom     

just be careful when updating to new version. due to cgi-name-prefixing your script will break. the correction is quite easy (see my first note)

 
mgarav@tiscali.it     Založený: 20.01.2005   Príspevky: 3  
Príspevok Zaslal: 2005-04-01 08:57
Návrat hore  Odpovedať s citátom     

michal Napísal:
just be careful when updating to new version. due to cgi-name-prefixing your script will break. the correction is quite easy (see my first note)


can you give me the esact sintax for my case?
I am an end user: no know how of this

I would appreciate your help

 
michal     Založený: 17.06.2003   Príspevky: 537   Bydlisko: Slovakia
Príspevok Zaslal: 2005-04-02 17:43
Návrat hore  Odpovedať s citátom     

here is a portion from my code
'premenna_id' is the name of the field, 1 is its number (in $opt['fdd']).

Kód:

$opts['cgi']['prefix']['data'] = 'PME_data_';
$opts['cgi']['prefix']['sys'] = 'PME_sys_';
$def = $_GET[$opts['cgi']['prefix']['data'].'premenna_id'];
if(!is_numeric($def)) $def = $_POST[$opts['cgi']['prefix']['sys'].'qf1_id'];


defintly to go to section hints-and-tips...

 
Odoslať novú tému   Odpovedať na tému    

Copyright © 2002-2006 Platon Group
Stránka používa redakčný systém Metafox
Na začiatok · Odkazový formulár · Prihláška
Upozorniť na chybu na PLATON.SK webstránke · Podmienky použitia · Ochrana osobných údajov