Platon Technologies
not logged in Login Registration
EnglishSlovak
open source software development celebrating 10 years of open source development! Friday, October 16, 2026
About Us
Magazine
Open Source
CVS
Services
Index  »  Projects  »  phpMyEdit  »  Forum  »  Adding records - persistant data

phpMyEdit General     Adding records - persistant data
Post new topic   Reply to topic    
 
harrinp1     Joined: 03 Jun 2004   Posts: 1  
Post Posted: 2004-06-03 21:42
Back to top  Reply with quote     

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     Joined: 23 Mar 2003   Posts: 159   Location: FRANCE
Post Posted: 2004-06-11 08:57
Back to top  Reply with quote     

harrinp1 wrote:
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     Joined: 03 Nov 2004   Posts: 9  
Post Posted: 2005-02-23 00:36
Back to top  Reply with quote     

hbernard wrote:
harrinp1 wrote:
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     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2005-02-23 00:44
Back to top  Reply with quote     

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     Joined: 03 Nov 2004   Posts: 9  
Post Posted: 2005-02-24 00:36
Back to top  Reply with quote     

michal wrote:
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     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2005-02-27 22:09
Back to top  Reply with quote     

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     Joined: 20 Jan 2005   Posts: 3  
Post Posted: 2005-03-05 10:40
Back to top  Reply with quote     

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     Joined: 23 Mar 2003   Posts: 159   Location: FRANCE
Post Posted: 2005-03-05 11:08
Back to top  Reply with quote     

try

Code:
global $_POST;


at the beginning of your script.

_________________
hbernard - phpMyEdit updater.
 
mgarav@tiscali.it     Joined: 20 Jan 2005   Posts: 3  
Post Posted: 2005-03-15 16:26
Back to top  Reply with quote     

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     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2005-03-15 18:39
Back to top  Reply with quote     

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     Joined: 20 Jan 2005   Posts: 3  
Post Posted: 2005-04-01 08:57
Back to top  Reply with quote     

michal wrote:
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     Joined: 17 Jun 2003   Posts: 537   Location: Slovakia
Post Posted: 2005-04-02 17:43
Back to top  Reply with quote     

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

Code:

$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...

 
Post new topic   Reply to topic    

Copyright © 2002-2006 Platon Group
Site powered by Metafox CMS
Go to Top · Feedback form · Application form
Report bug on PLATON.SK website · Terms of use · Privacy policy