本文整理汇总了PHP中EmployeePeer::doSelectOne方法的典型用法代码示例。如果您正苦于以下问题:PHP EmployeePeer::doSelectOne方法的具体用法?PHP EmployeePeer::doSelectOne怎么用?PHP EmployeePeer::doSelectOne使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmployeePeer
的用法示例。
在下文中一共展示了EmployeePeer::doSelectOne方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getSpecial
public function getSpecial()
{
$c = new Criteria();
$cton1 = $c->getNewCriterion(EmployeePeer::STAFF_TYPE_ID, 13);
$cton2 = $c->getNewCriterion(EmployeePeer::STAFF_TYPE_ID, 14);
$cton1->addOr($cton2);
$c->add($cton1);
$special = EmployeePeer::doSelectOne($c);
return $special;
}
示例2: date
<?php
$tanggal = date('Y-m-d');
echo DateToIndo($tanggal);
?>
<br />Guru Mata Pelajaran
</td>
</tr>
<tr><td colspan="25" height="70px"></td></tr>
<tr>
<td></td>
<td style="text-align: left; font-size: 12px; font-weight: bold;">
<?php
$c = new Criteria();
$c->add(EmployeePeer::DEPARTMENT_ID, $course_schedule->getAcademicCalendar()->getDepartmentId());
$c->add(EmployeePeer::STAFF_TYPE_ID, 14);
$employee = EmployeePeer::doSelectOne($c);
echo $employee->getName() ? $employee->getName() : '-';
?>
</td><td colspan="26"></td>
<td style="text-align: left; font-size: 12px; font-weight: bold;" colspan="8">
<?php
$tutors = array();
foreach ($course_schedule->getCourseScheduleTutors() as $cr) {
$tutors[] = $cr->getEmployee() ? $cr->getEmployee()->getName() : '-';
}
echo join(" dan ", $tutors);
?>
</td>
</tr>
</table>
</center>
示例3: getEmployee
/**
* Get the associated Employee object
*
* @param PropelPDO Optional Connection object.
* @return Employee The associated Employee object.
* @throws PropelException
*/
public function getEmployee(PropelPDO $con = null)
{
if ($this->aEmployee === null && $this->employee_id !== null) {
$c = new Criteria(EmployeePeer::DATABASE_NAME);
$c->add(EmployeePeer::ID, $this->employee_id);
$this->aEmployee = EmployeePeer::doSelectOne($c, $con);
/* The following can be used additionally to
guarantee the related object contains a reference
to this object. This level of coupling may, however, be
undesirable since it could result in an only partially populated collection
in the referenced object.
$this->aEmployee->addUsers($this);
*/
}
return $this->aEmployee;
}
示例4: __
?>
</label><br />
<input type="password" name="password" id="password" value=""/><br />
<input type=submit name=update value=<?php
echo __('Simpan');
?>
style='cursor:pointer; width: 50px; background-color: #FFCC00; color:#000; font-weight: bold; margin-top:5px;' >
</form>
<?php
} elseif ($this->getContext()->getUser()->getAttribute('usertype', '', 'bo') == 'lector') {
?>
<?php
$username = $this->getContext()->getUser()->getAttribute('username', '', 'bo');
$c = new Criteria();
$c->add(EmployeePeer::EMP_NO, $this->getContext()->getUser()->getAttribute('username_long', '', 'bo'));
$user = EmployeePeer::doSelectOne($c);
?>
<?php
#echo form_tag('user/updateLector')
?>
<!--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
?>
示例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(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;
}
} else {
$username = $this->getRequestParameter('login_user');
$dept_name = substr($username, 4, 3);
$c = new Criteria();
#$c->add(VStudentLoginPeer::DEPARTMENT_NAME, $dept_name);
$c->add(VStudentLoginPeer::LOGIN, $username);
$user = VStudentLoginPeer::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;
}
}
}
}
// 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: getServiceCoord
public function getServiceCoord(PropelPDO $con = null)
{
if ($this->aServiceCoord === null && $this->service_coord_id !== null) {
$c = new Criteria(EmployeePeer::DATABASE_NAME);
$c->add(EmployeePeer::ID, $this->service_coord_id);
$this->aServiceCoord = EmployeePeer::doSelectOne($c, $con);
}
return $this->aServiceCoord;
}