Esempio n. 1
0
 /**
  * Executes index action
  *
  * @param sfWebRequest $request
  */
 public function executeIndex(sfWebRequest $request)
 {
     $this->filter = new PropertyFormFilter();
     //$this->property_list = PropertyPeer::doSelect(new Criteria());
     $this->sort = $this->getRequestParameter('sort');
     $this->sort_type = $this->getRequestParameter('sort_type');
     $criteria = new Criteria();
     if (!is_null($this->sort)) {
         if (!is_null($this->sort_type) && $this->sort_type == 'desc') {
             $criteria->addDescendingOrderByColumn(PropertyPeer::$this->sort);
         } elseif (!is_null($this->sort_type) && $this->sort_type == 'asc') {
             $criteria->addAscendingOrderByColumn(PropertyPeer::$this->sort);
         }
     }
     if ($request->hasParameter('property_filters')) {
         $property_filters = $request->getParameter('property_filters');
         $this->filter->bind($property_filters);
         if ($this->filter->isValid()) {
             !empty($property_filters['municipality']['text']) ? $criteria->add(PropertyPeer::MUNICIPALITY, "%" . $property_filters['municipality']['text'] . "%", Criteria::LIKE) : null;
             !empty($property_filters['offer_id']) ? $criteria->add(PropertyPeer::OFFER_ID, $property_filters['offer_id']) : null;
             !empty($property_filters['type_id']) ? $criteria->add(PropertyPeer::TYPE_ID, $property_filters['type_id']) : null;
             !empty($property_filters['typology_id']) ? $criteria->add(PropertyPeer::TYPOLOGY_ID, $property_filters['typology_id']) : null;
             !empty($property_filters['state_id']) ? $criteria->add(PropertyPeer::STATE_ID, $property_filters['state_id']) : null;
             !empty($property_filters['price']['text']) ? $criteria->add(PropertyPeer::PRICE, $property_filters['price']['text'], Criteria::LESS_EQUAL) : null;
         }
     }
     $pager = new sfPropelPager('Property', sfConfig::get('app_max_propertyes_list', 20));
     $pager->setPeerMethod('doSelectJoinAll');
     $pager->setCriteria($criteria);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
 }
Esempio n. 2
0
 public function executeList(Criteria $crit = null)
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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;
     if ($crit == null) {
         $crit = new Criteria();
     }
     $this->sort($crit);
     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($crit, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), ' payment_journal_s'));
     $this->getUser()->setAttribute('max_per_page', $rpp, ' payment_journal_s');
     $pager = new sfPropelPager('PaymentJournal', $rpp);
     $pager->setCriteria($crit);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, ' payment_journal_s'));
     $this->getUser()->setAttribute('page', $page, ' payment_journal_s');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => ' payment_journal_s/create', 'color' => 'green'));
     }
     array_unshift($actions, array('name' => '_AS_CSV_', 'url' => ' payment_journal_s/listAsCSV', 'color' => 'white', 'type' => 'direct'));
     array_unshift($actions, array('name' => '_AS_PDF_', 'url' => ' payment_journal_s/listAsPDF', 'color' => 'white', 'type' => 'direct'));
     $this->actions = $actions;
     $this->subtitle = '';
     $this->byStudent = true;
 }
