本文整理汇总了PHP中EmployeePeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP EmployeePeer::retrieveByPK方法的具体用法?PHP EmployeePeer::retrieveByPK怎么用?PHP EmployeePeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmployeePeer
的用法示例。
在下文中一共展示了EmployeePeer::retrieveByPK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeEmailExpirationNotice
public function executeEmailExpirationNotice(sfWebRequest $request)
{
$notices = $request->getParameter('expired');
$mail_count = 0;
// prepare swift mailer
require_once sfConfig::get('sf_lib_dir') . '/vendor/swift/swift_required.php';
# needed due to symfony autoloader
$mailer = Swift_Mailer::newInstance(Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -t'));
foreach ($notices as $emp_id => $notices) {
$employee = EmployeePeer::retrieveByPK($emp_id);
if ($employee) {
foreach ($notices as $notice => $expired) {
// queue an email of type $notice with this $employee's info
switch ($notice) {
case 'tb_date':
$type = 'Tb';
break;
case 'physical_date':
$type = 'Physical';
break;
}
$mailBody = $this->getPartial('employee/emailExpired' . $type, array('name' => $employee->getFullname(), 'expiration' => $expired));
$to_address = $employee->getCompanyEmail() ? $employee->getCompanyEmail() : $employee->getPersonalEmail();
$message = Swift_Message::newInstance('Expired ' . $type . ' Notice')->setFrom(array('noreply@nckidsinc.com' => 'North Country Kids, Inc.'))->setTo(array($to_address, 'm.decker@nckidsinc.com'))->setBody($mailBody, 'text/html');
// queue it up
$mailer->send($message);
$mail_count++;
}
}
}
return $this->renderText($mail_count . ' messages have been sent.');
}
示例2: executeByEmployee
public function executeByEmployee()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$c = new Criteria();
$cton1 = $c->getNewCriterion(InboxPeer::EMPLOYEE_ID, $employee_id, Criteria::IN);
$cton2 = $c->getNewCriterion(InboxPeer::TYPE, 1, Criteria::IN);
$cton1->addAnd($cton2);
$c->add($cton1);
$c->addDescendingOrderByColumn(InboxPeer::SUBJECT);
$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(), 'outbox'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'outbox');
$pager = new sfPropelPager('Inbox', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'outbox'));
$this->getUser()->setAttribute('page', $page, 'outbox');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
$this->actions = $actions;
$this->subtitle = $employee->toString();
$this->employee_id = $employee_id;
}
示例3: configure
public function configure()
{
unset($this['note_entry_id']);
$this->widgetSchema['delete'] = new sfWidgetFormInputHidden(array('default' => '0'));
$this->validatorSchema['delete'] = new sfValidatorBoolean();
$employee = EmployeePeer::retrieveByPK($this->getOption('employee_id'));
$c = new Criteria();
$c->add(AreaOfConcernPeer::JOB_ID, $employee->getJobId());
// if job_id = special instruction (7), they also need to see speech (8)
if ($employee->getJobId() == 7) {
$c->addOr(AreaOfConcernPeer::JOB_ID, 8);
}
$this->widgetSchema['area_of_concern_id']->setOption('criteria', $c);
$c = new Criteria();
$c->add(PromptPeer::ID, 44, Criteria::GREATER_EQUAL);
$this->widgetSchema['prompt_id']->setOption('criteria', $c);
$this->widgetSchema['accuracy'] = new sfWidgetFormSelect(array('choices' => EntryConcernPeer::getAccuracyChoices()));
$this->widgetSchema->setLabels(array('area_of_concern_id' => 'Area of concern', 'objective_id' => 'Objective', 'prompt_id' => 'Prompt', 'level_id' => 'Level', 'accuracy' => 'Accuracy'));
}
示例4: executeListByEmployee
public function executeListByEmployee()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$c = new Criteria();
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
$c->add(CurriculumPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
$c->addJoin(SubjectCurrPeer::CURRICULUM_ID, CurriculumPeer::ID);
$c->addDescendingOrderByColumn(SubjectCurrPeer::ID);
$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(), 'subject_curriculum'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'subject_curriculum');
$pager = new sfPropelPager('SubjectCurr', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject_curriculum'));
$this->getUser()->setAttribute('page', $page, 'subject_curriculum');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
$this->actions = $actions;
$this->subtitle = $employee->toString();
}
示例5: executeListSummary
public function executeListSummary()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$counseling_id = $this->getRequestParameter('counseling_id');
$counseling = CounselingPeer::retrieveByPK($counseling_id);
$this->forward404Unless($counseling);
$accal_id = $this->getRequestParameter('accal_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
$this->forward404Unless($academic_calendar);
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
$c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE, Criteria::EQUAL);
$this->sortStudent($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->filterStudent($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student');
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
array_unshift($actions, array('name' => 'Print Excel', 'url' => "counseling_sd/listSummaryAsCSVSD?counseling_id=" . $counseling_id . "&accal_id=" . $academic_calendar->getId() . "&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => 'Print PDF', 'url' => "counseling_sd/listSummaryAsPDF?counseling_id=" . $counseling_id . "&accal_id=" . $academic_calendar->getId() . "&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$actions2 = array(array('name' => '<span>Wali Kelas (2013)</span>', 'url' => 'counseling_sd/list?academic_calendar_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Ledger Penilaian (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sky', 'type' => 'direct'));
array_push($actions2, array('name' => '<span>Ledger Penilaian KI.1 (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Ledger Penilaian KI.2 (Ringkasan Penilaian)</span>', 'url' => 'counseling_sd/listSummary?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId(), 'color' => 'sun'));
$this->actions2 = $actions2;
## Criterria Score Rule
$ct = new Criteria();
$ct->add(ScoreRulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getDepartmentId());
$ct->add(ScoreRulePeer::CLASS_TYPE_ID, $counseling->getClassTypeId());
$ct->add(ScoreRulePeer::CURRICULUM_ID, $academic_calendar->getCurriculumId());
$ct->add(ScoreRulePeer::TYPE, ScoreRule::TYPE_TWO);
$score_rule = ScoreRulePeer::doSelectOne($ct);
$cm = new Criteria();
$cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$course_scheds = VCoursePeer::doSelect($cm);
$subject_ids = array();
foreach ($course_scheds as $course_sched) {
$subject_ids[] = $course_sched->getSubjectCurrId();
}
$cc = new Criteria();
$cc->add(ScoreRuleSubjectPeer::SUBJECT_CURR_ID, $subject_ids, Criteria::IN);
$cc->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId());
##Sort Option
$cc->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
$course_schedules = ScoreRuleSubjectPeer::doSelect($cc);
$course_count = ScoreRuleSubjectPeer::doCount($cc);
$this->course_count = $course_count;
$this->course_schedules = $course_schedules;
$this->score_rule = $score_rule;
$this->counseling = $counseling;
$this->subtitle = $academic_calendar->toString() . ' # ' . $counseling->getClassGroup()->toString();
$this->employee_id = $employee_id;
$this->academic_calendar = $academic_calendar;
}
示例6: executeListLeave
public function executeListLeave()
{
$employee_id = $this->getRequestParameter('employee_id');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$accal_id = $this->getRequestParameter('academic_calendar_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
$this->forward404Unless($academic_calendar);
$c = new Criteria();
$c->add(EmployeePermitPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN);
$c->add(EmployeePermitPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$this->sortPermit($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->filterPermit($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'employee_permit'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'employee_permit');
$pager = new sfPropelPager('EmployeePermit', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'employee_permit'));
$this->getUser()->setAttribute('page', $page, 'employee_permit');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
array_unshift($actions, array('name' => 'Print Excel', 'url' => "employee_permit_recapt/listLeaveAsCSV?{$filter_string}&employee_id=" . $employee->getId() . "&academic_calendar_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => 'Print PDF', 'url' => "employee_permit_recapt/listLeaveAsPDF?{$filter_string}&employee_id=" . $employee->getId() . "&academic_calendar_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$this->subtitle = $employee->toString();
$this->employee = $employee;
$this->academic_calendar = $academic_calendar;
$actions2 = array(array('name' => '<span>Rekap Cuti</span>', 'url' => 'employee_permit_recapt/list', 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Detail Cuti</span>', 'url' => 'employee_permit_recapt/listLeave?employee_id=' . $employee->getId() . '&academic_calendar_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
$this->actions2 = $actions2;
}
示例7: executeSave
public function executeSave()
{
$i18n = new sfI18N();
$i18n->initialize($this->getContext());
$i18n->setCulture($this->getUser()->getCulture());
$action_i18n = $i18n->globalMessageFormat->format('save as new');
$action_type = $this->getRequestParameter('action_type');
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
$class_agenda = new ClassAgenda();
} else {
$class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($class_agenda);
}
$class_agenda->setId($this->getRequestParameter('id'));
$class_agenda->setCourseScheduleId($this->getRequestParameter('course_schedule_id'));
$class_agenda->setDetail($this->getRequestParameter('detail'));
if ($this->getRequestParameter('date')) {
$class_agenda->setDate($this->getRequestParameter('date'));
}
$class_agenda->setStatus($this->getRequestParameter('status'));
$class_agenda->setSubjectGradingId($this->getRequestParameter('subject_grading_id'));
$class_agenda->setMeetingPoint($this->getRequestParameter('meeting_point'));
$class_agenda->setActionType($this->getRequestParameter('action_type'));
$class_agenda->setDay($this->getRequestParameter('day'));
if ($this->getRequestParameter('class_group_id')) {
$class_agenda->setClassGroupId($this->getRequestParameter('class_group_id'));
} else {
$cs = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_schedule_id'));
$this->forward404Unless($cs);
$class_agenda->setClassGroupId($cs->getClassGroupId());
}
$class_agenda->setDescription($this->getRequestParameter('description'));
$class_agenda->save();
#$params = array();
#foreach (explode('&', $this->getRequestParameter('student_list_ser')) as $p) {
# $p = explode('=', $p);
# $params[rawurldecode($p[0])][] = rawurldecode($p[1]);
#}
#if (array_key_exists('students', $params)) {
# foreach ($params['students'] as $su_id) {
# $student_absence = new StudentAbsence();
#
# $student_absence->setStudentId($su_id);
# $student_absence->setStart($this->getRequestParameter('date'));
# $student_absence->setEnd($this->getRequestParameter('date'));
# $student_absence->setAcademicCalendarId($class_agenda->getCourseSchedule()->getAcademicCalendarId());
# $student_absence->setClassGroupId($this->getRequestParameter('class_group_id'));
# $student_absence->save();
# }
#}
return $this->redirect('agenda/edit?id=' . $class_agenda->getId());
#return $this->forward('agenda', 'list');
#return $this->forward('agenda', 'edit?id='.$class_agenda->getId());
}
示例8: executeListElse
public function executeListElse()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$group = $this->getContext()->getUser()->getAttribute('group', null, 'bo');
if ($group == 'lector') {
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
if ($employee->getStaffTypeId() == 13 || $employee->getStaffTypeId() == 14) {
$this->can_add == 0;
$this->can_edit == 0;
$this->can_remove == 0;
}
$this->employee = $employee;
} else {
$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_edit = $acl->getEditPriv() == 1;
$this->can_remove = $acl->getRemovePriv() == 1;
}
$counseling_id = $this->getRequestParameter('counseling_id');
$counseling = CounselingPeer::retrieveByPK($counseling_id);
$this->forward404Unless($counseling);
$c = new Criteria();
$c->add(VStudentElsePeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId(), Criteria::IN);
$c->add(VStudentElsePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$c->add(VStudentElsePeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL);
$c->add(VStudentElsePeer::STATUS, Student::STATUS_OVERDUE, Criteria::NOT_EQUAL);
$this->sortElse($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->filterElse($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'else'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'else');
$pager = new sfPropelPager('VStudentElse', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'else'));
$this->getUser()->setAttribute('page', $page, 'else');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'filter', 'color' => 'white'));
$filter_string = "";
if ($this->filters) {
foreach ($this->filters as $key => $val) {
$filter_string .= "&filters[{$key}]={$val}";
}
$filter_string = preg_replace('/^&/', '', $filter_string);
}
array_unshift($actions, array('name' => 'back', 'url' => "student_finance/list", 'color' => 'black'));
array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_finance/listElseAsCSV?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_finance/listElseAsPDF?counseling_id={$counseling_id}&{$filter_string}", 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$this->counseling = $counseling;
$this->subtitle = $counseling->getAcademicCalendar()->toString() . ' # ' . $counseling->getClassGroup()->toString();
$actions2 = array(array('name' => '<span>Jurnal Pembayaran Wakaf</span>', 'url' => 'student_finance/listStudent?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
array_unshift($actions2, array('name' => '<span>Jurnal Keuangan Murid</span>', 'url' => 'student_finance/list', 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Jurnal Pembayaran Infaq</span>', 'url' => 'student_finance/listInfaq?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Jurnal Pembayaran SPP</span>', 'url' => 'student_finance/listSpp?counseling_id=' . $counseling->getId(), 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Jurnal Pembayaran Lain-lain</span>', 'url' => 'student_finance/listElse?counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct'));
$this->actions2 = $actions2;
}
示例9: executeListStudentAll
public function executeListStudentAll()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('schedule_id'));
$this->forward404Unless($schedule);
$schedule_detail = ScheduleDetailPeer::retrieveByPk($this->getRequestParameter('detail_id'));
$this->forward404Unless($schedule_detail);
$schedule_id = $schedule->getId();
$tanggal = $this->getRequestParameter('time');
$c = new Criteria();
$c->add(AbsenceEkskulPeer::SCHEDULE_ID, $schedule->getId());
$c->add(AbsenceEkskulPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId());
$c->add(AbsenceEkskulPeer::TIME, $this->getRequestParameter('time'));
$c->addJoin(StudentPeer::ID, AbsenceEkskulPeer::STUDENT_ID);
$c->addAscendingOrderByColumn(StudentPeer::NAME);
$rpp = $this->getRequestParameter('max_per_page', 999);
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array(array('name' => 'kembali', 'url' => 'course_ekskul/listAbsence?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'black'));
$this->actions = $actions;
$actions2 = array(array('name' => '<span>Peserta Ekskul</span>', 'url' => 'course_ekskul/list?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun'));
array_unshift($actions2, array('name' => '<span>Detail Jadwal Ekskul</span>', 'url' => 'course_ekskul/listDetail?id=' . $schedule->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Absensi Ekskul</span>', 'url' => 'course_ekskul/listAbsence?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun', 'type' => 'direct'));
array_push($actions2, array('name' => '<span>Penilaian Ekskul</span>', 'url' => 'course_ekskul/listScore?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId(), 'color' => 'sun'));
$this->actions2 = $actions2;
$this->subtitle = $schedule->getGradeComponent()->toString() . ' - ' . $schedule_detail->getDayString();
$cw = new Criteria();
$cw->add(AbsenceEkskulPeer::SCHEDULE_ID, $schedule->getId());
$cw->add(AbsenceEkskulPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId());
$cw->add(AbsenceEkskulPeer::TIME, $tanggal);
$absence_course = AbsenceEkskulPeer::doSelectOne($cw);
$this->absence_course = $absence_course;
$this->schedule = $schedule;
$this->schedule_detail = $schedule_detail;
$this->schedule_id = $schedule_id;
$this->employee = $employee;
$this->tanggal = $tanggal;
}
示例10: executeDeleteByEmployee
public function executeDeleteByEmployee()
{
$class_agenda = ClassAgendaPeer::retrieveByPK($this->getRequestParameter('agenda_id'));
$this->forward404Unless($class_agenda);
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$this->employee = $employee;
$student_absence = StudentAbsencePeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($student_absence);
$ref_error = 0;
foreach ($student_absence->getRefCountMethods() as $ref) {
$method = "count" . $ref['affix'];
$count = $student_absence->{$method}();
if ($count > 0) {
++$ref_error;
$this->getRequest()->setError('leave/deleteByEmployee/' . sfInflector::camelize($ref['table']), $count);
}
}
if ($ref_error > 0) {
$this->getRequest()->setError('leave/deleteByEmployee', '_ERR_DELETE_ (' . $student_absence->toString() . ' - id:' . $student_absence->getId() . ')');
} else {
$student_absence->delete();
}
return $this->redirect('leave/listByEmployee?agenda_id=' . $class_agenda->getId());
}
示例11: executeShowByStudent
public function executeShowByStudent()
{
$student_id = $this->getRequestParameter('student_id');
$student = StudentPeer::retrieveByPk($student_id);
$this->forward404Unless($student);
$employee = EmployeePeer::retrieveByPk($this->getRequestParameter('id'));
if (!$employee) {
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
}
$this->forward404Unless($employee);
$this->subtitle = $employee->toString() . ' - id:' . $employee->getId();
$c = new Criteria();
$c->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee->getId());
$employee_detail = EmployeeDetailPeer::doSelectOne($c);
$actions = array(array('name' => 'back', 'url' => 'employee/listByStudent?student_id=' . $student_id, 'color' => 'black'));
$this->actions = $actions;
$this->employee = $employee;
$this->employee_detail = $employee_detail;
}
示例12: executeUpdate
public function executeUpdate()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$i18n = new sfI18N();
$i18n->initialize($this->getContext());
$i18n->setCulture($this->getUser()->getCulture());
$action_i18n = $i18n->globalMessageFormat->format('save as new');
$action_type = $this->getRequestParameter('action_type');
if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
$schedule = new Schedule();
} else {
$schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($schedule);
}
$course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
$this->forward404Unless($course_schedule);
$schedule->setId($this->getRequestParameter('id'));
$schedule->setSubjectCurrId($course_schedule->getSubjectCurrId());
$schedule->setClassGroupId($course_schedule->getClassGroupId());
$schedule->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
$schedule->setDay($this->getRequestParameter('day'));
$schedule->setName($this->getRequestParameter('name'));
$schedule->setSemester($this->getRequestParameter('semester'));
$schedule->setKkm($this->getRequestParameter('kkm'));
$schedule->setType(1);
$schedule->setClassSessionId($this->getRequestParameter('class_session_id'));
$c = new Criteria();
$c->add(CourseScheduleTutorPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
$cst = CourseScheduleTutorPeer::doSelectOne($c);
if ($employee->getStaffTypeId() != 21) {
$schedule->setEmployeeId($this->getRequestParameter('employee_id'));
} else {
$schedule->setEmployeeId($cst->getEmployeeId());
}
#$schedule->setEmployeeId($this->getRequestParameter('employee_id'));
$schedule->setLocationId($this->getRequestParameter('location_id'));
$schedule->setGradeSpecId($this->getRequestParameter('grade_spec_id'));
$schedule->setDate($this->getRequestParameter('date'));
$schedule->setDetail($this->getRequestParameter('detail'));
$schedule->save();
/* SMS Add */
if (SF_ENVIRONMENT == 'dev') {
if ($this->getRequestParameter('send_message') == 1) {
$lekarSms = new lekarSms();
$userType = $this->getContext()->getUser()->getAttribute('usertype', '', 'bo');
$lekarSms->sendSmsCourseTest($schedule, $userType);
}
}
/* --- */
return $this->redirect('course_test/list?course_id=' . $course_schedule->getId());
}
示例13: executeListScore
public function executeListScore()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$this->employee_id = $employee_id;
$course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
$this->forward404Unless($course_schedule);
$academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
$this->forward404Unless($academic_calendar);
$course_schedule_id = $course_schedule->getId();
$cr = new Criteria();
$cr->add(GradeSpecPeer::PARENT, 1);
$this->grade1 = GradeSpecPeer::doSelect($cr);
$this->count1 = GradeSpecPeer::doCount($cr);
$cw = new Criteria();
$cw->add(GradeSpecPeer::PARENT, 7);
$this->grade2 = GradeSpecPeer::doSelect($cw);
$this->count2 = GradeSpecPeer::doCount($cw);
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
$c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
$c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student');
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$this->student_count = StudentPeer::doCount($c);
$actions = array(array('name' => 'filter', 'color' => 'white'));
array_unshift($actions, array('name' => '_AS_CSV_', 'url' => 'employee_agenda/listScoreAsCSV?course_id=' . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => '_AS_PDF_', 'url' => 'employee_agenda/listScoreAsPDF?course_id=' . $course_schedule->getId(), 'color' => 'black', 'type' => 'direct'));
array_push($actions, array());
$this->actions = $actions;
if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') {
$actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'employee_agenda/list', 'color' => 'sun'));
} else {
$actions2 = array(array('name' => '<span>' . $course_schedule->getAcademicCalendar()->getName() . '</span>', 'url' => 'employee_agenda/list2', 'color' => 'sun'));
}
array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'employee_agenda/listAgenda?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Absensi</span>', 'url' => 'employee_agenda/listAbsence?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Jadwal Tugas/Ulangan/PR</span>', 'url' => 'employee_agenda/listTest?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Penilaian</span>', 'url' => 'employee_agenda/listScore?course_id=' . $course_schedule->getId() . '&accal_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
if ($course_schedule->getClassGroup()->getParent() == 70 || $course_schedule->getClassGroup()->getParent() == 85 || $course_schedule->getClassGroup()->getParent() == 117) {
array_push($actions2, array('name' => '<span>Penilaian Tryout</span>', 'url' => 'course_detail/listTryout?course_id=' . $course_schedule->getId() . '&accal_id=' . $course_schedule->getAcademicCalendarId(), 'color' => 'sun'));
}
$this->actions2 = $actions2;
$this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - ' . $course_schedule->getClassGroup()->toString();
$this->type = 'edit';
$this->course_schedule = $course_schedule;
$this->academic_calendar = $academic_calendar;
}
示例14: executeUpdate
public function executeUpdate()
{
$i18n = new sfI18N();
$i18n->initialize($this->getContext());
$i18n->setCulture($this->getUser()->getCulture());
$action_i18n = $i18n->globalMessageFormat->format('save as new');
$action_type = $this->getRequestParameter('action_type');
if ($action_type == $action_i18n || !$this->getRequestParameter('id')) {
$employee_medical = new EmployeeMedical();
} else {
$employee_medical = EmployeeMedicalPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($employee_medical);
}
$employee_medical->setId($this->getRequestParameter('id'));
$employee_medical->setEmployeeId($this->getRequestParameter('employee_id'));
$employee = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_id'));
if ($employee) {
$cd = new Criteria();
$cd->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee->getId());
$employee_detail = EmployeeDetailPeer::doSelectOne($cd);
if ($employee_detail->getEmployeeDivisionId()) {
$employee_medical->setEmployeeDivisionId($employee_detail->getEmployeeDivisionId());
}
if ($employee->getDepartmentId()) {
$employee_medical->setDepartmentId($employee->getDepartmentId());
}
}
$employee_medical->setStaffTypeId($this->getRequestParameter('staff_type_id'));
$employee_medical->setEmployeeLevelId($this->getRequestParameter('employee_level_id'));
$employee_medical->setIllnessId($this->getRequestParameter('illness_id'));
$employee_medical->setDetailMedical($this->getRequestParameter('detail_medical'));
$employee_medical->setHospital($this->getRequestParameter('hospital'));
$employee_medical->setPatientName($this->getRequestParameter('patient_name'));
$employee_medical->setTotal($this->getRequestParameter('total'));
$employee_medical->setRelation($this->getRequestParameter('relation'));
$employee_medical->setStatus($this->getRequestParameter('status'));
$employee_medical->setMedicine($this->getRequestParameter('medicine'));
$employee_medical->setHospitalization($this->getRequestParameter('hospitalization'));
$employee_medical->setCode($this->getRequestParameter('code'));
$employee_medical->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id'));
if ($this->getRequestParameter('medical_date')) {
$employee_medical->setMedicalDate($this->getRequestParameter('medical_date'));
}
$employee_medical->save();
return $this->redirect('employee_medical/list?employee_id=' . $this->getRequestParameter('employee_id'));
}
示例15: executeListRecapt
public function executeListRecapt()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
$this->forward404Unless($course_schedule);
$this->course_schedule = $course_schedule;
$actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
#array_unshift($actions, array('name'=>'Print Excel','url'=>"course_sd/listRecaptAsCSV?course_id=".$course_schedule->getId(), 'color'=>'black', 'type'=>'direct'));
#array_unshift($actions, array('name'=>'Print PDF','url'=>"course_sd/listRecaptAsPDF?course_id=".$course_schedule->getId(), 'color'=>'black', 'type'=>'direct'));
$this->actions = $actions;
## Mengambil Kompetensi Dasar Untuk KI.3
$cur13_ki = ScoreRule::THREE;
$ct = new Criteria();
$ct->add(Cur13TermPeer::CUR13_KI_ID, $cur13_ki);
$ct->add(Cur13TermPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
$cur13_terms = Cur13TermPeer::doSelect($ct);
$cur13_term_count = Cur13TermPeer::doCount($ct);
$this->cur13_terms = $cur13_terms;
$this->cur13_term_count = $cur13_term_count;
$actions2 = array(array('name' => '<span>Penilaian 2013</span>', 'url' => 'course_sd/list?accal_id=' . $course_schedule->getAcademicCalendarId() . '&class_id=' . $course_schedule->getClassGroupId(), 'color' => 'sky'));
array_push($actions2, array('name' => '<span>Proses Nilai KI.3 (Pengetahuan)</span>', 'url' => 'course_sd/listRecapt?course_id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
array_push($actions2, array('name' => '<span>Proses Nilai KI.4 (Keterampilan)</span>', 'url' => 'course_sd/listRecaptKi4?course_id=' . $course_schedule->getId(), 'color' => 'sky'));
$this->actions2 = $actions2;
$this->subtitle = $course_schedule->getAcademicCalendar()->getName() . ' # ' . $course_schedule->getSubjectCurr()->getSubject()->getName() . ' - id:' . $course_schedule->getId();
$this->type = 'edit';
$this->cur13_ki = $cur13_ki;
$this->title = 'Proses Nilai Raport KI.3 (Pengetahuan)';
$c = new Criteria();
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
$c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
$c->add(StudentPeer::STATUS, Student::STATUS_ACTIVE);
$c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'student');
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
$this->getUser()->setAttribute('page', $page, 'student');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
## Mengambil Student Accal Id
$cm = new Criteria();
$cm->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
$cm->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
$stu_accals = StudentAccalPeer::doSelect($cm);
$student_accal_id = array();
foreach ($stu_accals as $stu_accal) {
$student_accal_id[$stu_accal->getStudentId()] = $stu_accal->getId();
}
$this->student_accal_id = $student_accal_id;
$cri = new Criteria();
$stuterms = Cur13GradeTermPeer::doSelect($cri);
$this->stuterms = $stuterms;
$grade_scale = array();
$grade_value = array();
$remark = array();
foreach ($stuterms as $stuterm) {
$grade_scale[$stuterm->getStudentAccalId() . '#' . $stuterm->getCur13TermId()] = $stuterm->getGradeScale();
$grade_value[$stuterm->getStudentAccalId() . '#' . $stuterm->getCur13TermId()] = $stuterm->getGrade();
$remark[$stuterm->getStudentAccalId() . '#' . $stuterm->getCur13TermId()] = $stuterm->getRemark();
}
$this->grade_scale = $grade_scale;
$this->grade_value = $grade_value;
$this->remark = $remark;
$ct = new Criteria();
$ct->add(GradeConversionPeer::GRADE_CONVERSION_TEMPLATE_ID, 17);
$grade_convs = GradeConversionPeer::doSelect($ct);
$descript_select = array();
foreach ($grade_convs as $grade_conv) {
$descript_select[$grade_conv->getName()] = $grade_conv->getDescription();
}
$this->descript_select = $descript_select;
}