/** * Searches for contacts * CODE:contact_index */ public function executeIndex(sfWebRequest $request) { # security if (!$this->getUser()->hasCredential(array('Administrator', 'Staff', 'Volunteer'), false)) { $this->getUser()->setFlash("warning", 'You don\'t have permission to access this url ' . $request->getReferer()); $this->redirect('dashboard/index'); } # filter $this->processFilter($request); if ($request->isMethod('post') || $request->getParameter('page')) { $this->pager = ContactPeer::getPager($this->max, $this->page, $this->firstname, $this->lastname, $this->city, $this->state, $this->ref_source, $this->contact_type, $this->added_date1, $this->added_date2); $this->contact_list = $this->pager->getResults(); } $this->ref_sources = RefSourcePeer::doSelect(new Criteria()); $this->contact_types = ContactTypePeer::doSelect(new Criteria()); $this->date_widget = new widgetFormDate(array('format_date' => array('js' => 'mm/dd/yy', 'php' => 'm/d/Y')), array('class' => 'text')); }
<th><?php echo 'Referral Source:'; ?> </th> <td> <?php echo $form['ref_source_id']->renderError(); ?> <?php //echo $form['ref_source_id'] ?> <select id="contact_request_ref_source_id" name="contact_request[ref_source_id]"> <option value="0">--Please Select--</option> <?php $ref = new Criteria(); $refs = RefSourcePeer::doSelect($ref); foreach ($refs as $ref_list) { ?> <option value="<?php echo $ref_list->getId(); ?> "><?php echo $ref_list->getSourceName(); ?> </option> <?php } ?> </select> </td> </tr>
/** * Retrieve multiple objects by pkey. * * @param array $pks List of primary keys * @param PropelPDO $con the connection to use * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. */ public static function retrieveByPKs($pks, PropelPDO $con = null) { if ($con === null) { $con = Propel::getConnection(RefSourcePeer::DATABASE_NAME, Propel::CONNECTION_READ); } $objs = null; if (empty($pks)) { $objs = array(); } else { $criteria = new Criteria(RefSourcePeer::DATABASE_NAME); $criteria->add(RefSourcePeer::ID, $pks, Criteria::IN); $objs = RefSourcePeer::doSelect($criteria, $con); } return $objs; }