MiniVend Akopia Services

[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date ][Minivend by thread ]

[MV code] Direct access to code from [tag each ]



Hi,

I have a client side page for database editing.
In that page I have a navigation by means of "prev", "next" links.
I'm creating, editing and deleting one products record in one page.
The products database was created with MySQL.
Editing and deleting functions works fine, but when I'm creating
new empty product record I need to move to that one to continue editing.
Source code is based on browse1.html file from simple catalog.
....
[perl arg=scratch]
        $start = tag_data('session', 'arg') || 1;
        $chunk = 1;
        if($start =~ /(\d+):(\d*)/) {
                $start = $1;
                $chunk = $2 || 1;
        }
        $prev = $start - $chunk;
        if($prev < 1) {
                $prev = 0;
        }
        $Safe{'scratch'}{'start'} = $start;
        $Safe{'scratch'}{'chunk'} = $chunk;
        $Safe{'scratch'}{'next'} = $start + $chunk;
        $Safe{'scratch'}{'prev'} = $prev;
        $Safe{'scratch'}{'not_shown'} = 1;
        return '';
[/perl]

[tag each products]
[sort products:code -[scratch start] +[scratch chunk]]
[set not_shown][/set]
....

How can I make a direct relocation to the new created record?
I know this is a loop list, I know there is a MiniMate,
but I want to build a simple interface for the database editing.

Have a nice day,

Alex


Search for: Match: Format: Sort by: