function show_flash_message() { $CI =& get_instance(); $flash_message = $CI->session->userdata('flash_message'); if ($flash_message != FALSE) { $arr_flash = explode("(*)", $flash_message); foreach ($arr_flash as $row) { $flash_content = explode("%%%", $row); show_message_admin($flash_content[0], $flash_content[1]); } } $CI->session->unset_userdata('flash_message'); }
foreach ($object->error->all as $error) { show_message_admin('error', $error); } } else { foreach ($object as $o) { foreach ($o->error->all as $error) { show_message_admin('error', $error); } } } } ?> <?php if (isset($page_error)) { if (!is_array($page_error)) { show_message_admin('error', $page_error); } else { foreach ($page_error as $row_e) { show_message_admin('error', $row_e); } } } ?> <div class="clear"></div> <!--NOTIFICATION MESSAGES--> </div>
function delete($id) { $this->checkRole(array(1)); $productcat = new Productcat($id); $parent_id = $productcat->parentcat->id; if ($productcat->childCount() > 0) { show_message_admin("error", "Vui lòng xóa hết danh mục con"); redirect("admin/listAll/" . $productcat->parentcat->id); } $productcat->delete(); redirect("admin/productcats/listAll/" . $parent_id); //TODO: check product }