<?php echo $error; ?> <p> <label class="label_text">Tên dịch vụ</label> <input type="text" name="feature" class="input_text" value="<?php echo $feature; ?> "/> </p> <p> <label class="label_text">Dịch vụ cha</label> <select name="parent_id"> <option value="0">Dịch vụ mới</option> <?php echo Convert::selectOption($services, 'id', 'feature', $parent_id); ?> </select> </p> <p> <label class="label_text">Sắp xếp</label> <select name="ordinal" class=""> <?php if ($total > 0) { for ($total; $total > 0; $total--) { if ($ordinal == $total) { echo '<option value="' . $total . '" selected="selected">' . $total . '</option>'; } else { echo '<option value="' . $total . '">' . $total . '</option>'; } }
public function exeAdd() { Document::setTitle('Viết bài mới'); Document::setJs(array('jquery-1.8.3.min', 'ckeditor/ckeditor', 'replace-content', 'article-add-edit')); $data['action'] = BASE_URL_ADMIN . '/article/insert'; $data['error'] = ''; if (Session::get('article') != null) { $data['error'] = '<p class="error">' . Session::get('error') . '</p>'; Session::unsetSession('error'); } $data['pin'] = Session::get('article')['pin']; $data['quote'] = Session::get('article')['quote']; $data['title'] = Session::get('article')['title']; $sv = $this->LoadService(); $service = $sv->selectAll(); if (Session::get('article')['services'] != null) { $selected = Session::get('article')['services']; } elseif (Request::get('service') != null) { $selected = Request::get('service'); } else { $selected = 0; } $data['services'] = Convert::selectOption($service, 'id', 'feature', $selected); $data['content'] = Session::get('article')['content']; Session::unsetSession('article'); $this->view->render('add', $data); }