Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- *
- * @ This file is created by deZender.Net
- * @ deZender (PHP5 Decoder for ionCube Encoder)
- *
- * @ Version : 1.1.5.0
- * @ Author : DeZender
- * @ Release on : 09.06.2012
- * @ Official site : http://DeZender.Net
- *
- */
- class tipoHabitacion extends Zend_Db_Table_Abstract {
- private $_name = 'tipo_habitacion';
- function __construct() {
- $this->_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 = '<?xml version=\'1.0\' encoding=\'utf-8\'?>';
- $s .= '<rows>';
- $s .= '<page>' . $page . '</page>';
- $s .= '<total>' . $total_pages . '</total>';
- $s .= '<records>' . $count . '</records>';
- foreach ($filas as $fila) {
- $s .= '<row id=\'' . $fila->tipo_habitacion_id . '\'>';
- $s .= '<cell><![CDATA[' . $fila->tipo_habitacion_nombre . ']]></cell>';
- $s .= '<cell>' . $fila->id_hotel . '</cell>';
- $s .= '<cell>' . $fila->tipo_habitacion_id . '</cell>';
- $s .= '</row>';
- }
- $s .= '</rows>';
- return $result;
- }
- .....................................................
- .............................
- ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement