Ejemplo n.º 1
0
 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;
 }
Ejemplo n.º 2
0
                                      <?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("&nbsp;dan&nbsp;", $tutors);
?>
                            </td>
                   </tr>
        </table>
</center>
Ejemplo n.º 3
0
 /**
  * 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;
 }
Ejemplo n.º 4
0
    ?>
</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
    ?>
Ejemplo n.º 5
0
 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');
     }
 }
Ejemplo n.º 6
0
 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;
 }