06.30
php
saved
sarahk
Note
the controller for my search, the postbox section returns an incorrect number of rows.
the controller for my search, the postbox section returns an incorrect number of rows.
- <?php
- class PostalcodesController extends AppController
- {
- var $name = 'Postalcodes';
- var $layout = 'ajax';
- function search()
- {
- $add1 = $this->Utility->checkAddress( $this->data['Membership']['postal1']);
- $add2 = $this->Utility->checkAddress( $this->data['Membership']['postal2']);
- $add3 = $this->Utility->checkAddress( $this->data['Membership']['postal3']);
- $add4 = $this->Utility->checkAddress( $this->data['Membership']['postal4']);
- {
- $conds['`Postbox`.`lobby`'] = $add2;
- $this->Postbox->cacheQueries = false;
- $data = $this->Postbox->findAll($conds, null, '`Postbox`.`postcode`');
- }
- {
- $rdnum = $bits[0];
- $conds['`Rural`.`rd`'] = $rdnum;
- $conds['OR']['`Rural`.`town`'] = $add3;
- $conds['OR']['`Rural`.`town`'] = $add4;
- $data = $this->Rural->findAll($conds, null, '`Rural`.`postcode`');
- }
- else
- {
- $street = '';
- foreach($bits as $bit)
- {
- $street = $bit . ' ' . $street;
- $streetlist[] = $street;
- }
- //$conds[1] = "'`Street`.`street`' in ('". implode("','", $streetlist) ."')";
- $conds['`Street`.`street`'] = $streetlist;
- $data = $this->Street->findAll($conds, null, '`Suburb`.`postcode`');
- }
- $this->set('data', $data);
- }
- }
- ?>
Parsed in 0.137 seconds, using GeSHi 1.0.7.14