本文整理汇总了PHP中Student类的典型用法代码示例。如果您正苦于以下问题:PHP Student类的具体用法?PHP Student怎么用?PHP Student使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Student类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getMenuBlockView
public function getMenuBlockView(Student $student)
{
PHPWS_Core::initModClass('hms', 'RoommateProfile.php');
$profile = RoommateProfileFactory::getProfile($student->getBannerID(), $this->term);
PHPWS_Core::initModClass('hms', 'StudentMenuProfileView.php');
return new StudentMenuProfileView($student, $this->getStartDate(), $this->getEndDate(), $this->term, $profile);
}
示例2: __construct
public function __construct(Student $student, RoomDamage $damage)
{
$this->banner_id = $student->getBannerId();
$this->damage_id = $damage->getId();
$this->state = 'new';
$this->amount = null;
}
示例3: actionIndex
/**
* 首页
*
*/
public function actionIndex()
{
parent::_acl();
$model = new Student();
$criteria = new CDbCriteria();
$criteria->condition = $condition;
$criteria->order = 't.id ASC';
//$criteria->with = array ( 'catalog' );
$count = $model->count($criteria);
$pages = new CPagination($count);
$pages->pageSize = 13;
//$pageParams = XUtils::buildCondition( $_GET, array ( 'title' , 'catalogId','titleAlias' ) );
//$pages->params = is_array( $pageParams ) ? $pageParams : array ();
$criteria->limit = $pages->pageSize;
$criteria->offset = $pages->currentPage * $pages->pageSize;
$result = $model->findAll($criteria);
//审核
//$id = $_POST('id');
//$status = $_POST('status');
//$count = Student::model()->updateByPk($id, ,'status=:status',array(':status'=>$status));
$string = '审核更新失败';
function errorInfo($count, $string)
{
if ($count) {
echo "<b>{$string}</b>";
} else {
echo "<b>成功</b>";
}
}
set_error_handler("errorInfo");
$this->render('student_index', array('datalist' => $result, 'pagebar' => $pages));
}
示例4: executeFilter
public function executeFilter(sfWebRequest $request)
{
$students = Doctrine_Core::getTable('Student')->createQuery('a')->orderBy('a.created_at DESC');
$student_uid = $request->getParameter('student_uid');
$studentname = $request->getParameter('studentname');
$fstudentname = $request->getParameter('fstudentname');
$gfstudentname = $request->getParameter('fgstudentname');
$department = $request->getParameter('department');
// $college = $request->getParameter('college');
if ($student_uid == 'Enter Student Id' && $studentname == 'Enter Student Name' && $fstudentname == 'Enter Father Name' && $gfstudentname == 'Enter GFather Name' && $department == '0') {
$this->redirect('students_list');
}
if ($student_uid != 'Enter Student Id') {
$students->orWhere('a.student_uid like ?', $student_uid . '%');
}
if ($studentname != 'Enter Student Name') {
$students->orWhere('a.name like ?', $studentname . '%');
}
if ($studentname != 'Enter Father Name') {
$students->orWhere('a.fathers_name like ?', $fstudentname . '%');
}
$this->pager = new sfDoctrinePager('Student', 10);
$this->pager->setPage($request->getParameter('page', 1));
$this->pager->init();
$this->students = $students->execute();
$departments = new Student();
$this->departments = $departments->getAllDepartments();
//$this->colleges = $departments->getAllColleges();
}
示例5: authenticate
/**
* Authenticates a dummy user.
* @return boolean always true.
*/
public function authenticate()
{
$student = Student::model()->findByAttributes(array('username' => $this->username));
if ($student === null) {
$student = new Student();
$faculty = Faculty::model()->findByPk(1);
if ($faculty === null) {
$faculty = new Faculty();
$faculty->id = 1;
$faculty->name = 'Dummy Faculty';
$faculty->save(false);
}
$student->username = $this->username;
$student->name = $this->name;
$student->is_admin = $this->isAdmin;
$student->faculty_id = $faculty->id;
$student->photo = Yii::app()->params['defaultProfilePhoto'];
}
$student->last_login_timestamp = date('Y-m-d H:i:s');
$student->save();
$this->id = $student->id;
$this->name = $student->name;
$this->setState('isAdmin', $student->is_admin);
$this->setState('profilePhoto', $student->photo);
return true;
}
示例6: getMenuBlockView
public function getMenuBlockView(Student $student)
{
PHPWS_Core::initModClass('hms', 'HousingApplication.php');
PHPWS_Core::initModClass('hms', 'ApplicationMenuBlockView.php');
$application = HousingApplication::getApplicationByUser($student->getUsername(), $this->term);
return new ApplicationMenuBlockView($this->term, $this->getStartDate(), $this->getEditDate(), $this->getEndDate(), $application);
}
示例7: cont_nou
function cont_nou()
{
set('recaptcha', recaptcha_get_html(Config::get_key('recaptcha_pubkey')));
$s = $_POST['s'];
option('session', true);
$_SESSION['s'] = $s;
$s['cnp'] = filter_var($s['cnp'], FILTER_SANITIZE_NUMBER_INT);
$s['cont'] = filter_var($s['cont'], FILTER_SANITIZE_STRING);
$s['parola'] = filter_var($s['parola'], FILTER_SANITIZE_STRING);
$s['alias'] = filter_var($s['alias'], FILTER_SANITIZE_STRING);
$resp = recaptcha_check_answer(Config::get_key('recaptcha_privkey'), $_SERVER["REMOTE_ADDR"], $_POST["recaptcha_challenge_field"], $_POST["recaptcha_response_field"]);
if (!$resp->is_valid) {
flash('fail', 'Contul nu a fost creat. Verificați testul anti-robot.');
} else {
if (!empty($s['cnp']) && !empty($s['cont']) && !empty($s['parola'])) {
$cont = new Student();
$u = $cont->valid_user($s['cont'], $s['parola'], $s['cnp'], $s['alias']);
if ($u) {
if ($cont->create_user($u)) {
flash('ok', 'Contul a fost creat. Mulțumim.');
} else {
flash('fail', 'Contul nu a fost creat. A intervenit o eroare.');
}
} else {
flash('fail', 'Contul nu a fost creat. Utilizatorul sau alias-ul există deja sau avem o problemă cu SINU.');
}
} else {
flash('fail', 'Contul nu a fost creat. Verificați câmpurile obligatorii.');
}
}
redirect_to('creare');
}
示例8: execute
protected function execute($arguments = array(), $options = array())
{
// initialize the database connection
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
$names = array('Martin', 'Pedro', 'Lucas', 'Agustin', 'Cristian', 'Matias', 'Tomas', 'Cludio', 'Nancy', 'Emilia', 'Alejandra', 'Barbara', 'Luciana', 'Lucia', 'Belen', 'Natalia', 'Adriana', 'Patricio', 'Diego', 'Gonzalo', 'Juan', 'Pablo');
$last_names = array('Ramirez', 'Rodriguez', 'Cordoba', 'Brown', 'Osorio', 'Diaz', 'Ayesa', 'Ramirez', 'Perez', 'Ripoll', 'Bottini', 'Ponce', 'Casella', 'Martinez', 'Erviti', 'Rodgriguez', 'Gonzalez', 'Fernandez', 'Benitez');
$this->createContextInstance('backend');
for ($i = 1; $i <= 100; $i++) {
$person = new Person();
$person->setLastname($last_names[rand(0, 18)]);
$person->setFirstName($names[rand(0, 21)]);
$person->setIdentificationType(1);
$person->setIdentificationNumber($i);
$person->setSex(rand(1, 2));
$person->setBirthDate('2000-06-30');
$student = new Student();
$student->setGlobalFileNumber($i);
$student->setPerson($person);
$person->save();
$student->save();
$this->logSection("Person created", $person->__toString());
}
// add your code here
}
示例9: testPaidForDocument
function testPaidForDocument()
{
$x = new Student(1);
$this->assertTrue($x->paid_for_document(1));
$this->assertFalse($x->paid_for_document(3));
$this->assertFalse($x->paid_for_document(999));
$this->assertFalse($x->paid_for_document('dog'));
}
示例10: getAsObject
protected function getAsObject($row)
{
$result = new Student();
$result->setNew(false);
$result->setStudentId(Singleton::create("NullConverter")->fromDBtoDOM($row["studentId"]));
$result->setName(Singleton::create("NullConverter")->fromDBtoDOM($row["name"]));
return $result;
}
示例11: __construct
public function __construct(Student $student1, Student $student2, $lifestyle, $earliestTime)
{
$this->student1 = $student1;
$this->student2 = $student2;
$this->lifestyle = $lifestyle;
$this->gender = $student1->getGender();
$this->earliestTime = $earliestTime;
}
示例12: retrieveCurrentForStudentCriteria
public static function retrieveCurrentForStudentCriteria(Student $student, Criteria $c = null)
{
$c = is_null($c) ? new Criteria() : $c;
$c->add(self::SCHOOL_YEAR_ID, SchoolYearPeer::retrieveCurrent()->getId());
$c->addJoin(self::ID, StudentCareerSchoolYearPeer::CAREER_SCHOOL_YEAR_ID);
$c->add(StudentCareerSchoolYearPeer::STUDENT_ID, $student->getId());
return $c;
}
示例13: select_group
public function select_group()
{
$group_id = $this->input->post('group_id');
$this->_transaction_isolation();
$this->db->trans_begin();
$group = new Group();
$group->get_by_id($group_id);
if ($group->exists()) {
$course = $group->course->get();
if (is_null($course->groups_change_deadline) || date('U', strtotime($course->groups_change_deadline)) >= time()) {
$student = new Student();
$student->get_by_id($this->usermanager->get_student_id());
if ($student->is_related_to('active_course', $course->id)) {
$participant = new Participant();
$participant->where_related($student);
$participant->where_related($course);
$participant->where('allowed', 1);
$participant->get();
if ($participant->exists()) {
if (!$participant->is_related_to($group)) {
$participant->save($group);
$participant->where_related($course);
$participant->where_related($group);
$participant->where('allowed', 1);
$participants_count = $participant->count();
$room = new Room();
$room->where_related($group)->order_by('capacity', 'asc')->limit(1)->get();
if ($participants_count > intval($room->capacity)) {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_group_is_full', Messages::MESSAGE_TYPE_ERROR);
} else {
$this->db->trans_commit();
$this->messages->add_message(sprintf($this->lang->line('groups_message_group_changed'), $this->lang->text($group->name)), Messages::MESSAGE_TYPE_SUCCESS);
$this->_action_success();
$this->output->set_internal_value('course_id', $participant->course_id);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_you_are_in_group', Messages::MESSAGE_TYPE_ERROR);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_cant_found_participant_record', Messages::MESSAGE_TYPE_ERROR);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_cant_change_group_of_inactive_course', Messages::MESSAGE_TYPE_ERROR);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_groups_switching_disabled', Messages::MESSAGE_TYPE_ERROR);
}
} else {
$this->db->trans_rollback();
$this->messages->add_message('lang:groups_message_group_not_found', Messages::MESSAGE_TYPE_ERROR);
}
redirect(create_internal_url('groups'));
}
示例14: getInstance
public static function getInstance(Student $a_student)
{
if (isset(self::$analyticals[$a_student->getId()])) {
return self::$analyticals[$a_student->getId()];
}
$behavior = ucwords(sfConfig::get("nc_flavor_flavors_current", "demo"));
$clazz = $behavior . "AnalyticalBehaviour";
return self::$analyticals[$a_student->getId()] = new $clazz($a_student);
}
示例15: __construct
/**
* Create a new RoomChangeParticipant
*
* @param RoomChangeRequest $request
* @param Student $student
* @param HMS_Bed $fromBed
*/
public function __construct(RoomChangeRequest $request, Student $student, HMS_Bed $fromBed)
{
$this->id = 0;
$this->request_id = $request->getId();
$this->banner_id = $student->getBannerId();
$this->from_bed = $fromBed->getId();
// Set initial state
$this->setState(new ParticipantStateNew($this, time(), null, UserStatus::getUsername()));
}