Esempio n. 3
0
 public static function getPager($max = 10, $page = 1, $fbo_name = null, $discount = null, $default = null, $ident = null, $name = null, $city = null, $state = null)
 {
     $c = new Criteria();
     $c->addJoin(self::AIRPORT_ID, AirportPeer::ID);
     if ($fbo_name) {
         $c->add(self::NAME, '%' . $fbo_name . '%', Criteria::LIKE);
     }
     if ($discount) {
         $c->add(self::FUEL_DISCOUNT, '%' . $discount . '%', Criteria::LIKE);
     }
     if ($default) {
         $c->add(self::FUEL_DISCOUNT, '%' . $discount . '%', Criteria::LIKE);
     }
     if ($ident) {
         $c->add(AirportPeer::IDENT, $ident . '%', Criteria::LIKE);
     }
     if ($name) {
         $c->add(AirportPeer::NAME, $name . '%', Criteria::LIKE);
     }
     if ($city) {
         $c->add(AirportPeer::CITY, $city . '%', Criteria::LIKE);
     }
     if ($state) {
         $c->add(AirportPeer::STATE, $state . '%', Criteria::LIKE);
     }
     $c->addAscendingOrderByColumn(self::NAME);
     $pager = new sfPropelPager('Fbo', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
 static function doSearch($TEXT, $idS = 1, $page = 1)
 {
     $C = new Criteria();
     $C = AgendatelefonicaPeer::getCriteriaActiu($C, $idS);
     $PARAULES = explode(" ", $TEXT);
     $PAR2 = array();
     foreach ($PARAULES as $P) {
         if (strlen($P) > 2) {
             $PAR2[] = trim($P);
         }
     }
     foreach ($PAR2 as $P) {
         $text1Criterion = $C->getNewCriterion(AgendatelefonicaPeer::NOM, '%' . $P . '%', CRITERIA::LIKE);
         $text2Criterion = $C->getNewCriterion(AgendatelefonicaPeer::TAGS, '%' . $P . '%', CRITERIA::LIKE);
         $text3Criterion = $C->getNewCriterion(AgendatelefonicaPeer::ENTITAT, '%' . $P . '%', CRITERIA::LIKE);
         $text1Criterion->addOr($text2Criterion);
         $text1Criterion->addOr($text3Criterion);
         $C->add($text1Criterion);
     }
     $C->add(AgendatelefonicaPeer::SITE_ID, $idS);
     $C->addGroupByColumn(AgendatelefonicaPeer::AGENDATELEFONICAID);
     $C->addAscendingOrderByColumn(AgendatelefonicaPeer::NOM);
     $pager = new sfPropelPager('Agendatelefonica', 20);
     $pager->setCriteria($C);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
Esempio n. 5
0
 /**
  * Displays either the inbox or outbox
  */
 public function executeList()
 {
     if ($this->getRequestParameter('folder') == 'outbox') {
         //Grab all sent messages
         $c = PrivateMessagePeer::getCriteriaForSentToUser($this->getUser()->getRaykuUserId());
         //Name of the partial to use for each message
         $this->messageRowPartialName = 'message_row_outbox';
         //Name the URL for the pager
         $url = '@outbox';
     } else {
         //Grab all recieved messages
         $c = PrivateMessagePeer::getCriteriaForRecievedByUser($this->getUser()->getRaykuUserId());
         //Name of the partial to use for each message
         $this->messageRowPartialName = 'message_row_inbox';
         //Name the URL for the pager
         $url = '@inbox';
     }
     //Setup the pager
     $pager = new sfPropelPager('PrivateMessage', sfConfig::get('app_messages_messages_per_page', 10));
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->raykuPager = new RaykuPagerRenderer($pager);
     $this->raykuPager->setBaseUrl($url);
 }
Esempio n. 6
0
 public static function getPager($max = 10, $page = 1, Criteria $c)
 {
     /*$c = new Criteria();
     
             $c->addJoin(self::LETTER_ID, EmailLetterPeer::alias('letter', EmailLetterPeer::ID), Criteria::LEFT_JOIN);
     
             //person
             $c->addAlias('letter', EmailLetterPeer::TABLE_NAME);
     
             if ($subject)
                 $c->add(EmailLetterPeer::SUBJECT, $subject . '%', Criteria::LIKE);
     
             if ($priority)
                 $c->add(self::PRIORITY, $priority . '%', Criteria::LIKE);
     
     
             if ($request_date) {
                 $c->add(self::REQUEST_DATE, date('Y-m-d H:i', strtotime($request_date)) . ':00', Criteria::EQUAL);
             } elseif ($send_date) {
                 $c->add(self::SEND_DATE, date('Y-m-d H:i', strtotime($send_date)) . ':00', Criteria::EQUAL);
             }*/
     //self::addSelectColumns($c);
     //$c->addAscendingOrderByColumn('request_date');
     $pager = new sfPropelPager('EmailQueue', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
Esempio n. 7
0
 public static function getPager($max = 10, $page = 1, $firstname = null, $lastname = null, $city = null, $state = null, $country = null, $coor_of_week = null)
 {
     $c = new Criteria();
     $c->addJoin(self::MEMBER_ID, MemberPeer::ID);
     $c->addJoin(PersonPeer::ID, MemberPeer::PERSON_ID);
     if ($firstname) {
         $c->add(PersonPeer::FIRST_NAME, $firstname . '%', Criteria::LIKE);
     }
     if ($lastname) {
         $c->add(PersonPeer::LAST_NAME, $lastname . '%', Criteria::LIKE);
     }
     if ($city) {
         $c->add(PersonPeer::CITY, $city . '%', Criteria::LIKE);
     }
     if ($state) {
         $c->add(PersonPeer::STATE, $state . '%', Criteria::LIKE);
     }
     if ($country) {
         $c->add(PersonPeer::COUNTRY, $country . '%', Criteria::LIKE);
     }
     if ($coor_of_week) {
         $c->add(self::COOR_OF_THE_WEEK, $coor_of_week . '%', Criteria::LIKE);
     }
     $c->addAscendingOrderByColumn(PersonPeer::FIRST_NAME);
     $pager = new sfPropelPager('Coordinator', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
Esempio n. 8
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $ct = new Criteria();
     $ct->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($ct);
     $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();
     $c->add(GradeSpecPeer::TYPE_SPEC, GradeSpec::OTHERS, Criteria::NOT_EQUAL);
     $c->add(GradeSpecPeer::PARENT, 0, Criteria::IN);
     $this->sort($c);
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'grade_spec'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'grade_spec');
     $pager = new sfPropelPager('GradeSpec', $rpp);
     #$pager->setPeerMethod('doSelectOrdered');
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'grade_spec'));
     $this->getUser()->setAttribute('page', $page, 'grade_spec');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array();
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'grade_spec_new/create', 'color' => 'black'));
     }
     $this->actions = $actions;
     $this->subtitle = '';
 }
