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


PHP User_Model::getUserID方法代碼示例

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


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

示例1: validar

 function validar()
 {
     if ($this->getParam('Login') == true) {
         Sesion::obtenerInstancia()->crearSesion();
         $user = $this->getParam('user');
         $password = $this->getParam('pass');
         $usuario = new User_Model();
         if ($usuario->esValido($user, $password)) {
             //Aqui va la pr<<óxima vista
             $userID = $usuario->getUserID($user, $password);
             // $usuario->won($userID);
             $dataU = $usuario->getData($user, $password);
             $content_view = $this->view->fetch('menu_view', array('data' => $dataU, 'msgerror' => ''));
         } else {
             $content_view = $this->view->fetch('user_view', array('msgerror' => 'Invalid User'));
         }
     } else {
         if ($this->getParam('Register') == true) {
             $this->view->assign('type', "user");
             $content_view = $this->view->fetch('register_view', array('msgerror' => ''));
         }
     }
     $this->view->display('layout_view', array('content' => $content_view));
 }
開發者ID:nicanor5,項目名稱:BatallaNavalNGJL,代碼行數:24,代碼來源:users.php

示例2: index

 public function index($userID = NULL)
 {
     $this->load->model('User_model', 'Curriculum_model');
     $this->load->helper('url');
     //Loader user from passed ID and advisor from session ID
     // If the session id isn't the passed user or an advisor for the user, immediantly fail.
     $user = new User_Model();
     $user->loadPropertiesFromPrimaryKey($userID);
     $advisor = new User_Model();
     if (!isset($_SESSION["UserID"])) {
         redirect('login');
     }
     $advisor->loadPropertiesFromPrimaryKey($_SESSION["UserID"]);
     $flag = TRUE;
     foreach ($advisor->getAdvisees() as $student) {
         if ($student->getUserID() == $userID) {
             $flag = FALSE;
         }
     }
     if ($advisor->getUserID() == $user->getUserID()) {
         $flag = FALSE;
     }
     if ($flag == TRUE) {
         echo "YOU DON'T HAVE PERMISSION TO ACCESS THIS USER'S INFORMATION";
         exit;
     }
     $curriculums = $user->getCurriculums();
     $degree = FALSE;
     foreach ($curriculums as $c) {
         if ($c->getCurriculumType() == Curriculum_model::CURRICULUM_TYPE_DEGREE) {
             $degree = TRUE;
         }
     }
     if (!$degree) {
         echo "ERROR NO CURRICULUM SET FOR USER";
         exit;
     }
     //Create excel file
     $Excel = new PHPExcel();
     $Excel->getProperties()->setCreator("CSC 404 - 2015 App")->setLastModifiedBy("CSC 404 - 2015 App")->setTitle($user->getName() . " Checklist")->setSubject("Advising Checklist")->setDescription("Auto Generated Checklist")->setCategory("Advisee checklist file");
     //Set global defaults
     $Excel->getDefaultStyle()->getFont()->setSize(10)->setName('Arial');
     $Excel->removeSheetByIndex(0);
     //Generate course sheets
     $sheetnumber = 0;
     foreach ($curriculums as $c) {
         if ($c->getCurriculumType() == Curriculum_model::CURRICULUM_TYPE_DEGREE) {
             //Generate Checklist
             $checklist = $Excel->createSheet(NULL, $sheetnumber++);
             $checklist->setTitle("Checklist");
             $this->generatechecklist($checklist, $user, $c, $curriculums);
             //Generate Quarter View
             $qview = $Excel->createSheet(NULL, $sheetnumber++);
             $qview->setTitle("Quarter View");
             $this->generate_quarter_view($qview, $user, $c);
             break;
         }
     }
     //Generate advisor checklist sheet
     $advcheck = $Excel->createSheet(NULL, $sheetnumber++);
     $advcheck->setTitle("Advisor Checklist");
     $this->generateadvchecklist($advcheck);
     //Download file object (PDF or XLS)
     $Excel->setActiveSheetIndex(0);
     $objWriter = PHPExcel_IOFactory::createWriter($Excel, 'Excel5');
     header("Content-type: application/vnd.ms-exel");
     header("Content-Disposition: attachment; filename=\"" . $user->getName() . " Checklist.xls\"");
     $objWriter->save('php://output');
 }
開發者ID:Troutzorz,項目名稱:csapp,代碼行數:69,代碼來源:Checklistexport.php


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