예제 #1
0
     $hour_come = $employee_regulation->getCome('H');
     $out_come = $employee_regulation->getHome();
     $minute_home = $employee_regulation->getHome('i');
     $hour_home = $employee_regulation->getHome('H');
 } elseif (array_key_exists($academic_calendar->getParent() . '#' . $employee->getStaffTypeId(), $types)) {
     $id_reg = $types[$academic_calendar->getParent() . '#' . $employee->getStaffTypeId()];
     $employee_regulation = EmployeeRegulationPeer::retrieveByPK($id_reg);
     $in_come = $employee_regulation->getCome();
     $minute_come = $employee_regulation->getCome('i');
     $hour_come = $employee_regulation->getCome('H');
     $out_come = $employee_regulation->getHome();
     $minute_home = $employee_regulation->getHome('i');
     $hour_home = $employee_regulation->getHome('H');
 } elseif (array_key_exists($academic_calendar->getParent() . '#' . $employee->getStaffType()->getGroups(), $groups)) {
     $id_reg = $groups[$academic_calendar->getParent() . '#' . $employee->getStaffType()->getGroups()];
     $employee_regulation = EmployeeRegulationPeer::retrieveByPK($id_reg);
     $in_come = $employee_regulation->getCome();
     $minute_come = $employee_regulation->getCome('i');
     $hour_come = $employee_regulation->getCome('H');
     $out_come = $employee_regulation->getHome();
     $minute_home = $employee_regulation->getHome('i');
     $hour_home = $employee_regulation->getHome('H');
 } else {
     $in_come = "07:05:00";
     $minute_come = "05";
     $hour_come = "07";
     $out_come = "16:05:00";
     $minute_come = "05";
     $hour_come = "16";
 }
 ?>
예제 #2
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = EmployeeRegulationPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setStaffTypeId($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setEmployeeLevelId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setAcademicCalendarId($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setRegulationType($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setAmountSubsidy($arr[$keys[5]]);
     }
     if (array_key_exists($keys[6], $arr)) {
         $this->setTotalLeave($arr[$keys[6]]);
     }
     if (array_key_exists($keys[7], $arr)) {
         $this->setIsSubsidy($arr[$keys[7]]);
     }
     if (array_key_exists($keys[8], $arr)) {
         $this->setDetailRegulation($arr[$keys[8]]);
     }
     if (array_key_exists($keys[9], $arr)) {
         $this->setGroups($arr[$keys[9]]);
     }
     if (array_key_exists($keys[10], $arr)) {
         $this->setCome($arr[$keys[10]]);
     }
     if (array_key_exists($keys[11], $arr)) {
         $this->setHome($arr[$keys[11]]);
     }
     if (array_key_exists($keys[12], $arr)) {
         $this->setMaxLate($arr[$keys[12]]);
     }
 }
예제 #3
0
 public function executeDelete()
 {
     $employee_regulation = EmployeeRegulationPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($employee_regulation);
     $ref_error = 0;
     foreach ($employee_regulation->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $employee_regulation->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('employee_regulation/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('employee_regulation/delete', '_ERR_DELETE_ (' . $employee_regulation->toString() . ' - id:' . $employee_regulation->getId() . ')');
     } else {
         $employee_regulation->delete();
     }
     return $this->redirect('employee_regulation/list');
 }
예제 #4
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(EmployeeRegulationPeer::ID, $pks, Criteria::IN);
         $objs = EmployeeRegulationPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
예제 #5
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $cd = new Criteria();
     $cd->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($cd);
     $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;
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(EmployeePeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addJoin(VEmployeeMedicalPeer::EMPLOYEE_ID, EmployeePeer::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(), 'emp_medical'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'emp_medical');
     $pager = new sfPropelPager('VEmployeeMedical', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'emp_medical'));
     $this->getUser()->setAttribute('page', $page, 'emp_medical');
     $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_medical_recapt/listAsCSV?{$filter_string}", 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "employee_medical_recapt/listAsPDF?{$filter_string}", 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $this->subtitle = '';
     $cli = new Criteria();
     $cli->add(EmployeeRegulationPeer::REGULATION_TYPE, EmployeeRegulation::MEDICAL);
     $employ_regulations = EmployeeRegulationPeer::doSelect($cli);
     $accals = array();
     $levels = array();
     $groups = array();
     $types = array();
     $alls = array();
     foreach ($employ_regulations as $emp_reg) {
         $accals[$emp_reg->getAcademicCalendarId()] = $emp_reg->getAmountSubsidy();
         $levels[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getEmployeeLevelId()] = $emp_reg->getAmountSubsidy();
         $groups[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getGroups()] = $emp_reg->getAmountSubsidy();
         $types[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getStaffTypeId()] = $emp_reg->getAmountSubsidy();
         $alls[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getStaffTypeId() . '#' . $emp_reg->getEmployeeLevelId() . '#' . $emp_reg->getGroups()] = $emp_reg->getAmountSubsidy();
     }
     $this->employ_regulations = $employ_regulations;
     $this->alls = $alls;
     $this->accals = $accals;
     $this->levels = $levels;
     $this->groups = $groups;
     $this->types = $types;
 }
예제 #6
0
 public function getEmployeeRegulations($criteria = null, $con = null)
 {
     include_once 'lib/model/om/BaseEmployeeRegulationPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     if ($this->collEmployeeRegulations === null) {
         if ($this->isNew()) {
             $this->collEmployeeRegulations = array();
         } else {
             $criteria->add(EmployeeRegulationPeer::EMPLOYEE_LEVEL_ID, $this->getId());
             EmployeeRegulationPeer::addSelectColumns($criteria);
             $this->collEmployeeRegulations = EmployeeRegulationPeer::doSelect($criteria, $con);
         }
     } else {
         if (!$this->isNew()) {
             $criteria->add(EmployeeRegulationPeer::EMPLOYEE_LEVEL_ID, $this->getId());
             EmployeeRegulationPeer::addSelectColumns($criteria);
             if (!isset($this->lastEmployeeRegulationCriteria) || !$this->lastEmployeeRegulationCriteria->equals($criteria)) {
                 $this->collEmployeeRegulations = EmployeeRegulationPeer::doSelect($criteria, $con);
             }
         }
     }
     $this->lastEmployeeRegulationCriteria = $criteria;
     return $this->collEmployeeRegulations;
 }
