This forum is no longer open and is for reading/searching only.
Please use our new MachForm Community Forum instead.
MachForm Community Forums » MachForm 2
Way to style printed entries?
Started 16 years ago by bsimpson | 7 posts |
-
First off, this software is very nice, very quick to work with a form and the backend features are amazing. I was wondering if there was a way to style the entry output when you print an entry?
I have a long form (its an application) and the client wants the printed version to resemble their paper application. I would imagine somehow email variables could come into play here as a means to dump the info into a template.Thanks
Posted 16 years ago # -
Hi..
I think you can try edit "view_entry.php" to give style/format based on your print requirement but that would also affect the way you see the form entries.
MachForm Support
Posted 16 years ago # -
To make it clear, you will need to create a custom page for this purpose.
Create a page which pulls values from the database and then format it into your desired layout.
As redityo said above, you can copy the code in view_entry.php as a base for your custom page.
Although,I admit that it would be a great idea for MachForm to provide this kind of functionality. Providing variables as in the email template so that you could build your own printed version page. Thanks for the idea! I'm putting this into our feature request list.
MachForm Founder
Posted 16 years ago # -
On the topic of feature requests, I'd like to suggest this one:
The ability to display the mySQL/form data on a public web site, using the same idea of templates as is used in the email feature where you plug in the {element_1}, {element_2} type thing.
Maybe this feature could be an 'add-in' (at an extra cost if need be) if not implemented into Machform itself.
I've tried adapting the existing 'view-entry.php' and "manage-entries.php' but with limited success as all I need from those files is the 'display' function without the actual design/interface of the machform itself. but can't figure out how to remove the design/stylesheet from those files from the functionality.
I did figure out how to remove the need to log on, since if you run those files individually they redirect to log on screen.
Posted 16 years ago # -
Hi Everyone!
I love this script. It has totally solved a huge issue for the forms on a project I am currently working on.
I have a similar issue that my client wants to be able to print the data in the same format as their paper forms.
I have found the view_entry.php file and see where the data gets processed in a loop with <?php echo nl2br($data['value']); ?>. I'm not all that good with PHP though. Is there a way to just post the individual element values from the form outside of a loop? I guessed at a few things like echo $element_1 and echo nl2br($data['element_1']), but nothing worked for me.... like I said PHP noob.
Any help would be appreciated. If I can figure this out, the rest is a snap!
Posted 16 years ago # -
Hi kirby!
Yes, it is possible. You only need to access $entry_details variable.
It's an array containing all the values.You should be able to display the individual values like these:
echo $entry_details[0]['label']; //<-- print the label echo $entry_details[0]['value']; //<-- print the value echo $entry_details[1]['label']; echo $entry_details[1]['value']; echo $entry_details[2]['label']; echo $entry_details[2]['value'];
As you can see the array is indexed by a number, so you need to get the correct index number.
To get the correct number easier, try using this:
print_r($entry_details);
that would dump the whole array along with the index numbers.
I hope that helps.
MachForm Founder
Posted 16 years ago # -
This works really well. Thanks!
Posted 16 years ago #
Reply
You must log in to post.