RIFF"WEBPVP8 Е�* �>�T�M'��%�u|�� gk�ZaQb�����o����lN���s�_�3��S+���c�€R��y����//����~��H�@�2oF�X ���R@'�:�ꞓ}��a�M,.� ��o��=�p�U�&g<�:���~���t��.�1���cyW�� We�M=�f�Y6v�����(nO���������^- �9(b _�s%{�C|�p�@�����37�}B0��u���i�Գ���� ������5�}���֮M?dz���q�e��N�~�&�N��K�av$]hO�i�C�,��"]�����@����M@�o O[�Æ*;�e]��_; }�p�?��)�'VC� J��L�y� v����18��)7c�d�mߛ�]I� ����d��?�{�.����b)49��c��Zy/��c^��%��/z�å̯�t��rS��Z��Uͩ�h��2����` �7�:��~��zP���Z����?v�R��TD���G����CJ���}�o��fs��̜#b��e"k9,���3�{Or�i��x":���{/ۈ�`�7RČ����(�p:I��%:�ͺ��W(|�=KP��3�7}���������ed��;�3�;�e��8�g�4�9 %v,B�GU�����T% ֯��B+�tR���p������F7�sT��oϱq �h�Rݧ�~*�܈_�Ck���}�nY�>��C�PQ�B��(o�६�qxy������f ���]��}����%=CW�k^t�—]����M�cX�i��%��!�Y������:N=|��wj<9ł��,�s�O�,,�U�!�������e���{���W��989�y*z�=�"E�CyW���N�2�ę��LN�HW��?����`V���DJ=#׶×ܽ$eF���o;b� ��0��&�W���Y�bR�� �Fֵ� `J�an�-Є@�tR�v��e2W��Mn�p��4P1�q ���®w���ũur*�җ.�#�4b���������:���g��ʧ�`R�4�+G�f���niU����$�K-'A�zE&]��Y�H2�4� ��˄�t��Q�4%��L�#��0FS8�Bu����ژ��"����۹�[�JK��4��z�v�ڌ��L*jD0.����?�ڃN��H��J����n�w��6Q(i;��I,.3?|�`���y���D_��(��w��������[��ZYhe�')��D*��kb����c��@� �|S�S3���- ���iq!*��w������Ł��ܩ��*FY���jV�4Q���4�,�ʑV!��N�.�1�KT,��Zp� ���iL�r��Ȧ����"y�tU���PS�ģ��?�QGng_�#yEk��B̝��1hr��ѕ�z*Ԧ�L8T�����H�^�k�-�g�z������w��N����v��RH��E��!0Cؚ)R�@�q�J�qA�r�$k4���om���Ьnu���x�������������y$�8�Z���v� &�+2�|���\r:[,!�Y�C#c��͊�{��7Щ��Y�LVę]�j��)��^���󶦙$�_����Hx>����[ +K�ڏ�1������Q�7@�^{�ik�;'H{�8 �ȇe vR����^� Meq�����Y�MC��U<��O�۫�nAfBf317���x��O�.u@3R}e�`�D��\�z���L��P������y8�?����I�"s`�b 3��ٹd�0��A�/���� ��{b�b������1� ����ka�&T�z�_4���I��PN��8��}N�r��]�՜���ӿ��9�|/.��� �fˑ.�`r�r��U-���7�Rx8L��d$H�m��Ǒ�*x�P{�D�����k��o�ueV�-.��j}���U2��g絍g���s �������aN�X�ҍ���C�� ��X��B�EF���8%p57<�x�Y�e�cϔ�\��C �OAj&N�V���!v��U��~J��j��4�V|��8�R�v�fD�)�HA�3�G��ds�7Z.���= ����+kI2�0=�'� K �H,`�ɴāTE\����E�'/��;���;��a���0"��� �x$J�T��#U=������j-�8�����y c8W����Ԋ�K��_��Y� '%Vg$I�Пq�shE�y�:�m�}�F1(:b�U�~� ���0}�C�}0����#�#}���e�S9��.��SP�m���<�~�y��� ��ɭ�ٮ6N��� ğ��t��A��N�V ������f�+�w�O1�Jq���U�B�T��į���� ��*�=z�x"yU S���� ��// ����W᫮��R�O�2W�M��<-�;�F�`9 �����t�:C{a�8�� <�r'���:�g8%�9J̞�˦��eV�7l�~�#����.yY)$��k�|�!�3���m���XS���J4B���`�����oL[]��aT[�C��@h�T�l��_�e>�����K<'��P�zgk�#fm��V�]�ݽ�j1����H��J��J58��ڱ��@�e&*�w��e���Q��HT8�ֽ��\�Fa�栆�A�ڝӚ׹@�:9`��G�h�7����t<���_˒|�\bU�O�����,M�a�oynGf�޶7�w�i`�m[��XE4�*�8}5��U1���^�B*��_%[����Yb�^���S�l�"A�1�T��ڈ��(???)j�S�n�8v%� Eo��� mE��|�Έ�Ai�3uy5O����7Rܽ���"L��X���1�@�=?5�_'��{j�����Z3L��k��^x6g3i�����r.��N��&��9[��ɓW[+�� 7�����fe�3�K�%��0F��+V�ϛ+3�B�p,y;Z�NGK�uWg䁯9�v��t��ǒx�JY�O��K�iY��#FJy�Bzt�Q^�Y��Uϲ-͖��9��g�X,�X] f�P/�]d�䠾�̔m%Q��겓\q(�%'����/EN�P�1�o��� ���}��'��c�F��Ju��4��0ck�N��w�1��&]a ��^I�)����֓��\;�1��3��� �L��{>�+���a��Jg��#����P���>�5�a<�`>>˔�]�ߎey�-T���ʵ���r���8`dmNm���_mӐK�Ҏ-޴�� ��RQ%�d�l"��l�_��ie0.�$Xh|.jv,���l\ uyj�u\�/� B:�܀�]� _��T��I���lz�&c�A�g{g��O˂�O���O�M�t��7Y�~? ቶ`�7��'�w��#���˚�\��_��� a��d���[Ҭњ��]ɢ�A$ �l�v=E�66d �WA\̬fsǭ}x;';���?�UW�O��{�&|_a�C� |ȹ��pka�|���zf[S�������[�Jcf�A�&�L�U)Pd+)�_�$1�0�z�'�v\u�' +;�!���dž�]h�N�{ku��<��a��.0�,��]q��ZKao=ILo�z�rb&�{@K�i*7nX).�/�̶��ӒU�v �B֝���a��n��تx ���P�AG7M4N�?r;Z�����7�@�wA�q��RM5�8ۭ ��g��8�g���G�Tſ�O�{2��P3r��6�W,/��kC���p�V���~�"���T���6�/<�4�U�>��T�H�Fc�T�D�^I���!�����=&\Em�>b�,|T��d���n��=@\Wzi���D��&�f���1�t�mC�Ih��m��&�������84�!H�i�|�Z���� ��W���g����8�h�B] OvQ�u����+�}n�� FE�+q�&j����I�u��&��=!��T�b�@�ք0 �D�W�W�t�V}�������^�g�Erb`j��2 �wr�\Y5��L�Ρ���_�bNU�)~�e�Z�U�*�����:�vƀu2�W-W��W{KKo0�)��G�K.��{̮���v�/��p� !�� �w;`��b ������F���/���:����I�lm��Vc�,x~m<=|�_�>n����(A�����{�膾���m�,{3 �ӀH=٘�%��[USd��!J�|�f_�/ �߻��)I%���G�ܑ�G |N������d��BU5��qvG�c,���A?!��w��� �S��-i���Fr�P�_��E�+��)��V��f��������~�����������}"sk��cHN�<� 5I�r��1gu�ݗ�,N�I��f��k�s���0��: 0�<�\ͩB�܄ �:�f2A��mҞ�Z�6��3��t�����͟~����J�R9�] �,h������Z�@�{����9��W�il!�:��P��P���wK)���p���!���KuB\�7 uI�?(���/��r3����v,\'�8��qUa�ء���!��(b��n?�YfӸ����r�$���ה�~��_�&�8g�<(Mx$ZO�������u`q��:�N�Q !�%`���h:�� �~>�D���m�^��[V!y�6=� ��m��ѡ��p4�Iꎸ��1cE��QS�ٷ��W�C����*�����Q��=��3���&���-#,åCCG�������9�i��3�C��S[t>���qm����B��s���������o��� J�^s|����r��\ԺΦ�a�{��1��wT'���� �̓Q���B��\xx}��8��Of!��U�n��f�����bA��UD�cC} �r�������c ���^�X���k�Ɩk�6��^E�C�E�sՀ`�Ⱦ,i��v�� ٺe˟�!�co�64x4��A�ah��ˏ<��%�@�*|�\�TY����#:9��|?S�[������G hUw9���z]��D��-J6�m,ʭ��2�Iz�4W9��&���t�߁ R�Z�gP��H�dj�`%ap}�^떟��*fb{�Q) Dd_V����$��,�߁� @D�&f�2��S6��M�ɤ�)Q\F�i���5p��Wb'PN�R�>�����9��]��\8{B8�� ��ю�������%� ӏۙ{]�j,_Y>��!�l���'���H�["��;c?cy��1< 0ϑ���/�AAЛ�� ; �j�(!��1 [)5ݻK ��A7��"[�%"���{��H ���V�� ���m�K���VLn��9鿹8�At΀@����f`�1y�rЅ��q��7Nf���x)y��, 0e�"{�ƨ�"� o �6� �.|Tm.���-r �G� [ed���–q���]�X�oG*�1>�� م�p_Y{δ(N�|s��^{i�`��͒ QӴx+X.ݕ�kP�g]�޿�4��Q|�O��h�*c�W�G�4{~x�k��A:�{Yu�倀#ތM�K!�e�;ȩ����r������'���D&H�$�0�ߜ�w��Sq dH��P�y����z����h��d��"�;0��#I2�F{����. W�wl���|>s�\ŌO�&bO/4(z9ܭua��`��_3d�Qpt�/�P -��#5�,�M��� �pA:©�q�����NW��ډ�A���� �9nʺج���� �TSM��{J6?7��r�@�\����D��� �׶���s�f�TJj?"��D��`?��̒� b�#�%�C*v�$�{�$����5Ծ�F�s��y�e/8��h-�f�̰&(����Gj�L:U� 2�� ����v�_k����Y��gp,�k�WF�R������_C�R��N@���R�@�ߔ?A�w9���F("iNa-S���Q�o�3tDMLh*�#4k�T/iQ��Y*�G��m����)��8�hBm/�I�,g�ﯖ���Z��}�Cz�q@´��d.����L�ŕ�,��1�Z�܌�: ̪���F+J-'��c�tvJ8��]Q-��b��y �6;*J`r_�d ��'�G ~p��)'�C,�%F��E(��2�k�����lР�z�!�=t ��_�0��f7��� ;�p�|�U �%host = $configDB[0]; $this->user = $configDB[1]; $this->password = $configDB[2]; $this->database = $configDB[3]; $this->locale = $configDB[4]; //dati generali $this->data = time(); $this->dataFormattata = date("d/n/o", time()); //dati sito $this->nomeSito = "Eolie Solution"; $this->indirizzoSito = "https://www.eoliesolution.it/es/"; $this->emailSito = "info@eoliesolution.it"; //debugger $this->debugger = 0; $this->anno = Date("Y"); } /* * setter - non so come le chiamino nel php ma in java si chiamano cosí e cosí rimarranno 🙂 * ---------------------------------------------------------------------------- */ public function getPDO() { $dsn = "mysql:host={$this->host};dbname={$this->database};charset=utf8mb4"; try { $pdo = new PDO($dsn, $this->user, $this->password, [ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION ]); return $pdo; } catch (PDOException $e) { die("Errore connessione DB: " . $e->getMessage()); } } //setter per abilitare il "debugger" function set_debugger($val) { $this->debugger = $val; } /* * getter - come sopra,non so come le chiamino nel php ma in java si chiamano cosí e cosí rimarranno 🙂 * ---------------------------------------------------------------------------- */ //recupero il nome del sito function get_NomeSito() { return $this->nomeSito; } //recupero l'indirizzo del sito function get_indirizzoSito() { return $this->indirizzoSito; } //recupero la mia e-mail function get_emailSito() { return $this->emailSito; } //recupero la data in timestamp,puó sempre tornare utile 😉 function get_data() { return $this->data; } //sono pigro e recupero anche la data giá formattata XD function get_dataFormattata() { return $this->dataFormattata; } /* * connessione e disconnessione * ---------------------------------------------------------------------------- */ //creo la funzione per la connessione function getConnection(){ $this->mysqli = new mysqli( $this->host, $this->user, $this->password, $this->database ); if ($this->mysqli->connect_errno) { echo "Errore durante la connessione al DBMS: " . $this->mysqli->connect_error; exit(); } // 🔥 QUESTA È LA RIGA CHE TI MANCA $this->mysqli->set_charset("utf8mb4"); } //creo la funzione per la disconnessione function closeConnection() { //$this->mysqli->close(); } /* * query * ---------------------------------------------------------------------------- */ function pulisci_prezzo($valore) { $val = ""; $pos = strpos(strtoupper($valore), 'RISERVA'); if ($pos !== false) { $val = $valore; } else { $val = "€ " . $valore; } return $val; } function pulisci_prezzo_affitto($valore) { $val = ""; $valore = str_replace("€", "", $valore); $pos = strpos(strtoupper($valore), 'AGENZ'); if ($pos !== false) { $val = $valore; } else { $val = "€ " . $valore; } return $val; } function get_link($codice) { $link = ""; switch ($codice) { case 1: $link = "casa-vendita-ve-"; break; case 2: $link = "casa-affitto-af-"; break; case 3: $link = "casa-vacanza-ab-"; break; } return $link; } function data_eng_to_ita($stringa) { $data = ""; $data = substr($stringa, 8, 2) . "/" . substr($stringa, 5, 2) . "/" . substr($stringa, 0, 4); return $data; } function get_tipo_annuncio($codice, $ritorno) { $tipo_annuncio = ""; $tipo_annuncio_abbr = ""; $valore_ritorno = ""; switch ($codice) { case 1: $tipo_annuncio = "Vendita"; $tipo_annuncio_abbr = "VE"; break; case 2: $tipo_annuncio = "Affitto"; $tipo_annuncio_abbr = "AF"; break; case 3: $tipo_annuncio = "Casa Vacanza"; $tipo_annuncio_abbr = "AB"; break; } if ($ritorno > 0) { $valore_ritorno = $tipo_annuncio_abbr; } else { $valore_ritorno = $tipo_annuncio; } return $valore_ritorno; } function get_tipologia($id) { $tipologia = ""; $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM annuncio WHERE IdAnnuncio = $id"); // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $tipologia = $row['Tipologia']; endwhile; $result->close(); endif; } //disconnessione $this->closeConnection(); $tipologia = str_replace('á', 'à', $tipologia); return $tipologia; } function get_dettaglio_descr($id, $chiave) { $descrizione = ""; $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM affittobreve WHERE Chiave = '$chiave' and IdCodice = $id"); // conteggio dei record restituiti dalla query if ($result) { $descrizione = "trovato"; if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $descrizione = $row['Label']; endwhile; $result->close(); endif; } else { $descrizione = "SELECT * FROM affittobreve WHERE Chiave = '$chiave' and IdCodice = $id"; } //disconnessione $this->closeConnection(); return $descrizione; } function lastContInt($id) { $ultimoRecord = 0; $this->getConnection(); $result = $this->mysqli->query("SELECT ContInt FROM elencoimg where numid = $id order by ContInt ASC"); if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $ultimoRecord = $row['ContInt']; endwhile; $result->close(); endif; } $this->closeConnection(); return $ultimoRecord + 1; } function lastID() { $ultimoRecord = 0; $this->getConnection(); $result = $this->mysqli->query("SELECT IdAnnuncio FROM annuncio where IdAnnuncio > 0 order by IdAnnuncio DESC limit 1"); // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $ultimoRecord = $row['IdAnnuncio']; endwhile; $result->close(); endif; } //disconnessione $this->closeConnection(); return $ultimoRecord + 1; } function lastPositionImg($id_annuncio) { $ultimoRecord = 0; $this->getConnection(); // Prendiamo l'ultimo ContInt per l'annuncio specifico $result = $this->mysqli->query(" SELECT ContInt FROM elencoimg WHERE numid = $id_annuncio ORDER BY ContInt DESC LIMIT 1 "); if ($result && $result->num_rows > 0) { $row = $result->fetch_assoc(); $ultimoRecord = $row['ContInt']; // <-- leggere il campo corretto $result->close(); } $this->closeConnection(); // Se non ci sono record, ritorna 1, altrimenti ultimoRecord + 1 return $ultimoRecord > 0 ? $ultimoRecord + 1 : 1; } function recupera_foto($key) { $this->getConnection(); $img = 'logo_agenzia.gif'; $perc = "https://www.eoliesolution.it/web-admin/upload/"; $result_a = $this->mysqli->query("SELECT * FROM elencoimg WHERE attiva = 1 and numid = $key order by ContInt ASC"); //if($this->debugger==1): echo("SELECT * FROM elencoimg WHERE numid = $key order by ContInt ASC") ; endif; // conteggio dei record restituiti dalla query if ($result_a) { //echo "trovata"; if ($result_a->num_rows > 0) { //echo "trovata"; $count = 0; while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $count++; $img = $row_a['immagine']; if ($count > 0) { break; } endwhile; $result_a->close(); } else { //echo "Non trovata"; } } else { //echo "Non entro"; } //disconnessione $this->closeConnection(); return $perc . $img; } function visualizza_gestione_foto($key) { $this->getConnection(); $img = 'logo_agenzia.gif'; $perc = "../upload/"; $result_a = $this->mysqli->query("SELECT * FROM elencoimg WHERE attiva = 1 and numid = $key order by ContInt ASC"); //if($this->debugger==1): echo("SELECT * FROM elencoimg WHERE numid = $key order by ContInt ASC") ; endif; // conteggio dei record restituiti dalla query if ($result_a) { //echo "trovata"; if ($result_a->num_rows > 0) { //echo "trovata"; $count = 0; while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)){ $count++; $img = $row_a['immagine']; $keyid = $row_a['KeyId']; $description = $row_a['Descrizione']; $ext = strtolower(pathinfo($img, PATHINFO_EXTENSION)); $isImage = in_array($ext, ['jpg','jpeg','png','gif','webp','jfif']); $isVideo = in_array($ext, ['mp4','mov','avi','webm']); ?>
  • <?php echo htmlspecialchars($description, ENT_QUOTES); ?>
  • close(); } else { //echo "Non trovata"; } } else { //echo "Non entro"; } //disconnessione $this->closeConnection(); return $perc . $img; } function sposta_annuncio($id_annuncio, $valore) { $this->getConnection(); $query = $this->mysqli->query("SELECT IdAnnuncio, Posizione, Annuncio FROM annuncio WHERE IdAnnuncio = $id_annuncio"); if ($query) { if ($query->num_rows > 0) { while ($row_a = $query->fetch_array(MYSQLI_ASSOC)){ $posizione_corrente = $row_a['Posizione']; $tipo_annuncio = $row_a['Annuncio']; // Calcola la nuova posizione verso cui si vuole spostare $direzione = ($valore < 0) ? 1 : -1; $posizione_target = $posizione_corrente + $direzione; // Trova l'annuncio che occupa la nuova posizione $query_bis = $this->mysqli->query("SELECT IdAnnuncio, Annuncio FROM annuncio WHERE Annuncio = $tipo_annuncio and Posizione = $posizione_target LIMIT 1"); if ($query_bis) { if ($query_bis->num_rows > 0) { while ($row_b = $query_bis->fetch_array(MYSQLI_ASSOC)){ $id_altro = $row_b['IdAnnuncio']; $tipo_annuncio = $row_b['Annuncio']; $table = "annuncio"; $option = "Posizione = '$posizione_target'"; $where_cause = " IdAnnuncio = '$id_annuncio'"; $this->DB_update($table, $option, $where_cause); $option = "Posizione = '$posizione_corrente'"; $where_cause = " IdAnnuncio = '$id_altro'"; $this->DB_update($table, $option, $where_cause); } } } return $tipo_annuncio; } } } else { die ("non entro"); return 0; } } function visualizza_foto_link($key) { $this->getConnection(); $result_a = $this->mysqli->query("SELECT * FROM elencoimg WHERE attiva = 1 and numid = $key order by ContInt ASC"); //if($this->debugger==1): echo("SELECT * FROM elencoimg WHERE numid = $key order by ContInt ASC") ; endif; // conteggio dei record restituiti dalla query if ($result_a) { //echo "trovata"; if ($result_a->num_rows > 0) { //echo "trovata"; $count = 0; while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $img = $row_a['immagine']; if ($count < 1) { $class = 'class="active"'; } else { $class = ''; } ?>
  • >
  • close(); } else { //echo "Non trovata"; } } else { //echo "Non entro"; } //disconnessione $this->closeConnection(); //return $perc . $img; } function visualizza_foto($key) { $this->getConnection(); $img = 'logo_agenzia.gif'; $perc = "https://www.eoliesolution.it/web-admin/upload/"; $result_a = $this->mysqli->query("SELECT * FROM elencoimg WHERE attiva = 1 and numid = $key order by ContInt ASC"); //if($this->debugger==1): echo("SELECT * FROM elencoimg WHERE numid = $key order by ContInt ASC") ; endif; // conteggio dei record restituiti dalla query if ($result_a) { //echo "trovata"; if ($result_a->num_rows > 0) { //echo "trovata"; $count = 0; while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $img = $row_a['immagine']; if ($count < 1) { $class = 'active'; } else { $class = ''; } ?> close(); } else { //echo "Non trovata"; } } else { //echo "Non entro"; } //disconnessione $this->closeConnection(); //return $perc . $img; } function DataItaToEng($key) { $stringa = $key; $dataora = ""; $dataora .= substr($stringa, 6, 4) . "-"; $dataora .= substr($stringa, 3, 2) . "-"; $dataora .= substr($stringa, 0, 2); return $dataora; } function DataEngToIta($key) { $stringa = $key; $dataora = ""; $dataora .= substr($stringa, 8, 2) . "/"; $dataora .= substr($stringa, 5, 2) . "/"; $dataora .= substr($stringa, 0, 4); return $dataora; } function DataEngToItaMese($key) { $stringa = $key; $dataora = ""; $dataora .= substr($stringa, 8, 2) . " "; $mese = substr($stringa, 5, 2); switch ($mese) { case "01": $mese1 = "Gennaio"; break; case "02": $mese1 = "Febbraio"; break; case "03": $mese1 = "Marzo"; break; case "04": $mese1 = "Aprile"; break; case "05": $mese1 = "Maggio"; break; case "06": $mese1 = "Giugno"; break; case "07": $mese1 = "Luglio"; break; case "08": $mese1 = "Agosto"; break; case "09": $mese1 = "Settembre"; break; case "10": $mese1 = "Ottobre"; break; case "11": $mese1 = "Novembre"; break; case "12": $mese1 = "Dicembre"; break; } $dataora .= $mese1 . " "; $dataora .= substr($stringa, 0, 4); return $dataora; } function AnnoData($key) { $stringa = $key; $AnnoData = ""; $AnnoData .= substr($stringa, 0, 4); return $AnnoData; } function view_elenco_vendite($query, $filtro) { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM annuncio where " . $query . $filtro . " and annuncio = 1 order by posizione DESC limit 1"); if ($result && $result->num_rows > 0) { $row = $result->fetch_array(MYSQLI_ASSOC); $ultima_posizione = $row['Posizione']; } $result = $this->mysqli->query("SELECT * FROM annuncio where " . $query . $filtro . " and annuncio = 1 order by posizione ASC"); if ($this->debugger == 1): echo ("SELECT * FROM annuncio where " . $query . $filtro . " and annuncio = 1 order by posizione ASC"); endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): $conteggio = 0; while ($row = $result->fetch_array(MYSQLI_ASSOC)): ?> VE- conta_foto_gallery($row['IdAnnuncio']) > 0) { ?> recupera_tipologia($row['IdAnnuncio']); ?> pulisci_prezzo($row['Prezzo']); ?> 0 ) { ?>  Trattabili
    0 ) { ?> 0) { echo "ribasso del "; } else { echo "aumento del "; $diffe = $diffe * -1; } echo $diffe . "% circa"; echo "
    "; } else { echo "*"; // Prezzo non numerico } } else { echo "*"; // Prezzoold non numerico } ?> DataEngToIta($row['DataAnnuncio']); ?> close(); endif; } //disconnessione $this->closeConnection(); } function view_elenco_affitti($query, $filtro){ $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM annuncio where " . $query . $filtro . " and annuncio = 2 order by posizione DESC limit 1"); if ($result && $result->num_rows > 0) { $row = $result->fetch_array(MYSQLI_ASSOC); $ultima_posizione = $row['Posizione']; } $result = $this->mysqli->query("SELECT * FROM annuncio where " . $query . $filtro . " and annuncio = 2 order by posizione ASC"); //if($this->debugger==1): echo("SELECT * FROM strutture where attivo ='S' order by data desc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): $conteggio = 0; while ($row = $result->fetch_array(MYSQLI_ASSOC)): ?> AF- conta_foto_gallery($row['IdAnnuncio']) > 0) { ?> recupera_tipologia($row['IdAnnuncio']); ?> pulisci_prezzo_affitto($row['Prezzo']); ?> DataEngToIta($row['DataAnnuncio']); ?> close(); endif; } //disconnessione $this->closeConnection(); } function aggiorna_posizione_annunci($filtro, $query = "") { $this->getConnection(); // Preparazione della query if (!empty($query)) { $sql = "SELECT IdAnnuncio FROM annuncio WHERE " . $query . " AND Annuncio = ? ORDER BY Posizione ASC"; } else { $sql = "SELECT IdAnnuncio FROM annuncio WHERE Annuncio = ? ORDER BY Posizione ASC"; } // Prepared statement per sicurezza $stmt = $this->mysqli->prepare($sql); $stmt->bind_param("i", $filtro); $stmt->execute(); $result = $stmt->get_result(); $esito = true; if ($result && $result->num_rows > 0) { // Prima memorizziamo tutti gli ID per evitare conflitti durante l'update $ids = []; while ($row = $result->fetch_assoc()) { $ids[] = $row['IdAnnuncio']; } $result->close(); $stmt->close(); // Aggiorniamo le posizioni partendo da 1 $conteggio = 1; foreach ($ids as $id_annuncio) { $table = "annuncio"; $option = "Posizione = $conteggio"; $where_cause = "IdAnnuncio = $id_annuncio"; $this->DB_update($table, $option, $where_cause); $conteggio++; } } else { $esito = false; } $this->closeConnection(); return $esito; } function view_elenco_case_vacanze($query, $filtro) { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM annuncio where " . $query . $filtro . " and Annuncio = 3 order by Posizione DESC limit 1"); if ($result && $result->num_rows > 0) { $row = $result->fetch_array(MYSQLI_ASSOC); $ultima_posizione = $row['Posizione']; } $result = $this->mysqli->query("SELECT * FROM annuncio where " . $query . $filtro . " and Annuncio = 3 order by Posizione ASC"); //if($this->debugger==1): echo("SELECT * FROM strutture where attivo ='S' order by data desc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): $conteggio = 0; while ($row = $result->fetch_array(MYSQLI_ASSOC)): ?> AB- conta_foto_gallery($row['IdAnnuncio']) > 0) { ?> recupera_tipologia($row['IdAnnuncio']); ?> get_prezzo_casavacanza($row['IdAnnuncio']); ?> DataEngToIta($row['DataAnnuncio']); ?> close(); endif; } //disconnessione $this->closeConnection(); } function get_position_list($tipo) { $this->getConnection(); $result = $this->mysqli->query("SELECT IdAnnuncio, Posizione FROM annuncio WHERE Archivio = 0 and Cancellato = 0 and Venduto = 0 and Disattivo = 0 and Annuncio = $tipo order by Posizione ASC"); if ($result) { if ($result->num_rows > 0): $conteggio = 0; while ($row = $result->fetch_array(MYSQLI_ASSOC)): ?> close(); endif; } //disconnessione $this->closeConnection(); } function get_parametri($tipo) { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM tab_tipologia where Loc_Prov = '$tipo' order by Loc_Desc ASC"); //if($this->debugger==1): echo("SELECT * FROM strutture where attivo ='S' order by data desc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): $conteggio = 0; while ($row = $result->fetch_array(MYSQLI_ASSOC)): ?> close(); endif; } //disconnessione $this->closeConnection(); } function get_elenco_isole() { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM isole"); //if($this->debugger==1): echo("SELECT * FROM strutture where attivo ='S' order by data desc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): $conteggio = 0; while ($row = $result->fetch_array(MYSQLI_ASSOC)): ?> close(); endif; } //disconnessione $this->closeConnection(); } function get_parametri_annunci($tipo) { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM parametri where Parametro = '$tipo' order by Chiave, Valore ASC"); //if($this->debugger==1): echo("SELECT * FROM strutture where attivo ='S' order by data desc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): $conteggio = 0; while ($row = $result->fetch_array(MYSQLI_ASSOC)): ?> close(); endif; } //disconnessione $this->closeConnection(); } function recupera_tipologia($key) { $this->getConnection(); $recupera_tipologia = ""; $result = $this->mysqli->query("SELECT * FROM annuncio where IdAnnuncio = '" . $key . "'"); if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $recupera_tipologia = $row['Tipologia']; endwhile; $result->close(); endif; } //disconnessione $this->closeConnection(); return $recupera_tipologia; } function getDateDisponibili($id_annuncio, $anno) { $dateOccupate = []; $this->getConnection(); $result = $this->mysqli->query("SELECT data FROM disponibilita WHERE id_annuncio = $id_annuncio AND YEAR(data) = $anno"); if ($result) { if ($result->num_rows > 0){ while ($row = $result->fetch_array(MYSQLI_ASSOC)){ $dateOccupate[] = $row['data']; // es: "2025-01-14" } } } $this->closeConnection(); return $dateOccupate; } function recupera_tipo_annuncio($key) { $this->getConnection(); $tipo_annuncio = 0; $result = $this->mysqli->query("SELECT * FROM annuncio where IdAnnuncio = '" . $key . "'"); if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $tipo_annuncio = $row['Annuncio']; endwhile; $result->close(); endif; } //disconnessione $this->closeConnection(); return $tipo_annuncio; } function conta_foto_gallery($key) { $idnumeroreparto = 0; $result = $this->mysqli->query("SELECT * FROM elencoimg where attiva = 1 and numid = " . $key); if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $idnumeroreparto++; endwhile; $result->close(); endif; } //disconnessione $this->closeConnection(); return $idnumeroreparto; } function get_annuncio($id_tipo, $nr_annuncio) { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio"); //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $id_annuncio = $row['IdAnnuncio']; $link = $this->get_link($id_tipo); $tipo_annuncio = $this->get_tipo_annuncio($row['Annuncio'], 1); $immagine = $this->recupera_foto($id_annuncio); //echo $immagine; ?> close(); endif; } //disconnessione $this->closeConnection(); } function get_annuncio_isola($id_tipo, $nr_annuncio, $isola, $tipologia) { $this->getConnection(); if ($tipologia <> 0) { if ($tipologia > 1) { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = 2 and Categoria = 'Co' order by posizione asc"); } else { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = 2 and Categoria = 'Re' order by posizione asc"); } } else { if ($isola <> 0) { if ($id_tipo > 0) { if ($id_tipo > 1) { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo and isola = '$isola' order by posizione asc limit 0, $nr_annuncio"); } else { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and disattivo = 0 and Annuncio = $id_tipo and isola = '$isola' order by posizione asc limit 0, $nr_annuncio"); } } else { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and isola = '$isola' order by posizione asc limit 0, $nr_annuncio"); } } else { if ($id_tipo > 1) { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio"); } else { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and disattivo = 0 and Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio"); } } } //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $id_annuncio = $row['IdAnnuncio']; $tipo_annuncio = $this->get_tipo_annuncio($row['Annuncio'], 1); $link = $this->get_link($row['Annuncio']); $immagine = $this->recupera_foto($id_annuncio); //echo $immagine; ?>
    0) { ?>
    VENDUTO
    <?php echo $this->get_tipo_annuncio($row['Annuncio'], 2); ?>-<?php echo $id_annuncio; ?>

    get_tipo_annuncio($row['Annuncio'], 2); ?>-

    • Locali
    • Bagni
    • mq

    pulisci_prezzo($row['Prezzo']); echo $val_ann; break; case 2: $val_ann = $this->pulisci_prezzo_affitto($row['Prezzo']); echo $val_ann; break; case 3: $val_ann = $this->get_prezzo_casavacanza($id_annuncio); echo $val_ann; break; } ?>

    close(); endif; } //disconnessione $this->closeConnection(); } function get_ultimi_annunci($id_tipo, $nr_annuncio) { $this->getConnection(); if ($id_tipo > 0) { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio"); } else { $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 order by posizione asc limit 0, $nr_annuncio"); } //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $id_annuncio = $row['IdAnnuncio']; $tipo_annuncio = $this->get_tipo_annuncio($row['Annuncio'], 1); $link = $this->get_link($row['Annuncio']); $immagine = $this->recupera_foto($id_annuncio); //echo $immagine; ?>
    <?php echo $this->get_tipo_annuncio($row['Annuncio'], 2); ?>-<?php echo $id_annuncio; ?>
    get_tipologia($id_annuncio); ?>

    pulisci_prezzo($row['Prezzo']); echo $val_ann; break; case 2: $val_ann = $this->pulisci_prezzo_affitto($row['Prezzo']); echo $val_ann; break; case 3: $val_ann = $this->get_prezzo_casavacanza($id_annuncio); echo $val_ann; break; } ?>

    close(); endif; } //disconnessione $this->closeConnection(); } function get_annuncio_carousel() { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = 1 order by posizione asc limit 0, 10"); //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $id_annuncio = $row['IdAnnuncio']; $link = $this->get_link($row['Annuncio']); $immagine = $this->recupera_foto($id_annuncio); //echo $immagine; ?> close(); endif; } //disconnessione $this->closeConnection(); } function get_elenco_tipologia($categoria, $selezione = "") { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM tab_tipologia WHERE Loc_Prov = '$categoria' ORDER BY Loc_Desc ASC"); // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): if ($selezione == $row['Loc_Desc']) { ?> getConnection(); $result = $this->mysqli->query("SELECT * FROM parametri WHERE Parametro = '$parametro' and Chiave = '$chiave' ORDER BY Valore ASC"); // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): ?> getConnection(); $result = $this->mysqli->query("SELECT * FROM affittobreve WHERE Chiave = 'Descr' ORDER BY Label ASC"); // Esplode il parametro $selezione in un array $selezione_array = explode(", ", $selezione); // Conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0) { while ($row = $result->fetch_array(MYSQLI_ASSOC)) { // Controlla se l'IdCodice è presente nell'array $selezione_array $checked = in_array($row['IdCodice'], $selezione_array) ? "checked" : ""; ?> getConnection(); $result = $this->mysqli->query("SELECT * FROM affittobreve WHERE Chiave = 'Accessori' ORDER BY Label ASC"); // Esplode il parametro $selezione in un array $selezione_array = explode(", ", $selezione); // Conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0) { while ($row = $result->fetch_array(MYSQLI_ASSOC)) { // Controlla se l'IdCodice è presente nell'array $selezione_array $checked = in_array($row['IdCodice'], $selezione_array) ? "checked" : ""; ?> getConnection(); $result = $this->mysqli->query("SELECT * FROM affittobreve WHERE Chiave = 'Sport' ORDER BY Label ASC"); // Esplode il parametro $selezione in un array $selezione_array = explode(", ", $selezione); // Conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0) { while ($row = $result->fetch_array(MYSQLI_ASSOC)) { // Controlla se l'IdCodice è presente nell'array $selezione_array $checked = in_array($row['IdCodice'], $selezione_array) ? "checked" : ""; ?> getConnection(); $result = $this->mysqli->query("SELECT * FROM isole ORDER BY Isola ASC"); // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): if ($selezione == $row['Isola']) { echo ''; } else { echo ''; } endwhile; endif; } } function get_regione($selezione = "") { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM regioni ORDER BY regione ASC"); // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): echo ''; while ($row = $result->fetch_array(MYSQLI_ASSOC)): if ($selezione == $row['regione']) { echo ''; } else { echo ''; } endwhile; endif; } } function get_elenco_province($selezione = "") { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM province WHERE provincia = '$selezione' ORDER BY provincia ASC"); // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): if ($selezione == $row['sigla']) { ?> getConnection(); $result = $this->mysqli->query("SELECT * FROM annuncio_lang WHERE IdAnnuncio = $id"); // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $lingua = $row[$campo]; endwhile; $result->close(); endif; } //disconnessione $this->closeConnection(); return $lingua; } function getAnnoDisponibile($idAnnuncio, $annoPartenza, $maxAnniIndietro = 3) { for ($i = 0; $i <= $maxAnniIndietro; $i++) { $anno = $annoPartenza - $i; $condizione = " id_annuncio = '$idAnnuncio' AND data_inizio >= '$anno-01-01' AND data_inizio < '".($anno + 1)."-01-01' "; $ris = $this->DB_select("tabella_periodi", $condizione); if (!empty($ris)) { return $anno; } } return $annoPartenza; // fallback } function get_prezzo_casavacanza($id) { $pdo = $this->getPDO(); $stmt = $pdo->prepare(" SELECT MIN(pr.prezzo_euro) AS prezzo_minimo FROM tabella_periodi p JOIN prezzi pr ON pr.id_periodo = p.id WHERE p.id_annuncio = ? AND YEAR(p.data_inizio) = ( SELECT MAX(YEAR(data_inizio)) FROM tabella_periodi WHERE id_annuncio = ? ) "); $stmt->execute([$id, $id]); $prezzoMinimo = $stmt->fetchColumn(); if (!empty($prezzoMinimo)) { return "A partire da € " . $prezzoMinimo; } else { return ""; } } function get_annuncio_simili_dettaglio($tipo) { $this->getConnection(); $result = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $tipo order by posizione asc limit 0, 3"); //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE Annuncio = $id_tipo order by posizione asc limit 0, $nr_annuncio") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0): while ($row = $result->fetch_array(MYSQLI_ASSOC)): $id_annuncio = $row['IdAnnuncio']; $link = $this->get_link($row['Annuncio']); $immagine = $this->recupera_foto($id_annuncio); //echo $immagine; ?>

    get_tipo_annuncio($row['Annuncio'], 2); ?>-

    get_tipologia($id_annuncio); ?>

    Dettagli
    close(); endif; } //disconnessione $this->closeConnection(); } function get_conta_annuncio($id_tipo) { $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno = 0; // esecuzione della query $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo "); //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo ") ; endif; // conteggio dei record restituiti dalla query if ($result_a): if ($result_a->num_rows > 0): // generazione di un array multidimensionale while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $arrayRitorno++; endwhile; $result_a->close(); endif; endif; //disconnessione $this->closeConnection(); //ritorno l´array con il result_a echo $arrayRitorno; } function visualizza_annuncio($id_annuncio) { $this->getConnection(); //array contenente il valore di ritorno // esecuzione della query $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE IdAnnuncio = $id_annuncio "); //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo ") ; endif; // conteggio dei record restituiti dalla query if ($result_a) { if ($result_a->num_rows > 0) { // generazione di un array multidimensionale while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $tipologia = $row_a['Tipologia']; $tipo_ann = $row_a['annuncio']; ?>

    Prezzo: pulisci_prezzo($row_a['Prezzo']); echo $val_ann; break; case 2: $val_ann = $this->pulisci_prezzo_affitto($row['Prezzo']); echo $val_ann; break; case 3: $val_ann = $this->get_prezzo_casavacanza($id_annuncio); echo $val_ann; break; } ?>
    Tipologia: get_tipologia($id_annuncio); ?>
    • Locali
    • Bagni
    • mq
    • Cucina:
    • Dist.Mare:
    • Ipe
    • Classe
    Informazioni Generali
    get_lingua($id_annuncio, 'eng'); ?>
    get_lingua($id_annuncio, 'fra'); ?>
    get_lingua($id_annuncio, 'deu'); ?>
    get_lingua($id_annuncio, 'spa'); ?>
    get_lingua($id_annuncio, 'rus'); ?>
    get_lingua($id_annuncio, 'cin'); ?>
    Altri Dettagli
    • data_eng_to_ita($row_a['DataAnnuncio']); ?>
    • Residenziale Commerciale
    • Posti Letto:
    • mq
    • 0) { ?> Terrazzo: SI Terrazzo: NO
    • 0) { ?> Balcone: SI Balcone: NO
    • Box:
    • Stato:
    • Nr. Locali:
    • Bagni:
    • Cucina:
    • " ") { ?>
    • " ") { ?> su Piani
    • 0) { ?> Con Ascensore Senza Ascensore
    • Riscald.:
    • 0) { ?>
    • Condizionatore: SI
    • Orient.:
    • Giardino:
    • " ") { ?>
    • Dist. Mare:
    2) { ?>
    Ulteriori Dettagli
    • get_dettaglio_descr($str_arr[$i], 'Descr'); ?>
    • get_dettaglio_descr($str_arr[$i], 'Accessori'); ?>
    • get_dettaglio_descr($str_arr[$i], 'Sport'); ?>
    Prezzi e Disponibilità
    anno = $anno; $dbPrezzo = "prezziario" . $anno; $dbNote = "noteab" . $anno; //echo $dbPrezzo; //echo $dbNote; $intestazione = $this->DB_select_campo($dbNote, 'numid=' . $id_annuncio, 'Intestazione'); $note = $this->DB_select_campo($dbNote, 'numid=' . $id_annuncio, 'Note1'); ?>
    DB_visualizza_prezzi($dbPrezzo, "numid=" . $id_annuncio); ?>
    DB_visualizza_calendario($id_annuncio); ?>

    Chiedi informazioni per questo immobile

    Error! Non è stato possibile inviare il messaggio.


    Altri Annunci Simili
    get_annuncio_simili_dettaglio(1); ?>
    close(); } else { ?>

    Annuncio non gestito

    Annuncio non gestito

    closeConnection(); } function DB_visualizza_calendario($uid) { $this->getConnection(); $selAnno = $this->anno; $result = $this->mysqli->query("SELECT * FROM disponibile WHERE numid = $uid and anno = $this->anno"); //if($this->debugger==1): echo("SELECT * FROM disponibile WHERE numid = $uid and anno = $this->anno") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0) { // generazione di un array multidimensionale while ($row = $result->fetch_array(MYSQLI_ASSOC)) { $giornimese[8] = explode(',', $row['settembre']); $giornimese[0] = explode(',', $row['gennaio']); $giornimese[1] = explode(',', $row['febbraio']); $giornimese[2] = explode(',', $row['marzo']); $giornimese[3] = explode(',', $row['aprile']); $giornimese[4] = explode(',', $row['maggio']); $giornimese[5] = explode(',', $row['giugno']); $giornimese[6] = explode(',', $row['luglio']); $giornimese[7] = explode(',', $row['agosto']); //$giornimese[8] = $row['settembre']; $giornimese[9] = explode(',', $row['ottobre']); $giornimese[10] = explode(',', $row['novembre']); $giornimese[11] = explode(',', $row['dicembre']); } } else { $giornimese = array( 8 => array(0 => "0"), 0 => array(0 => "0"), 1 => array(0 => "0"), 2 => array(0 => "0"), 3 => array(0 => "0"), 4 => array(0 => "0"), 5 => array(0 => "0"), 6 => array(0 => "0"), 7 => array(0 => "0"), 9 => array(0 => "0"), 10 => array(0 => "0"), 11 => array(0 => "0") ); } } else { $giornimese = array( 8 => array(0 => "0"), 0 => array(0 => "0"), 1 => array(0 => "0"), 2 => array(0 => "0"), 3 => array(0 => "0"), 4 => array(0 => "0"), 5 => array(0 => "0"), 6 => array(0 => "0"), 7 => array(0 => "0"), 9 => array(0 => "0"), 10 => array(0 => "0"), 11 => array(0 => "0") ); } $intToDay = array( 0 => 'D', 1 => 'L', 2 => 'M', 3 => 'M', 4 => 'G', 5 => 'V', 6 => 'S' ); $intToMonth = array( 1 => 'Gen', 2 => 'Feb', 3 => 'Mar', 4 => 'Apr', 5 => 'Mag', 6 => 'Giu', 7 => 'Lug', 8 => 'Ago', 9 => 'Set', 10 => 'Ott', 11 => 'Nov', 12 => 'Dic' ); //print_r($giornimese[7]); //print_r($giornimese[8]); ?>
    Disponibilità anno; ?>
    Libero Occupato
    '; $day = 1; $returnCode .= "Mese:"; for ($count = 0; $count < 37; $count++) { if (($day % 7) == 0) { $day = 0; $returnCode .= '' . $intToDay[$day] . ''; } else { if (($day % 6) == 0) { $returnCode .= '' . $intToDay[$day] . ''; } else { $returnCode .= '' . $intToDay[$day] . ''; } } $day++; } $returnCode .= ' '; //stampo i vari mesi for ($cmese = 1; $cmese < 13; $cmese++) { $xmese = $cmese - 1; $d = cal_days_in_month(CAL_GREGORIAN, $cmese, $this->anno); $inizio = (int) date("w", strtotime($cmese . '/01/' . $this->anno . ' 00:00:00')); $returnCode .= '' . $intToMonth[$cmese] . ''; $conteggio = 0; $day = 1; if ($inizio > 0) { for ($y = 1; $y < $inizio; $y++) { $conteggio++; if (($day % 7) == 0) { $day = 0; $returnCode .= ' '; } else { if (($day % 6) == 0) { $returnCode .= ' '; } else { $returnCode .= ' '; } } $day++; } } else { for ($y = 1; $y < 7; $y++) { $conteggio++; if (($day % 7) == 0) { $day = 0; $returnCode .= ' '; } else { if (($day % 6) == 0) { $returnCode .= ' '; } else { $returnCode .= ' '; } } $day++; } } //var_dump($returnCode); for ($counter = 1; $counter <= $d; $counter++) { if (in_array($counter, $giornimese[$xmese])) { $conteggio++; if (($day % 7) == 0) { $day = 0; } else { } $day++; $returnCode .= '' . $counter . ''; } else { $conteggio++; if (($day % 7) == 0) { $day = 0; $returnCode .= '' . $counter . ''; } else { if (($day % 6) == 0) { $returnCode .= '' . $counter . ''; } else { $returnCode .= '' . $counter . ''; } } $day++; //$returnCode .= ''.$counter.''; } } for ($y = $conteggio; $y < 37; $y++) { if (($day % 7) == 0) { $day = 0; $returnCode .= ' '; } else { if (($day % 6) == 0) { $returnCode .= ' '; } else { $returnCode .= ' '; } } $day++; } $returnCode .= ' '; } for ($count = 0; $count < array_search($startingDay, $intToDay); $count++) { $returnCode .= "
    "; } $returnCode .= ''; echo $returnCode; } function DB_visualizza_prezzi($table, $option = "") { $this->getConnection(); //array contenente il valore di ritorno // esecuzione della query //$result = $this->mysqli->query("SELECT count(idPrezziario) as NumeroRecord FROM $table WHERE $option and Periodo1 <>'NO'") ; $result = $this->mysqli->query("SELECT * FROM $table WHERE $option"); //if($this->debugger==1): echo("SELECT count(idPrezziario) as NumeroRecord FROM $table WHERE $option and Periodo1 <>'NO'") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0) { // generazione di un array multidimensionale $nrRecord = 0; while ($row = $result->fetch_array(MYSQLI_ASSOC)) { if ($row['Periodo1'] <> "NO") { $nrRecord++; } //$nrRecord = $row['NumeroRecord']; //echo $nrRecord; } $aPeriodo = array($nrRecord - 1); $aPeriodo1 = array($nrRecord - 1); $aPeriodo2 = array($nrRecord - 1); $aPeriodo3 = array($nrRecord - 1); $aPeriodo4 = array($nrRecord - 1); $aPeriodo5 = array($nrRecord - 1); $aPrezzo1 = array($nrRecord - 1); $aPrezzo2 = array($nrRecord - 1); $aPrezzo3 = array($nrRecord - 1); $aPrezzo4 = array($nrRecord - 1); $aPrezzo5 = array($nrRecord - 1); $aPrezzo6 = array($nrRecord - 1); $aPrezzo7 = array($nrRecord - 1); $aPrezzo8 = array($nrRecord - 1); $result_a = $this->mysqli->query("SELECT * FROM $table WHERE $option "); //if($this->debugger==1): echo("SELECT * FROM $table WHERE $option ") ; endif; // conteggio dei record restituiti dalla query if ($result_a) { if ($result_a->num_rows > 0) { //echo "entro"; $count = 0; while ($row_z = $result_a->fetch_array(MYSQLI_ASSOC)) { if ($row_z['Periodo1'] <> "NO") { $aPeriodo[$count] = $row_z['Periodo']; $count++; } } //print_r($aPeriodo); $count = 0; foreach ($aPeriodo as $valore) { $result_a = $this->mysqli->query("SELECT * FROM $table WHERE $option and Periodo = '$valore'"); //if($this->debugger==1): echo("SELECT * FROM $table WHERE $option and Periodo = '$valore'") ; endif; // conteggio dei record restituiti dalla query if ($result_a) { if ($result_a->num_rows > 0) { //echo "entro"; while ($row_z = $result_a->fetch_array(MYSQLI_ASSOC)) { if ($row_z['Periodo1'] <> "NO") { $aPeriodo1[$count] = $row_z['Periodo1']; $aPeriodo2[$count] = $row_z['Periodo2']; $aPeriodo3[$count] = $row_z['Periodo3']; $aPeriodo4[$count] = $row_z['Periodo4']; $aPeriodo5[$count] = $row_z['Periodo5']; $aPrezzo1[$count] = $row_z['Prezzo1']; $aPrezzo2[$count] = $row_z['Prezzo2']; $aPrezzo3[$count] = $row_z['Prezzo3']; $aPrezzo4[$count] = $row_z['Prezzo4']; $aPrezzo5[$count] = $row_z['Prezzo5']; $aPrezzo6[$count] = $row_z['Prezzo6']; $aPrezzo7[$count] = $row_z['Prezzo7']; $aPrezzo8[$count] = $row_z['Prezzo8']; } } } } $count++; } // stampo a video ?> array_pieno($aPeriodo1) > 0) { ?> al", $valore); ?> array_pieno($aPeriodo2) > 0) { ?> al", $valore); ?> array_pieno($aPeriodo3) > 0) { ?> al", $valore); ?> array_pieno($aPeriodo4) > 0) { ?> al", $valore); ?> array_pieno($aPeriodo5) > 0) { ?> al", $valore); ?> array_pieno($aPrezzo1) > 0) { ?> 0) { $valore = substr($valore, $pos); } ?> array_pieno($aPrezzo2) > 0) { ?> 0) { $valore = substr($valore, $pos); } ?> array_pieno($aPrezzo3) > 0) { ?> 0) { $valore = substr($valore, $pos); } ?> array_pieno($aPrezzo4) > 0) { ?> 0) { $valore = substr($valore, $pos); } ?> array_pieno($aPrezzo5) > 0) { ?> 0) { $valore = substr($valore, $pos); } ?> array_pieno($aPrezzo6) > 0) { ?> 0) { $valore = substr($valore, $pos); } ?> array_pieno($aPrezzo7) > 0) { ?> 0) { $valore = substr($valore, $pos); } ?> array_pieno($aPrezzo8) > 0) { ?> 0) { $valore = substr($valore, $pos); } ?>
    € >
    close(); } } //disconnessione $this->closeConnection(); } function array_pieno($valore) { $pieno = 0; //print_r($valore); foreach ($valore as $val) { if (!empty(trim($val))) { $pieno = 1; } } //echo "restituisce: " . $pieno; return $pieno; } function get_conta_investimenti(){ $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno=0; // esecuzione della query $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Invest = 1 order by posizione asc ") ; //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo ") ; endif; // conteggio dei record restituiti dalla query if($result_a): if($result_a->num_rows >0): // generazione di un array multidimensionale while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $arrayRitorno++; endwhile; $result_a->close(); endif; endif; //disconnessione $this->closeConnection(); //ritorno l´array con il result_a return $arrayRitorno; } function get_conta_nuovo(){ $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno=0; // esecuzione della query $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Nuovo = 1 order by posizione asc ") ; //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo ") ; endif; // conteggio dei record restituiti dalla query if($result_a): if($result_a->num_rows >0): // generazione di un array multidimensionale while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $arrayRitorno++; endwhile; $result_a->close(); endif; endif; //disconnessione $this->closeConnection(); //ritorno l´array con il result_a return $arrayRitorno; } function get_conta_ribasso(){ $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno=0; // esecuzione della query $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and ribasso = 1 order by posizione asc ") ; //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo ") ; endif; // conteggio dei record restituiti dalla query if($result_a): if($result_a->num_rows >0): // generazione di un array multidimensionale while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $arrayRitorno++; endwhile; $result_a->close(); endif; endif; //disconnessione $this->closeConnection(); //ritorno l´array con il result_a return $arrayRitorno; } function get_conta_lusso(){ $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno=0; // esecuzione della query $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and lusso = 1 order by posizione asc ") ; //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo ") ; endif; // conteggio dei record restituiti dalla query if($result_a): if($result_a->num_rows >0): // generazione di un array multidimensionale while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $arrayRitorno++; endwhile; $result_a->close(); endif; endif; //disconnessione $this->closeConnection(); //ritorno l´array con il result_a return $arrayRitorno; } function get_conta_affitto($id_tipologia) { $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno = 0; // esecuzione della query if ($id_tipologia > 0) { $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = 2 and Categoria = 'Re'"); } else { $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = 2 and Categoria = 'Co'"); } //if($this->debugger==1): echo("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = $id_tipo ") ; endif; // conteggio dei record restituiti dalla query if ($result_a): if ($result_a->num_rows > 0): // generazione di un array multidimensionale while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $arrayRitorno++; endwhile; $result_a->close(); endif; endif; //disconnessione $this->closeConnection(); //ritorno l´array con il result_a echo $arrayRitorno; } function get_conta_annuncio_isola($id_tipo, $isola, $id_comune) { $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno = 0; // esecuzione della query if ($id_comune > 0) { $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE Archivio = 0 and cancellato = 0 and Venduto = 0 and Disattivo = 0 and Comune = '" . $isola . "'"); } else { if ($id_tipo > 0) { $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and Annuncio = " . $id_tipo . " and isola = '" . $isola . "'"); } else { $result_a = $this->mysqli->query("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and isola = '" . $isola . "'"); } } //echo("SELECT * FROM annuncio WHERE archivio = 0 and cancellato = 0 and venduto = 0 and disattivo = 0 and isola = '" . $isola . "'"); // conteggio dei record restituiti dalla query if ($result_a): if ($result_a->num_rows > 0): // generazione di un array multidimensionale while ($row_a = $result_a->fetch_array(MYSQLI_ASSOC)): $arrayRitorno++; endwhile; $result_a->close(); endif; endif; //disconnessione $this->closeConnection(); //ritorno l´array con il result_a return $arrayRitorno; } function get_conta_annuncio_comune($id_tipo, $comune){ $this->getConnection(); $comune = $this->mysqli->real_escape_string($comune); $sql = " SELECT COUNT(*) AS totale FROM annuncio WHERE Archivio = 0 AND Cancellato = 0 AND Venduto = 0 AND Disattivo = 0 AND Comune = '$comune' "; if ($id_tipo > 0) { $sql .= " AND Annuncio = " . intval($id_tipo); } $result = $this->mysqli->query($sql); $totale = 0; if ($result && $row = $result->fetch_assoc()) { $totale = (int)$row['totale']; } $this->closeConnection(); return $totale; } //query SELECT function DB_select_campo($table, $nomecampo, $option = "") { $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno = ""; // esecuzione della query $result = $this->mysqli->query("SELECT * FROM $table WHERE $option "); //if($this->debugger==1): echo("SELECT * FROM $table WHERE $option") ; endif; // conteggio dei record restituiti dalla query if ($result) { if ($result->num_rows > 0) { // generazione di un array multidimensionale while ($row = $result->fetch_array(MYSQLI_ASSOC)) { $arrayRitorno = $row[$nomecampo]; } $result->close(); } } //disconnessione $this->closeConnection(); //ritorno l´array con il result return $arrayRitorno; } //query SELECT function DB_select($table, $option = "") { $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno = array(); // esecuzione della query $result = $this->mysqli->query("SELECT * FROM $table WHERE $option "); //if($this->debugger==1): echo("SELECT * FROM $table WHERE $option") ; endif; // conteggio dei record restituiti dalla query if ($result): if ($result->num_rows > 0): // generazione di un array multidimensionale while ($row = $result->fetch_array(MYSQLI_ASSOC)): $arrayRitorno[] = $row; endwhile; $result->close(); endif; endif; //disconnessione $this->closeConnection(); //ritorno l´array con il result return $arrayRitorno; } //query INSERT function DB_insert($table, $option_name, $option_value) { $this->getConnection(); // esecuzione della query $result = $this->mysqli->query("INSERT INTO $table ($option_name) VALUES ($option_value)"); //if ($this->debugger == 1): echo ("INSERT INTO $table ($option_name) VALUES ($option_value)"); //endif; //disconnessione $this->closeConnection(); return $result; } //query UPDATE function DB_update($table, $option, $where_cause) { $this->getConnection(); // esecuzione della query $result = $this->mysqli->query("UPDATE $table SET $option WHERE $where_cause "); if ($this->debugger == 1): echo ("UPDATE $table SET $option WHERE $where_cause "); endif; //disconnessione $this->closeConnection(); return $result; } //query DELETE function DB_delete($table, $option) { $this->getConnection(); //array contenente il valore di ritorno $arrayRitorno = array(); // esecuzione della query $this->mysqli->query("DELETE FROM $table WHERE $option "); if ($this->debugger == 1): echo ("DELETE FROM $table WHERE $option "); endif; //disconnessione $this->closeConnection(); } /* **fatemi sapere cosa ne pensate e soprattutto se avete dubbi e quali aricoli volete **le mie guide sono totalmente free,l'unica cosa che chiedo é il vostro sostegno 🙂 */ } ?>