예제 #7
0
 public function executePrintAbsenceXLS()
 {
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $this->forward404Unless($academic_calendar);
     $department_id = $this->getRequestParameter('department_id');
     $department = DepartmentPeer::retrieveByPK($department_id);
     $this->forward404Unless($department);
     $month_id = $this->getRequestParameter('month_id');
     $month = MonthPeer::retrieveByPK($month_id);
     $this->forward404Unless($month);
     $tgl_absen1 = $this->getRequestParameter('tgl_absen1');
     $tgl_absen2 = $this->getRequestParameter('tgl_absen2');
     $time = $this->getRequestParameter('time');
     $time2 = $this->getRequestParameter('time2');
     $tgl_cetak = $this->getRequestParameter('tgl_cetak');
     $cr = new Criteria();
     $cr->add(TempTablePeer::COUNSELING_ID, $academic_calendar->getId());
     $cr->add(TempTablePeer::STUDENT_ID, $department->getId());
     $cr->add(TempTablePeer::TIME, $time);
     $cr->addJoin(EmployeePeer::ID, TempTablePeer::EMPLOYEE_ID);
     $cr->addAscendingOrderByColumn(EmployeePeer::ID);
     $employees = EmployeePeer::doSelect($cr);
     $this->academic_calendar = $academic_calendar;
     $this->department = $department;
     $this->time = $time;
     $this->time2 = $time2;
     $this->tgl_cetak = $tgl_cetak;
     $this->tgl_absen1 = $tgl_absen1;
     $this->tgl_absen2 = $tgl_absen2;
     $this->employees = $employees;
     $this->month = $month;
     $cli = new Criteria();
     $cli->add(EmployeeRegulationPeer::REGULATION_TYPE, EmployeeRegulation::ABSENCE);
     $employ_regulations = EmployeeRegulationPeer::doSelect($cli);
     $groups = array();
     $types = array();
     $alls = array();
     foreach ($employ_regulations as $emp_reg) {
         $groups[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getGroups()] = $emp_reg->getId();
         $types[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getStaffTypeId()] = $emp_reg->getId();
         $alls[$emp_reg->getAcademicCalendarId() . '#' . $emp_reg->getStaffTypeId() . '#' . $emp_reg->getGroups()] = $emp_reg->getId();
     }
     $this->employ_regulations = $employ_regulations;
     $this->alls = $alls;
     $this->groups = $groups;
     $this->types = $types;
     $this->setLayout(false);
     $this->getResponse()->setHttpHeader('Content-Type', 'application/vnd-ms-excel');
     $this->getResponse()->setHttpHeader('Content-Disposition', 'attachment; filename="' . $this->getModuleName() . '.xls"');
 }
예제 #8
0
    ?>
                                    <tr class="list"><td colspan="100"><div class="no_record"><?php 
    echo __('No record found');
    ?>
</div></td></tr>
                            <?php 
} else {
    ?>
                                    <?php 
    $i = 0;
    foreach ($pager->getResults() as $employee_regulation) {
        $c = new Criteria();
        $c->add(EmployeeRegulationPeer::ACADEMIC_CALENDAR_ID, $employee_regulation->getAcademicCalendarId());
        $c->add(EmployeeRegulationPeer::GROUPS, $employee_regulation->getGroups());
        $c->add(EmployeeRegulationPeer::REGULATION_TYPE, $employee_regulation->getRegulationType());
        $employee_regulation->child = EmployeeRegulationPeer::doCount($c);
        ?>
                                            <tr id='cs_<?php 
        echo $employee_regulation->getId();
        ?>
' class="list<?php 
        ++$i;
        if ($i % 2 == 0) {
            echo ' even';
        }
        ?>
">
                                                    <td id='cs_<?php 
        echo $employee_regulation->getId();
        ?>
_expand' style="vertical-align: middle; text-align: center;">