當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Subject::delete方法代碼示例

本文整理匯總了PHP中Subject::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP Subject::delete方法的具體用法?PHP Subject::delete怎麽用?PHP Subject::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Subject的用法示例。


在下文中一共展示了Subject::delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: subject

 public static function subject($type, $data)
 {
     require_once 'subject.class.php';
     $class = new Subject();
     $status = false;
     $class->setData($data);
     switch ($type) {
         case 'add':
             $status = $class->add();
             break;
         case 'update':
             $status = $class->update();
             break;
         case 'delete':
             $status = $class->delete();
             break;
         case 'getsingle':
             $status = $class->getsingle();
             break;
         case 'getpage':
             $status = $class->getpage();
             break;
         case 'search':
             $status = $class->search();
             break;
         default:
             break;
     }
     if ($status) {
         wp_send_json_success($status);
     } else {
         wp_send_json_error($class->error);
     }
 }
開發者ID:khiconit,項目名稱:Device-manager,代碼行數:34,代碼來源:ManagementAdmin.class.php

示例2: Subject

            }
            break;
        case "new_subject":
            $new_subject = new Subject();
            $new_subject->subject_type_id = $_POST['subject_type_id'];
            $new_subject->name = $_POST['name'];
            $new_subject->save();
            echo "Saved.";
            break;
        case "edit_subject":
            $current_subject = new Subject();
            $current_subject->load($_POST['subject_id']);
            $current_subject->name = $_POST['name'];
            $current_subject->subject_type_id = $_POST['subject_type_id'];
            $current_subject->update();
            echo "saved.";
            break;
        case "delete_subject":
            $current_subject = new Subject();
            $current_subject->load($_POST['subject_id']);
            $current_subject->delete();
            echo "deleted";
            break;
        default:
            new LogEntry(__FILE__ . " was hit with an invalid action, from IP: " . $_SERVER['REMOTE_ADDR']);
            echo 'There was an error.  It has been logged.';
    }
} else {
    new LogEntry(__FILE__ . " was hit with no action, from IP: " . $_SERVER['REMOTE_ADDR']);
    echo 'There was an error.  It has been logged.';
}
開發者ID:imonroe,項目名稱:coldreader,代碼行數:31,代碼來源:subject_controller.php

示例3: doDelete

function doDelete()
{
    @($id = $_POST['selector']);
    $key = count($id);
    //multi delete using checkbox as a selector
    for ($i = 0; $i < $key; $i++) {
        $subj = new Subject();
        $subj->delete($id[$i]);
    }
    message("Course(s) already Deleted!", "info");
    redirect('index.php');
}
開發者ID:allybitebo,項目名稱:CCECourseCatalogue,代碼行數:12,代碼來源:controller.php

示例4: showSubject

function showSubject()
{
    global $connector;
    $subject = new Subject();
    $subject->setConnector($connector);
    if (isset($_POST['operation'])) {
        list($operation, $params) = explode("#", $_POST['operation']);
        switch ($operation) {
            case 'saveChanges':
                $subject->storeFormValues($_POST);
                $error_msg = $subject->insert();
                if ($error_msg) {
                    $result['edit'] = $subject;
                }
                break;
            case 'delete':
                $error_msg = $subject->delete($params);
                break;
            case 'edit':
                $result['edit'] = $subject->getById($params);
                break;
            case 'editChanges':
                $subject->storeFormValues($_POST);
                $error_msg = $subject->update();
                break;
            default:
                $error_msg = "Operazione non valida";
        }
        if ($error_msg != "") {
            $result["errorMessage"] = $error_msg;
        } elseif ($operation != 'edit') {
            $result["statusMessage"] = "Operazione completata!";
        }
    }
    if (isset($_POST['search'])) {
        $result["subjects"] = $subject->search($_POST['search']);
    } else {
        $result["subjects"] = $subject->getList();
    }
    $page = "subject.php";
    include_once BASE_PATH . "template.php";
}
開發者ID:christian-rizza,項目名稱:sis-portal,代碼行數:42,代碼來源:index.php


注:本文中的Subject::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。