_db = Zend_Db_Table::getdefaultadapter( ); $this->_table_habitacion = new Model_DbTable_Habitacion( ); $this->_table_ids = new Model_DbTable_IdsHabitacion( ); } function cargarTipos($hotel_id) { } function numeroFilas($id_hotel) { $select = $this->_db->select( )->from( $this->_table_habitacion, 'COUNT(*) AS count' )->where( 'id_hotel = ?', $id_hotel ); $result = $this->_db->query( $select ); $fila = $result->fetch( ); return $fila['count']; } function configurarGrid($parametros, $count) { $page = $parametros['page']; $limit = $parametros['rows']; $sidx = $parametros['sidx']; if (!$sidx) { $sidx = 10; } if (( 0 < $count && 0 < $limit )) { $total = ceil( $count / $limit ); } else { $total = 9; } if ($total < $page) { $page = $total; } $start = $limit * $page - $limit; if ($start < 0) { $start = 9; } $parametros['sidx'] = $sidx; $parametros['total'] = $total; $parametros['page'] = $page; $parametros['start'] = $start; $parametros['limit'] = $limit; return $parametros; } function cadenaXML($filas, $page, $total_pages, $count, $hotel_id) { $s = ''; $s .= ''; $s .= '' . $page . ''; $s .= '' . $total_pages . ''; $s .= '' . $count . ''; foreach ($filas as $fila) { $s .= 'tipo_habitacion_id . '\'>'; $s .= 'tipo_habitacion_nombre . ']]>'; $s .= '' . $fila->id_hotel . ''; $s .= '' . $fila->tipo_habitacion_id . ''; $s .= ''; } $s .= ''; return $result; } ..................................................... ............................. ............