本文整理汇总了PHP中StudentPeer::doSelectOne方法的典型用法代码示例。如果您正苦于以下问题:PHP StudentPeer::doSelectOne方法的具体用法?PHP StudentPeer::doSelectOne怎么用?PHP StudentPeer::doSelectOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类StudentPeer
的用法示例。
在下文中一共展示了StudentPeer::doSelectOne方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getStudent
public function getStudent()
{
$c = new Criteria();
$c->add(StudentPeer::ID, $this->getPayer());
$student = StudentPeer::doSelectOne($c);
return $student;
}
示例2: link_to_function
<p class="user_detail" style="padding-top: 5px;"><?php
echo link_to_function('Edit Akun', visual_effect('toggle_appear', 'edit_account', array('onclick' => 'this.blur()')), 'class=user_info_black title="' . __('Edit Akun') . '"');
?>
</p>
</td>
</tr>
<tr id="edit_account" style="display:none; line-height:20px;">
<td>
<?php
if ($this->getContext()->getUser()->getAttribute('usertype', '', 'bo') == 'student') {
?>
<?php
$username = $this->getContext()->getUser()->getAttribute('username', '', 'bo');
$c = new Criteria();
$c->add(StudentPeer::CODE, $this->getContext()->getUser()->getAttribute('username_long', '', 'bo'));
$user = StudentPeer::doSelectOne($c);
?>
<?php
echo form_tag('user/updateStudent');
?>
<input type="hidden" value="<?php
#echo $user->getId()
?>
" name="id" id="id" />
<label style="color:#000; font-weight: bold; text-align:left;"><?php
echo __('Username');
?>
</label><br />
<input type="text" name="login" id="login" value="<?php
echo $username;
?>
示例3: executeGetListScore
public function executeGetListScore()
{
$cur13Lib = new cur13Lib();
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$class_group_id = $this->getRequestParameter('class_group_id');
$class_group = ClassGroupPeer::retrieveByPK($class_group_id);
$this->forward404Unless($class_group);
$academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
$this->forward404Unless($academic_calendar);
## Cek apakah Guru Tersebut merupakan Walas dari kelas ini
$cf = new Criteria();
$cf->add(CounselingTutorPeer::EMPLOYEE_ID, $employee->getId());
$cf->addJoin(CounselingPeer::ID, CounselingTutorPeer::COUNSELING_ID);
$cf->add(CounselingPeer::CLASS_GROUP_ID, $class_group->getId());
$cf->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getParent());
$counsel_tutor = CounselingPeer::doSelectOne($cf);
$this->counsel_tutor = $counsel_tutor;
$c = new Criteria();
if ($cur13Lib->isFullAccess($employee)) {
$cf = new Criteria();
$cf->addJoin(CounselingPeer::ID, CounselingTutorPeer::COUNSELING_ID);
$cf->add(CounselingPeer::CLASS_GROUP_ID, $class_group->getId());
$cf->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getParent());
$counsel_tutor = CounselingPeer::doSelectOne($cf);
$this->counsel_tutor = $counsel_tutor;
$c = new Criteria();
$c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_group->getId());
$c->addAscendingOrderByColumn(CourseSchedulePeer::CLASS_GROUP_ID);
} else {
$c = new Criteria();
$c->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN);
$c->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID);
$c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_group->getId());
$c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
if (!$this->getRequest()->getParameter('sort') && !$this->getUser()->getAttribute('sort_field', null, 'course')) {
$c->addJoin(SubjectPeer::ID, SubjectCurrPeer::SUBJECT_ID);
$c->addJoin(CourseSchedulePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID);
$c->addAscendingOrderByColumn(SubjectPeer::NAME);
}
}
/*
$c->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN);
$c->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID);
$c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_group->getId(), Criteria::IN);
## Khusus Home Session
$cton1 = $c->getNewCriterion(CourseSchedulePeer::SUBJECT_CURR_ID, 84, Criteria::NOT_IN);
$cton2 = $c->getNewCriterion(CourseSchedulePeer::SUBJECT_CURR_ID, 85, Criteria::NOT_IN);
$cton1->addAnd($cton2);
$c->add($cton1);
if (!$this->getRequest()->getParameter('sort') && !$this->getUser()->getAttribute('sort_field', null, 'course')) {
$c->addJoin(SubjectPeer::ID, SubjectCurrPeer::SUBJECT_ID);
$c->addJoin(CourseSchedulePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID);
$c->addAscendingOrderByColumn(SubjectPeer::NAME);
}
*/
$this->sort($c);
if ($this->getRequest()->hasParameter('filters')) {
$filters = $this->getRequestParameter('filters');
if ($filters == 'clear') {
$this->filters = null;
} else {
$defined_filter = false;
foreach ($filters as $f) {
if (is_array($f)) {
if (strlen($f['from']) > 0 || strlen($f['to']) > 0) {
$defined_filter = true;
break;
}
} else {
if ($f != null && $f != '') {
$defined_filter = true;
break;
}
}
}
if ($defined_filter) {
$this->filters = $filters;
$this->filter($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'course');
$pager = new sfPropelPager('CourseSchedule', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course'));
$this->getUser()->setAttribute('page', $page, 'course');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$cw = new Criteria();
$cw->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN);
$cw->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID);
$cw->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
//.........这里部分代码省略.........
示例4: executeEditStudent
public function executeEditStudent()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$c = new Criteria();
$c->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($c);
$acl = AclPeer::retrieveByPK($group_id, $job->getId());
if (!$acl) {
$this->forward('default', 'error404');
}
$this->can_add = $acl->getAddPriv() == 1;
$this->can_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
$member = MemberPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($member);
$this->member_detail = $member->getMemberDetail();
$c = new Criteria();
$c->add(StudentPeer::CODE, $member->getCode());
$student = StudentPeer::doSelectOne($c);
#$student = StudentPeer::retrieveByPk($this->getRequestParameter('student_id'));
$this->forward404Unless($student);
$this->student_detail = $student->getStudentDetail();
if ($this->hasRequestParameter('no_reg') && $this->getRequestParameter('no_reg') != '' && $this->getRequestParameter('no_reg') != null) {
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'member/deleteStudent?id=' . $member->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'member/listStudent?filters[NO_REG]=' . $this->getRequestParameter('no_reg'), 'color' => 'white'));
} elseif ($this->hasRequestParameter('code') && $this->getRequestParameter('code') != '' && $this->getRequestParameter('code') != null) {
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'member/deleteStudent?id=' . $member->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'member/listStudent?filters[CODE]=' . $this->getRequestParameter('code'), 'color' => 'white'));
} elseif ($this->hasRequestParameter('dept_id') && $this->getRequestParameter('dept_id') != '' && $this->getRequestParameter('dept_id') != null) {
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'member/deleteStudent?id=' . $member->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'member/listStudent?filters[DEPARTMENT_ID]=' . $this->getRequestParameter('dept_id'), 'color' => 'white'));
} elseif ($this->hasRequestParameter('status') && $this->getRequestParameter('status') != '' && $this->getRequestParameter('status') != null) {
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'member/deleteStudent?id=' . $member->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'member/listStudent?filters[STATUS]=' . $this->getRequestParameter('status'), 'color' => 'white'));
} elseif ($this->hasRequestParameter('name') && $this->getRequestParameter('name') != '' && $this->getRequestParameter('name') != null) {
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'member/deleteStudent?id=' . $member->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'member/listStudent?filters[NAME]=' . $this->getRequestParameter('name'), 'color' => 'white'));
} else {
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
if ($acl->getRemovePriv()) {
array_push($actions, array('name' => 'delete', 'url' => 'member/deleteStudent?id=' . $member->getId(), 'color' => 'red'));
}
array_push($actions, array('name' => 'cancel', 'url' => 'member/listStudent', 'color' => 'white'));
}
$this->filter_noreg = $this->getRequestParameter('no_reg');
$this->filter_code = $this->getRequestParameter('code');
$this->filter_deptid = $this->getRequestParameter('dept_id');
$this->filter_status = $this->getRequestParameter('status');
$this->filter_name = $this->getRequestParameter('name');
$this->subtitle = $member->toString() . ' - id:' . $member->getId();
$this->type = 'edit';
$this->member = $member;
$this->student = $student;
$this->actions = $actions;
}
示例5: executeDoLogin
public function executeDoLogin()
{
if ($this->hasRequestParameter('login_user') && $this->hasRequestParameter('login_password')) {
// check if the user exists
$c = new Criteria();
$c->add(UserPeer::LOGIN, $this->getRequestParameter('login_user'));
$user = UserPeer::doSelectOne($c);
if ($user) {
// check if the password is correct
$password = $this->getRequestParameter('login_password');
$crypted = sha1(sfConfig::get('app_salt') . $password);
if ($crypted == $user->getPassword()) {
// sign in
$this->getContext()->getUser()->signIn($user);
// proceed to home page
$this->setTemplate('index');
return;
}
} else {
$c = new Criteria();
$c->add(StudentPeer::CODE, $this->getRequestParameter('login_user'));
$user = StudentPeer::doSelectOne($c);
if ($user) {
// check if the password is correct
$password = $this->getRequestParameter('login_password');
$crypted = sha1(sfConfig::get('app_salt') . $password);
if ($crypted == $user->getPassword()) {
// sign in
$this->getContext()->getUser()->signInStudent($user);
// proceed to home page
$this->setTemplate('index');
return;
}
} else {
$c = new Criteria();
$c->add(EmployeePeer::EMP_NO, $this->getRequestParameter('login_user'));
$user = EmployeePeer::doSelectOne($c);
if ($user) {
// check if the password is correct
$password = $this->getRequestParameter('login_password');
$crypted = sha1(sfConfig::get('app_salt') . $password);
if ($crypted == $user->getPassword()) {
// sign in
$this->getContext()->getUser()->signInLector($user);
// proceed to home page
$this->setTemplate('index');
return;
}
}
}
}
// an error was found
$this->getRequest()->setError('login_error_title', 'Login failed');
$this->getRequest()->setError('login_error_msg', 'Your username or password are not correct. Please try again.');
$this->getRequest()->setParameter('login_submit', null);
return $this->forward('default', 'login');
} else {
$this->forward('default', 'login');
}
}
示例6: getStudent
public function getStudent()
{
$c = new Criteria();
$c->add(StudentPeer::PERSON_ID, $this->getId());
return StudentPeer::doSelectOne($c);
}
示例7: getStudentId
public function getStudentId($criteria = null, $con = null)
{
$c = new Criteria();
$c->add(StudentPeer::MEMBER_ID, $this->getId());
return StudentPeer::doSelectOne($c);
}
示例8: getNameWriters
public function getNameWriters($separator = null)
{
$writers = array();
if ($this->getCatCategory() && $this->getCatCategory()->getCatTemplate() && $this->getCatCategory()->getCatTemplate()->getCode() == 'Book') {
$catalog_writers = $this->getCatalogWritersJoinWriter();
foreach ($catalog_writers as $cw) {
array_push($writers, $cw->getWriter()->getName());
}
return join($separator ? $separator : ' / ', $writers);
} elseif ($this->getCatCategory() && $this->getCatCategory()->getCatTemplate() && $this->getCatCategory()->getCatTemplate()->getCode() == 'ebook') {
$catalog_writers = $this->getCatalogWritersJoinWriter();
foreach ($catalog_writers as $cw) {
array_push($writers, $cw->getWriter()->getName());
}
return join($separator ? $separator : ' / ', $writers);
} else {
if ($this->getCatCategoryId() == Catalog::STUDENT) {
$cd = new Criteria();
$cd->add(CatalogStudentPeer::CATALOG_ID, $this->getId());
$cd->addJoin(StudentPeer::ID, CatalogStudentPeer::STUDENT_ID);
$student = StudentPeer::doSelectOne($cd);
return $student->getName();
} elseif ($this->getCatCategoryId() == Catalog::TEACHER) {
$cd = new Criteria();
$cd->add(CatalogStudentPeer::CATALOG_ID, $this->getId());
$cd->addJoin(StudentPeer::ID, CatalogStudentPeer::STUDENT_ID);
$student = StudentPeer::doSelectOne($cd);
return $student->getName();
} elseif ($this->getCatCategoryId() == Catalog::MOSLEM) {
$catalog_writers = $this->getCatalogWritersJoinWriter();
foreach ($catalog_writers as $cw) {
array_push($writers, $cw->getWriter()->getName());
}
return join($separator ? $separator : ' / ', $writers);
} else {
return $this->getStudentName();
}
}
}