<a href="main-page.php?p=product-cat-edit&id=[id]"> <img width="20" height="20" src="img/config_ico.jpg" title="Sửa" /> </a> <a onclick="return confirm ('Bạn có chắc là muốn xóa không?')" href="sub-pages/product-cat-act.php?act=delete&id=[id]"> <img width="20" height="20" src="img/delete_ico.jpg" title="Xóa" /> </a></td> </tr> <?php $s = ob_get_clean(); $s = str_replace("[id]", $row_item[id], $s); $s = str_replace("[cat_title]", $row_item[cat_title], $s); if ($row_item[cat_parent] == '0') { $s = str_replace("[cat_parent]", "Cấp cao nhất", $s); } else { $id = $row_item[cat_parent]; $cat_parent = cat_parent($id); $row_cat_parent = mysql_fetch_array($cat_parent); $s = str_replace("[cat_parent]", $row_cat_parent[cat_title], $s); } echo $s; } ?> </table> <div id="thanhphantrang"> <?php if ($sotrang > 1) { ?> <?php if ($trang > 1) { $prev = $trang - 1; ?>
<?php $id = $_GET["id"]; settype($id, "int"); $curPageURL = curPageURL(); $item = cat_parent($id); $item_rs = mysql_fetch_array($item); if (isset($_POST["btnsubmit"])) { $cat_title = $_POST["cat_title"]; $cat_url = changeTitle($cat_title); $cat_parent = $_POST["cat_parent"]; $qr = "UPDATE product_cat SET \n\t\t cat_title='{$cat_title}',\n\t\t cat_url='{$cat_url}',\n\t\t cat_parent='{$cat_parent}'\n\t\t WHERE id='{$id}'\n\t\t"; mysql_query($qr) or die(mysql_error()); header("location:" . $curPageURL . "/nvadmin/main-page.php?p=product-cat"); } ?> <div class="title_style">DANH MỤC SẢN PHẨM</div> <div class="wrap_page_act"> <div id="usual1" class="usual"> <ul> <li><a href="#tab1">SỬA DANH MỤC SẢN PHẨM</a></li> </ul> <div class="tab_content" id="tab1"> <form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"> <div class="row_form_input"> <label>Tên danh mục</label> <input type="text" name="cat_title" id="cat_title" value="<?php echo $item_rs[cat_title]; ?> " /> </div>