public function validatefromDate($attribute) {
       
        if ($this->from_date!='0000-00-00' && $this->from_date!='' && $this->to_date!='0000-00-00' && $this->to_date!='') {
            if(strtotime($this->from_date)<=strtotime($this->to_date)){
                $condition='((from_date<="' . $this->from_date . '" AND to_date>="' . $this->to_date . '") OR  (from_date BETWEEN  "' . $this->from_date . '" AND  "' . $this->to_date . '"
                                OR to_date BETWEEN  "' . $this->from_date . '" AND  "' . $this->to_date . '"))';
                if($this->id!=''){
                    $condition.=' AND id!="'.$this->id.'"';
                }
                $model_fuel_sur_charge = self::model()->find(array('condition' =>$condition));
                if(!empty($model_fuel_sur_charge)){
                    $this->addError($attribute, 'Already exist from '.date("d/m/Y",strtotime($model_fuel_sur_charge->from_date)).' - '.date("d/m/Y",strtotime($model_fuel_sur_charge->to_date)));
                    return false;
                }else{
                    return true;
                }
            }else{
                $this->addError($attribute, 'Start Date must be less that End Date');
                return false;
            }
        } else {
            $this->addError($attribute, 'Please Enter Date in Given Format');
            return false;
        }
        
	}