public static function selectAgegroup($id = false) { $agegroup = Model_Agegroup::getAllSelect(1); // foreach ($agegroup as $age) { if ($id == $age['id']) { ?> <option value="<?php echo $age['id']; ?> " selected><?php echo $age['title']; ?> </option> <?php } else { ?> <option value="<?php echo $age['id']; ?> "><?php echo $age['title']; ?> </option> <?php } } }
public function action_deleteAgegroup() { $this->auto_render = FALSE; $id = $this->request->param('id'); $result = Model_Agegroup::deleteAgegroup($id); if ($result) { print 'success'; } else { print 'error'; } }