Exemple #1
0
                    $type = 'error';
                    $msg = 'Error: ' . $error;
                    set_alert($type, $msg);
                    safe_redirect('self');
                }
            } else {
                //$color_id  = $this->color_id[$i];
                $category_image = $_POST["color_image_" . $i];
            }
            $_update->update_category($name, $category_image, $visibility, $parent, $category_id);
            //HILLPAK
            //ACTIVATE NOT HILLPAK $_update->update_category($name, $description, $visibility, $parent, $category_id);
            //if($detail_category->category_level > 0){
            $count_child = $_get->count_childs($category_id);
            if ($count_child->rows > 0) {
                $temp_child = $_get->get_childs($detail_category->category_id);
                foreach ($temp_child as $temp_child) {
                    $child_category_alias = cleanurl($name) . '-' . cleanurl($temp_child->category_name);
                    $child_category_id = $temp_child->category_id;
                    $_update->update_child($child_category_alias, $child_category_id);
                }
            }
            // }
            $page = 'self';
            $type = 'success';
            $msg = 'Changes successfully saved';
            set_alert($type, $msg);
            safe_redirect($page);
        }
    }
}