Jump to content


Probleme with callback_insert and Date entry

callback insert Date

  • Please log in to reply
No replies to this topic

#1 Daoud Ouassou

Daoud Ouassou

    Newbie

  • Members
  • Pip
  • 1 posts

Posted 09 July 2016 - 08:22 PM

I'm using Call_back insert to insert a foreign key, But the problem appears when I check the table of entries, The fields with Date entries are empty. Here's My controller .

 public $idt;
     public $insert;
     function __construct()
     {
         parent::__construct();
        $this->load->library('grocery_CRUD');
         // Load url helper
         $this->load->helper('url');

     }
     
     function index(){
         echo "Access granted";
     }
     function table($table , $iditem = null) {
         $gcrud = $this -> grocery_crud;

        $gcrud->set_theme('datatables');

         switch ($table){
             case 'client':
                 $gcrud->set_table($table);
                 $gcrud->set_subject('Clients');
                 $gcrud->columns(array('idClient','NomClient','FormeJuridique','NumTVA','DateEntree','Activite','PaysRegion','Ville',
                     'DateConstitution','TribunalCommerce','SecretariatSocial'));

               $gcrud->callback_column('NomClient',array($this,'_callback_webpage_url'));
                 break;

             case 'declarationtva':
                 $this->idt = $iditem;
                 $this->insert = 'declarationtva';
                 $gcrud->set_table($table);
                 $gcrud->set_subject('Declarations TVA');
                 $gcrud->columns(array('Etat','DateOperationtva','Gestion','Periode','Annee','Observation','idClient'));

                 $gcrud->fields('idDeclarationTVA','Etat','DateOperationtva','Gestion','Periode','Annee','Observation','idClient');
                 $gcrud->field_type('idDeclarationTVA','invisible');
                 $gcrud->field_type('idClient','invisible');


                 $gcrud->where('idClient',$iditem);
                
                   $gcrud->callback_insert(array($this,'iditem_insert_callback'));
                
                  break;

         }

         $out = $gcrud->render();
         $this->load->view('useraccess/userview',array('out'=>$out));

     }

     function iditem_insert_callback($post_array) {

         $post_array['idClient'] = $this->idt;

         return $this->db->insert($this->insert,$post_array);
     }


     
 }

Attached Thumbnails

  • taho.PNG






Also tagged with one or more of these keywords: callback insert, Date

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users