<!DOCTYPE html>
<html lang="ko">

<head>
    <?php $this->load->view('adm/layout/head')?>
</head>

<body>
    <!-- start wrapper -->
    <div class="wrapper">
        <!-- start nav -->
        <?php $this->load->view('adm/layout/nav')?>
        <!-- end nav -->
        <!-- start content_wrapper -->
        <div class="content_wrapper">
            <!-- start header -->
            <?php $this->load->view('adm/layout/header')?>
            <!-- end header -->
            <div class="contents">
                <h3 style="font-size:17px;font-weight:bold;color:#aaa">기본관리 > 카테고리 정보 업데이트</h3>
                <!-- 여기까지 레이아웃 상단입니다 -->
                <div class="box">
                    <div class="box-table">
                        <form method="post" action="" enctype="multipart/form-data">
                            <input type="hidden" name="redirect" value="<?php echo $this->input->server('HTTP_REFERER')?>">
                            <input type="hidden" name="idx" class="form-control" value="<?php if(isset($category)) echo $category->idx?>">
                            <table class="table table-bordered">
                                <tbody>
                                    <tr>
                                        <th>상위 카테고리</th>  
                                        <td>
                                            <select name="parent" class="form-control" style="width:200px">
                                                <option value="">카테고리</option>
                                                <?php foreach($lifeCategories as $c) { echo '<option value="'.$c->idx.'" '.(!empty($category) && $category->parent == $c->idx ? 'selected':'').'>'. $c->category_name. '</option>';}?>
                                            </select>
                                        </td>
                                    </tr>                                    
                                    <tr>
                                        <th>카테고리명</th>
                                        <td>
                                            <input type="text" name="category_name" class="form-control" value="<?php if(isset($category->category_name)) echo $category->category_name?>">
                                        </td>
                                    </tr>
									<tr>
                                        <th>설명</th>
                                        <td>
                                            <input type="text" name="description" class="form-control" value="<?php if(isset($category->description)) echo $category->description?>">
                                        </td>
                                    </tr>
                                </tbody>
                            </table>
                            <div style="text-align:center">
                                <a class="btn btn-danger" href="<?php echo $this->input->server('HTTP_REFERER')?>">취소</a>
                                <button type="submit" class="btn btn-success">저장</button>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- 여기부터 레이아웃 하단입니다 -->
            </div>
        </div>
        <!-- end content_wrapper -->
    </div>
    <!-- end wrapper -->
    <?php $this->load->view('adm/layout/footer')?>
</body>

</html>