Changeset 2136
- Timestamp:
- 03/02/10 16:20:01 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/workflow/inc/local/classes/class.wf_location.php
r795 r2136 72 72 c.id_city AS id_city, 73 73 c.city_name AS city_name, 74 c.is_district, 74 75 s.id_state AS id_state, 75 76 s.state_name AS state_name, … … 125 126 * Busca as cidades de um estado 126 127 * @param int $state_id Numero ID do estado 128 * @param bool $include_districts True, busca cidades e distritos. False, busca apenas cidades. 127 129 * @return mixed (array ou boolean) 128 130 * @access public 129 131 */ 130 function getCitiesFromState($state_id )132 function getCitiesFromState($state_id, $include_districts = true) 131 133 { 132 if (!is_numeric($state_id) )134 if (!is_numeric($state_id) || !is_bool($include_districts)) 133 135 return false; 134 136 … … 137 139 return $this->citiesFromState[$state_id]; 138 140 141 $where = ""; 142 if(!$include_districts){ 143 $where = " AND c.is_district = 'F' "; 144 } 145 139 146 $sql = 140 147 "SELECT 141 148 c.id_city AS id_city, 142 c.city_name AS city_name 149 c.city_name AS city_name, 150 c.is_district 143 151 FROM 144 152 phpgw_cc_state s, … … 147 155 c.id_state = s.id_state AND 148 156 s.id_country = 'BR' AND 149 c.id_state = ? 157 c.id_state = ? " . $where . " 150 158 ORDER BY 151 159 city_name"; … … 159 167 return $output; 160 168 } 161 169 /** 162 170 * Busca os estados brasileiros 163 171 * @return mixed (array ou boolean)
Note: See TracChangeset
for help on using the changeset viewer.