• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP student类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: login_student

 public function login_student($student_id, $student_password)
 {
     if (empty($student_id) || empty($student_password)) {
         echo "Username or Password is invalid";
         return false;
     }
     $student_id = stripslashes($student_id);
     $student_password = stripslashes($student_password);
     $student_id = mysql_real_escape_string($student_id);
     $student_password = mysql_real_escape_string($student_password);
     $student_password = sha1($student_password);
     $students_rec = mysql_query("SELECT * FROM " . $this->students_table . " where student_id = {$student_id};");
     if (($obj = mysql_fetch_object($students_rec)) != NULL) {
         $student = new student($obj->student_id, $obj->user_name, $obj->user_password, $obj->change_password);
         if ($student->getUser_password() == $student_password) {
             echo "welcome " . $student->getUser_name();
             return true;
         } else {
             echo "Wrong password";
             return false;
         }
     } else {
         echo "No such user!";
         return false;
     }
 }
开发者ID:AhmedJavacc,项目名称:WebProgForCollege,代码行数:26,代码来源:StudentsGateway.php


示例2: test_student_save_nouserobject

 /**
  * Test student save works when $USER object not set
  */
 public function test_student_save_nouserobject()
 {
     global $DB, $USER;
     // Create Moodle course category.
     $crscat = create_course_category((object) array('name' => 'Test Course category', 'idnumber' => 'MCC-1'));
     // Create Moodle course.
     $crsdata = array('category' => $crscat->id, 'fullname' => 'MC-TEST-ELIS-8484', 'shortname' => 'MC-TEST-ELIS-8484', 'idnumber' => 'MC-TEST-ELIS-8484');
     $mdlcrs = new stdClass();
     $mdlcrs->id = $DB->insert_record('course', (object) $crsdata);
     $cddata = array('name' => 'CD-ELIS-8484', 'code' => 'CD-ELIS-8484', 'idnumber' => 'CD-ELIS-8484', 'syllabus' => 'syllabus');
     $cd = new course($cddata);
     $cd->save();
     $ci = new pmclass(array('idnumber' => 'CI-ELIS-8484', 'courseid' => $cd->id, 'moodlecourseid' => $mdlcrs->id, 'autocreate' => 0));
     $ci->save();
     $testuser = new user(array('idnumber' => 'testuserelis8484', 'username' => 'testuserelis8484', 'firstname' => 'Test', 'lastname' => 'User-ELIS8484', 'email' => '[email protected]', 'city' => 'Waterloo', 'country' => 'CA'));
     $testuser->save();
     $USER = null;
     $sturec = new stdClass();
     $sturec->userid = $testuser->id;
     $sturec->classid = $ci->id;
     $sturec->grade = 0;
     $sturec->enrolmenttime = time();
     $student = new student($sturec);
     $student->save();
     $this->assertFalse(empty($student));
     if (!empty($student)) {
         $this->assertFalse(empty($student->id));
     }
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:32,代码来源:student_save_nouserobject_test.php


示例3: addteacher

 protected function addteacher()
 {
     global $objPDO;
     global $user;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/subject_teacher_relations.php';
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:10,代码来源:subjectclassController.php


示例4: create

 protected function create()
 {
     global $objPDO;
     global $user;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/create_section.php';
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:10,代码来源:sectionController.php


示例5: insertion

 public function insertion()
 {
     echo "hello";
     if (!is_dir("uploads/")) {
         mkdir("uploads/");
     }
     $dir = "uploads/";
     $valuePost = array("firstname" => $_POST['firstname'], "lastname" => $_POST['lastname'], "fathername" => $_POST['fathername'], "dob" => $_POST['dob'], "sex" => $_POST['sex'], "contact" => $_POST['contact'], "email" => $_POST['email'], "secondary" => $_POST['secondary'], "senior" => $_POST['senior'], "fn" => $_FILES['img']['name'], "target" => $dir . basename($_FILES['img']['name']));
     $student = new student();
     $error = $student->Insertion($valuePost);
     return $error;
 }
开发者ID:Prafful-p,项目名称:php,代码行数:12,代码来源:controller.php


示例6: create_student

 private function create_student($row)
 {
     $obj = new student();
     $obj->setstudentId($row["student_Id"]);
     $obj->setFirstName($row["FirstName"]);
     $obj->setLastName($row["LastName"]);
     $obj->setDob(new \DateTime($row["dob"]));
     $obj->setGender($row["gender"]);
     $obj->setUsername($row["UserName"]);
     $obj->setPassword($row["password"]);
     $obj->setapproved($row["approved"]);
     return $obj;
 }
开发者ID:Abenezer,项目名称:SchoolManagmentWithApi,代码行数:13,代码来源:StudentDAO.php


示例7: save_enrolments

 /**
  * Save a set of enrolments and LO grades to the database
  * @param array $enrolments Enrolment data to save
  * @param array $grades LO grade data to save
  */
 protected function save_enrolments($enrolments, $grades = array())
 {
     // Enrolments.
     foreach ($enrolments as $enrolment) {
         $student = new student($enrolment);
         $sink = $this->redirectMessages();
         $student->save();
     }
     // LO grades.
     foreach ($grades as $grade) {
         $studentgrade = new student_grade($grade);
         $studentgrade->save();
     }
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:19,代码来源:pmclassupdateenrolmentstatus_test.php


示例8: studentsection

 protected function studentsection()
 {
     global $objPDO;
     global $user;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/section_student_relation_view.php';
     } else {
         if ($student->checkTeacher()) {
         } else {
         }
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:14,代码来源:miscellaneousController.php


示例9: create_class_enrolment

 /**
  * Method to create test user class enrolment
  * @param int $userid the user DB id
  * @param int $classid the class DB id
  */
 public function create_class_enrolment($userid, $classid)
 {
     // Initialize version1elis importplugin for utility functions.
     $importplugin = rlip_dataplugin_factory::factory('dhimport_version1elis');
     $record = new stdClass();
     $record->userid = $userid;
     $record->classid = $classid;
     $record->completestatusid = 0;
     $record->grade = 50;
     $record->credits = 1;
     $record->locked = 0;
     $record->enrolmenttime = $importplugin->parse_date('Jan/10/2013');
     $stu = new student($record);
     $stu->save();
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:20,代码来源:ws_elis_class_enrolment_update_test.php


示例10: addparent

 protected function addparent()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true && isset($_GET['uid'])) {
         global $objPDO;
         $studentProfile = new StudentProfile($objPDO);
         $studentProfile->loadByUserId($_GET['uid']);
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/addparent.php';
     } else {
         header('Location:http://localhost/cloud');
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:15,代码来源:parentController.php


示例11: student_sync_role_set

 /**
  * When a role is selected from the sync configuration, create class
  * enrolments for the specified role assignments.
  */
 static function student_sync_role_set()
 {
     require_once CURMAN_DIRLOCATION . '/lib/student.class.php';
     global $CURMAN;
     $contextlevel = context_level_base::get_custom_context_level('class', 'block_curr_admin');
     // find all class role assignments
     $sql = "SELECT ra.id, cu.id AS userid, ctx.instanceid AS classid\n                  FROM {$CURMAN->db->prefix_table('role_assignments')} ra\n                  JOIN {$CURMAN->db->prefix_table('user')} mu ON ra.userid = mu.id\n                  JOIN {$CURMAN->db->prefix_table('crlm_user')} cu ON mu.idnumber = cu.idnumber\n                  JOIN {$CURMAN->db->prefix_table('context')} ctx ON ctx.id = ra.contextid\n                 WHERE ctx.contextlevel = {$contextlevel}\n                   AND ra.roleid = {$CURMAN->config->enrolment_role_sync_student_role}";
     $studentswanted = $CURMAN->db->get_records_sql($sql);
     $studentswanted = $studentswanted ? $studentswanted : array();
     foreach ($studentswanted as $student) {
         unset($student->id);
         $student = new student($student);
         $student->add();
     }
     return true;
 }
开发者ID:remotelearner,项目名称:elis.cm,代码行数:20,代码来源:lib.php


示例12: index

 protected function index()
 {
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin() == true) {
         $role = $student->getacctType();
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/temp_page.php';
     } else {
         if ($student->checkTeacher() == true) {
             $role = $student->getacctType();
             include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/temp_page.php';
         } else {
             header('Location:http://localhost/cloud');
         }
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:18,代码来源:leaveController.php


示例13: index

 protected function index()
 {
     global $objPDO;
     global $user;
     $student = new student($objPDO, $user->getuserId());
     $headMenu = array("username" => $student->getName());
     if ($user->checkAdmin()) {
         include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/admin.php';
     } else {
         if ($student->checkTeacher()) {
             include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/employee.php';
         } else {
             if ($student->checkStudent()) {
                 include $_SERVER['DOCUMENT_ROOT'] . '/cloud/view/student.php';
             }
         }
     }
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:18,代码来源:homeController.php


示例14: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $emails = ['[email protected]'];
     Mail::send('mails.welcome', ['name' => 'Angela Namikoye, Brian Phiri'], function ($message) use($emails) {
         $message->to($emails)->from('[email protected]', 'strath')->subject('This is test email');
     });
     $user = Auth::user()->regNo;
     student::where('studentNo', '=', $user)->update(['state' => 'Activated']);
     Session::flash('flash_msg', 'You have initiated the clearance process');
     return redirect('/student');
 }
开发者ID:BrianPhiri,项目名称:su-clearance,代码行数:16,代码来源:MailsController.php


示例15: savepass

 protected function savepass()
 {
     $required = array("current" => "Current Password", "new" => "New Password");
     foreach ($required as $key => $value) {
         if (!isset($_POST[$key]) || $_POST[$key] == '' || $_POST[$key] == 'select') {
             echo $value . ' is Required<br/>';
             return;
         }
     }
     global $user;
     global $objPDO;
     $student = new student($objPDO, $user->getuserId());
     if (md5($_POST['current']) == $student->getPassword()) {
         $student->setPassword(md5($_POST['new']));
         $student->save();
     } else {
         echo 'The Current Password is Wrong';
         return;
     }
     echo '<meta http-equiv="Refresh" content="0;url=http://localhost/cloud/profile"/>';
 }
开发者ID:srinivasans,项目名称:educloud,代码行数:21,代码来源:profileController.php


示例16: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $user = Auth::user()->regNo;
     $res = DB::table('students')->select('faculty')->where('studentNo', '=', $user)->pluck('faculty');
     //Query below gets the email of the specific administrator
     $admin = DB::table('departments')->join('administrators', 'departments.administrator', '=', 'administrators.admin_id')->select('administrators.email')->where('departments.department_name', '=', $res)->pluck('email');
     Mail::send('mails.welcome', ['name' => 'Angela Namikoye, Brian Phiri'], function ($message) use($admin) {
         $message->to($admin)->from('[email protected]', 'Strathmore University')->subject('Clearance Request');
     });
     student::where('studentNo', '=', $user)->update(['state' => 'Activated']);
     Session::flash('flash_msg', 'You have initiated the clearance process');
     return redirect('/student');
 }
开发者ID:bryan-mwas,项目名称:Clearance101,代码行数:18,代码来源:MailsController.php


示例17: test_success

 /**
  * Test successful class enrolment deletion.
  */
 public function test_success()
 {
     global $DB;
     $this->give_permissions(array('local/elisprogram:class_enrol'));
     // Initialize version1elis importplugin for utility functions.
     $importplugin = rlip_dataplugin_factory::factory('dhimport_version1elis');
     // Create test course and class.
     $datagen = new elis_program_datagenerator($DB);
     $crs = $datagen->create_course(array('idnumber' => 'TestCourse'));
     $cls = $datagen->create_pmclass(array('idnumber' => 'TestClassEnrolmentCreate', 'courseid' => $crs->id));
     $data = array('class_idnumber' => $cls->idnumber, 'user_username' => 'assigninguser', 'user_email' => '[email protected]');
     // Create the class enrolment record to delete.
     $userid = $DB->get_field(user::TABLE, 'id', array('username' => 'assigninguser'));
     $stu = new student(array('classid' => $cls->id, 'userid' => $userid));
     $stu->save();
     $response = local_datahub_elis_class_enrolment_delete::class_enrolment_delete($data);
     $this->assertNotEmpty($response);
     $this->assertInternalType('array', $response);
     $this->assertArrayHasKey('messagecode', $response);
     $this->assertArrayHasKey('message', $response);
     $this->assertEquals(get_string('ws_class_enrolment_delete_success_code', 'local_datahub'), $response['messagecode']);
     $this->assertEquals(get_string('ws_class_enrolment_delete_success_msg', 'local_datahub'), $response['message']);
     $this->assertFalse($DB->record_exists(student::TABLE, array('classid' => $cls->id, 'userid' => $userid)));
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:27,代码来源:ws_elis_class_enrolment_delete_test.php


示例18: handle

 /**
  * Handle the event.
  *
  * @param  UserAuthenticated  $event
  * @return void
  */
 public function handle(DelayOrderAccepted $event)
 {
     $delay_order = $event->order;
     //add student history
     $student = student::findOrFail($delay_order->student_id);
     StudentHistory::where('academycycle_semester_id', $delay_order->semester_id)->where('student_id', $delay_order->student_id)->update(['state' => 'delayed']);
     /*
             StudentHistory::insert([
                 'academycycle_semester_id' => $delay_order->semester_id,
                 'student_id' => $delay_order->student_id,
                 'state' => 'delayed',
                 'study_state' => 'stop',
                 'academystructure_department_id' => $student->academystructure_department_id
                 ]);   
     */
 }
开发者ID:hisambahaa,项目名称:DARES,代码行数:22,代码来源:AddStudentDelayedToHistory.php


示例19: studentPdf

 public function studentPdf(Request $request)
 {
     $post = $request->all();
     $user = $post['student'];
     $std = student::where('studentNo', '=', $user)->first();
     $charge = charges::where('students_studentNo', '=', $user)->first();
     $serial = Serial::where('students_studentNo', '=', $user)->first();
     if ($charge->total == 0) {
         $html = PDF::make($std, $serial);
     } else {
         $html = PDF::create($std, $charge, $serial);
     }
     $mpdf = new mpdf();
     $mpdf->WriteHTML($html);
     $mpdf->Output();
 }
开发者ID:bryan-mwas,项目名称:Clearance101,代码行数:16,代码来源:ViewsController.php


示例20: test_enrolled_course_user_syncstoclass

 /**
  * Validate that the sync from course role assignment to class instance enrolment works
  */
 public function test_enrolled_course_user_syncstoclass()
 {
     global $CFG, $DB;
     require_once elispm::lib('lib.php');
     // Set up import data.
     $this->load_csv_data();
     // Make sure the context is set up.
     $crsctx = context_course::instance(100);
     // Set up our test role.
     $roleid = create_role('gradedrole', 'gradedrole', 'gradedrole');
     set_config('gradebookroles', $roleid);
     // Create role assignments.
     role_assign($roleid, 100, $crsctx->id);
     // Attempt the sync.
     $sync = new \local_elisprogram\moodle\synchronize();
     $sync->synchronize_moodle_class_grades();
     // Make sure the student record was created.
     $student = student::find();
     $this->assertTrue($student->valid());
     // Make sure the student has the right class id.
     $student = $student->current();
     $this->assertEquals(100, $student->classid);
 }
开发者ID:jamesmcq,项目名称:elis,代码行数:26,代码来源:autoclassenrolment_test.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP subinventory类代码示例发布时间:2022-05-23
下一篇:
PHP strings类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap