Exemple #1
0
 function up()
 {
     $this->ok = array();
     $this->err = array();
     foreach ($this->post_arr as $v) {
         $up_group = new up_library_category($v);
         $status = $up_group->check_info();
         if ($status != 'OK') {
             $this->err[$v['id']] = 'ID ' . $v['id'] . ' : ' . $status;
         } else {
             $status = $up_group->mysql_updata();
             if ($status != 'OK') {
                 $this->err[$v['id']] = 'ID ' . $v['id'] . ' : ' . $status;
             } else {
                 $this->ok[$v['id']] = 'ID ' . $v['id'] . ' : 成功更新';
             }
         }
     }
     return $this->err;
 }
 case 'new-group':
     $new_group = new new_library_category($_POST);
     $status = $new_group->check_info();
     if ($status != 'OK') {
         print_err_notice($status, '');
     } else {
         $status = $new_group->mysql_inster();
         if ($status != 'OK') {
             print_err_notice($status, '');
         } else {
             print_err_notice("成功新建分类 " . $_POST['name'], 'library-category.php?type=new&status=OK');
         }
     }
     break;
 case 'edit-group':
     $up_group = new up_library_category($_POST);
     $status = $up_group->check_info();
     if ($status != 'OK') {
         print_err_notice($status, '');
     } else {
         $status = $up_group->mysql_updata();
         if ($status != 'OK') {
             print_err_notice($status, '');
         } else {
             print_err_notice("成功更新分类 " . $_POST['name'], 'library-category.php?action=edit&id=' . $_POST['id'] . '&type=edit&status=OK');
         }
     }
     library_category_up_all();
     break;
 case 'succdel':
     $cat_del = new library_category_del();