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


PHP Subject::addSubject方法代码示例

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


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

示例1: mkdir

session_start();
//import files
foreach (glob("apps/studyhall/models/*.php") as $filename) {
    include_once $filename;
}
$subject = $_POST['subject'];
$class = $_POST['class'];
$name = $_POST['name'];
$snf = $_POST['subject_not_found'];
$cnf = $_POST['class_not_found'];
if ($subject == "Subject Not Listed") {
    //for now assume that subject that is input is not a folder
    $subject = $snf;
    mkdir("apps/studyhall/Documents/" . $subject, 0777);
    $add_subject = new Subject();
    $add_subject->addSubject($subject);
}
if ($class == "Class Not Listed") {
    //same as above
    $class = $cnf;
    mkdir("apps/studyhall/Documents/" . $subject . "/" . $class, 0777);
    $add_class = new Classes();
    $add_class->addClass($class, $subject);
}
//this is the path created to place the document in the correct folder
$target_path = "apps/studyhall/Documents/" . $subject . "/" . $class . "/";
//this adds the file name and extension to the end of the path
$target_path = $target_path . basename($_FILES['uploadedfile']['name']);
$ext = pathinfo($target_path, PATHINFO_EXTENSION);
//echo $ext;
//only certain file types can be uploaded (constraint from ViewerJS)
开发者ID:anokbakn,项目名称:StudyHall,代码行数:31,代码来源:default.php

示例2: Subject

$user2->unblock();
$isBlocked2 = $user2->isBlocked();
$bool_str2 = $isBlocked2 ? "true" : "false";
printf("User is blocked: %s\n", $bool_str2);
unset($user);
unset($user2);
////////////////////////////
//Subject UNIT TESTS
////////////////////////////
printf("/////////////////////////////////\n");
printf("STARTING Subject UNIT TESTS\n");
printf("/////////////////////////////////\n");
//construct subject
$subject = new Subject();
//add subject
$subject->addSubject("Math");
//get subject
$subject_string = $subject->getSubject();
printf("Got Subject: %s\n", $subject_string);
//get AZSubjectArray
$orderedArray = $subject->getAZSubjects();
printf("Ordered Subjects: \n");
foreach ($orderedArray as $subject_val) {
    printf("%s\n", $subject_val);
}
////////////////////////////
//Classes UNIT TESTS
////////////////////////////
printf("/////////////////////////////////\n");
printf("STARTING Classes UNIT TESTS\n");
printf("/////////////////////////////////\n");
开发者ID:anokbakn,项目名称:StudyHall,代码行数:31,代码来源:index.php

示例3: function

    $app->render('admin/addClass.php');
})->name('addClass');
$app->post('/addClass', function () use($app) {
    $result = StudentClass::addClass($_POST['className']);
    $app->redirect($app->urlFor('gestionClass'));
});
$app->get('/delClass/:classId', function ($classId) use($app) {
    $result = StudentClass::delClass($classId);
    $app->redirect($app->urlFor('gestionClass'));
});
$app->get('/addSubject', function () use($app) {
    $allteacher = User::listTeacher();
    $app->render('admin/addSubject.php', array('allteacher' => $allteacher));
})->name('addSubject');
$app->post('/addSubject', function () use($app) {
    Subject::addSubject($_POST['subjectName'], $_POST['teacherId']);
    $app->redirect($app->urlFor('gestionSubject'));
});
$app->get('/delSubject/:sucjectId', function ($subjectId) use($app) {
    $result = Subject::delSubject($subjectId);
    $app->redirect($app->urlFor('gestionSubject'));
});
$app->get('/gestionSubject', function () use($app) {
    $allsubject = Subject::getAllSubject();
    $allteacher = User::listTeacher();
    $tab = array();
    $i = 0;
    $size = sizeof($allteacher);
    while ($i < $size) {
        $tab[$allteacher[$i]['teacherId']] = $allteacher[$i]['mail'];
        $i++;
开发者ID:juliobasito,项目名称:novi-challenge,代码行数:31,代码来源:index.php


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