Welcome Guest, Not a member yet? Register   Sign In
groceryCRUD version 0.8
#20

[eluser]web-johnny[/eluser]
[quote author="kimy_cool" date="1295349084"]The My_Output.php posted here now works very well on Windows but the earlier My_Output.php works well in Linux.

I have the below function working very well. In this table i have a column called description(TEXT) where when adding a description, i want a way the first 20 words from description are formatted (strip special characters) and inserted in a column called except(TEXT) in the same table. How can i have this in this function or do i have to write a new function to achieve this?

Code:
function codes()
    {
        $this->crud->set_table('codes');        
        $this->crud->set_operations(array('add','edit','delete'));
        $this->crud->get();
    }

This CRUD is very well done!

-K[/quote]

here is your answer :-). Its tested that it works. But you first need to donwload the file: crud.php and replace your crud.php file. In your case it is on C:\xampp\htdocs\CI\system\application\libraries\crud.php . I'm working with callbacks. I am still working on it, that's why I don't have it in my version 0.8. Still want to write some documentation when I have time.

Code:
function codes()
    {
        $this->crud->set_table('codes');
        $this->crud->set_subject('Code');
        
        $this->crud->set_fields('description');
        $this->crud->callback_after_add(array($this,'add_except'));
        $this->crud->callback_after_edit(array($this,'add_except'));
        
        $this->crud->set_operations(array('add','edit','delete'));
        $this->crud->get();
    }
    
    function add_except($my_id, $post_array)
    {
        $this->load->helper('text');
        $this->db->update('codes',array('except' => word_limiter(strip_tags($post_array['description']),20)),array('id' => $my_id));
    }


Messages In This Thread
groceryCRUD version 0.8 - by El Forum - 12-28-2010, 04:59 PM
groceryCRUD version 0.8 - by El Forum - 12-31-2010, 04:47 AM
groceryCRUD version 0.8 - by El Forum - 12-31-2010, 04:55 AM
groceryCRUD version 0.8 - by El Forum - 12-31-2010, 08:21 AM
groceryCRUD version 0.8 - by El Forum - 12-31-2010, 07:02 PM
groceryCRUD version 0.8 - by El Forum - 12-31-2010, 11:09 PM
groceryCRUD version 0.8 - by El Forum - 01-17-2011, 08:35 AM
groceryCRUD version 0.8 - by El Forum - 01-17-2011, 11:16 AM
groceryCRUD version 0.8 - by El Forum - 01-17-2011, 12:14 PM
groceryCRUD version 0.8 - by El Forum - 01-17-2011, 01:12 PM
groceryCRUD version 0.8 - by El Forum - 01-17-2011, 03:12 PM
groceryCRUD version 0.8 - by El Forum - 01-17-2011, 11:11 PM
groceryCRUD version 0.8 - by El Forum - 01-18-2011, 01:04 AM
groceryCRUD version 0.8 - by El Forum - 01-18-2011, 03:02 AM
groceryCRUD version 0.8 - by El Forum - 01-18-2011, 01:23 PM
groceryCRUD version 0.8 - by El Forum - 01-18-2011, 06:29 PM
groceryCRUD version 0.8 - by El Forum - 01-18-2011, 11:43 PM
groceryCRUD version 0.8 - by El Forum - 01-19-2011, 10:17 AM
groceryCRUD version 0.8 - by El Forum - 01-19-2011, 10:31 AM
groceryCRUD version 0.8 - by El Forum - 01-22-2011, 05:15 AM
groceryCRUD version 0.8 - by El Forum - 01-24-2011, 07:17 AM
groceryCRUD version 0.8 - by El Forum - 01-24-2011, 11:43 AM
groceryCRUD version 0.8 - by El Forum - 02-17-2011, 04:19 PM
groceryCRUD version 0.8 - by El Forum - 02-17-2011, 08:16 PM
groceryCRUD version 0.8 - by El Forum - 02-18-2011, 11:19 AM
groceryCRUD version 0.8 - by El Forum - 02-18-2011, 11:29 AM
groceryCRUD version 0.8 - by El Forum - 02-18-2011, 02:02 PM
groceryCRUD version 0.8 - by El Forum - 02-21-2011, 02:49 AM
groceryCRUD version 0.8 - by El Forum - 02-21-2011, 12:39 PM
groceryCRUD version 0.8 - by El Forum - 02-21-2011, 01:16 PM
groceryCRUD version 0.8 - by El Forum - 02-21-2011, 01:18 PM
groceryCRUD version 0.8 - by El Forum - 02-21-2011, 01:30 PM
groceryCRUD version 0.8 - by El Forum - 02-21-2011, 01:33 PM
groceryCRUD version 0.8 - by El Forum - 04-14-2011, 10:21 AM
groceryCRUD version 0.8 - by El Forum - 04-15-2011, 02:17 AM
groceryCRUD version 0.8 - by El Forum - 08-08-2011, 03:15 AM



Theme © iAndrew 2016 - Forum software by © MyBB