Esempio n. 9
0
 static function doSearch($TEXT, $PAGE, $ACCIO, $idS)
 {
     $C = new Criteria();
     $C = self::getCriteriaActiu($C, $idS);
     $PARAULES = explode(" ", $TEXT);
     $PAR2 = array();
     foreach ($PARAULES as $P) {
         if (strlen($P) > 2) {
             $PAR2[] = trim($P);
         }
     }
     foreach ($PAR2 as $P) {
         $text1Criterion = $C->getNewCriterion(MissatgesPeer::TITOL, '%' . $P . '%', CRITERIA::LIKE);
         $text2Criterion = $C->getNewCriterion(MissatgesPeer::TEXT, '%' . $P . '%', CRITERIA::LIKE);
         $text1Criterion->addOr($text2Criterion);
         $C->add($text1Criterion);
     }
     $C->addGroupByColumn(MissatgesPeer::MISSATGEID);
     $C->addDescendingOrderByColumn(self::PUBLICACIO);
     $C->addDescendingOrderByColumn(self::MISSATGEID);
     if ($ACCIO != 'SF') {
         $C->add(MissatgesPeer::PUBLICACIO, date('Y-m-d', time()), CRITERIA::LESS_EQUAL);
     } else {
         $C->add(MissatgesPeer::PUBLICACIO, date('Y-m-d', time()), CRITERIA::GREATER_THAN);
     }
     $pager = new sfPropelPager('Missatges', 20);
     $pager->setCriteria($C);
     $pager->setPage($PAGE);
     $pager->init();
     return $pager;
 }
