⚠ In case you've missed it, we have migrated to our new website, with a brand new forum. For more details about the migration you can read our blog post for website migration. This is an archived forum. ⚠

  •     

profile picture

Need help creating a form with photo?



tanver
  • profile picture
  • Member

Posted 10 December 2011 - 18:14 PM

Hi Guy's, I need to create a form to store the basic info [like name, age, date_of_birth] about the employee with its picture. The challenge I am face with is
1. that the picture has to be stored and retrieved from a table column, and
2. the Add Employee's form must contain a button to upload the pic of the employee [in a blob column] and able to display the photo in this mode as well - may be some ajax will have to be used.
I am new to this whole concept and am not sure how to achieve all this, will appreciate if someone can share his/her experience with me so that I am able to achieve all this.
TIA

xxaxxo
  • profile picture
  • Member

Posted 12 December 2011 - 08:00 AM

Do you really think it's necessary to flood the forum with multiple similar threads? Just post it 1 time pls, don't be a !@#%

tanver
  • profile picture
  • Member

Posted 12 December 2011 - 20:36 PM

No, I don't think so but am actually desperate to find a solution? so may be I did it un-intentionally. Can I ask another question, is there is a way to use some external [to grocery_crud] source to generate the form and yet being able to use the crud functionality?
I will appreciate if someone can respond to it quickly?

web-johnny
  • profile picture
  • Administrator
  • 1,166 posts

Posted 12 December 2011 - 23:29 PM

[quote name='tanver' timestamp='1323722169' post='140']
No, I don't think so but am actually desperate to find a solution? so may be I did it un-intentionally. Can I ask another question, is there is a way to use some external [to grocery_crud] source to generate the form and yet being able to use the crud functionality?
I will appreciate if someone can respond to it quickly?
[/quote]

Hello tanver,
I really like to answer you at all those questions, but I think you don't need grocery CRUD for your project. To use grocery CRUD you have to understand that there is an automatic method to generate fast,safe and stable CRUDs. If you change almost everything that has the functionality of CRUD you will have two basic problems.
1. You will have really big functions and hacks to make your CRUD works. This will make not only your project big but also unstable.
2. You will not be able to update to a newer version of grocery CRUD. Especially now that I'm creating the multilingual functionality at last :-)

So my suggestion is to use grocery CRUD for your basic tables, such as users, webpages, groups, e.t.c. and have some other functions,models etc for your custom CRUD. Of course you can have your own CRUD and the grocery CRUD together. There is no reason to use grocery CRUD 100% at your backoffice system.
For example to store the images into the database is for me a sin :P . I can't suggest to anyone to have this functionality, because it has many many problems. Also for now it is difficult to customize grocery CRUD to do it with blob and image.

It really will take more time to customize grocery CRUD than to create a custom CRUD from scratch sometimes.

For any other help, or bug or suggestions I am always here to help.

tanver
  • profile picture
  • Member

Posted 13 December 2011 - 07:51 AM

@web-johnny, thank you very much for your kind response and advise, I really appreciate your support. I was actually inclined towards using this for all my needs as I really wanted to have my all interfaces same look and feel, but as you suggest customizing it do the image uploading etc will be more expensive [in terms of effort] so am taking your advice and will now look for some other alternative like sparks? as well.
Thanks again,

xxaxxo
  • profile picture
  • Member

Posted 13 December 2011 - 08:15 AM

multilingual functionality ... yaay!
I'm working on 1 project atm (online shop) and i'm using the CRUD for the admin and moderator part - 60% and the other 40% i'm just creating for my needs , and implementin them in the CRUD or to work with it.
for example - I've reworked the display of the CRUD to show 1_n relations on several rows in 1 display - and every row is linked to the "edit" of e certain function in the crud. (1 user orders 3 products - the order is displayed in 1 row with every product linking to an edit with semi customized options )

Only you can say if you need grocery CRUD for your project , or the rework/hack/ etc will be greater than building your own.

tanver
  • profile picture
  • Member

Posted 13 December 2011 - 16:00 PM

I think if there is some mechanism to control the div tags surrounding the form elements, and the callbacks are little more consistent we can use Grocery_Crud for most of our needs. YES being multilingual is a very important step forward.
Just an afterthought can we use crud with sparks - formgenlib offers a wonderful ways to create forms.