public function getTextos() { //$this->dtainicio, $this->dtafim $datas = mysql_query("SELECT datas.DTAINICIO, datas.DTAFIM FROM \r\n\t\t datas \r\n\t\t INNER JOIN pacotes_rel_datas ON pacotes_rel_datas.CODDTA=datas.CODDTA\r\n\t\t INNER JOIN pacotes ON pacotes.CODPACOTE=pacotes_rel_datas.CODPACOTE\r\n\t\t WHERE datas.CODDTA!=''\r\n\t\t AND datas.STATUS=1\r\n\t\t AND (pacotes.STATUS=1 OR pacotes.STATUS=0)\r\n\t\t AND pacotes.CODQUARTOTIPO='" . $this->codquartotipo . "'\r\n\t\t GROUP BY datas.CODDTA\r\n\t\t ORDER BY datas.DTAINICIO ASC"); $controle = false; if (mysql_num_rows($datas) != 0) { $arrDtas = arrayDtas($datas); if (in_array($this->dtainicio, $arrDtas) || in_array($this->dtafim, $arrDtas)) { $controle = true; } } $controle = false; //if( $this->analisaPacote( $this->dtainicio, $this->dtafim ) && $this->codpacote == "") if ($controle) { $html .= "<div id='inline1' style='display: block;'>"; $html .= "<p>"; $html .= "<form id='formReserva' name='form1' method='post' novalidate action='index.php?actionType=reservas.forma.pgto.cielo' style='max-width: initial'>"; $html .= "<div class='ContainerAcomodacao pag-deposito'>"; $html .= "<p>"; $html .= "<div class='sep-pattern-1'></div>"; $html .= "<center>"; $html .= "<h1 class='alert-green' style='font-size: 2.4rem;padding: 98px;'>"; $html .= getLabel('LABEL_DTA_RESERVAS', $_SESSION['LANGUAGE']); $html .= "</h1>"; $html .= "</center>"; $html .= "<div class='sep-pattern-1'></div>"; $html .= "</p>"; $html .= "</div>"; $html .= "<div><a class='BtnFiltro small full-width push-right' href='http://www.maravista.com.br/pacotes-e-promocoes'>" . getLabel('LABEL_PACOTES', $_SESSION['LANGUAGE']) . "</a></div>"; $html .= "</form>"; $html .= "</p>"; $html .= "</div>"; } else { $html = "<div class='pag_interna reserva_item' style='padding:0 !important;'>"; $html .= "<div>"; if ($this->nom_pacote == "") { $html .= "<div class='pint_titulo Acomodacoes' style='border-bottom: none;height:8px'></div>"; } else { $html .= "<div class='pint_titulo Acomodacoes'>" . $this->nom_pacote . "</div>"; /*$html .= "<div class='pint_titulo Acomodacoes'>".$this->nom_temporada."</div>";*/ } $html .= "<div class='blog_view_img' style='background-image: url(" . $this->foto . ")'>"; $html .= "<h2 class='blog_view_title' >" . $this->quartotipo_name . "</h2>"; $html .= "</div>"; $html .= "<div class='painel'>"; //$html .= "<div class='Acomodacoes painel-label'>".getLabel('LABEL_PERIODO', $_SESSION['LANGUAGE'])."</div>"; $html .= "<h3>" . $this->getLabel('LABEL_CHEGADA') . ": " . $this->formataDataparabrasil($this->dtainicio) . "</h3>"; $html .= "<h3>" . $this->getLabel('LABEL_SAIDA_FORM') . ": " . $this->formataDataparabrasil($this->dtafim) . "</h3>"; if ($this->total_dias() == 1) { $html .= "<div>" . $this->total_dias() . " " . $this->getLabel('LABEL_DIA') . ".</div>"; } else { $html .= "<div>" . $this->total_dias() . " " . $this->getLabel('LABEL_DIAS') . ".</div>"; } $html .= "<div>" . $this->getLabel('LABEL_ADULTOS') . ": " . $this->adulto . "</div>"; $html .= "</div>"; $t = (int) $this->crianca0a5 + (int) $this->crianca6a12 + (int) $this->crianca12; if ($t != 0) { $html .= "<div class='painel'>"; $html .= "<div class='Acomodacoes painel-label'>" . $this->getLabel('LABEL_CRIANCAS') . "</div>"; $html .= "<div>5 anos: " . $this->crianca0a5 . "</div>"; $html .= "<div>de 6 a 12 anos: " . $this->crianca6a12 . "</div>"; $html .= "<div>acima de 12 anos: " . $this->crianca12 . "</div>"; $html .= "</div>"; } if (strlen($this->codpacote) == 32) { $html .= "<div class='painel'>"; $this->total = $this->getValorpacote(); $this->setNomepacote(); $this->total_formatado = $this->formataReais($this->getValorpacote()); $html .= "<div class='Acomodacoes painel-label'>" . $this->getLabel('LABEL_PACOTES') . "</div>"; $html .= "<div>" . $this->getLabel('LABEL_NOM_PACOTE') . ": " . $this->nomepacote . "</div>"; //$html .= "<div>".$this->getLabel('LABEL_TOTAL_PARCIAL').": ".$this->moeda." ".$this->total_formatado."</div>"; $html .= "</div>"; } else { //$html .= "<div class='Acomodacoes painel-label'>".$this->getLabel('LABEL_DIARIA')."</div>"; //$html .= "<div>".$this->getLabel("LABEL_SEGASEX").", ".$this->getLabel("LABEL_DIARIA")." ".$this->moeda." ".$this->formataReais($this->valor_Diadasemana)." x ".$this->qntd_Diadasemana." = ".$this->moeda." ".$this->total_dia_semana_formatado."</div>"; //$html .= "<div>".$this->getLabel("LABEL_SABADOM").", ".$this->getLabel("LABEL_DIARIA")." ".$this->moeda." ".$this->formataReais($this->valor_Finaldesemana)." x ".$this->qntd_Finaldesemana." = ".$this->moeda." ".$this->total_fim_semana_formatado."</div>"; //$html .= "<div>".$this->getLabel('LABEL_TOTAL_PARCIAL').": ".$this->moeda." ".$this->total_formatado."</div>"; } $html .= "</div>"; $this->start_tmp(); $this->isadulto1(); $a = $this->somaAdulto(); $b = $this->somaCrianca0a5(); $c = $this->somaCrianca6a12(); $d = $this->somaCrianca12(); if ($this->existe_acrescimo) { $html .= "<div class='painel'>"; $html .= "<div class='Acomodacoes painel-label'>" . getLabel('LABEL_RESERVA_ACRESCIMO', $_SESSION['LANGUAGE']) . "</div>"; $html .= "<div>" . $a . "</div>"; $html .= "<div>" . $b . "</div>"; $html .= "<div>" . $c . "</div>"; $html .= "<div>" . $d . "</div>"; $html .= "<div>" . $this->moeda . " " . $this->formataReais($this->acrescimo) . "</div>"; $html .= "</div>"; } $html .= "<div class='painel'>"; $html .= "<div class='Acomodacoes painel-label'>" . getLabel('LABEL_RESERVA', $_SESSION['LANGUAGE']) . "</div>"; $html .= "<div>"; $html .= "<form name='formReserva" . rand(10, 100) . "' id='formReserva" . rand(10, 100) . "' method='post' action='" . $this->https . "/index.php?actionType=reservas.continue' onSubmit='testa_termos(this.id);return false;'>"; $html .= "<br/>"; $html .= "<script>\r\n\t\t\t\t\t\t\tfunction testa_termos(id)\r\n\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\tvar guid = '#'+id;\r\n\t\t\t\t\t\t\t\tif( \$('#termos').is(':checked') )\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\tfield = document.getElementById('email');\r\n\t\t\t\t\t\t\t\t\tusuario = field.value.substring(0, field.value.indexOf('@')); \r\n\t\t\t\t\t\t\t\t\tdominio = field.value.substring(field.value.indexOf('@')+ 1, field.value.length); \r\n\t\t\t\t\t\t\t\t\t//alert('usuario: '+usuario+' dominio: '+ dominio);\r\n\t\t\t\t\t\t\t\t\tif ((usuario.length >=1) \r\n\t\t\t\t\t\t\t\t\t&& (dominio.length >=3) \r\n\t\t\t\t\t\t\t\t\t&& (usuario.search('@')==-1) \r\n\t\t\t\t\t\t\t\t\t&& (dominio.search('@')==-1) \r\n\t\t\t\t\t\t\t\t\t&& (usuario.search(' ')==-1) \r\n\t\t\t\t\t\t\t\t\t&& (dominio.search(' ')==-1) \r\n\t\t\t\t\t\t\t\t\t&& (dominio.search('.')!=-1) \r\n\t\t\t\t\t\t\t\t\t&& (dominio.indexOf('.') >=1)\r\n\t\t\t\t\t\t\t\t\t&& (dominio.lastIndexOf('.') < dominio.length - 1)) \r\n\t\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t\t\$(guid).submit();\r\n\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t\t\t\t\$('#email').css('border-color','#fa4343');\r\n\t\t\t\t\t\t\t\t\t\t\$('#email').css('background','#fecaca');\r\n\t\t\t\t\t\t\t\t\t} \r\n\t\t\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\t</script>"; $html .= $this->input_hidden(); $html .= "<div class='painel'>"; $html .= "<div class='Acomodacoes painel-label'>" . $this->getLabel('LABEL_HOSPEDES') . "</div><br />"; if ($this->adulto != 0) { $html .= "<label>" . $this->getLabel("LABEL_ADULTOS") . "</label><br/>"; $i = $this->adulto; $j = 1; $nm = 1; while ($i != 0) { $html .= "<div class='EntradaText' style='margin-bottom: 3px'>"; $html .= "<input type='text' name='hospede_adulto_" . $j . "' style='width: 328px;' required placeholder='" . $this->getLabel('LABEL_ADULTO') . " {$nm}' class='falecom' oninvalid=\"setCustomValidity('" . $this->getLabel('LABEL_NOM_REQUERIDO') . "');\" onchange=\"try{setCustomValidity('')}catch(e){}\"/>"; $html .= "</div>"; $i--; $j++; $nm++; } } if ($this->crianca0a5 != 0) { $html .= "<label>" . $this->getLabel('LABEL_CRIANCAS_5ANOS_2') . "</label><br/>"; $i = $this->crianca0a5; $j = 1; while ($i != 0) { $html .= "<div class='EntradaText' style='margin-bottom: 3px'>"; $html .= "<input type='text' name='hospede_crianca0a5_" . $j . "' style='width: 328px;' required placeholder='" . getLabel('LABEL_NOME', $_SESSION['LANGUAGE']) . "' class='falecom' oninvalid=\"setCustomValidity('" . $this->getLabel('LABEL_NOM_REQUERIDO') . "');\" onchange=\"try{setCustomValidity('')}catch(e){}\"/>"; $html .= "</div>"; $i--; $j++; } } if ($this->crianca6a12 != 0) { $html .= "<label>" . $this->getLabel('LABEL_CRIANCAS_6A12') . "</label><br/>"; $i = $this->crianca6a12; $j = 1; while ($i != 0) { $html .= "<div class='EntradaText' style='margin-bottom: 3px'>"; $html .= "<input type='text' name='hospede_crianca6a12_" . $j . "' style='width: 328px;' required placeholder='" . getLabel('LABEL_NOME', $_SESSION['LANGUAGE']) . "' class='falecom' oninvalid=\"setCustomValidity('" . $this->getLabel('LABEL_NOM_REQUERIDO') . "');\" onchange=\"try{setCustomValidity('')}catch(e){}\"/>"; $html .= "</div>"; $i--; $j++; } } if ($this->crianca12 != 0) { $html .= "<label>" . $this->getLabel('LABEL_CRIANCAS_ACIMA12') . "</label><br/>"; $i = $this->crianca12; $j = 1; while ($i != 0) { $html .= "<div class='EntradaText' style='margin-bottom: 3px'>"; $html .= "<input type='text' name='hospede_crianca12_" . $j . "' style='width: 328px;' required placeholder='" . getLabel('LABEL_NOME', $_SESSION['LANGUAGE']) . "' class='falecom' oninvalid=\"setCustomValidity('" . $this->getLabel('LABEL_NOM_REQUERIDO') . "');\" onchange=\"try{setCustomValidity('')}catch(e){}\"/>"; $html .= "</div>"; $i--; $j++; } } $html .= "</div>"; $html .= "<div class='painel'>"; $html .= "<label class='painel-label'>" . $this->getLabel('LABEL_RESP_RESERVA') . "</label><br/>"; $html .= "<div class='EntradaText' style='margin-bottom: 3px'>"; $html .= "<input type='text' name='responsavel_reserva' style='width: 328px;' required placeholder='" . $this->getLabel('LABEL_NOME') . "' class='falecom' oninvalid=\"setCustomValidity('" . $this->getLabel('LABEL_NOM_REQUERIDO') . "');\" onchange=\"try{setCustomValidity('')}catch(e){}\"/>"; $html .= "</div>"; $html .= "<div class='EntradaText' style='margin-bottom: 3px'>"; $html .= "<input type='text' name='email' id='email' style='width: 328px;' required placeholder='" . $this->getLabel('LABEL_EMAIL') . "' class='falecom' oninvalid=\"setCustomValidity('" . $this->getLabel('LABEL_EMAIL_REQUERIDO') . "');\" onchange=\"try{setCustomValidity('')}catch(e){}\"/>"; $html .= "</div>"; $html .= "<div class='EntradaText' style='margin-bottom: 3px'>"; $html .= "<input type='text' name='telefone' id='telefone' maxlength='50' style='width: 328px;' required placeholder='" . $this->getLabel('LABEL_FONE_CEL') . "' class='falecom' oninvalid=\"setCustomValidity('" . $this->getLabel('LABEL_TEL_REQUERIDO') . "');\" onchange=\"try{setCustomValidity('')}catch(e){}\"/>"; $html .= "</div>"; /* $html .="<script>$('#telefone').mask('(00) 00000-0000');</script>";*/ $html .= "</div>"; $html .= "<label>" . $this->getLabel('LABEL_SOLICITACOES') . "</label><br/>"; $html .= "<div class='EntradaText' style='margin-bottom: 3px'>"; $html .= "<textarea class='bloco' name='observacoes'></textarea><br/>"; $html .= "</div>"; /* $html .= "<label>Forma de Pagamento</label><br/>"; $html .= "<select name='forma_pgto' id='forma_pgto' class='select'>"; $html .= "<option value='1'>".$this->getLabel("LABEL_DEPOSITO")."</option>"; $html .= "<option value='2'>".$this->getLabel("LABEL_CARTAO_CREDITO")."</option>"; $html .= "</select><br/>"; */ $html .= "<div class='EntradaText ckr-termos' style='margin-bottom: 3px'>"; $html .= "<input type='checkbox' name='termos' id='termos' style='width: 10px !important'/> " . $this->getLabel('LABEL_DECL_TERMOS') . " <span><a href='http://www.maravista.com.br/termos' target='_blank'>" . getLabel('LABEL_LEIA_MAIS', $_SESSION['LANGUAGE']) . "</a></span>"; $html .= "</div>"; $html .= "<div class='total'><span>Total:<span> " . $this->moeda . " " . $this->total_formatado . "</div>"; $html .= "<div class='dtaCalendarioSubmit_div continuacao'>"; $html .= "<input class='dtaCalendarioSubmit btnCliqueAqui' type='submit' name='Reservar' value='" . $this->getLabel("LABEL_FAZER_RESERVA") . "'/>"; $html .= "</div>"; $html .= "</form>"; $html .= "</div>"; $html .= "<div>"; $html .= "<script>" . "\$('#forma_pgto').fancySelect();" . "</script>"; } return $html; }
#echo "SELECT DATEDIFF('{$df}','{$di}') AS DiffDate"; #die(); while ($di != $dfim) { #"SELECT DATE_ADD('{$di}', INTERVAL 1 DAY) as DTA<br/>"; $adianta1 = mysql_query("SELECT DATE_ADD('{$di}', INTERVAL 1 DAY) as DTA"); $adianta1 = mysql_fetch_object($adianta1); $di = $adianta1->DTA; if (!in_array($di, $arrDtas)) { $arrDtas[] = $di; } } return $arrDtas; } $datas = mysql_query("SELECT pacotes.CODPACOTE, datas.DTAINICIO, datas.DTAFIM FROM \r\n\tdatas \r\n\tINNER JOIN pacotes_rel_datas ON pacotes_rel_datas.CODDTA=datas.CODDTA\r\n\tINNER JOIN pacotes ON pacotes.CODPACOTE=pacotes_rel_datas.CODPACOTE\r\n\tWHERE datas.CODDTA!=''\r\n\tAND datas.STATUS=1\r\n\tAND (pacotes.STATUS=1 OR pacotes.STATUS=0)\r\n\tAND pacotes.CODQUARTOTIPO='{$codquartotipo}'\r\n\tGROUP BY datas.CODDTA\r\n\tORDER BY datas.DTAINICIO ASC"); if (mysql_num_rows($datas)) { $arrDtas = arrayDtas($datas); (int) ($qntd_quartos = mysql_num_rows(mysql_query("SELECT * FROM quartos\r\n\t\tINNER JOIN quartos_rel_quartos_tipo ON quartos_rel_quartos_tipo.CODQUARTO=quartos.CODQUARTO\r\n\t\tINNER JOIN quartos_tipo ON quartos_tipo.CODQUARTOTIPO=quartos_rel_quartos_tipo.CODQUARTOTIPO\r\n\t\tWHERE quartos_tipo.CODQUARTOTIPO='{$codquartotipo}' \r\n\t\tAND quartos_tipo.STATUS=1 \r\n\t\tAND quartos.STATUS=1\r\n\t\tGROUP BY quartos.CODQUARTO"))); (int) ($qntd_quartos_reservados = mysql_num_rows(mysql_query("SELECT * FROM reservas\r\n\t\tINNER JOIN reservas_rel_tipo_quarto ON reservas_rel_tipo_quarto.CODRESERVA=reservas.CODRESERVA\r\n\t\tINNER JOIN reservas_rel_datas ON reservas_rel_datas.CODRESERVA=reservas.CODRESERVA\r\n\t\tWHERE reservas_rel_datas.DTA BETWEEN '{$dtainicio}' AND '{$dtafim}' \r\n\t\tAND reservas_rel_tipo_quarto.CODTIPOQUARTO='{$codquartotipo}' AND reservas.STATUS=1\r\n\t\tGROUP BY reservas.CODRESERVA"))); (int) ($saida = mysql_num_rows(mysql_query("SELECT * FROM reservas\r\n\t\tINNER JOIN reservas_rel_tipo_quarto ON reservas_rel_tipo_quarto.CODRESERVA=reservas.CODRESERVA\r\n\t\tINNER JOIN reservas_rel_datas ON reservas_rel_datas.CODRESERVA=reservas.CODRESERVA\r\n\t\tWHERE reservas_rel_tipo_quarto.CODTIPOQUARTO='{$codquartotipo}' \r\n\t\tAND (reservas.STATUS=1 OR reservas.STATUS=3 OR reservas.STATUS=4 OR reservas.STATUS=5)\r\n\t\tAND reservas_rel_datas.DTA='{$dtainicio}' AND reservas_rel_datas.CHECK_IN='entrada'\r\n\t\tGROUP BY reservas.CODRESERVA"))); if ($saida) { if ($qntd_quartos == $saida) { echo Error("LABEL_DTA_RESERVAS"); return; } } else { $entrada = mysql_num_rows(mysql_query("SELECT * FROM reservas\r\n\t\t\tINNER JOIN reservas_rel_tipo_quarto ON reservas_rel_tipo_quarto.CODRESERVA=reservas.CODRESERVA\r\n\t\t\tINNER JOIN reservas_rel_datas ON reservas_rel_datas.CODRESERVA=reservas.CODRESERVA\r\n\t\t\tWHERE reservas_rel_tipo_quarto.CODTIPOQUARTO='{$codquartotipo}' \r\n\t\t\tAND (reservas.STATUS=1 OR reservas.STATUS=3 OR reservas.STATUS=4 OR reservas.STATUS=5)\r\n\t\t\tAND (reservas_rel_datas.DTA='{$dtafim}' AND reservas_rel_datas.CHECK_IN='saida')")); if ($qntd_quartos == $entrada) { echo Error("LABEL_DTA_RESERVAS"); return; } }