Esempio n. 10
0
 public static function getPager($max = 10, $page = 1, $firstname = null, $lastname = null, $city = null, $state = null, $agency_name = null)
 {
     $c = new Criteria();
     $c->addJoin(PersonPeer::ID, self::PERSON_ID);
     $c->addJoin(self::AGENCY_ID, AgencyPeer::ID);
     if ($firstname) {
         $c->add(PersonPeer::FIRST_NAME, $firstname . '%', Criteria::LIKE);
     }
     if ($lastname) {
         $c->add(PersonPeer::LAST_NAME, $lastname . '%', Criteria::LIKE);
     }
     if ($city) {
         $c->add(PersonPeer::CITY, $city . '%', Criteria::LIKE);
     }
     if ($state) {
         $c->add(PersonPeer::STATE, $state . '%', Criteria::LIKE);
     }
     if ($agency_name) {
         $c->add(AgencyPeer::NAME, $agency_name . '%', Criteria::LIKE);
     }
     $c->addAscendingOrderByColumn(PersonPeer::FIRST_NAME);
     $pager = new sfPropelPager('Requester', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
Esempio n. 11
0
 public function executeIndex(sfWebRequest $request)
 {
     //get request parameters
     $this->selectedBrand = $this->getRequestParameter('brand');
     $this->selectedSeries = $this->getRequestParameter('series');
     $this->selectedModel = $this->getRequestParameter('model');
     $cConfig = new Criteria();
     $cConfig->addJoin(ConfigPeer::MODEL_ID, ModelPeer::ID);
     $cConfig->addJoin(ModelPeer::SERIES_ID, SeriesPeer::ID);
     $cConfig->addJoin(SeriesPeer::BRAND_ID, BrandPeer::ID);
     if ($this->selectedBrand) {
         $cConfig->add(BrandPeer::ID, $this->selectedBrand);
     }
     if ($this->selectedSeries) {
         $cConfig->add(SeriesPeer::SERIES_NAME, $this->selectedSeries, Criteria::LIKE);
     }
     if ($this->selectedModel) {
         $cConfig->add(ModelPeer::MODEL_NAME, $this->selectedModel, Criteria::LIKE);
     }
     //$this->Configs = ConfigPeer::doSelect($cConfig);
     //paginatiom
     $pager = new sfPropelPager('Config', 15);
     $pager->setCriteria($cConfig);
     $pager->setPage($this->getRequestParameter('page'));
     $pager->init();
     $this->pager = $pager;
     //get config columns
     $c = new Criteria();
     $c->addDescendingOrderByColumn(ConfigFieldCategoryPeer::WEIGHT);
     $this->configFieldCategories = ConfigFieldCategoryPeer::doSelect($c);
     //get brands
     $cBrand = new Criteria();
     $this->brands = BrandPeer::doSelect($cBrand);
 }
Esempio n. 12
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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;
     $c = new Criteria();
     $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(), 'academic_cost_component'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'academic_cost_component');
     $pager = new sfPropelPager('AcademicCostComponent', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'academic_cost_component'));
     $this->getUser()->setAttribute('page', $page, 'academic_cost_component');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'academic_cost_component/create', 'color' => 'black'));
     }
     $this->actions = $actions;
     $cw = new Criteria();
     $cw->add(JobPeer::PARENT, $job->getId());
     $modules = JobPeer::doSelect($cw);
     $this->modules = $modules;
     $actions2 = array(array('name' => '<span>Komponen Biaya Sekolah</span>', 'url' => $job->getCode(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }
Esempio n. 13
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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;
     $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
     $this->forward404Unless($student);
     $this->student = $student;
     $c = new Criteria();
     $c->add(StudentLeavePeer::STUDENT_ID, $student->getId());
     $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(), 'student_leave_by_student'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'student_leave_by_student');
     $pager = new sfPropelPager('StudentLeave', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student_leave_by_student'));
     $this->getUser()->setAttribute('page', $page, 'student_leave_by_student');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'student_leave_by_student/create?student_id=' . $student->getId(), 'color' => 'green'));
     }
     array_unshift($actions, array('type' => 'direct', 'name' => 'paymentSlip', 'url' => 'student_leave_by_student/paymentSlip?student_id=' . $student->getId(), 'color' => 'white'));
     $this->actions = $actions;
     $this->subtitle = $student->toString();
 }
