Ejemplo n.º 1
0
 /**
  *
  * @param int $id
  * @return Zend_Db_Table_Rowset
  */
 public function listInstitute($id)
 {
     $mapperEducationInstitue = new Register_Model_Mapper_EducationInstitute();
     $select = $mapperEducationInstitue->getSelectEducationInstitute();
     $dbGroupContact = App_Model_DbTable_Factory::get('SmsGroupContact');
     $select->join(array('gc' => $dbGroupContact), 'gc.fk_id_fefpeduinstitution = ei.id_fefpeduinstitution', array())->where('gc.fk_id_sms_group = ?', $id);
     return $dbGroupContact->fetchAll($select);
 }
Ejemplo n.º 2
0
 /**
  * 
  * @return Zend_Db_Table_Rowset
  */
 public function listInstitutes()
 {
     $mapperInstitute = new Register_Model_Mapper_EducationInstitute();
     $select = $mapperInstitute->getSelectEducationInstitute();
     $dbFeContract = App_Model_DbTable_Factory::get('FEContract');
     $select->join(array('fec' => $dbFeContract), 'fec.fk_id_fefpeduinstitution = ei.id_fefpeduinstitution', array());
     return $dbFeContract->fetchAll($select);
 }
Ejemplo n.º 3
0
 /**
  * 
  * @return Zend_Db_Select
  */
 public function getSelect()
 {
     $dbAnnualPlanning = App_Model_DbTable_Factory::get('FPAnnualPlanning');
     $dbPlanningCourse = App_Model_DbTable_Factory::get('FPPlanningCourse');
     $dbPerScholarity = App_Model_DbTable_Factory::get('PerScholarity');
     $mapperInstitute = new Register_Model_Mapper_EducationInstitute();
     $select = $mapperInstitute->getSelectEducationInstitute();
     $select->reset(Zend_Db_Select::GROUP);
     $select->join(array('ap' => $dbAnnualPlanning), 'ap.fk_id_fefpeduinstitution = ei.id_fefpeduinstitution', array('id_annual_planning', 'year_planning', 'total_students', 'total_cost'))->join(array('pc' => $dbPlanningCourse), 'pc.fk_id_annual_planning = ap.id_annual_planning', array('id_planning_course', 'date_start', 'date_finish', 'total_man', 'total_woman', 'students_course' => 'total_students', 'cost_course' => 'total_cost', 'fk_id_fefpstudentclass'))->join(array('ps' => $dbPerScholarity), 'pc.fk_id_perscholarity = ps.id_perscholarity', array('id_perscholarity', 'scholarity', 'external_code', 'category'))->group(array('pc.id_planning_course'))->order(array('ap.year_planning DESC', 'pc.date_start'));
     return $select;
 }
Ejemplo n.º 4
0
 /**
  * 
  * @param int $id
  * @return Zend_Db_Table_Rowset
  */
 public function listEntities($id)
 {
     $dbRegistratonEntity = App_Model_DbTable_Factory::get('FERegistrationEntity');
     $mapperEduInstitute = new Register_Model_Mapper_EducationInstitute();
     $selectEduInstitute = $mapperEduInstitute->getSelectEducationInstitute();
     $mapperEnterprise = new Register_Model_Mapper_Enterprise();
     $selectEnterprise = $mapperEnterprise->getSelectEnterprise();
     $select = $dbRegistratonEntity->select()->from(array('re' => $dbRegistratonEntity))->setIntegrityCheck(false)->joinLeft(array('ee' => new Zend_Db_Expr('(' . $selectEnterprise . ')')), 'ee.id_fefpenterprise = re.fk_id_fefpenterprise', array())->joinLeft(array('ei' => new Zend_Db_Expr('(' . $selectEduInstitute . ')')), 'ei.id_fefpeduinstitution = re.fk_id_fefpeduinstitution', array('type' => "IF(re.fk_id_fefpenterprise, 'enterprise', 'institute')", 'id' => 'IFNULL(re.fk_id_fefpenterprise, re.fk_id_fefpeduinstitution)', 'name' => 'IFNULL(ee.enterprise_name, ei.institution)'))->where('re.fk_id_fe_registration = ?', $id)->where('IFNULL(re.fk_id_fefpenterprise, re.fk_id_fefpeduinstitution) IS NOT NULL');
     return $dbRegistratonEntity->fetchAll($select);
 }