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


PHP Booking::setConnector方法代碼示例

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


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

示例1: homepage

function homepage()
{
    global $connector;
    global $result;
    if (isset($_SESSION['admin'])) {
        header("Location: admin/");
    }
    if (isset($_SESSION['login'])) {
        include_once "classes/Student.php";
        include_once "classes/Exam.php";
        include_once "classes/Plan.php";
        include_once "classes/Payment.php";
        include_once "classes/Notice.php";
        include_once "classes/Booking.php";
        include_once "classes/Document.php";
        $student = new Student();
        $student->setConnector($connector);
        $student = $student->getById($_SESSION['id_student']);
        $student->setConnector($connector);
        $exam = new Exam();
        $plan = new Plan();
        $payment = new Payment();
        $notice = new Notice();
        $booking = new Booking();
        $document = new Document();
        $exam->setConnector($connector);
        $plan->setConnector($connector);
        $payment->setConnector($connector);
        $notice->setConnector($connector);
        $booking->setConnector($connector);
        $document->setConnector($connector);
        if (isset($_POST['operation'])) {
            list($operation, $params) = explode("#", $_POST['operation']);
            switch ($operation) {
                case 'editChanges':
                    $student->storeFormValues($_POST);
                    $student->id = $params;
                    if (isset($_POST['password']) && $_POST['password'] != '') {
                        $student->generatePassword($_POST['password']);
                    }
                    $error_msg = $student->update();
                    break;
                case 'saveBook':
                    $error_msg = $booking->saveBooking($student->id, $params);
                    break;
                case 'sendMail':
                    $error_msg = sendMail();
                    break;
                default:
                    $error_msg = $operation . "#" . $params;
                    break;
            }
            if ($error_msg != "") {
                $result["errorMessage"] = $error_msg;
            } elseif ($operation != 'edit' && $operation != "nextPage") {
                $result["statusMessage"] = "Operazione completata!";
            }
        }
        if ($student) {
            $result["edit"] = $student;
            $result["edit"]->exam = $exam->getList($student);
            $result["edit"]->plan = $plan->getById($student->id_plan);
            $result['edit']->payment = $payment->getById($student->id);
            $result['edit']->notice = $notice->getList();
            $result['edit']->booking = $booking->getListForStudent($student);
            $result['edit']->booked = $booking->getBookedList($student->id);
            $result['edit']->document = $document->getList();
        }
        $page = "home.php";
        include_once BASE_PATH . "/template.php";
    } else {
        $page = "login.php";
        include_once BASE_PATH . "/template.php";
    }
}
開發者ID:christian-rizza,項目名稱:sis-portal,代碼行數:75,代碼來源:index.php

示例2: showBooking

function showBooking()
{
    global $connector;
    $course = new Course();
    $course->setConnector($connector);
    $plan = new Plan();
    $plan->setConnector($connector);
    $booking = new Booking();
    $booking->setConnector($connector);
    if (isset($_POST['operation'])) {
        list($operation, $params) = explode("#", $_POST['operation']);
        switch ($operation) {
            case 'getAjaxPlanList':
                echo $plan->getAjaxList($params, "nome");
                return;
            case 'saveChanges':
                $booking->storeFormValues($_POST);
                $error_msg = $booking->insert();
                break;
            case 'delete':
                $error_msg = $booking->delete($params);
                break;
            default:
                $error_msg = "Operazione non valida";
        }
        if ($error_msg != "") {
            $result["errorMessage"] = $error_msg;
        } elseif ($operation != 'edit') {
            $result["statusMessage"] = "Operazione completata!";
        }
    }
    $result['courses'] = $course->getList("nome");
    $result['booked'] = $booking->getList();
    $page = "booking.php";
    include_once BASE_PATH . "template.php";
}
開發者ID:christian-rizza,項目名稱:sis-portal,代碼行數:36,代碼來源:index.php


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