⚠ 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

Redirect To Mode Print



spyflash
  • profile picture
  • Member

Posted 15 July 2013 - 14:35 PM

Hi for all.

I need help for this situation:

 

After insert in the database, i need show to user mode of impress the page redirecting to samecontroller/print.

 

I add in the grocery crud this code:

 

 

 

$crud->callback_after_insert(array($this, 'log_user_after_insert'));

 

 

         $crud->set_lang_string('insert_success_message',
             ' Mode Print.
               
             <script type="text/javascript">
              window.location = "'.site_url(strtolower(__CLASS__).'/'.'print').'/'.$this->session->userdata('primarykey').'";
             </script>
             <div style="display:none">
             '
       );    
 

 

In the funcion of callback:

 

    function log_user_after_insert($post_array,$primary_key)
    {
        $this->session->set_userdata('primarykey', $primary_key);
    
        return true;
    }   

 

 

But don't works.

 

Any help?

 

Thanks a lot !

 

Sorry for the poor english.