CodeIgniter Forums

Full Version: Administration of wizard (or step) style application
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]jleequeen[/eluser]
Hello fellow CodeIgniters!

I'm converting a paper form here at work into a data entry application. I breaking the form up into a multi-step process to make it easier and less complex for the outside user to enter data. Some steps involve a simple one to one relationship with the database but some involve one to many and so on. The form as a whole will be written to around 9 tables (fully relational) so that is another reason I though it easier to break it up into steps.

My problem lies from the standpoint of administration. Once this multi-step form is filled out by the end user and submitted an administrator will need to look over it and make any changes that are necessary. I don't want to write separate screens for the admin, but I also don't seen the admin using the multi-step form to do his editing. For instance, when the admin looks over the submission, he will be looking at the view of the full form (uneditable) and then he might want to jump into step 5 and make a simple edit, then jump out. But for the outside user, he will be going through the steps sequentially, so the buttons on the form will just provide (Next and Back).

How do you manage from an administrative standpoint, this type of thing?

El Forum

[eluser]alrightythen[/eluser]
I think you could use a javascript content slider to slide through the steps, then set a fieldset for every step so that you have one form that the admin can edit.

Something like this...

<form method="POST" action="">

<fieldset id="step1">
<legend>Login info</legend>

<label for="name">Username: </label>
&lt;input type="text" name="username" /&gt;

<label for="pwd">Password: </label>
&lt;input type="password" name="pwd" /&gt;

</fieldset>

<fieldset id="step 2">
<legend>Person info</legend>

<label for="age">Age: </label>
&lt;input type="text" name="age" /&gt;

<label for="location">Location: </label>
&lt;input type="password" name="location" /&gt;

</fieldset>

&lt;input type="submit" id="submit" value="Login" name="submit" /&gt;

&lt;/form&gt;

I think that might work

El Forum

[eluser]andrewtheandroid[/eluser]
i dont feel im in a position to give advice about best practice or anything like that but in terms of implementation you could for your admin form just be the one form with the 5 views all at the same time or maybe it's read only at first then if they click "edit" the form will become "editable".

Or you could do as above if it's one form you could then just store this information and then use the same form for the admin and repopulate the form with the user's data. Then admin can then edit it there and then before committing. you could disable the javascript so the administator can see all the views.

Another option is to use styles and then use jquery to hide the elements for the user according to the login stage but then for the admin stylesheet show all..

edit: that way you can reuse all your methods and views

El Forum

[eluser]BrianDHall[/eluser]
Before I used Datamapper Overzealous Extention with the HTMLForm extension (which would make all this 10X simpler), I found it best to cut the form into individual views - but not include either the form open, form close, or submit buttons.

This way I was able to have a listing creator, login form, and account creation form all on the same page to cut down the number of steps needed for someone to buy a listing from my site.

Then you just need to make sure your controller logic is setup in such a way as to support the handling of all form submissions at once. In your case I would build a _process_form($_POST) function in the controller that handles all the form processing, and have it done so it could process just part of a form or the whole thing at once.

This would allow you to only write individual pieces of the form once, yet be able to have an admin option where you just load all the form views at once and spit them out as a single form.