Esempio n. 14
0
 public static function getPager($max = 10, $page = 1, $camp_name = null, $agency_name = null, $agency_city = null, $agency_state = null, $agency_country = null, $airport_ident = null, $airport_city = null, $airport_state = null)
 {
     $c = new Criteria();
     $c->addJoin(self::AGENCY_ID, AgencyPeer::ID, Criteria::LEFT_JOIN);
     $c->addJoin(self::AIRPORT_ID, AirportPeer::ID, Criteria::LEFT_JOIN);
     if ($camp_name) {
         $c->add(self::CAMP_NAME, $camp_name . '%', Criteria::LIKE);
     }
     if ($agency_name) {
         $c->add(AgencyPeer::NAME, $agency_name . '%', Criteria::LIKE);
     }
     if ($agency_city) {
         $c->add(AgencyPeer::CITY, $agency_city . '%', Criteria::LIKE);
     }
     if ($agency_state) {
         $c->add(AgencyPeer::STATE, $agency_state . '%', Criteria::LIKE);
     }
     if ($airport_ident) {
         $c->add(AirportPeer::IDENT, $airport_ident . '%', Criteria::LIKE);
     }
     if ($airport_city) {
         $c->add(AirportPeer::CITY, $airport_city . '%', Criteria::LIKE);
     }
     if ($airport_state) {
         $c->add(AirportPeer::STATE, $airport_state . '%', Criteria::LIKE);
     }
     $c->addAscendingOrderByColumn(self::CAMP_NAME);
     $pager = new sfPropelPager('Camp', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
Esempio n. 15
0
 public static function getPager($max = 10, $page = 1, $ident = null, $name = null, $city = null, $state = null, $wing_name = null, $closed = null)
 {
     $c = new Criteria();
     $c->addJoin(self::WING_ID, WingPeer::ID, Criteria::LEFT_JOIN);
     if ($ident) {
         $c->add(self::IDENT, $ident . '%', Criteria::LIKE);
     }
     if ($name) {
         $c->add(self::NAME, $name . '%', Criteria::LIKE);
     }
     if ($city) {
         $c->add(self::CITY, $city . '%', Criteria::LIKE);
     }
     if ($state) {
         $c->add(self::STATE, $state . '%', Criteria::LIKE);
     }
     if ($wing_name) {
         $c->add(WingPeer::NAME, $wing_name . '%', Criteria::LIKE);
     }
     if ($closed) {
         $c->add(self::CLOSED, $closed . '%', Criteria::LIKE);
     }
     self::addSelectColumns($c);
     $c->addAsColumn("fbos", "(Select COUNT(a.id) from fbo as f, airport as a where f.airport_id = a.id and a.id = " . self::ID . " group by a.id)");
     $c->addAscendingOrderByColumn(self::IDENT);
     $pager = new sfPropelPager('Airport', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
Esempio n. 16
0
 public static function getPager($max = 10, $page = 1, $date_req = null, $pass_name = null, $req_name = null, $pass_lname = null, $req_lname = null)
 {
     $c = new Criteria();
     $c->addJoin(self::PASSENGER_ID, PassengerPeer::ID, Criteria::LEFT_JOIN);
     $c->addJoin(self::REQUESTER_ID, RequesterPeer::ID, Criteria::LEFT_JOIN);
     $c->addJoin(PassengerPeer::PERSON_ID, PersonPeer::alias('c1', PersonPeer::ID), Criteria::LEFT_JOIN);
     $c->addJoin(RequesterPeer::PERSON_ID, PersonPeer::alias('c2', PersonPeer::ID), Criteria::LEFT_JOIN);
     $c->addAlias('c1', PersonPeer::TABLE_NAME);
     $c->addAlias('c2', PersonPeer::TABLE_NAME);
     if ($date_req) {
         $c->add(self::DATE_REQUESTED, '%' . date('Y-m-d', strtotime($date_req)) . '%', Criteria::LIKE);
     }
     if ($pass_name) {
         $c->add(PersonPeer::alias("c1", PersonPeer::FIRST_NAME), $pass_name . '%', Criteria::LIKE);
     }
     if ($req_name) {
         $c->add(PersonPeer::alias("c2", PersonPeer::FIRST_NAME), $req_name . '%', Criteria::LIKE);
     }
     if ($pass_lname) {
         $c->add(PersonPeer::alias("c1", PersonPeer::LAST_NAME), $pass_lname . '%', Criteria::LIKE);
     }
     if ($req_lname) {
         $c->add(PersonPeer::alias("c2", PersonPeer::LAST_NAME), $req_lname . '%', Criteria::LIKE);
     }
     $c->addAscendingOrderByColumn(self::DATE_REQUESTED);
     $pager = new sfPropelPager('Itinerary', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
Esempio n. 17
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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;
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addJoin(StudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     // filter out graduated alumni
     $cton1 = $c->getNewCriterion(StudentPeer::STATUS, Student::STATUS_GRADUATE, Criteria::EQUAL);
     $cton2 = $c->getNewCriterion(StudentPeer::STATUS, Student::STATUS_OVERDUE, Criteria::EQUAL);
     $cton1->addOr($cton2);
     $c->add($cton1);
     $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(), 'alumni'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'alumni');
     $pager = new sfPropelPager('Student', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'alumni'));
     $this->getUser()->setAttribute('page', $page, 'student');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     #if ($acl->getAddPriv()) array_unshift($actions, array('name'=>'add','url'=>'student/create', 'color'=>'green'));
     $this->actions = $actions;
 }
Esempio n. 18
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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;
     $accal_id = $this->getRequestParameter('accal_id');
     $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($accal);
     $this->accal = $accal;
     $c = new Criteria();
     $c->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $accal_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_accal_s'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'subject_accal_s');
     $pager = new sfPropelPager('SubjectAccal', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject_accal_s'));
     $this->getUser()->setAttribute('page', $page, 'subject_accal_s');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'subject_accal_s/create?accal_id=' . $accal_id, 'color' => 'green'));
     }
     $this->actions = $actions;
 }
Esempio n. 19
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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;
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(CurriculumPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addJoin(StudentPeer::CURRICULUM_ID, CurriculumPeer::ID);
     $c->addJoin(ComprehensiveExamPeer::STUDENT_ID, StudentPeer::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(), 'comprehensive_exam'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'comprehensive_exam');
     $pager = new sfPropelPager('ComprehensiveExam', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'comprehensive_exam'));
     $this->getUser()->setAttribute('page', $page, 'comprehensive_exam');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'comprehensive_exam/create', 'color' => 'green'));
     }
     $this->actions = $actions;
 }
