Jump to content


Sanaa Alauddin Khan

Member Since 20 Jul 2015
Offline Last Active Sep 15 2015 07:44 PM
-----

Topics I've Started

Add View on same page as the CRUD

28 August 2015 - 03:26 AM

Is it possible to have Add view and then the CRUD datagrid below it. so user enters in add view and clicks save and sees it in the CRUD?


Bootstrap, Save and Save and go back button issue

22 August 2015 - 02:33 AM

Save and go back button is not working.

 

Save shows this screen with this message. {"success":true,"insert_primary_key":true,"success_message":"

Your data has been successfully stored into the database. Edit Employment Details<\/a> or Go back to list<\/a><\/p>","success_list_url":"http:\/\/blah blah"}

 

Cancel button is also not working.

 

any help will be highly appreciated.


DateTime Picker not showing

22 August 2015 - 02:29 AM

I am using Bootstrap theme. For some reason, the Date time picker is not showing. its a plain text box which has "Clear (dd/mm/yyyy) hh:mm:ss" written below it. Please help.

 


Bootstrap theme error message

08 August 2015 - 04:28 AM

Hi all, Is it possible to change the placemnet of the error messages in the add form? Also is there a possibility to use live validation?


Date fields are not saving to database

03 August 2015 - 01:40 AM

Below is my controller. On adding I can see the datetime picker but it is not saving to database.

 

public function new_user_employment(){
           $this->load->library('session');
            $userid = $_SESSION['logged_in']["user_profile_id"];
            $this->load->library('grocery_CRUD');
            $this->load->database();
            $this->load->helper('url');
            $crud = new grocery_CRUD();
            echo "<h2>Registration Form - Employment Details</h2>";
            $crud->set_theme('datatables');
            $crud->set_subject('Employment Details');
            $crud->set_table('user_employment_details');
          $crud->set_relation('user_profile_id','user_profile','id');
           $crud->where('user_profile_id',$userid);
            $crud->required_fields('company_name','title','date_from','date_to','address1','address2','city','state','zip','country','work_email');
            $crud->set_relation('country','country','country_name');
            $crud->columns(array('company_name','title','date_from','date_to','address1','address2','city','state','zip','country','work_email'));
            $crud->add_fields(array('company_name','title','date_from','date_to','address1','address2','city','state','zip','country','work_email'));
            $crud->edit_fields(array('company_name','title','date_from','date_to','address1','address2','city','state','zip','country','work_email'));
            $crud->change_field_type('user_profile_id','invisible');
        $crud->change_field_type('added_on','invisible');
        $crud->change_field_type('added_by','invisible');
        $crud->change_field_type('updated_by','invisible');
            $crud->unset_export();
            $crud->unset_print();  
         $crud->callback_insert(array($this,'insert_employment'));
         $output = $crud->render();
            $this->_example_output($output);         
        }  

function insert_employment($post_array) {
       
            $user_employment_insert = array(
                "user_profile_id" => $_SESSION['logged_in']["user_profile_id"],
                "company_name" => $post_array["company_name"],
                "title" => $post_array["title"],
                "date_from" =>  $post_array["date_from"],
                "date_to" =>  $post_array["date_to"],
                "address1" => $post_array["address1"],
                "address2" => $post_array["address2"],
                "city" => $post_array["city"],
                "state" => $post_array["state"],
                "zip" => $post_array["zip"],
                "country" => $post_array["country"],
                "work_email" => $post_array["work_email"],
                 "added_on" => date('Y-m-d H:i:s'),         
                "added_by" => 'Web Registration',
        "updated_by" => 'Web Registration'
    );
  return $this->db->insert('user_employment_details',$user_employment_insert);
}    
// END - Store employment data in database -Author/Reviewer