⚠ In case you've missed it we are migrating 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 forum is read-only and soon will be archived. ⚠


Arjunraj

Member Since 28 Aug 2017
Offline Last Active Nov 20 2017 01:28 PM
-----

Posts I've Made

In Topic: Simple dependant dropdown extension

17 November 2017 - 10:35 AM

Can anyone help me with the where clause in set_relation_dependency() ?

    -Thank You


In Topic: Simple dependant dropdown extension

18 September 2017 - 06:30 AM

It is working while inserting , but when I press the edit button, the dropdown 'state' is not fetching the value as I have shown in the above screen shot , Can anyone help me with that....?


In Topic: Simple dependant dropdown extension

01 September 2017 - 09:12 AM

There is no problem in this while inserting but when I press edit 


In Topic: Simple dependant dropdown extension

01 September 2017 - 09:09 AM

There is no problem in this while inserting but when I press edit 


In Topic: How to Validate two dates

01 September 2017 - 06:08 AM

I found it , This will work for all cases,

     $crud->set_rules('end_date', 'end_date', 'trim|callback_check_dates['.$this->input->post('start_date') .']');

 

 

  // Callback function

public function check_dates($end_date, $start_date) { 
        $parts = explode('/', $this->input->post('start_date'));
        $start_date = join('-', $parts);
        $start_date=  strtotime($start_date);
 
        $parts2 = explode('/', $this->input->post('end_date'));
        $end_date = join('-', $parts2);
        $end_date= strtotime($end_date);
        
        if ($end_date >= $start_date) {
            
            return true;
        } else {
            $this->form_validation->set_message('check_dates', "end date should be greater than start date");
            return false;
        }
    }