$name_thumb = cleanurl($name) . "_thumb_" . $date_only . "_" . substr(cleanurl($file_name), 0, 20) . '-' . $k . $file_type; $error = $color_image["error"][$i]; if ($error == 0) { move_uploaded_file($tmp_name, "../files/uploads/category_image/{$name_thumb}"); $category_image = "files/uploads/category_image/{$name_thumb}"; } else { $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';
# ---------------------------------------------------------------------- */ $_get = new CATEGORY_GET(); $_update = new CATEGORY_UPDATE(); $category_id = filter_var($_REQUEST['cid'], FILTER_SANITIZE_STRING); $detail_category = $_get->get_category($category_id); if (isset($_POST['btn-detail-category']) && $_POST['btn-detail-category'] == 'Save Changes') { if ($_POST['btn-detail-category'] == 'Delete') { } else { if ($_POST['btn-detail-category'] == 'Save Changes') { $name = filter_var($_POST['name'], FILTER_SANITIZE_STRING); $description = filter_var($_POST['description'], FILTER_SANITIZE_STRING); $visibility = filter_var($_POST['visibility'], FILTER_SANITIZE_STRING); $parent = filter_var($_POST['parent'], FILTER_SANITIZE_STRING); $category_id = $detail_category->category_id; $_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 = 'detail-category/' . $category_id . '/' . cleanurl($name); $type = 'success'; $msg = 'Changes successfully saved'; }