protected function updateFormatCountry()
    {
        $format = $this->getSubmitted();

        foreach ($format as $id => &$item) {

            $item['status'] = isset($item['status']);
            $item['required'] = isset($item['required']);

            if ($id === 'country') {
                $item['status'] = 1;
                $item['required'] = 1;
            }

            if ($item['required']) {
                $item['status'] = 1;
            }
        }

        if ($this->country->update($this->data_country['code'], array('format' => $format))) {
            $this->redirect('admin/settings/country', $this->text('Country has been updated'), 'success');
        }

        $this->redirect('', $this->text('Country has not been updated'), 'warning');
    }
protected function updateFormatCountry()
    {
        $format = $this->getSubmitted();

        foreach ($format as $id => &$item) {

            $item['status'] = isset($item['status']);
            $item['required'] = isset($item['required']);

            if ($id === 'country') {
                $item['status'] = 1;
                $item['required'] = 1;
            }

            if ($item['required']) {
                $item['status'] = 1;
            }
        }

        if ($this->country->update($this->data_country['code'], array('format' => $format))) {
            $this->redirect('admin/settings/country', $this->text('Country has been updated'), 'success');
        }

        $this->redirect('', $this->text('Country has not been updated'), 'warning');
    }
protected function updateFormatCountry ( ) { $ format = $ this -> getSubmitted ( ) ; foreach ( $ format as $ id => & $ item ) { $ item [ 'status' ] = isset ( $ item [ 'status' ] ) ; $ item [ 'required' ] = isset ( $ item [ 'required' ] ) ; if ( $ id === 'country' ) { $ item [ 'status' ] = 1 ; $ item [ 'required' ] = 1 ; } if ( $ item [ 'required' ] ) { $ item [ 'status' ] = 1 ; } } if ( $ this -> country -> update ( $ this -> data_country [ 'code' ] , array ( 'format' => $ format ) ) ) { $ this -> redirect ( 'admin/settings/country' , $ this -> text ( 'Country has been updated' ) , 'success' ) ; } $ this -> redirect ( '' , $ this -> text ( 'Country has not been updated' ) , 'warning' ) ; }
Updates a country format
Updates a country format