示例#1
0
    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 
            }
        }
    }
示例#2
0
 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';
     }
 }