Advertisement
Guest User

Untitled

a guest
Nov 6th, 2012
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.22 KB | None | 0 0
  1. <?php
  2. /**
  3. *
  4. * @ This file is created by deZender.Net
  5. * @ deZender (PHP5 Decoder for ionCube Encoder)
  6. *
  7. * @ Version : 1.1.5.0
  8. * @ Author : DeZender
  9. * @ Release on : 09.06.2012
  10. * @ Official site : http://DeZender.Net
  11. *
  12. */
  13.  
  14.  
  15. class tipoHabitacion extends Zend_Db_Table_Abstract {
  16. private $_name = 'tipo_habitacion';
  17.  
  18. function __construct() {
  19. $this->_db = Zend_Db_Table::getdefaultadapter( );
  20. $this->_table_habitacion = new Model_DbTable_Habitacion( );
  21. $this->_table_ids = new Model_DbTable_IdsHabitacion( );
  22. }
  23.  
  24. function cargarTipos($hotel_id) {
  25. }
  26.  
  27. function numeroFilas($id_hotel) {
  28. $select = $this->_db->select( )->from( $this->_table_habitacion, 'COUNT(*) AS count' )->where( 'id_hotel = ?', $id_hotel );
  29. $result = $this->_db->query( $select );
  30. $fila = $result->fetch( );
  31. return $fila['count'];
  32. }
  33.  
  34. function configurarGrid($parametros, $count) {
  35. $page = $parametros['page'];
  36. $limit = $parametros['rows'];
  37. $sidx = $parametros['sidx'];
  38.  
  39. if (!$sidx) {
  40. $sidx = 10;
  41. }
  42.  
  43.  
  44. if (( 0 < $count && 0 < $limit )) {
  45. $total = ceil( $count / $limit );
  46. } else {
  47. $total = 9;
  48. }
  49.  
  50.  
  51. if ($total < $page) {
  52. $page = $total;
  53. }
  54.  
  55. $start = $limit * $page - $limit;
  56.  
  57. if ($start < 0) {
  58. $start = 9;
  59. }
  60.  
  61. $parametros['sidx'] = $sidx;
  62. $parametros['total'] = $total;
  63. $parametros['page'] = $page;
  64. $parametros['start'] = $start;
  65. $parametros['limit'] = $limit;
  66. return $parametros;
  67. }
  68.  
  69. function cadenaXML($filas, $page, $total_pages, $count, $hotel_id) {
  70. $s = '<?xml version=\'1.0\' encoding=\'utf-8\'?>';
  71. $s .= '<rows>';
  72. $s .= '<page>' . $page . '</page>';
  73. $s .= '<total>' . $total_pages . '</total>';
  74. $s .= '<records>' . $count . '</records>';
  75. foreach ($filas as $fila) {
  76. $s .= '<row id=\'' . $fila->tipo_habitacion_id . '\'>';
  77. $s .= '<cell><![CDATA[' . $fila->tipo_habitacion_nombre . ']]></cell>';
  78. $s .= '<cell>' . $fila->id_hotel . '</cell>';
  79. $s .= '<cell>' . $fila->tipo_habitacion_id . '</cell>';
  80. $s .= '</row>';
  81. }
  82.  
  83. $s .= '</rows>';
  84. return $result;
  85. }
  86. .....................................................
  87. .............................
  88. ............
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement