当前位置: 首页>>代码示例>>PHP>>正文


PHP User_Model::getName方法代码示例

本文整理汇总了PHP中User_Model::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP User_Model::getName方法的具体用法?PHP User_Model::getName怎么用?PHP User_Model::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在User_Model的用法示例。


在下文中一共展示了User_Model::getName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getOwnerName

 /**
  * return the username of the owner
  * @return mixed
  */
 public function getOwnerName()
 {
     $userObj = new User_Model($this->owner);
     return $userObj->getName();
 }
开发者ID:brandon-bailey,项目名称:osdms,代码行数:9,代码来源:Module_model.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::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。