當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。