Esempio n. 20
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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;
     $c = new Criteria();
     if (!$this->getRequest()->getParameter('sort') && !$this->getUser()->getAttribute('sort_field', null, 'sm_outgoing')) {
         $c->addDescendingOrderByColumn(SmOutgoingPeer::OUTGOING_DATE);
     }
     $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(), 'sm_outgoing'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'sm_outgoing');
     $pager = new sfPropelPager('SmOutgoing', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'sm_outgoing'));
     $this->getUser()->setAttribute('page', $page, 'sm_outgoing');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'sm_outgoing/create', 'color' => 'green'));
     }
     $this->actions = $actions;
     $this->subtitle = '';
 }
 public static function getEmailsFromLlistes($A_llistes, $P)
 {
     $C = self::CriteriaEmailsFromLlistes($A_llistes, true);
     $pager = new sfPropelPager('LlistesEmails', 50);
     $pager->setCriteria($C);
     $pager->setPage($P);
     $pager->init();
     return $pager;
 }
Esempio n. 22
0
 public function executeList()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $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;
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(ClassGroupPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $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', 999);
     $this->getUser()->setAttribute('max_per_page', $rpp, 'class_group');
     $pager = new sfPropelPager('ClassGroup', $rpp);
     $pager->setCriteria($c);
     $pager->setPeerMethod('doSelectFiltered');
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'class_group'));
     $this->getUser()->setAttribute('page', $page, 'class_group');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array();
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'class_group/create', 'color' => 'black'));
     }
     $this->actions = $actions;
 }
