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


PHP application::setType方法代碼示例

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


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

示例1: postApplication

 public function postApplication()
 {
     $username = Input::get("username");
     $applicantId = Input::get("applicant_id");
     $orderOfPreference = Input::get("schoolPiority");
     $schoolId = Input::get("schoolId");
     $type = Input::get("type");
     $distance = Input::get("distanceT");
     $medium = '';
     if (Input::get("MediumT") == 0) {
         $medium = 'Sinhala';
     } else {
         $medium = 'Tamil';
     }
     $guardianNic = Input::get("guardianNic");
     $schoolIds = array(Input::get("schoolId1"), Input::get("schoolId2"), Input::get("schoolId3"), Input::get("schoolId4"), Input::get("schoolId5"), Input::get("schoolId6"), Input::get("schoolId7"), Input::get("schoolId8"), Input::get("schoolId9"), Input::get("schoolId10"));
     $yearset = array(Input::get("year1"), Input::get("year2"), Input::get("year3"), Input::get("year4"), Input::get("year5"), Input::get("year6"));
     $divisionSet = array(Input::get("division1"), Input::get("division2"), Input::get("division3"), Input::get("division4"), Input::get("division5"), Input::get("division6"));
     $application = new application();
     $application->setOrderOfPreference($orderOfPreference);
     $application->setType($type);
     $application->setSchool_id($schoolId);
     $application->setDistance($distance);
     $application->setMedium($medium);
     $application->setApplicant_id($applicantId);
     $isStudentApplySchoolFromThisCategory = DBApplicationController::isStudentApplySchoolFromThisCategory($applicantId, $schoolId, $type);
     if ($isStudentApplySchoolFromThisCategory) {
         return "you have allready added  this type of application to this school";
     }
     switch ($type) {
         case 0:
             $resultCD = DBGuardianController::hasCategory1Detail($guardianNic);
             if ($resultCD) {
                 $applicantResult = DBApplicationController::addApplication($application);
                 if ($applicantResult) {
                     return "added successfully";
                 } else {
                     return "not aded successfully";
                 }
             } else {
                 return View::make('G1SAS/category1')->with('application', $application)->with('username', $username)->with('schools', $schoolIds)->with('yArray', $yearset)->with('guardianNic', $guardianNic)->with('dArray', $divisionSet);
             }
             break;
         case 1:
             // never reached because "a" is already matched with 0
             return View::make('G1SAS/category2')->with('application', $application)->with('username', $username)->with('schools', $schoolIds)->with('yArray', $yearset)->with('guardianNic', $guardianNic)->with('dArray', $divisionSet);
             break;
         case 2:
             return View::make('G1SAS/category3')->with('application', $application)->with('username', $username)->with('schools', $schoolIds)->with('yArray', $yearset)->with('guardianNic', $guardianNic)->with('dArray', $divisionSet);
             break;
         case 3:
             // never reached because "a" is already matched with 0
             return View::make('G1SAS/category4')->with('application', $application)->with('username', $username)->with('schools', $schoolIds)->with('yArray', $yearset)->with('guardianNic', $guardianNic)->with('dArray', $divisionSet);
             break;
         case 4:
             return View::make('G1SAS/category5')->with('application', $application)->with('username', $username)->with('schools', $schoolIds)->with('yArray', $yearset)->with('guardianNic', $guardianNic)->with('dArray', $divisionSet);
             break;
         case 5:
             return View::make('G1SAS/category6')->with('application', $application)->with('username', $username)->with('schools', $schoolIds)->with('yArray', $yearset)->with('guardianNic', $guardianNic)->with('dArray', $divisionSet);
             break;
     }
 }
開發者ID:dushaniw,項目名稱:Grade1_admission_system,代碼行數:62,代碼來源:applicationController.php

示例2: getApplication

 public static function getApplication($application_id)
 {
     $db = Connection::getInstance();
     $mysqli = $db->getConnection();
     $query = "select * from application where application_id='{$application_id}';";
     $result = $mysqli->query($query);
     $application = new application();
     if ($result->num_rows > 0) {
         if ($row = $result->fetch_assoc()) {
             $application->setSchool_id($row["schoolId"]);
             $application->setApplication_id($row["application_id"]);
             $application->setApplicant_id($row["applicantId"]);
             $application->setType($row["typeOfApplication"]);
             $application->setMedium($row["medium"]);
             $application->setOrderOfPreference($row["orderOfPreference"]);
             $application->setDistance($row["distanceToSchool"]);
             $application->setIsverified($row["isverified"]);
         }
     }
     return $application;
 }
開發者ID:dushaniw,項目名稱:Grade1_admission_system,代碼行數:21,代碼來源:DBApplicationController.php


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