本文整理汇总了PHP中Teacher类的典型用法代码示例。如果您正苦于以下问题:PHP Teacher类的具体用法?PHP Teacher怎么用?PHP Teacher使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Teacher类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: photo_POST
function photo_POST($id)
{
$teacher = new Teacher($id);
$src = make_image('photo');
$teacher->update('photo', $src);
redirect("teacher/{$id}");
}
开发者ID:TheDenisNovikov,项目名称:teacher,代码行数:7,代码来源:photo.php
示例2: getAsObject
protected function getAsObject($row)
{
$result = new Teacher();
$result->setNew(false);
$result->setTeacherId(Singleton::create("NullConverter")->fromDBtoDOM($row["teacherId"]));
$result->setName(Singleton::create("NullConverter")->fromDBtoDOM($row["name"]));
return $result;
}
开发者ID:aeberh,项目名称:php-movico,代码行数:8,代码来源:TeacherPersistence.php
示例3: edit_teacher_POST
function edit_teacher_POST($id)
{
$description = _post('description');
$teacher = new Teacher($id);
if ($description) {
$teacher->update('description', $description);
}
redirect("teacher/{$id}/edit");
}
开发者ID:TheDenisNovikov,项目名称:teacher,代码行数:9,代码来源:edit_teacher.php
示例4: testTeacher
public function testTeacher()
{
$teacher = new Teacher("Teacher");
$groupLeader = new GroupLeader("GroupLeader");
$number = 10;
for ($i = 1; $i <= $number; $i++) {
$groupLeader->addGirl(new Girl("girl:{$i}"));
}
$teacher->commond($groupLeader);
}
开发者ID:hongker,项目名称:DesignPatterns,代码行数:10,代码来源:LODTest.php
示例5: testForTeacher
function testForTeacher()
{
$x = new Teacher(2);
$y = $x->consultation_requests();
$this->assertType('array', $y);
$this->assertEquals(3, count($y));
$z = array_shift($y);
$this->assertType('ConsultationRequest', $z);
$this->assertEquals(3, $z->id);
}
开发者ID:songwork,项目名称:songwork,代码行数:10,代码来源:testConsultationRequests.php
示例6: teacher_GET
/**
* @author ryan <[email protected]>
*/
function teacher_GET($id)
{
$teacher = new Teacher($id);
$comments = Comment::search()->filterBy('teacher', $id)->find();
$has_login = $GLOBALS['has_login'];
if ($has_login) {
$teacher->commentedByMe = $teacher->commentedByUser($GLOBALS['user']);
}
$schools = $GLOBALS['config']['school'];
render_view('master', compact('teacher', 'courses', 'comments', 'has_login', 'schools'));
}
开发者ID:TheDenisNovikov,项目名称:teacher,代码行数:14,代码来源:teacher.php
示例7: selected_teachers
public function selected_teachers()
{
if (!is_null($this->id)) {
$teachers = new Teacher();
$teachers->where_related($this);
$teachers->get_iterated();
$output = array();
foreach ($teachers as $teacher) {
$output[$teacher->id] = $teacher->id;
}
return $output;
}
return array();
}
开发者ID:andrejjursa,项目名称:list-lms,代码行数:14,代码来源:room.php
示例8: actionCreate
/**
* 录入
*
*/
public function actionCreate()
{
parent::_acl();
$model = new Teacher();
if (isset($_POST['Teacher'])) {
$acl = $this->_gets->getPost('acl');
$model->attributes = $_POST['Teacher'];
if ($model->save()) {
AdminLogger::_create(array('catalog' => 'create', 'intro' => '录入内容,ID:' . $model->id));
$this->redirect(array('index'));
}
}
$this->render('teacher_create', array('model' => $model));
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:18,代码来源:TeacherController.php
示例9: createTeacher
public function createTeacher(PropelPDO $con = null)
{
$con = is_null($con) ? Propel::getConnection() : $con;
$teacher = new Teacher();
$teacher->setPerson($this->getPerson());
$teacher->save($con);
$guard_user = $this->getPersonSfGuardUser();
if (!is_null($guard_user)) {
$teacher_group = BaseCustomOptionsHolder::getInstance('GuardGroups')->getStringFor(GuardGroups::TEACHER);
if (!array_key_exists($teacher_group, $guard_user->getGroups())) {
$guard_user->addGroupByName($teacher_group);
$guard_user->save($con);
}
}
}
开发者ID:nvidela,项目名称:kimkelen,代码行数:15,代码来源:Personal.php
示例10: testDocumentAdd
function testDocumentAdd()
{
$d = new Document(false);
$set = array('teacher_id' => 1, 'mediatype' => 'wma', 'url' => 'newsong.wma', 'description' => 'new song', 'pricecode' => 'b');
$new_id = $d->add($set);
$d = new Document($new_id);
$d->add_teacher($set['teacher_id']);
$this->assertEquals($set['description'], $d->description());
$t = new Teacher($set['teacher_id']);
$ds = $t->documents();
$this->assertType('array', $ds);
$this->assertArrayHasKey($new_id, $ds);
$d = $ds[$new_id];
$this->assertEquals($set['description'], $d->description());
}
开发者ID:songwork,项目名称:songwork,代码行数:15,代码来源:testDocument.php
示例11: addSectionCode
public function addSectionCode()
{
$section_code = new SectionCode();
$teacher = Teacher::find(Auth::Id());
$subject_id = Input::get('subject');
$section_id = Input::get('section');
$current_period = Input::get('current_period');
$section_code->teacher_id = new MongoId($teacher->_id);
$section_code->subject_id = new MongoId($subject_id);
$section_code->section_id = new MongoId($section_id);
$section_code->current_period = $current_period;
$section_code->teamleaders_id = array();
$section_code->students_id = array();
$section_code->status = true;
$subject = Subject::find($subject_id);
$section = $subject->sections()->find($section_id);
$code = $this->getInitialLetters($subject->name) . '-' . $section->code . '-' . $current_period;
$section_code->code = $code;
if (!is_null($section->current_code)) {
$sectionCode = SectionCode::where('code', $section->current_code)->first();
if (isset($sectionCode->_id)) {
$sectionCode->status = false;
$sectionCode->save();
}
}
try {
$section_code->save();
$section->current_code = $code;
$section->save();
} catch (MongoDuplicateKeyException $e) {
return Redirect::back()->withErrors(array('error' => Lang::get('section_codes.duplicate_code')));
}
return Redirect::to(Lang::get('routes.section_codes'))->with(array('message' => Lang::get('section_codes.success_message')));
}
开发者ID:ronnysuero,项目名称:devsfarm,代码行数:34,代码来源:SectionCodeController.php
示例12: __construct
/**
* This is construct base of the class.
*
* A public constructor; initializes the variable $instanceDataBase.
*
*/
public function __construct($instanceDataBase)
{
parent::__construct($instanceDataBase);
Teacher::setDataOperationBusiness($instanceDataBase);
Teacher::getBusiness();
Teacher::getDescriptionBusiness();
}
开发者ID:vicholuis,项目名称:proyectopruebalms,代码行数:13,代码来源:Teacher.php
示例13: run
public function run()
{
$faker = Faker::create();
foreach (range(1, 10) as $index) {
Teacher::create(['name' => $faker->firstName, 'lastName' => $faker->lastName, 'dob' => $faker->date(), 'pob' => $faker->city, 'gender' => $faker->word, 'email' => $faker->email, 'password' => Hash::make('buffer'), 'grade' => $faker->word]);
}
}
开发者ID:andelus,项目名称:echooly,代码行数:7,代码来源:TeachersTableSeeder.php
示例14: actionView
public function actionView($id)
{
$lesson = $this->loadModel($id);
$userId = $this->_cookiesGet('userId');
$userType = $this->_cookiesGet('userType');
$this->_seoTitle = '课程 - ' . $lesson->name;
//取报名人数
$actual_students_criteria = new CDbCriteria();
$actual_students = StudentLesson::model()->count($actual_students_criteria->addCondition("lesson_id =" . $id));
$lesson->actual_students = $actual_students;
$teacher = Teacher::model()->findByPk($lesson->teacher_id);
$place = Place::model()->findByPk($lesson->place_id);
//教学环境图片显示
$imageList = $this->_gets->getParam('imageList');
$imageListSerialize = XUtils::imageListSerialize($imageList);
//判断学员已收藏的课程
if ($userType === 'student') {
$is_focus = StudentLesson::model()->findByAttributes(array('student_id' => $userId, 'lesson_id' => $id, 'is_collection' => 1));
}
if ($imageList) {
$imageList = $imageListSerialize['data'];
} elseif ($place->pic_other) {
$imageList = unserialize($place->pic_other);
}
$this->render('view', array('is_focus' => $is_focus, 'isJoin' => $this->isJoin($userId, $id, 1), 'userType' => $userType, 'lesson' => $lesson, 'place' => $place, 'teacher' => $teacher, 'imageList' => $imageList));
}
开发者ID:tecshuttle,项目名称:51qsk,代码行数:26,代码来源:LessonController.php
示例15: getModel
private function getModel()
{
if (!$this->isGuest && $this->_model === null) {
$this->_model = Teacher::model()->findByPk($this->id, array('select' => 'role'));
}
return $this->_model;
}
开发者ID:DostonAkhmedov,项目名称:Dars_jadvali,代码行数:7,代码来源:WebUser.php
示例16: showDashboard
public function showDashboard()
{
$data = [];
$loginid = Session::get('user')->id;
$collegeid = Session::get('user')->collegeid;
$flag = Session::get('user')->flag;
$tb = "";
if ($flag == 1) {
$tb = "Admin";
} else {
if ($flag == 2) {
$tb = "Teacher";
} else {
if ($flag == 3) {
$tb = "Student";
} else {
$tb = "Staff";
}
}
}
$dt = $tb::where('loginid', '=', $loginid)->first();
$data['name'] = $dt->name;
$data['pic'] = $dt->profilepic;
$data['id'] = $loginid;
//Cards value
$data['students'] = Student::where('collegeid', '=', $collegeid)->count();
$data['teachers'] = Teacher::where('collegeid', '=', $collegeid)->count();
$data['subjects'] = Subject::where('collegeid', '=', $collegeid)->count();
$data['parents'] = $data['students'] * 2;
return View::make('pages.dashboard', array('data' => $data, 'flag' => $flag));
}
开发者ID:pankaja455,项目名称:WebSchool,代码行数:31,代码来源:HomeController.php
示例17: caculate
/**
* 計算課表
*/
public static function caculate($param)
{
// 設定執行時間
set_time_limit(60);
// 產生教室使用時間,提供排課使用
$classroom = Classroom::all();
foreach ($classroom as $classroomItem) {
$GLOBALS['classroomCourseTime'][$classroomItem->classroom_id] = str_replace('1', $classroomItem->count, $classroomItem->course_time);
}
// 取得教師排課需求,計算適應值用
$teacher = Teacher::where('course_time', '<>', str_repeat(0, 35))->get();
foreach ($teacher as $teacherItem) {
$GLOBALS['teacherRequire'][$teacherItem->teacher_id]['require'] = $teacherItem->course_time;
$GLOBALS['teacherRequire'][$teacherItem->teacher_id]['classes_id'] = $teacherItem->classes_id;
if ($teacherItem->classes_id != 0) {
$GLOBALS['teacherRequire'][$teacherItem->teacher_id]['courseTime'] = $teacherItem->classes->year->course_time;
}
}
// 產生課表,速度、計算適應值
$seed = self::_generateSeed($param['seedCount']);
// 發生錯誤,回傳錯誤結果
if ($seed[0] == 'error') {
return $seed;
}
// 進行粒子最佳化計算
$seedProgressHistory = array();
$extinctionTimes = 1;
while ($param['extinctionCount'] > 0) {
$withoutProgressCount = 0;
$bestSeed = self::_getBestSeed($seed);
$seedProgressHistory[] = number_format($bestSeed['fitness'], 2, '.', '');
while ($withoutProgressCount < $param['executeCount']) {
// 更新種子速度
self::_updateSeedV($seed, $bestSeed);
// 依照速度更新課表排課、計算適應值
$seed = self::_updateSeed($seed);
// 取得新的全域最佳值
$newBestSeed = self::_getBestSeed($seed);
// 判斷是否改進
if ($bestSeed['fitness'] < $newBestSeed['fitness']) {
$bestSeed = $newBestSeed;
$withoutProgressCount = 0;
$seedProgressHistory[] = number_format($bestSeed['fitness'], 2, '.', '') . '<sup class="progross"> 改進</sup>';
} else {
$withoutProgressCount++;
$seedProgressHistory[] = number_format($bestSeed['fitness'], 2, '.', '');
}
}
// 進行判斷是否改進毀滅結果
if (!isset($historyBestSeed) || $historyBestSeed['fitness'] < $bestSeed['fitness']) {
$historyBestSeed = $bestSeed;
}
$seedProgressHistory[] = '<strong>' . number_format($historyBestSeed['fitness'], 2, '.', '') . '<sup> 全域最佳</sup></strong>';
$seedProgressHistory[] = 'Extinction ' . $extinctionTimes;
$param['extinctionCount']--;
$extinctionTimes++;
}
file_put_contents(storage_path() . '\\result.json', json_encode($historyBestSeed['timetable']));
return $seedProgressHistory;
}
开发者ID:ramazanalic,项目名称:open-school-timetable,代码行数:63,代码来源:Courseunit.php
示例18: run
public function run()
{
DB::table('teachers')->delete();
$extra = array('1', '2', '3', '4');
$extra = serialize($extra);
Teacher::create(array('user_id' => 1, 'email' => '[email protected]', 'dob' => '1996-01-01', 'extra' => $extra));
}
开发者ID:eufelipemartins,项目名称:edlara,代码行数:7,代码来源:TeacherTableSeeder.php
示例19: actionIndex
public function actionIndex()
{
Yii::app()->getModule('aud');
Yii::app()->getModule('group');
Yii::app()->getModule('lesson');
Yii::app()->getModule('sch');
Yii::app()->getModule('spec');
Yii::app()->getModule('teacher');
$schs = Sch::model()->findAll(array('order' => 'modified_time DESC', 'limit' => 100));
$auds = Aud::model()->findAll(array('order' => 'updated_time DESC', 'limit' => 100));
$specs = Spec::model()->findAll(array('order' => 'updated_time DESC', 'limit' => 100));
$groups = Group::model()->findAll(array('order' => 'updated_time DESC', 'limit' => 100));
$lessons = Lesson::model()->findAll(array('order' => 'updated_time DESC', 'limit' => 100));
$teachers = Teacher::model()->findAll(array('order' => 'updated_time DESC', 'limit' => 100));
$entries = $this->addEntries(array($auds, $specs, $groups, $lessons, $teachers));
foreach ($schs as $value) {
$entries[] = array('id' => $value->group_id, 'module' => strtolower(get_class($value)), 'time' => $value->modified_time . rand(100000, 999999), 'time' => $value->modified_time, 'user' => $value->modified_by, 'action' => 'update');
}
$entriesNew = array();
foreach ($entries as $value) {
$entriesNew[$value['time'] . rand(10000, 99999)] = $value;
}
krsort($entriesNew);
$this->render('index', array('entries' => $entriesNew));
}
开发者ID:BigMacckk,项目名称:kepsch,代码行数:25,代码来源:ActivityController.php
示例20: getLastTitleId
public static function getLastTitleId()
{
try {
return Teacher::find(self::$lastTeacherId)->title->title_id;
} catch (Exception $e) {
return 'all';
}
}
开发者ID:ramazanalic,项目名称:open-school-timetable,代码行数:8,代码来源:Teacher.php
注:本文中的Teacher类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论