Esempio n. 23
0
 private function getPager($c = null, $nbr = 4)
 {
     if (!is_null($c)) {
         $pager = new sfPropelPager('Relation', $nbr);
         $pager->setCriteria($c);
         $pager->setPage($this->getRequestParameter('page', 1));
         $pager->init();
     }
     return $pager;
 }
Esempio n. 24
0
 public static function getPager($max = 50, $page = 1)
 {
     $c = new Criteria();
     $c->addAscendingOrderByColumn(self::TITLE);
     $pager = new sfPropelPager('Permission', $max);
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }
Esempio n. 25
0
 public static function getNoticies($TEXT = "", $PAGINA = 1, $filtreWEB = false, $totes = false, $idS)
 {
     $C = new Criteria();
     $C = self::getNoticiesCriteria($C, $TEXT, $filtreWEB, $totes, $idS);
     $pager = new sfPropelPager('Noticies', 20);
     $pager->setCriteria($C);
     $pager->setPage($PAGINA);
     $pager->init();
     return $pager;
 }
Esempio n. 26
0
 public static function getList($PAGE = 1)
 {
     $C = new Criteria();
     $C->addDescendingOrderByColumn(self::IDENTRADA);
     $pager = new sfPropelPager('Entrades', 10);
     $pager->setCriteria($C);
     $pager->setPage($PAGE);
     $pager->init();
     return $pager;
 }
Esempio n. 27
0
 static function cercaTotsCamps($text, $PAGINA = 1, $idS)
 {
     $C = new Criteria();
     $C = self::CriteriaCerca($text, $C);
     $C = self::getCriteriaActiu($C, $idS);
     $pager = new sfPropelPager('Usuaris', 10);
     $pager->setCriteria($C);
     $pager->setPage($PAGINA);
     $pager->init();
     return $pager;
 }
Esempio n. 28
0
 public static function getFormularisCercaHospici($CER)
 {
     $C = new Criteria();
     $C = self::CriteriaCercaFormularisHospici($CER, $C);
     //Ara fem la select dels cursos amb el pager
     $pager = new sfPropelPager('Formularis', 20);
     $pager->setCriteria($C);
     $pager->setPage($CER['P']);
     $pager->init();
     return $pager;
 }
Esempio n. 29
0
 public function executeView()
 {
     $c = new Criteria();
     $c->add(ColItemPeer::CATALOG_ID, $this->catalog_id);
     $c->addAscendingOrderByColumn(ColItemPeer::CATALOG_ID);
     $pager = new sfPropelPager('ColItem', $this->getRequestParameter('max_per_page', 10));
     $pager->setCriteria($c);
     $pager->setPage($this->getRequestParameter('page', 1));
     $pager->init();
     $this->pager = $pager;
 }
Esempio n. 30
0
 public function getInterestedUsersPager($page)
 {
     $c = new Criteria();
     $c->addJoin(UserPeer::ID, InterestPeer::USER_ID, Criteria::LEFT_JOIN);
     $c->add(InterestPeer::QUESTION_ID, $this->getId());
     $pager = new sfPropelPager('User', sfConfig::get('app_pager_users_max'));
     $pager->setCriteria($c);
     $pager->setPage($page);
     $pager->init();
     return $pager;
 }