⚠ 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

on clicking save Im getting a loading, saving data. what am i doing wrong?



Sanaa Alauddin Khan

Sanaa Alauddin Khan
  • profile picture
  • Member

Posted 20 July 2015 - 20:31 PM

This is my contro


Sanaa Alauddin Khan

Sanaa Alauddin Khan
  • profile picture
  • Member

Posted 20 July 2015 - 20:35 PM

public function new_user_education()
        {
            
            $userid = $_SESSION['logged_in']["user_profile_id"];
            
            $this->load->library('grocery_CRUD');
            $crud = new grocery_CRUD();
            echo "<h1>Education Details</h1>";
            $crud->set_theme('datatables');
            $crud->set_subject('Education Details');
            $crud->set_table('user_education_details');
            $crud->set_relation('user_profile_id','user_profile','id');
            $crud->where('user_profile_id',$userid);
            $crud->required_fields('degree','status','college','address1','address2','city','zip','country');
            $crud->columns(array('degree','status','college','address1','address2','city','state','zip','country'));
            $crud->fields(array('degree','status','college','address1','address2','city','state','zip','country'));
            $crud->field_type('degree','dropdown',array('1' => 'Bachelors', '2' => 'Diploma','3' => 'Doctorate' , '4' => 'Masters'));
            $crud->field_type('user_profile_id', 'hidden', $userid);
            $crud->set_relation('country','country','country_name');
            $crud->field_type('status','dropdown',array('1' => 'Completed', '2' => 'In Progress'));
            $crud->unset_export();
            $crud->unset_print();
           
            $output = $crud->render();
            
            $this->_example_output($output);         
        } 


Mehdi

Mehdi
  • profile picture
  • Member

Posted 26 September 2017 - 18:36 PM

Hello,
 
Thank you for the good job you do.
No response since this message, because I have the same error and after several tests, I understand that my error is systematic after using $ crud-> required_fields ('xxx').
 
Do you have an explanation for that?
here is an excerpt of my code
I thank you in advance and excuse my basic English
/***************************************/
// TRAITEMENTS
/***************************************/
 public function traitements(){
  $this->load->library('grocery_CRUD');
  $this->load->library('ajax_grocery_crud');
 $crud = new ajax_grocery_CRUD();


$crud->set_table('ta_traitement'); 
$crud->set_subject("Traitement");
$crud->unset_columns('Contenu');


$crud->set_relation('CodeComposant','ta_composants','{CodeApplicationMere} - {LibelleComposant}');




$crud->set_relation('CodeTypeTrt','ta_type_traitement','LibelleTypeTrt');
$crud->set_relation('EtatTraitement','ta_etat','LibelleEtat');
$crud->set_relation('ComposantSource','ta_composants','LibelleComposant');
$crud->set_relation('ComposantDestination','ta_composants','LibelleComposant');
$crud->set_relation_n_n('Fichiers', 'TA_TRAITEMENT_has_TA_FICHIERS', 'ta_fichiers', 'TA_TRAITEMENT_CodeTraitement', 'TA_FICHIERS_CodeFichier', 'NomFichier');


$crud->set_rules('CodeComposant','Composant','required');
$crud->set_relation_dependency('CodeTraitement','CodeComposant','CodeApplication');
$crud->columns('CodeComposant','CodeTypeTrt','EtatTraitement','CodeTypeTrt','Frequence','Planification','EtatTraitement','ComposantSource','ComposantDestination','Fichiers');


$crud->unset_texteditor('Contenu');


$crud->required_fields('CodeComposant');


$crud->display_as('CodeTypeTrt','Type de traitement');
$crud->display_as('EtatTraitement','Etat');
$crud->display_as('ComposantSource','Source "Composant"');
$crud->display_as('ComposantDestination','Destination "Composant"');
$crud->display_as('Libelletraitement ','Nom du traitement');


$crud->set_language("french");


$output = $crud->render();


$this->_example_output($output);        
}

Mehdi

Mehdi
  • profile picture
  • Member

Posted 27 September 2017 - 10:05 AM

Hello,
 
Is there anyone who could help please?
 
When I use required_filed (), I systematically "loading saving data" after a validation
 
in the firbug of google I find that:
POST : jquery.form.min.js:7 POST http://127.0.0.1/CodeIgniter/index.php/configuration/traitements/update_validation/2 500 (Internal Server Error)

send @ jquery-1.11.1.min.js:4
ajax @ jquery-1.11.1.min.js:4
g @ jquery.form.min.js:7
a.fn.ajaxSubmit @ jquery.form.min.js:7
(anonymous) @ datatables-edit.js:16
dispatch @ jquery-1.11.1.min.js:3
r.handle @ jquery-1.11.1.min.js:3
trigger @ jquery-1.11.1.min.js:3
(anonymous) @ jquery-1.11.1.min.js:3
each @ jquery-1.11.1.min.js:2
each @ jquery-1.11.1.min.js:2
trigger @ jquery-1.11.1.min.js:3
(anonymous) @ datatables-edit.js:12
dispatch @ jquery-1.11.1.min.js:3
r.handle @ jquery-1.11.1.min.js:3


Amit Shah

Amit Shah
  • profile picture
  • Member

Posted 28 September 2017 - 12:02 PM

Hi there,

 

Well .. change the CI environment from production to development - that should help you throw up the errors.

Also - you can set the threshold values in config.php of CI to be 1 

and enable logging in database.php

 

That should help you get the error. There are most often seen issues with database that keeps giving in internal server errors. Through this pattern - it should help u resolve it

 

Happy GCing :)