ruạṛ
<?php session_start(); require_once 'scripts-includes/universal.php'; require_once 'scripts-includes/display.php'; if(!$cat_id = is_numeric_id($_GET['cat'])) { getout('Invalid category ID','categories.php'); exit; } $connID = connect_to_db(); if(!$page = mysql_query("select * from categories where cat_id = '$cat_id'")) { getout('Category not found','categories.php'); exit; } foreach(mysql_fetch_assoc($page) as $f => $v) { $$f = $v; } head('products','Edit a category'); ?> <h1>Edit <?php echo $cat_name; ?></h1> <p> </p> <form method="post" action="processes/process-category-edit.php" name="cat_edit" id="cat_edit" enctype="multipart/form-data"> <input name="cat_id" id="cat_id" type="hidden" value="<?php echo $cat_id; ?>" /> <div class="mock_table"> <?php /* hardcoded directotries ?> <label for="menu"><span class="right">Name (menu entry):</span><span class="left"><input name="menu" id="menu" type="text" size="30" maxlength="30" value="<?php echo $menu_text; ?>" /></span></label> <?php // */ ?> <?php //* not hardcoded directories ?> <label for="cat_name"><span class="right">Name (menu entry):</span><span class="left"><input name="cat_name" id="cat_name" type="text" size="30" maxlength="30" value="<?php echo $cat_name; ?>" /></span></label> <?php // */ ?> <label for="title"><span class="right">Title:</span><span class="left"><input name="title" id="title" type="text" size="60" maxlength="60" value="<?php echo $title; ?>" /></span></label> <label for="keywords"><span class="right">Keywords:</span><span class="left"><textarea name="keywords" id="short_description" cols="50" rows="2" title="Comma-separated list"><?php echo $keywords; ?></textarea></span></label> <label for="description"><span class="right">Description:</span><span class="left"><textarea name="description" id="description" cols="50" rows="3"><?php echo html_entity_decode($description,ENT_QUOTES); ?></textarea></span></label> <?php /* ?> <label for="content"><span class="right">Pre-product Content:</span></label> <br class="clear" /> <div style="width: 980px; margin: 0px auto; text-align: center;"> <?php /* ?> <textarea name="content" class="tinymce" style="width:980px; height:600px"><?php echo html_entity_decode($content,ENT_QUOTES); ?></textarea> </div> <?php // */ ?> <?php //* ?> <label for="thumbnail"><span class="right">Add/Replace Thumbnail:</span><span class="left"><input name="thumbnail" id="thumbnail" type="file" size="30" /></span></label> <p class="center"> <?php $dir = '/resources/images/category/'.$cat_id.'/'; $filename = select_one('image_data','image_filename','concat(image_type,container_id)','category'.$cat_id); echo ($filename && file_exists(DOC_ROOT.$dir.$filename)) ? '<img align="middle" src="'.$dir.$filename.'" />' : 'No image found ';//.$dir.$filename; /* image removal button, follows <img> tag * <input name="imgdel" type="button" value="Remove image" onclick="if(confirm(\'Remove image?\')){window.location=\'process-image-remove.php?cat='.$cat_id.'\';return true;}else{return false;}" /> */ ?> </p> <?php // */ ?> <p> </p> </div> <!-- end mock_table --> <p class="center"> <input name="submit" id="submit" type="submit" value="Update Category" /> </p> </form> <?php footer(); exit; ?>
cải xoăn