当前位置: 首页>>代码示例>>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;未经允许,请勿转载。