当前位置: 首页>>代码示例>>PHP>>正文


PHP Dept::delete方法代码示例

本文整理汇总了PHP中Dept::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Dept::delete方法的具体用法?PHP Dept::delete怎么用?PHP Dept::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Dept的用法示例。


在下文中一共展示了Dept::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionDeleteDept

 /**
  * Handler for delete dept
  */
 public function actionDeleteDept()
 {
     if (isset($_REQUEST['id'])) {
         Dept::delete($_REQUEST['id']);
     }
     $this->showResponse(array('status' => true));
 }
开发者ID:crashkita,项目名称:dept,代码行数:10,代码来源:MainController.php

示例2: doDelete

function doDelete()
{
    @($id = $_POST['selector']);
    $key = count($id);
    //multi delete using checkbox as a selector
    for ($i = 0; $i < $key; $i++) {
        $dept = new Dept();
        $dept->delete($id[$i]);
    }
    message("Department name(s) already Deleted!", "info");
    redirect('index.php');
}
开发者ID:allybitebo,项目名称:CCECourseCatalogue,代码行数:12,代码来源:controller.php

示例3: count

                 }elseif($_POST['delete']){
                     //Deny all deletes if one of the selections has members in it.
                     $sql='SELECT count(staff_id) FROM '.STAFF_TABLE.' WHERE dept_id IN ('.$ids.')';
                     list($members)=db_fetch_row(db_query($sql));
                     $sql='SELECT count(topic_id) FROM '.TOPIC_TABLE.' WHERE dept_id IN ('.$ids.')';
                     list($topics)=db_fetch_row(db_query($sql));
                     if($members){
                         $errors['err']='Can not delete Dept. with members. Move staff first.';
                     }elseif($topic){
                          $errors['err']='Can not delete Dept. associated with a help topics. Remove association first.';
                     }else{
                         //We have to deal with individual selection because of associated tickets and users.
                         $i=0;
                         foreach($_POST['ids'] as $k=>$v) {
                             if($v==$cfg->getDefaultDeptId()) continue; //Don't delete default dept. Triple checking!!!!!
                             if(Dept::delete($v)) $i++;
                         }
                         if($i>0){
                             $warn="$i of $count selected departments deleted";
                         }else{
                             $errors['err']='Unable to delete selected departments.';
                         }
                     }
                 }
             }
         break;            
         default:
             $errors['err']='Unknown Dept action';
     }
 break;
 default:
开发者ID:hungnv0789,项目名称:vhtm,代码行数:31,代码来源:admin.php

示例4: list

                 list($members) = db_fetch_row(db_query($sql));
                 $sql = 'SELECT count(topic_id) FROM ' . TOPIC_TABLE . ' WHERE dept_id IN (' . $ids . ')';
                 list($topics) = db_fetch_row(db_query($sql));
                 if ($members) {
                     $errors['err'] = 'Can not delete Dept. with members. Move staff first.';
                 } elseif ($topic) {
                     $errors['err'] = 'Can not delete Dept. associated with a help topics. Remove association first.';
                 } else {
                     //We have to deal with individual selection because of associated tickets and users.
                     $i = 0;
                     foreach ($_POST['ids'] as $k => $v) {
                         if ($v == $cfg->getDefaultDeptId()) {
                             continue;
                         }
                         //Don't delete default dept. Triple checking!!!!!
                         if (Dept::delete($v)) {
                             $i++;
                         }
                     }
                     if ($i > 0) {
                         $warn = "{$i} of {$count} selected departments deleted";
                     } else {
                         $errors['err'] = 'Unable to delete selected departments.';
                     }
                 }
             }
         }
         break;
     default:
         $errors['err'] = 'Unknown Dept action';
 }
开发者ID:kumarsivarajan,项目名称:ctrl-dock,代码行数:31,代码来源:admin.php


注:本文中的Dept::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。