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


PHP Course::setConnector方法代碼示例

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


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

示例1: getList

 public function getList($order = "didascalia")
 {
     $order = trim(filter_var($order, FILTER_SANITIZE_STRING));
     //interrogazione tabella
     $sql = "SELECT * FROM upload ORDER BY {$order}";
     $auth = $this->connector->query($sql);
     $list = array();
     // controllo sul risultato dell'interrogazione
     if (mysql_num_rows($auth) > 0) {
         $doc = new Document();
         $doc->setConnector($this->connector);
         $course = new Course();
         $course->setConnector($this->connector);
         while ($res = $this->connector->getObjectResult($auth)) {
             $doc = new Document($res->id, $res->path, $res->tipo, $res->didascalia);
             //Calcolo le informazioni di servizio
             if ($res->tipo == 1) {
                 $doc->course_name = "TUTTI";
             } else {
                 $doc->course_name = $course->getById($res->tipo)->name;
             }
             $list[] = $doc;
         }
     }
     return $list;
 }
開發者ID:christian-rizza,項目名稱:sis-portal,代碼行數:26,代碼來源:Document.php

示例2: getById

 public function getById($id)
 {
     $id = (int) $id;
     $sql = "SELECT * FROM piani WHERE id_piano='{$id}' LIMIT 1";
     $auth = $this->connector->query($sql);
     if (mysql_num_rows($auth) > 0) {
         //Inializzo le classi di servizio
         $course = new Course();
         $course->setConnector($this->connector);
         $subjectPlan = new SubjectPlan();
         $subjectPlan->setConnector($this->connector);
         $res = $this->connector->getObjectResult($auth);
         //Recupero la lista delle entries
         $sub_list = $subjectPlan->getList($res->id_piano, "anno");
         $plan = new Plan($res->id_piano, $res->codice, $res->id_corso, $sub_list);
         //Calcolo le informazioni di servizio
         $plan->course_name = $course->getById($plan->course_id)->name;
         //ritorno il piano cercato
         return $plan;
     }
     return false;
 }
開發者ID:christian-rizza,項目名稱:sis-portal,代碼行數:22,代碼來源:Plan.php

示例3: getById

 public function getById($id)
 {
     // interrogazione della tabella
     $sql = "SELECT * FROM studenti WHERE id_studente='{$id}'";
     $auth = $this->connector->query($sql);
     $student = null;
     if (mysql_num_rows($auth) > 0) {
         $res = $this->connector->getObjectResult($auth);
         $student = new Student(get_object_vars($res));
     }
     //Gestisco i dati di servizio
     $plan = new Plan();
     $plan->setConnector($this->connector);
     $student_plan = $plan->getById($student->id_plan);
     $student->course_id = $student_plan->course_id;
     $course = new Course();
     $course->setConnector($this->connector);
     $student_course = $course->getById($student->course_id);
     $student->course_name = $student_course->name;
     $student->course_year = $student_course->years;
     return $student;
 }
開發者ID:christian-rizza,項目名稱:sis-portal,代碼行數:22,代碼來源:Student.php

示例4: showCourse

function showCourse()
{
    global $connector;
    $page = "course.php";
    $course = new Course();
    $course->setConnector($connector);
    if ($_POST['operation']) {
        list($operation, $params) = explode("#", $_POST['operation']);
        switch ($operation) {
            case 'saveChanges':
                $course->storeFormValues($_POST);
                $error_msg = $course->insert();
                if ($error_msg) {
                    $result['edit'] = $course;
                }
                break;
            case 'delete':
                $error_msg = $course->delete($params);
                break;
            case 'edit':
                $result['edit'] = $course->getById($params);
                break;
            case 'editChanges':
                $course->storeFormValues($_POST);
                $error_msg = $course->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["courses"] = $course->search($_POST['search']);
    } else {
        $result["courses"] = $course->getList();
    }
    $page = "course.php";
    include_once BASE_PATH . "template.php";
}
開發者ID:christian-rizza,項目名稱:sis-portal,代碼行數:43,代碼來源:index.php


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