EllisLab text mark
Advanced Search
21 of 23
21
   
v 1.3.3 grocery CRUD - an automatic Codeigniter CRUD
Posted: 15 May 2012 02:12 AM   [ Ignore ]   [ # 311 ]   [ Rating: 0 ]
Joined: 2011-04-22
9 posts

For those who are having trouble using HMVC with Grocery kindly see this link below.

Mit posted a great fix in the grocery forum.

http://www.grocerycrud.com/forums/topic/426-form-validation-callbacks-not-working-with-hmvc-modular-extention/ 

thanks

 
Posted: 14 June 2012 02:17 PM   [ Ignore ]   [ # 312 ]   [ Rating: 0 ]
Avatar
Joined: 2010-12-18
244 posts

New grocery CRUD version 1.2.3 is now released fully compatible with CI 2.1.1

 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- Web and Development - personal Blog

 
Posted: 14 June 2012 09:10 PM   [ Ignore ]   [ # 313 ]   [ Rating: 0 ]
Joined: 2012-06-12
1 posts

awesome.  Have not used it yet, will try it today.  Love the design of the grocerycrud page.  Are you a coder with design criteria? scary… lol Great work

 
Posted: 05 July 2012 06:47 AM   [ Ignore ]   [ # 314 ]   [ Rating: 0 ]
Joined: 2012-06-28
4 posts

Hello web-johnny

Great work! I write my thesis and use your library as well. It saves me a lot of time and till now I don’t have big problems with it, but…

project

I have 28 tables which are linked together. I solved most of the special work with callbacks and it works fine.

problem

I have problems with n_n relations. An example:

client
*id
client_nr
...

client_frontuser
*client_id
*frontuser_id

frontuser
*id
username
...

Link frontuser
../index.php/back/frontuser

In the frontuser table I add a column which contains the following link

../index.php/back/clients/index/94

94 is the id from the frontuser. The aim is to show only clients which belongs to this specific frontuser.

I’m not sure if it’s feasible with set_model.

I’m not a native english speaker and perhaps I missed the solution grin

Cheers
Ashirra

 

 

 
Posted: 05 July 2012 08:31 AM   [ Ignore ]   [ # 315 ]   [ Rating: 0 ]
Avatar
Joined: 2011-08-28
136 posts

Hi,@Ashirra
In my case I have article and comment table.
An article can have more than one comment.

This is my code:

public function comment($article_id=NULL){
     $crud 
= new grocery_CRUD();     
     
$crud->set_table('blog_comment');
     if(isset(
$article_id)){
      $crud
->where('blog_comment.article_id'$article_id);
     
}     
     $output 
$crud->render();
     
     
$this->view('grocery_CRUD'$output'blog_comment');
    

The most important thing here is you can use $crud->where(‘your_field’, $value);
it works perfectly….

 Signature 

Homepage : http://www.getnocms.com
Github page : https://github.com/goFrendiAsgard/No-CMS

A free CodeIgniter based CMS-Framework, It is not just another CMS !!!

 
Posted: 05 July 2012 09:25 AM   [ Ignore ]   [ # 316 ]   [ Rating: 0 ]
Joined: 2012-06-28
4 posts

Hi Asgard

thanks for your reply.

An article can have more than one comment.

That’s an 1:n relation and it works very well in my project too.

But I have problems with n:n relations

frontuser
id / name
1     asgard
2     ashirra

frontuser_client
frontuser / client
1               1
1               2
1               3
2               1
2               2

client
id / name
1     peter
2     phil
3     petra

One solution is to use the pivot directly.

from frontuser
../index.php/back/frontuser
to the pivot
../index.php/back/frontuser_client
to the client (details)
../index.php/back/client

“divide et impera”. Because an n:n can be splitted into two 1:n.
but is it the best solution?

 
Posted: 05 July 2012 10:56 AM   [ Ignore ]   [ # 317 ]   [ Rating: 0 ]
Avatar
Joined: 2011-08-28
136 posts
Ashirra - 05 July 2012 09:25 AM

But I have problems with n:n relations

frontuser
id / name
1     asgard
2     ashirra

frontuser_client
frontuser / client
1               1
1               2
1               3
2               1
2               2

client
id / name
1     peter
2     phil
3     petra

One solution is to use the pivot directly.

from frontuser
../index.php/back/frontuser
to the pivot
../index.php/back/frontuser_client
to the client (details)
../index.php/back/client

“divide et impera”. Because an n:n can be splitted into two 1:n.
but is it the best solution?

Ah, sorry, I think I have misunderstand it :p
Do you mean something like this? http://www.grocerycrud.com/examples/set_a_relation_n_n
I think it is better to have 2 grids, the frontuser and the client. You can then add n_n relation field to the both grids (please see the link).

 Signature 

Homepage : http://www.getnocms.com
Github page : https://github.com/goFrendiAsgard/No-CMS

A free CodeIgniter based CMS-Framework, It is not just another CMS !!!

 
Posted: 05 July 2012 11:17 AM   [ Ignore ]   [ # 318 ]   [ Rating: 0 ]
Joined: 2012-06-28
4 posts
function linkToClients($value,$row){
      
return "<a href='".site_url('>id)."'>clients</a>";
 } 

‘.$row - >id).”’

This link invokes directly my client site. So the question was “it’s possible with set_model or other solutions, to take the ID fromt the link and start a own query with this value ($row->id).

SQL Code like this

SELECT FROM clientclient_frontuser 
         where client
.id client_frontuser.client_id 
         
and client_frontuser.frontuser_id $ID 

Now I found a solution.

Instead of taking one step (frontuser -> client). I take two with one step in the middle (frontuser->frontuser_client->client). So it works.

Now, I’m interested if there is a better solution.

thanks asgard for your inputs wink

gn8

 

 

 

 
Posted: 27 August 2012 06:54 PM   [ Ignore ]   [ # 319 ]   [ Rating: 0 ]
Avatar
Joined: 2010-12-18
244 posts

Proud to announce the new version 1.3 smile

The new version 1.3 is out with brand new features

After almost three months of development I am proud to announce you the new version 1.3 with brand new features and not only bug fixes this time. You can download it straight away from http://www.grocerycrud.com/downloads .

For more check the forum topic at grocery CRUD’s forum

 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- Web and Development - personal Blog

 
Posted: 12 September 2012 04:39 PM   [ Ignore ]   [ # 320 ]   [ Rating: 0 ]
Joined: 2012-04-29
7 posts

hi
i have a problem i never can use dates with Grocery CRud

the calander neverh showen

please help
so tell me what i need to setup database table and grocery crud to make all work out
for sure i did searched alot in google and in forum of grocery crud but still not working

thank you in advance

 
Posted: 12 September 2012 05:13 PM   [ Ignore ]   [ # 321 ]   [ Rating: 0 ]
Avatar
Joined: 2010-12-18
244 posts

Hello @C1t1zen.

If you have any problem to use dates you can easily use the change_field_type method. So in your case you can simply have:

$crud->change_field_type('inserted_date''date'); 

If you have any JavaScript problem you have to give a print-screen of your problem.

 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- Web and Development - personal Blog

 
Posted: 12 September 2012 06:50 PM   [ Ignore ]   [ # 322 ]   [ Rating: 0 ]
Joined: 2012-04-29
7 posts

Hey Johnny!
i did waste about 2 days with crud
but now i’m still stuck with it

i did used this line code

$crud->change_field_type(‘inserted_date’, ‘date’);

look to my code in code in controller

<?php

if (!defined('BASEPATH'))
    exit(
'No direct script access allowed');

class 
Examples extends CI_Controller {

    
function __construct() {
        parent
::__construct();

        
$this->load->database();
        
$this->load->helper('url');

        
$this->load->library('grocery_CRUD');
    
}

    
function _example_output($output null{
        $this
->load->view('example.php'$output);
    
}
    
function index() {
        $this
->_example_output((object) array('output' => '''js_files' => array(), 'css_files' => array()));
    
}


    
function payments() {

        
/* This is only for the autocompletion */
        
$crud = new grocery_CRUD();
   
        
$crud->set_table('payments');
        
$crud->set_subject('مجموعات الرجيم ::  :: ');
        
$crud->required_fields(' title');
        
$crud->columns(' title''desc''group_slug');
        
$crud->change_field_type('birthdate''date');
        
$output $crud->render();
       
$this->_example_output($output);
    
}

so i dont know why calander is not loading

Also when i update i get this message:


{“success”:true,“insert_primary_key”:true,“success_message”:“Your data has been successfully updated. <a href=‘http:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/www.domain.com\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/examples\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\/diet’>Go back to list<\/a><\/p>”,“success_list_url”:“http:\/\/www.domain.com\/examples\/diet\/success\/1”}

this message only appears when i use date field in mysql table
if i removed this date field it does not appears and everything go fine.

thank you in advance

 
Posted: 14 September 2012 02:36 AM   [ Ignore ]   [ # 323 ]   [ Rating: 0 ]
Avatar
Joined: 2010-12-18
244 posts

Ok I think I know where the problem should be. Can you please tell me:
- PHP Version
- Codeigniter Version
- grocery CRUD version
- default language

Probably there is something with the default language, perhaps a bug. Can you please check if you change it to english (application/config/grocery_crud.php):

$config['grocery_crud_default_language''english'

This now works for you?  If yes then just let me know and I will check it further.

Cheers
Johnny

 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- Web and Development - personal Blog

 
Posted: 14 September 2012 08:00 AM   [ Ignore ]   [ # 324 ]   [ Rating: 0 ]
Joined: 2012-04-29
7 posts

Hey
thank you for reply
PHP Version 5.2.17
- Codeigniter Version :2.1.2
- grocery CRUD version : last version

application/config/grocery_crud.php settings;

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
 
//For view all the languages go to the folder assets/grocery_crud/languages/
 
$config['grocery_crud_default_language''english';

 
// There are only three choices: "uk-date" (dd/mm/yyyy), "us-date" (mm/dd/yyyy) or "sql-date" (yyyy-mm-dd) 
 
$config['grocery_crud_date_format']   'sql-date';

 
// The default per page when a user firstly see a list page
 
$config['grocery_crud_default_per_page'25//Can only take values 10,25,50,100
 
 
$config['grocery_crud_file_upload_allow_file_types']   'gif|jpeg|jpg|png|tiff|doc|docx|txt|odt|xls|xlsx|pdf|ppt|pptx|pps|ppsx|mp3|m4a|ogg|wav|mp4|m4v|mov|wmv|flv|avi|mpg|ogv|3gp|3g2';
 
$config['grocery_crud_file_upload_max_file_size']    '20MB'//ex. '10MB' (Mega Bytes), '1067KB' (Kilo Bytes), '5000B' (Bytes)
 
 //You can choose 'ckeditor','tinymce' or 'markitup'
 
$config['grocery_crud_default_text_editor''ckeditor';
 
//You can choose 'minimal' or 'full'
 
$config['grocery_crud_text_editor_type']  'full'
 
 
//The character limiter at the list page, zero(0) value if you don't want character limiter at your list page
 
$config['grocery_crud_character_limiter']  30

 

 
Posted: 15 September 2012 04:02 AM   [ Ignore ]   [ # 325 ]   [ Rating: 0 ]
Avatar
Joined: 2010-12-18
244 posts

I think I found where the problem can be, try this one:

function payments() {

        
/* This is only for the autocompletion */
        
$crud = new grocery_CRUD();
   
        
$crud->set_table('payments');
        
$crud->set_subject('مجموعات الرجيم ::  :: ');
        
$crud->required_fields('title'); // instead you had ' title' with whitespace
        
$crud->columns('title''desc''group_slug'); // instead you had ' title' with whitespace
        
$output $crud->render();
       
$this->_example_output($output);
    
 Signature 

- grocery CRUD - a codeigniter CRUD library - user guide and download
- Web and Development - personal Blog

 
21 of 23
21