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


PHP Uploader::getName方法代码示例

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


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

示例1: factory

 public static function factory($accountType)
 {
     if (Instructor::getName() === $accountType) {
         return new Instructor();
     }
     if (Uploader::getName() === $accountType) {
         return new Uploader();
     }
     return new Student();
 }
开发者ID:aleckretch,项目名称:UA-Lecture-Notes,代码行数:10,代码来源:account.php

示例2: getUploadersForCourse

 public static function getUploadersForCourse($courseID)
 {
     $args = array($courseID, Uploader::getName());
     $conn = self::connect();
     $stmt = $conn->prepare("SELECT userID AS id FROM Account WHERE courseID=? AND accountType=?");
     $stmt->execute($args);
     return $stmt->fetchAll();
 }
开发者ID:aleckretch,项目名称:UA-Lecture-Notes,代码行数:8,代码来源:database.php

示例3: urlencode

     if ($myAcc === NULL || !$myAcc->canPromote()) {
         $message = urlencode("You do not have permission to add uploaders for this course.");
         header("Location: error.php?error={$message}");
         exit;
     }
     $id = Database::getUserId($_POST['user']);
     if ($id === -1) {
         $id = Database::createUser($_POST['user']);
     }
     $acc = Database::getAccount($id, $_POST['course']);
     if ($acc !== NULL && $acc->canUpload()) {
         $message = urlencode("The uploader you want to add is already an uploader.");
         header("Location: error.php?error={$message}");
         exit;
     }
     Database::createAccount($id, $_POST['course'], Uploader::getName());
     header("Location: admin.php?course={$courseInfo['id']}");
     exit;
 } else {
     if (isset($_POST['remove']) && isset($_POST['removed']) && isset($_POST['token'])) {
         if (!Session::verifyToken($_POST['token'])) {
             $message = urlencode("The token provided does not match.");
             header("Location: error.php?error={$message}");
             exit;
         }
         $courseInfo = Database::getCourseByID($_POST['remove']);
         //if the course with the id provided is not in the database then redirect and exit
         if (!isset($courseInfo['id'])) {
             $message = urlencode("The course provided is not valid.");
             header("Location: error.php?error={$message}");
             exit;
开发者ID:aleckretch,项目名称:UA-Lecture-Notes,代码行数:31,代码来源:form.php


注:本文中的Uploader::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。