grocery-crud

Two field as one unique field in Grocery Crud

[亡魂溺海] 提交于 2019-12-07 21:49:06
问题 I have one problem in GroceryCrud. I want to insert the data in one table. Table is like this: id, card_no, site_code, site_no card_no is unique and i have implemented it. However; my problem is that site_code and site_no should be unique only is both values match. Which means that is site_code is 101 and site_no is 102 and we try to insert identical values for both again is should reject it. If we one of the values is different it should allow it. In this case we are treating both values as

Two field as one unique field in Grocery Crud

主宰稳场 提交于 2019-12-06 09:39:38
I have one problem in GroceryCrud. I want to insert the data in one table. Table is like this: id, card_no, site_code, site_no card_no is unique and i have implemented it. However; my problem is that site_code and site_no should be unique only is both values match. Which means that is site_code is 101 and site_no is 102 and we try to insert identical values for both again is should reject it. If we one of the values is different it should allow it. In this case we are treating both values as one when we insert it. I hope I'am clear. Thanks in advance. Apart from your table design login, you

Set dropdown input default value based on third parameter in Grocery CRUD

不想你离开。 提交于 2019-12-05 19:30:33
Code sample below, function product($parameter){ $crud = new grocery_CRUD(); ... $crud->callback_add_field('dropdown_field_name',array($this,'_add_field_callback')); ... $output = $crud->render(); } Can I do something like this ? function _add_field_callback($parameter){ //load db model //call the result and return as dropdown input field with selected selection when value = $parameter } Actually this is easy to do it by using the controller. For example you can simply do: function product($parameter){ $this->my_test_parameter = $parameter; $crud = new grocery_CRUD(); ... $crud->callback_add

How to use grocery set_relation function to display content from two different tables in different columns

我怕爱的太早我们不能终老 提交于 2019-12-05 16:55:17
I have to tables with these schema: users(id, name, email) user_details (id, user_id, physical_address, otherinfo) I would like to display all contents of both tables in one grid using grocery crud when i try to use set relation on the first table as shown: Note: I have reducted the part that does the rendering of the view; $crud = new grocery_CRUD(); $crud->set_table('users'); $crud->set_relation('id', 'user_details', '{physical_address} + {otherinfo}'); the values of the id field as well as the referenced table don't appear in the grid, so it does not seem to work when using primary keys. So

set_field_upload - how to custom multi image upload in grocery_CRUD library on codeigniter?

梦想的初衷 提交于 2019-12-02 06:15:53
问题 I need to upload multiple image from grocery_CRUD Library on codeigniter framework. I need step by step process ! $crud->set_field_upload('image','assets/uploads/products'); $crud->callback_after_upload(array($this,'resize_after_upload')); Now this is working as a single image upload only. Anybody please to help ? 回答1: Try Grocery_Crud_Multiuploader library, I wrote long back, might help you, instructions are given in github, current library supports files as well as images grocery_crud