Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

rtavix

Connection request timed out" string

Recommended Posts

Amigos, boa tarde! Estou recebendo a seguinte mensagem de erro:

Mensagem "Solicitação de conexão tem tempo limite". + OracleLogicalTransaction {Oracle.ManagedDataAccess.Client.OracleLogicalTransaction} Oracle.ManagedDataAccess.Client.OracleLogicalTransaction. Fonte: seqüência de caracteres "Oracle Data Provider para .NET, Driver gerenciado". ($ exception) .StackTrace: em OracleInternal.ConnectionPool.PoolManager`3.Get (ConnectionString csWithDiffOrNewPwd, Boolean bGetForApp, CriteriaCtx CriteriaCtx, Cadeia affinityInstanceName, Boolean bForceMatch) em OracleInternal.ConnectionPool.OraclePoolManager.Get (ConnectionString csWithNewPassword, Boolean bGetForApp, CriteriaCtx criteriaCtx, String affinityInstanceName, Boolean bForceMatch) em OracleInternal.ConnectionPool.OracleConnectionDispenser`3.Get (ConnectionString cs, PM conPM, ConnectionString pmCS, SecureString protectedPassword, SecureString protectedProxyPassword,

em NHibernate.Tool.hbm2ddl.SuppliedConnectionProviderConnectionHelper.Prepare () em NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords (Dialect dialect, IConnectionHelper connectionHelper) em NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update (ISessionFactory sessionFactory) em NHibernate.Impl.SessionFactoryImpl. .ctor (Configuração cfg, mapeamento IMapping, configurações Settings, ouvintes EventListeners)

em NHibernate.Cfg.Configuration.BuildSessionFactory () em SDPJDominio.DataAccess.NhibernateHelper.HelpThreading () na D: \ Repositório SVN \ SDP \ SDPJ \ filiais \ SDPJ-V3.1.0 \ SDPJ-102 \ SDPJDominio \ DataAccess \ NhibernateHelper.cs : linha 41 em SDPJView.ImportacaoProcessoView.ImportacaoProcesso. <> c__DisplayClass20_0. <ProcessamentoTabela> b__0 (Dados do objeto) na D: \ Repositório SVN \ SDP \ SDPJ \ ramais \ SDPJ-V3.1.0 \ SDPJ-102 \ SDPJView \ ImportacaoProcessoView \ ImportacaoProcesso .aspx.cs: linha 209 em System.Threading.Tasks.Task.InnerInvoke () em System.Threading.Tasks.Task.Execute ()

 

DataAccess, NhibernateHelp:

 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mapping.Attributes;
using NHibernate.Cfg;
using NHibernate;
using System.IO;
using NHibernate.Context;
using System.Reflection;
using Oracle.ManagedDataAccess.Client;

namespace SDPJDominio.DataAccess
{
    public class NhibernateHelper
    {
        private ISessionFactory sessionFactory;


        public static ISession GetSession ()
        {
            if (! CurrentSessionContext.HasBind (Instance.GetSessionFactory ()))
                CurrentSessionContext.Bind (Instance.GetSessionFactory (). OpenSession ());
            
            return Instance.GetSessionFactory (). GetCurrentSession ();
        }
        
        public static ISessionFactory HelpThreading ()
        {
            MemoryStream stream = new System.IO.MemoryStream ();
            HbmSerializer.Default.Validate = true;
            //HbmSerializer.Default.Serialize(stream, AppDomain.CurrentDomain.GetAssemblies () .Where (w => w.FullName.Contains ("SDPJDomain").) FirstOrDefault ());
            HbmSerializer.Default.Serialize (stream, System.Reflection.Assembly.GetExecutingAssembly ());
            stream.Position = 0;
            Configuration configuration = new Configuration ();
            configuration.Configure ();
            configuration.SetProperty ("connection.connection_string", ConfigNhibernate.getConfig ());
            configuration.SetProperty ("current_session_context_class", "thread_static");
            configuration.AddInputStream (stream);
            stream.Close ();
            Instance.sessionFactory = configuration.BuildSessionFactory ();
            return Instance.sessionFactory;
        }

public NhibernateHelper ()
        {
            MemoryStream stream = new System.IO.MemoryStream ();
            HbmSerializer.Default.Validate = true;
            HbmSerializer.Default.Serialize (stream, System.Reflection.Assembly.GetExecutingAssembly ());
            stream.Position = 0;
            Configuration configuration = new Configuration ();
            configuration.Configure ();
            configuration.SetProperty ("connection.connection_string", ConfigNhibernate.getConfig ()); // add this line
            configuration.AddInputStream (stream);
            stream.Close ();

            sessionFactory = configuration.BuildSessionFactory ();
        }

        public static ISessionFactory SessionFactory
        {
            get {return Instance.sessionFactory; }
        }

        private ISessionFactory GetSessionFactory ()
        {
            return sessionFactory;
        }

        public static NhibernateHelper Instance
        {
            get
            {
                return CreateSessionGenerator.
            }
        }

        public static ISession OpenSession ()
        {
            return Instance.GetSessionFactory (). OpenSession ();
        }

        public static void ReloadSession (object obj)
        {
            SessionRefresh (obj);
        }

        public static ISession SessionCurrent
        {
            get
            {
                
                if (! CurrentSessionContext.HasBind (Instance.GetSessionFactory ()))
                    return null;
                return Instance.GetSessionFactory (). GetCurrentSession ();
            }
        }

        class CreateSessionKey
        {
            internal static readonly NhibernateHelperSession Manager = new NhibernateHelper ();
        }


    }
}

 

line: 209

 

Action <object> processing = (data) =>
            {
                NHibernate.Context.ThreadStaticSessionContext.Bind (NhibernateHelper.HelpThreading ().OpenSession ());
            }

 

WebConfig:

 

<?xml version="1.0" encoding="utf-8"?>
<configuration>
	<configSections>
		<section name="extnet" type="Ext.Net.GlobalConfig" requirePermission="false" />
		<sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
			<section name="SDPJView.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
		</sectionGroup>
		<sectionGroup name="businessObjects">
			<sectionGroup name="crystalReports">
				<section name="rptBuildProvider" type="CrystalDecisions.Shared.RptBuildProviderHandler, CrystalDecisions.Shared, Version=13.0.2000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, Custom=null" />
				<section name="crystalReportViewer" type="System.Configuration.NameValueSectionHandler" />
			</sectionGroup>
		</sectionGroup>
		<section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
	</configSections>

	<extnet theme="Gray" />

    <location path="Content/temp">
        <system.web>
            <authorization>
                <allow users="?" />
            </authorization>
        </system.web>
    </location>
	<location path="Content/css">
		<system.web>
			<authorization>
				<allow users="?" />
			</authorization>
		</system.web>
	</location>
	<location path="Content/img_SDPJ">
		<system.web>
			<authorization>
				<allow users="?" />
			</authorization>
		</system.web>
	</location>
	<location path="Autenticacao">  
		<system.web>
			<authorization>
				<allow users="?" />
			</authorization>
		</system.web>
	</location>
	<appSettings>
		<add key="CodigoSistema" value="SDPJ" />
		<add key="CodigoModulo" value="INTRANET" />
		<add key="CrystalImageCleaner-AutoStart" value="true" />
		<add key="CrystalImageCleaner-Sleep" value="60000" />
		<add key="CrystalImageCleaner-Age" value="120000" />
	</appSettings>
	<connectionStrings>
		<add name="ADConnectionString" connectionString="LDAP://net.sefaz.es.gov.br" />
		<add name="ConnectionString" connectionString="DATA SOURCE=DAPP;PASSWORD=A#$##$$;USER ID=APL_SDP" providerName="Oracle.DataAccess.Client" />
	</connectionStrings>
	<businessObjects>
		<crystalReports>
			<rptBuildProvider>
				<add embedRptInResource="true" />
			</rptBuildProvider>
			<crystalReportViewer>
				<add key="ResourceUri" value="../../aspnet_client/system_web/4_0_30319/crystalreportviewers13" />
			</crystalReportViewer>
		</crystalReports>
	</businessObjects>
	<system.web>
		<!-- 
            Set compilation debug="true" to insert debugging 
            symbols into the compiled page. Because this 
            affects performance, set this value to true only 
            during development.
        -->
		<siteMap defaultProvider="XmlSiteMapProvider" enabled="true">
			<providers>
				<add name="XmlSiteMapProvider" description="Default SiteMap provider" type="System.Web.XmlSiteMapProvider" siteMapFile="~/Content/Navigation.sitemap" securityTrimmingEnabled="true" />
			</providers>
		</siteMap>
		<compilation debug="true">
			<assemblies>
				<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
				<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
				<add assembly="CrystalDecisions.CrystalReports.Engine, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
				<add assembly="CrystalDecisions.ReportSource, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
				<add assembly="CrystalDecisions.Shared, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
				<add assembly="CrystalDecisions.Web, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
				<add assembly="CrystalDecisions.ReportAppServer.ClientDoc, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
				<add assembly="Microsoft.ReportViewer.WebForms, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="Microsoft.ReportViewer.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="Microsoft.Build.Framework, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
				<add assembly="System.Management, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
			</assemblies>
		</compilation>
		<globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8" culture="pt-br" />
		<!--<globalization enableClientBasedCulture="false" requestEncoding="utf-8" responseEncoding="utf-8" fileEncoding="iso-8859-1" responseHeaderEncoding="utf-8" resourceProviderFactoryType="string" enableBestFitResponseEncoding="true" culture="pt-BR" uiCulture="pt-BR"/>-->
		<!--
            The <authentication> section enables configuration 
            of the security authentication mode used by 
            ASP.NET to identify an incoming user. 
        -->
		<authorization>
			<deny users="?" />
		</authorization>
		<authentication mode="Forms">
			<forms loginUrl="~/Autenticacao/Login.aspx" timeout="20" defaultUrl="~/Default.aspx" slidingExpiration="true" />
		</authentication>

		<sessionState timeout="10" />
		<machineKey validationKey="C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE" decryptionKey="8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F" validation="SHA1" />
		<membership defaultProvider="SDPJMembershipProvider">
			<providers>
				<clear />
				<add name="SDPJMembershipProvider" type="SDPJView.Seguranca.SDPJMembershipProvider" connectionStringName="ADConnectionString" writeExceptionsToEventLog="false" applicationName="/SDPJView" />
			</providers>
		</membership>
		<!--
            The <customErrors> section enables configuration 
            of what to do if/when an unhandled error occurs 
            during the execution of a request. Specifically, 
            it enables developers to configure html error pages 
            to be displayed in place of a error stack trace.

        <customErrors mode="RemoteOnly" defaultRedirect="GenericErrorPage.htm">
            <error statusCode="403" redirect="NoAccess.htm" />
            <error statusCode="404" redirect="FileNotFound.htm" />
        </customErrors>
        -->
		<customErrors mode="Off" />
		<!--<pages validateRequest="false" controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>-->
		<pages controlRenderingCompatibilityVersion="4.0" clientIDMode="AutoID">
			<controls>
				<add assembly="Ext.Net" namespace="Ext.Net" tagPrefix="ext" />
			</controls>
		</pages>
		<httpHandlers>
			<add path="*/ext.axd" verb="*" type="Ext.Net.ResourceHandler" validate="false" />
			<add verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" />
		</httpHandlers>
		<httpModules>
			<add name="DirectRequestModule" type="Ext.Net.DirectRequestModule, Ext.Net" />
		</httpModules>
		<httpRuntime maxRequestLength="102400" />
	</system.web>
	<!-- 
        The system.webServer section is required for running ASP.NET AJAX under Internet
        Information Services 7.0.  It is not necessary for previous version of IIS.
    -->
	<system.webServer>
		<httpErrors errorMode="Detailed" />
		<asp scriptErrorSentToBrowser="true" />
		<validation validateIntegratedModeConfiguration="false" />
		<modules runAllManagedModulesForAllRequests="true">
			<add name="DirectRequestModule" preCondition="managedHandler" type="Ext.Net.DirectRequestModule, Ext.Net" />
		</modules>
		<handlers accessPolicy="Read, Execute, Script">
			<add name="CrystalImageHandler.aspx_GET" verb="GET" path="CrystalImageHandler.aspx" type="CrystalDecisions.Web.CrystalImageHandler, CrystalDecisions.Web, Version=13.0.3500.0, Culture=neutral, PublicKeyToken=692fbea5521e1304" preCondition="integratedMode" />
			<add name="DirectRequestHandler" verb="*" path="*/ext.axd" preCondition="integratedMode" type="Ext.Net.ResourceHandler" />
			<add name="AboMapperCustom-9501872-V4" path="*.axd" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
			<add name="AboMapperCustom-9501871-V4.0" path="*.aspx" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
			<add name="AboMapperCustom-9501870-V4.0" path="*.asmx" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
			<add name="AboMapperCustom-9501869-V4.0" path="*.ashx" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
			<add name="AboMapperCustom-9501868-V4.0" path="*.ascx" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
			<add name="AboMapperCustom-9501867-V4.0" path="*.asax" verb="*" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
			<add name="ScriptResource" path="ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" resourceType="Unspecified" requireAccess="Script" preCondition="integratedMode" />
		</handlers>
	</system.webServer>
	<runtime>
		<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
			<dependentAssembly>
				<assemblyIdentity name="AjaxControlToolkit" publicKeyToken="28f01b0e84b6d53e" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-3.0.30930.28736" newVersion="4.1.50508.0" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" />
				<bindingRedirect oldVersion="1.0.0.0-4.5.10" newVersion="4.5.11" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="Ext.Net.Utilities" publicKeyToken="2c34ac34702a3c23" />
				<bindingRedirect oldVersion="0.0.0.0-2.2.0" newVersion="2.2.1" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="Transformer.NET" publicKeyToken="e274d618e7c603a7" />
				<bindingRedirect oldVersion="0.0.0.0-2.1.0" newVersion="2.1.1" />
			</dependentAssembly>
			<dependentAssembly>
				<publisherPolicy apply="no" />
				<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="CrystalDecisions.CrystalReports.Engine" publicKeyToken="692fbea5521e1304" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-13.0.2000.0" newVersion="13.0.2000.0" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="CrystalDecisions.Shared" publicKeyToken="692fbea5521e1304" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-13.0.3500.0" newVersion="13.0.3500.0" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="CrystalDecisions.ReportSource" publicKeyToken="692fbea5521e1304" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-13.0.2000.0" newVersion="13.0.2000.0" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-4.1.0.4000" newVersion="4.1.0.4000" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="Iesi.Collections" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="4.0.0.0" />
			</dependentAssembly>
			<dependentAssembly>
				<assemblyIdentity name="Castle.Core" publicKeyToken="407dd0808d44fbdc" culture="neutral" />
				<bindingRedirect oldVersion="0.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
			</dependentAssembly>
		</assemblyBinding>
	</runtime>
	<system.serviceModel>
		<bindings>
   <basicHttpBinding>
    <binding name="IntegrationWSBindingP" closeTimeout="00:10:50" openTimeout="00:10:05" receiveTimeout="00:10:05" sendTimeout="00:10:05" maxReceivedMessageSize="10000000">
     <security mode="Transport" />
    </binding>
    <binding name="IntegrationWSBindingH" closeTimeout="00:10:50" openTimeout="00:10:05" receiveTimeout="00:10:05" sendTimeout="00:10:05" maxReceivedMessageSize="10000000" />
   </basicHttpBinding>
  </bindings>
		<client>
   <endpoint address="https://portalinternet.banestes.com.br/br.com.banestes.djw.integration.server/IntegrationWSPort" binding="basicHttpBinding" bindingConfiguration="IntegrationWSBindingP" contract="IntegracaoBanestesProducao.IntegrationWS" name="IntegrationWSPort" />
   <endpoint address="http://portalinternet.h.banestes.com.br/br.com.banestes.djw.integration.server/IntegrationWSPort" binding="basicHttpBinding" bindingConfiguration="IntegrationWSBindingH" contract="IntegracaoBanestesHomologacao.IntegrationWS" name="IntegrationWSPort1" />
  </client>
		<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
		<standardEndpoints>
			<webScriptEndpoint>
				<standardEndpoint name="" crossDomainScriptAccessEnabled="true" />
			</webScriptEndpoint>
		</standardEndpoints>
	</system.serviceModel>
	
</configuration>

 

Compartilhar este post


Link para o post
Compartilhar em outros sites

  • Conteúdo Similar

    • Por belann
      Olá!
       
      Gerei uma chave de autenticação no github, mas quando eu vou dar o git push ele pede usuário e senha já verifiquei parece que está tudo certo
       ssh -T git@github.com
      Hi Username! You've successfully authenticated, but GitHub does not provide shell access.
      dá essa mensagem e verifico o agente e ele adicionou a chave gerada, mas não funciona.
    • Por Jack Oliveira
      Ola estou fazendo um instalador de banco de dados 
       
      em parte funciona  
       
      Mas quando uso o
      <<<HTML
       
      HTML;
       
      Ele fica com estas informações no top
       
      7.4 ao 8.38.0.28512MOnOnOnOffOffOnOffOffOnOnOnOnOnprogress-bar-success
       
      <?php $MeuHtml = <<<HTML <!DOCTYPE html> <html> <head><meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Instalação {$autor}</title> <link rel="icon" href="{$urlApi}api/allinstall/assets/icone.png?v={$versao}" sizes="32x32"> <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport"> <link rel="stylesheet" href="{$urlApi}api/allinstall/assets/css/app.css?v={$versao}"> <style type="text/css"> .license { background-color: #FFF; height: 400px; width: 100%; margin: 10px; } .form-control{ margin-bottom: 5px; } #primary{background: #FF6403} .paper-card{background: #272c33} .card{background: none;} .sw-theme-circles>ul.step-anchor:before{background-color: #30363d} .sw-theme-circles>ul.step-anchor>li>a{border: 3px solid #30363d} .sw-theme-circles>ul.step-anchor>li>a{background: #f5f5f5; min-width: 50px; height: 50px; text-align: center; -webkit-box-shadow: inset 0 0 0 3px #fff!important; box-shadow: inset 0 0 0 3px #fff!important; text-decoration: none; outline-style: none; z-index: 99; color: #999; background: #fff; line-height: 2; font-weight: bold;} .sw-theme-circles>ul.step-anchor>li{margin-left: 15%;} .card-header{border-bottom: 0} .table-striped tbody tr:nth-of-type(odd){background-color: #30363d;} .table-bordered{border: 1px solid #30363d;} .table-bordered td, .table-bordered th { border: 1px solid #30363d; } </style> </head> <body class="light loaded"> <div id="app"> <main> <div id="primary" class="p-t-b-100 height-full"> <div class="container"> <div class="row"> <div class="col-lg-8 mx-md-auto paper-card"> <div class="text-center"> <img class="img-responsive" src="{$urlApi}api/allinstall/assets/{$imagem}?v={$versao}"> <p><strong><H3>Instalação {$projeto} | V: {$versao}</H3></strong></p> </div> HTML; if (!isset($_GET['step']) || $_GET['step'] == '1') { $MeuHtml .= <<<HTML <div class="card no-b"> <div class="card-header pb-0"> <div class="stepper sw-main sw-theme-circles" id="smartwizard" data-options='{ "theme":"sw-theme-circles", "transitionEffect":"fade" }'> <ul class="nav step-anchor"> <li><a href="#step-1y">1</a></li> <li><a href="#step-2y">2</a></li> <li><a href="#step-3y">3</a></li> <li><a href="#step-4y">4</a></li> </ul> </div> </div> <div class="card-body"> <h6><b>Configurações do Servidor</b></h6><br> <table class="table table-condensed table-bordered table-striped"> <tr> <th>Função / Extensão</th> <th>Config. Necessária</th> <th>Config. Atual</th> <th width="50px">Status</th> </tr> <tr> <td>Versão do PHP</td> <td> HTML; echo $php7. ' ao '.$php8; $MeuHtml .= <<<HTML </td> <td> HTML; echo phpversion(); $MeuHtml .= <<<HTML </td> <td> HTML; if(phpversion() >= $php7 && phpversion() <= $php8) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> HTML; $MeuHtml .= <<<HTML <tr> <td>Memória do PHP</td> <td>128MB</td> <td> HTML; echo $mem = ini_get('memory_limit'); $MeuHtml .= <<<HTML </td> <td> HTML; if($mem >= 128) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>cURL</td> <td>On</td> <td> HTML; if(function_exists('curl_init')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(function_exists('curl_init')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>Allow URL fopen</td> <td>On</td> <td> HTML; if(ini_get('allow_url_fopen')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(ini_get('allow_url_fopen')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>File Get Contents</td> <td>On</td> <td> HTML; if(function_exists('file_get_contents')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(function_exists('file_get_contents')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>Sessão Auto Start</td> <td>Off</td> <td> HTML; if(ini_get('session_auto_start')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(!ini_get('session_auto_start')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>Safe Mode</td> <td>Off</td> <td> HTML; if(ini_get('safe_mode')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(!ini_get('safe_mode')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>Short Open Tags</td> <td>On</td> <td> HTML; if(ini_get('short_open_tag')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(ini_get('short_open_tag')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>Magic Quotes GPC</td> <td>Off</td> <td> HTML; if(ini_get('magic_quotes_gpc')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(!ini_get('magic_quotes_gpc')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>Register Globals</td> <td>Off</td> <td> HTML; if(ini_get('register_globals')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(!ini_get('register_globals')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>PHPMail</td> <td>On</td> <td> HTML; if(function_exists('mail')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(function_exists('mail')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { $i = $i + 1; echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>MySQLi</td> <td>On</td> <td> HTML; if(extension_loaded('mysqli')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(extension_loaded('mysqli')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>ZIP</td> <td>On</td> <td> HTML; if(extension_loaded('zip')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(extension_loaded('zip')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>MBString</td> <td>On</td> <td> HTML; if(extension_loaded('mbstring')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(extension_loaded('mbstring')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> <tr> <td>XML</td> <td>On</td> <td> HTML; if(extension_loaded('libxml')) { echo 'On'; } else { echo 'Off'; } $MeuHtml .= <<<HTML </td> <td> HTML; if(extension_loaded('libxml')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> </table> <hr> <h6><b>Diretórios e Permissões de Arquivos</b></h6><br> <table class="table table-condensed table-bordered table-striped"> <tr> <th>Diretório</th> <th style="width: 40px">Status</th> </tr> <tr> <td>database</td> <td> HTML; if(is_writable('database')) { $i = $i + 1; echo '<button type="button" class="btn btn-success"><i class="icon-check"></i></button>'; } else { echo '<button type="button" class="btn btn-danger"><i class="icon-close"></i></button>'; } $MeuHtml .= <<<HTML </td> </tr> </table> <hr> <h6><b>Pontuação / Compatibilidade</b></h6><br> <div class="progress"> <div class="progress-bar progress-bar-striped progress-bar-animated HTML; echo ProgressBar(substr(VerificaPontuacao($i,'16'),0,4)); $PontPorce = VerificaPontuacao($i,'16'); $pont100 = substr(VerificaPontuacao($i,'16'),0,4); $MeuHtml .= <<<HTML " role="progressbar" aria-valuemax="100" style="width: {$PontPorce}%;"> <strong>{$pont100} / 100</strong> </div> </div> <center> <br> <button class="btn btn-primary" onclick="document.location.href='{$URL}?step=1';">Verificar</button> <button class="btn btn-primary" onclick="document.location.href='{$URL}?step=2';">Próximo</button> </center> </div> </div> HTML; } elseif (isset($_GET['step']) && $_GET['step'] == '2') { $MeuHtml .= <<<HTML <div class="card no-b"> <div class="card-header pb-0"> <div class="stepper sw-main sw-theme-circles" id="smartwizard" data-options='{ "theme":"sw-theme-circles", "transitionEffect":"fade" }'> <ul class="nav step-anchor"> <li><a href="#step-1y">1</a></li> <li class="active"><a href="#step-2y">2</a></li> <li><a href="#step-3y">3</a></li> <li><a href="#step-4y">4</a></li> </ul> </div> </div> <div class="card-body "> <iframe src="{$urlApi}api/allinstall/termos.php{$Frame}" class="license" frameborder="0" scrolling="auto"></iframe> <form action="setup.php"> <input type="hidden" name="step" value="3"> <label><input type="checkbox" required=""> Sim, eu aceito</label> <center> <br> <a href="javascript:history.back()"><button class="btn btn-primary">Voltar</button></a> <button class="btn btn-primary" type="submit">Próximo</button> </center> </form> </div> </div> HTML; } elseif (isset($_GET['step']) && $_GET['step'] == '3') { $MeuHtml .= <<<HTML <div class="card no-b"> <div class="card-header pb-0"> <div class="stepper sw-main sw-theme-circles" id="smartwizard" data-options='{ "theme":"sw-theme-circles", "transitionEffect":"fade" }'> <ul class="nav step-anchor"> <li><a href="#step-1y">1</a></li> <li class="active"><a href="#step-2y">2</a></li> <li class="active"><a href="#step-3y">3</a></li> <li><a href="#step-4y">4</a></li> </ul> </div> </div> <div class="card-body"> <form method="post" action="?InstallDB"> <h6><b>1. MySQL - Configuração do Banco de Dados</b></h6><hr> <div class="form-group row"> <label class="col-sm-3 control-label">MySQL Host:</label> <div class="col-sm-9"> <input class="form-control" name="dbhost" value="localhost" required> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">Usuário MySQL:</label> <div class="col-sm-9"> <input class="form-control" name="dbuser" required> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">Senha MySQL:</label> <div class="col-sm-9"> <input class="form-control" name="dbpass"> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">Nome do Banco MySQL:</label> <div class="col-sm-9"> <input class="form-control" name="dbname" required> </div> </div> <h6><b>2. Configuração Comum</b></h6><hr> <div class="form-group row"> <label class="col-sm-3 control-label">Nome do Site:</label> <div class="col-sm-9"> <input class="form-control" name="nomesite" required> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">URL do Site:</label> <div class="col-sm-9"> <input class="form-control" name="urlsite" value="{$urlsite}" required> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">URL de Instalação:</label> <div class="col-sm-9"> <input class="form-control" name="siteurl" value="{$siteurl}" required> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">Extensão:</label> <div class="col-sm-9"> <select class="form-control" name="extensao" required> <option value=""> Selecionar Extensão </option> <option value="1"> MYSQLI </option> <option value="2"> PDO </option> </select> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">Define TimeZone:</label> <div class="col-sm-9"> <select class="form-control" name="timezone" id="timezone"> HTML; foreach ($timezones as $timezone) : echo '<option value="'.$timezone.'" '.$timezone === $current_timezone ? 'selected' : ''.'> '.$timezone.' </option>'; endforeach; $MeuHtml .= <<<HTML </select> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">E-mail:</label> <div class="col-sm-9"> <input class="form-control" name="email" required> <em>Mesmo e-mail cadastrado em nosso Site.</em> </div> </div> <h6><b>3. Configuração do Administrador</b></h6><hr> <div class="form-group row"> <label class="col-sm-3 control-label">Nome do Usuário:</label> <div class="col-sm-9"> <input class="form-control" name="usuario" required> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">Login:</label> <div class="col-sm-9"> <input class="form-control" name="login" required> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">Senha:</label> <div class="col-sm-9"> <input class="form-control" type="password" name="senha" required> </div> </div> <div class="form-group row"> <label class="col-sm-3 control-label">Senha[confimação]:</label> <div class="col-sm-9"> <input class="form-control" type="password" name="senhaconfirm" required> </div> </div> <center> <a class="btn btn-primary" href="javascript:history.back()">Voltar</a> <button class="btn btn-primary">Próximo</button> </center> </form> </div> </div> HTML; } elseif (isset($_GET['step']) && $_GET['step'] == '4') { $MeuHtml .= <<<HTML <div class="card no-b"> <div class="card-header pb-0"> <div class="stepper sw-main sw-theme-circles" id="smartwizard" data-options='{ "theme":"sw-theme-circles", "transitionEffect":"fade" }'> <ul class="nav step-anchor"> <li><a href="#step-1y">1</a></li> <li class="active"><a href="#step-2y">2</a></li> <li class="active"><a href="#step-3y">3</a></li> <li class="active"><a href="#step-4y">4</a></li> </ul> </div> </div> <div class="card-body"> <div> <h4><b>Instalação realizada com sucesso!</b></h4> <p>Agora você poderá utilizar o seu {$projeto}, em caso de dúvidas entre em contato com o suporte: <b>{$emailautor}</b></p> </div> <center> <form action="{$URL}?step=4" method="post"> <button type="submit" name="realizar_login" class="btn btn-primary">Realizar Login</button> </form> </center> </div> </div> HTML; } if (isset($_POST['realizar_login'])) { // Deletar os arquivos @unlink('setup.php'); @unlink($URL); @unlink('termos.php'); @unlink('database/BD.sql'); @unlink('controller/setup.php'); // Redirecionar para a página de login ou outra página desejada header('Location: login.php?finish'); exit; } $MeuHtml .= <<<HTML <div class="box-footer"> <center> Todos os Direitos Reservados {$autor} </center> </div> </div> </div> </div> </div> </main> </div> <script src="{$urlApi}api/allinstall/assets/js/app.js"></script> </body> </html> HTML; echo $MeuHtml;  
    • Por Jack Oliveira
      Ola pessoal, boa noite a todos
       
      Bom é o seguinte tenho um codigo html onde selecione um modelo de site para poder criar na base selecionada, ele criar ate então, mas ele esta pegando somente o index.html
      Mas quero que ele salva junto ao novo projeto o css, js, img, images, assets e fonts, quando faço os ajuste para que pega tudo isso ele me da erro ao salvar 
      Vou mostra parte do html onde faz a seleção dos modelos
       
      <!-- new page modal--> <div class="modal fade" id="new-page-modal" tabindex="-1" role="dialog"> <div class="modal-dialog" role="document"> <form id="newPageForm" method="POST" action="save.php"> <div class="modal-content"> <div class="modal-header"> <h6 class="modal-title text-primary fw-normal"><i class="la la-lg la-file"></i> Nova página</h6> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"> </button> </div> <div class="modal-body text"> <div class="mb-3 row" data-key="type"> <label class="col-sm-3 col-form-label"> Modelo <abbr title="O conteúdo deste modelo será usado como ponto de partida para o novo modelo"> <i class="la la-lg la-question-circle text-primary"></i> </abbr> </label> <div class="col-sm-9 input"> <div> <select class="form-select" name="startTemplateUrl"> <option value="themes/modelo-branco/branco-template.html">Modelo em branco</option> <option value="themes/modelo1/index.html">Modelo 1 de L2</option> <option value="themes/modelo2/index.html">Modelo 3 de L2</option> <option value="themes/modelo3/index.html">Modelo 3 de L2 </option> </select> </div> </div> </div> <div class="mb-3 row" data-key="href"> <label class="col-sm-3 col-form-label">Nome da página</label> <div class="col-sm-9 input"> <div> <input name="title" type="text" value="Minha página" class="form-control" placeholder="Minha página" required> </div> </div> </div> <div class="mb-3 row" data-key="href"> <label class="col-sm-3 col-form-label">Nome do arquivo</label> <div class="col-sm-9 input"> <div> <input name="file" type="text" value="my-page.html" class="form-control" placeholder="index.html" required> </div> </div> </div> <div class="mb-3 row" data-key="href"> <label class="col-sm-3 col-form-label">Salvar na pasta</label> <div class="col-sm-9 input"> <div> <input name="folder" type="text" value="my-pages" class="form-control" placeholder="/" required> </div> </div> </div> </div> <div class="modal-footer"> <button class="btn btn-secondary btn-lg" type="reset" data-bs-dismiss="modal"><i class="la la-times"></i> Cancelar</button> <button class="btn btn-primary btn-lg" type="submit"><i class="la la-check"></i> Criar página</button> </div> </div> </form> </div> </div> A ideia aqui é salvar tudo que tiver depois do themes/demo1/
      quando ele salva so salva 
      my-pasta/index.html
      e quando for salva ele salva dentro de um pasta Projetos/MeuSite1
      Projetos/MeuSite2  e assim vai
      Este é o save.php
       
      <?php define('MAX_FILE_LIMIT', 1024 * 1024 * 2);//Tamanho máximo de arquivo HTML de 2 megabytes define('ALLOW_PHP', false);//verifique se o html salvo contém tag php e não salve se não for permitido define('ALLOWED_OEMBED_DOMAINS', [ 'https://www.youtube.com/', 'https://www.vimeo.com/', 'https://www.twitter.com/' ]);//carregar URLs apenas de sites permitidos para oembed function sanitizeFileName($file, $allowedExtension = 'html') { $basename = basename($file); $disallow = ['.htaccess', 'passwd']; if (in_array($basename, $disallow)) { showError('Nome de arquivo não permitido!'); return ''; } //sanitize, remova o ponto duplo .. e remova os parâmetros get, se houver $file = preg_replace('@\?.*$@' , '', preg_replace('@\.{2,}@' , '', preg_replace('@[^\/\\a-zA-Z0-9\-\._]@', '', $file))); if ($file) { $file = __DIR__ . DIRECTORY_SEPARATOR . $file; } else { return ''; } //permitir apenas extensão .html if ($allowedExtension) { $file = preg_replace('/\.[^.]+$/', '', $file) . ".$allowedExtension"; } return $file; } function showError($error) { header($_SERVER['SERVER_PROTOCOL'] . ' 500 Internal Server Error', true, 500); die($error); } function validOembedUrl($url) { foreach (ALLOWED_OEMBED_DOMAINS as $domain) { if (strpos($url, $domain) === 0) { return true; } } return false; } $html = ''; $file = ''; $action = ''; if (isset($_POST['startTemplateUrl']) && !empty($_POST['startTemplateUrl'])) { $startTemplateUrl = sanitizeFileName($_POST['startTemplateUrl']); $html = ''; if ($startTemplateUrl) { $html = file_get_contents($startTemplateUrl); } } else if (isset($_POST['html'])){ $html = substr($_POST['html'], 0, MAX_FILE_LIMIT); if (!ALLOW_PHP) { //if (strpos($html, '<?php') !== false) { if (preg_match('@<\?php|<\? |<\?=|<\s*script\s*language\s*=\s*"\s*php\s*"\s*>@', $html)) { showError('PHP não permitido!'); } } } if (isset($_POST['file'])) { $file = sanitizeFileName($_POST['file']); } if (isset($_GET['action'])) { $action = htmlspecialchars(strip_tags($_GET['action'])); } if ($action) { //ações do gerenciador de arquivos, excluir e renomear switch ($action) { case 'rename': $newfile = sanitizeFileName($_POST['newfile']); if ($file && $newfile) { if (rename($file, $newfile)) { echo "Arquivo '$file' renomeado para '$newfile'"; } else { showError("Erro ao renomear arquivo '$file' renomeado para '$newfile'"); } } break; case 'delete': if ($file) { if (unlink($file)) { echo "Arquivo '$file' excluído"; } else { showError("Erro ao excluir arquivo '$file'"); } } break; case 'saveReusable': //bloco ou seção $type = $_POST['type'] ?? false; $name = $_POST['name'] ?? false; $html = $_POST['html'] ?? false; if ($type && $name && $html) { $file = sanitizeFileName("$type/$name"); if ($file) { $dir = dirname($file); if (!is_dir($dir)) { echo "$dir pasta não existe\n"; if (mkdir($dir, 0777, true)) { echo "$dir pasta foi criada\n"; } else { showError("Erro ao criar pasta '$dir'\n"); } } if (file_put_contents($file, $html)) { echo "Arquivo salvo '$file'"; } else { showError("Erro ao salvar arquivo '$file'\nAs possíveis causas são falta de permissão de gravação ou caminho de arquivo incorreto!"); } } else { showError('Nome de arquivo inválido!'); } } else { showError("Faltam dados de elementos reutilizáveis!\n"); } break; case 'oembedProxy': $url = $_GET['url'] ?? ''; if (validOembedUrl($url)) { header('Content-Type: application/json'); echo file_get_contents($url); } else { showError('URL inválida!'); } break; default: showError("Ação inválida '$action'!"); } } else { //salvar pagina if ($html) { if ($file) { $dir = dirname($file); if (!is_dir($dir)) { echo "$dir pasta não existe\n"; if (mkdir($dir, 0777, true)) { echo "$dir pasta foi criada\n"; } else { showError("Erro ao criar pasta '$dir'\n"); } } if (file_put_contents($file, $html)) { echo "Arquivo salvo '$file'"; } else { showError("Erro ao salvar arquivo '$file'\nAs possíveis causas são falta de permissão de gravação ou caminho de arquivo incorreto!"); } } else { showError('O nome do arquivo está vazio!'); } } else { showError('O conteúdo HTML está vazio!'); } } Espero que possam entender o que preciso aqui....  fico no aguardo!  quando eu tento mudar a forma de salva no php, ele me da erro de que não foi salvo, e volta ao orginal como esta ai acima ele salva, talvez eu esteja escapando alguma coisa que não estou vendo.... 
    • Por juliosonic
      Boa noite..
      Estou desenvolvendo um site de https://www.maithunatantra.com.br/ e estou com um duvida sobre o menu de navegação da versão mobile.
      O menu que tem o dropdown "Terapeutas" e "Terapias" quando clico em cima ele expande como deve ser, mas quando clico denovo para recolher os submenus
      nao acontece nada.. segue o trecho do codigo do menu..
      <div class="collapse navbar-collapse" id="navbarsExample09">             <ul class="navbar-nav ml-auto">               <li class="nav-item  active"><a class="nav-link" href="index.html">Home</a></li>               <li class="nav-item  active"><a class="nav-link" href="about-us.html">Quem Somos</a></li>               <li class="nav-item dropdown1">                     <a class="nav-link dropdown-toggle" data-toggle="dropdown1" href="#">Terapeutas</a>                     <ul class="dropdown-menu">                         <li><a class="dropdown-item" href="terapeuta-julio-cezar.html">Julio Cezar</a></li>                         <li><a class="dropdown-item" href="terapeuta-pamela-priscila.html">Pamela Priscila</a></li>                     </ul>                                    </li>               <li class="nav-item dropdown">                     <a class="nav-link dropdown-toggle" data-toggle="dropdown1" href="#">Terapias</a>                     <ul class="dropdown-menu" aria-labelledby="dropdown01">                         <li><a class="dropdown-item" href="o-que-e-reiki.html">O que é Reiki</a></li>                         <li><a class="dropdown-item" href="beneficios-reiki.html">Benefícios do Reiki</a></li>                         <li><a class="dropdown-item" href="principios-reiki.html">Princípios do Reiki</a></li>                         <li><a class="dropdown-item" href="animais-reiki.html">Reiki em Animais</a></li>                         <li><a class="dropdown-item" href="animais-reiki.html">Estudos Sobre Reiki</a></li>                         <li><a class="dropdown-item" href="terapia-massagem-tantrica.html">Terapia Tântrica</a></li>                     </ul>               </li>               <li class="nav-item  active"><a class="nav-link" href="blog.html">Blog</a></li>                <li class="nav-item"><a class="nav-link" href="contato.html">Contato</a></li>             </ul>         </div>  
      Massagem Tantrica em Curitiba
      Tantra Curitiba
      Massagem Tântrica
      Tantra
      Julio Darshan

      Obrigado
      Att
      Julio Cezar
       
       
       
    • Por joeythai
      Boa tarde pessoal,
       
      Eu criei um formulário em que tenho 3 interações: evento click, change e uma chamada ajax. No evento on change ("select#removal_table_from" )eu faço uma chamada ajax onde eu passo como parametro o id do item selecionado e construo uma tabela dinamica com o próprio javascript, após isto, tenho um input em que o usuario coloca um valor de percentual para que eu possa preencher em 3 colunas da tabela que foi criada dinamicamente: moto_atualizado, carro_atualizado e caminhao_atualizado, até aí tudo bem, o codigo está fazendo isso, porém, como a tabela é criada dinamicamente eu preciso de alguma forma enviar o arrayData para meu backend mas quando faço o calculo dentro do loop apos resposta do meu ajax, os valores desses 3 campos chegam como null, não sei se é possível fazer o que pretendo ou se é ainda não sei como faz
       
      <code>
           $(document).ready(function (event) {   let arrayData = []; let percentage; let removal_vehicle; let removal_motorcycle; let removal_tuck; let apply_removal = $('#apply_removal');   // apply_removal.on('click', function () { // percentage = $('#percentage').val();   // $('.table-body tr').each(function () {   // let veiculo = $(this).find('.veiculo').text(); // let moto = $(this).find('.moto').text(); // let caminhao = $(this).find('.caminhao').text();   // let removal_vehicle = parseFloat(veiculo) + (parseFloat(veiculo) * parseFloat(percentage)) / 100; // let removal_motorcycle = parseFloat(moto) + (parseFloat(moto) * parseFloat(percentage)) / 100; // let removal_tuck = parseFloat(caminhao) + (parseFloat(caminhao) * parseFloat(percentage)) / 100;   // arrayData.push({ // removal_vehicle, // removal_motorcycle, // removal_tuck // })   // $(this).find('.veiculo_atualizado').val(removal_vehicle.toFixed(2)); // $(this).find('.moto_atualizado').val(removal_motorcycle.toFixed(2)); // $(this).find('.caminhao_atualizado').val(removal_tuck.toFixed(2)); // }); // });   apply_removal.on('click', function () { percentage = $('#percentage').val();   $('.table-body tr').each(function () {   let veiculo = $(this).find('.veiculo').text(); let moto = $(this).find('.moto').text(); let caminhao = $(this).find('.caminhao').text();   removal_vehicle = parseFloat(veiculo) + (parseFloat(veiculo) * parseFloat(percentage)) / 100; removal_motorcycle = parseFloat(moto) + (parseFloat(moto) * parseFloat(percentage)) / 100; removal_tuck = parseFloat(caminhao) + (parseFloat(caminhao) * parseFloat(percentage)) / 100;   arrayData.push({ removal_vehicle, removal_motorcycle, removal_tuck })   $(this).find('.veiculo_atualizado').val(removal_vehicle.toFixed(2)); $(this).find('.moto_atualizado').val(removal_motorcycle.toFixed(2)); $(this).find('.caminhao_atualizado').val(removal_tuck.toFixed(2));     console.log('Removal Vehicle:', removal_vehicle); console.log('Removal Motorcycle:', removal_motorcycle); console.log('Removal Truck:', removal_tuck); }); });   $('select#removal_table_from').on('change', function (e) { let table_id = $(this).val(); let action = route('removal.removal-values.show', table_id);   $.ajax({ type: "GET", url: action, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') },   success: function (data) { $('.table-body').empty();   for (let i = 0; i < data.length; i++) { let carro = parseFloat(data[i].CARRO); let moto = parseFloat(data[i].MOTO); let caminhao = parseFloat(data[i].CAMINHAO); let distancia = data[i].DISTANCIA; let origem = data[i].ORIGEM; let destino = data[i].DESTINO; let localidadeOrigem = data[i].LocalidadeOrigem_ID; let localidadeDestino = data[i].LocalidadeDestino_ID;   let newRow = '<tr class="removal-row">' + '<td class="align-middle">' + '<div class="row">' + '<div class="col-1">' + '<span class="font-weight-bold">Origem</span><br>' + '<span class="origem">' + origem + '</span>' + '</div>' + '<div class="col-1">' + '<span class="font-weight-bold">Destino</span><br>' + '<span class="destino">' + destino + '</span>' + '</div>' + '<div class="col-1">' + '<span class="font-weight-bold">KM</span><br>' + '<span class="km">' + distancia + '</span>' + '</div>' + '<div class="col-1">' + '<span class="font-weight-bold">Veículo</span><br>' + '<span class="veiculo">' + carro + '</span>' + '</div>' + '<div class="col-2">' + '<span class="font-weight-bold">Veículo Atualizado</span><br>' + '<input type="text" class="veiculo_atualizado">' + '</div>' + '<div class="col-1">' + '<span class="font-weight-bold">Moto</span><br>' + '<span class="moto">' + moto + '</span>' + '</div>' + '<div class="col-2">' + '<span class="font-weight-bold">Moto Atualizado</span><br>' + '<input type="text" class="moto_atualizado">' + '</div>' + '<div class="col-1">' + '<span class="font-weight-bold">Caminhão</span><br>' + '<span class="caminhao">' + caminhao + '</span>' + '</div>' + '<div class="col-2">' + '<span class="font-weight-bold">Caminhão Atualizado</span><br>' + '<input type="text" class="caminhao_atualizado">' + '</div>' + '</div>' + '</div>' + '</td>' + '</tr>';   $('.table-body').append(newRow); //let row = $('.removal-row:last');   // Calcula o valor atualizado e define nos campos diretamente // let veiculo_atualizado = carro + (carro * percentage) / 100; // let moto_atualizado = moto + (moto * percentage) / 100; // let caminhao_atualizado = caminhao + (caminhao * percentage) / 100; // console.log('PORCENTS: ', percentage); //console.log('Veiculo Atualizado:', veiculo_atualizado, 'Moto Atualizado:', moto_atualizado, 'Caminhao Atualizado:', caminhao_atualizado);   // Define os valores diretamente nos campos da nova linha // row.find('.veiculo_atualizado').val(veiculo_atualizado.toFixed(2)); // row.find('.moto_atualizado').val(moto_atualizado.toFixed(2)); // row.find('.caminhao_atualizado').val(caminhao_atualizado.toFixed(2));   arrayData.push({ carro, moto, caminhao, distancia, origem, destino, localidadeOrigem, localidadeDestino, removal_vehicle, removal_motorcycle, removal_tuck }); }   $('#copy_data_table').val(JSON.stringify(arrayData)); }   }); });   //javascript para o formulario de cadastro // $(document).ready(function (event) { $('#uf').change(function () { let code_city = $(this).val(); let deposit = localStorage.getItem('selected_deposit_id'); let action = route('removal.removal-values.cities', code_city); $.ajax({ type: "POST", url: action, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, data: { code_city: code_city },   success: function (data) {   $('#city').empty(); $('#deposit').empty();   for (let i = 0; i < data.cities.length; i++) { $('#city').append('<option value="' + data.cities[i].NM + '">' + data.cities[i].NM + '<option>'); }   if (data.deposits.length > 0) { for (let i = 0; i < data.deposits.length; i++) { $('#deposit').append('<option value="' + data.deposits[i].NM + '">' + data.deposits[i].NM + '<option>'); } } else { // $('#deposit').prop('disabled', true); // $('#city').prop('disabled', false); }   $('#city').trigger('change'); } });   });   $('#deposit').on('change', function () { depositId = $(this).val(); localStorage.setItem('selected_deposit_id', depositId); });   $('#uf_destiny').change(function () { let code_city = $(this).val(); let depositDestiny = localStorage.getItem('selected_deposit_destiny_id'); let action = route('removal.removal-values.cities', code_city); $.ajax({ type: "POST", url: action, headers: { 'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content') }, data: { code_city: code_city },   success: function (data) {   $('#city_destiny').empty(); $('#deposit_destiny').empty();   for (let i = 0; i < data.cities.length; i++) { $('#city_destiny').append('<option value="' + data.cities[i].NM + '">' + data.cities[i].NM + '</option>'); }   if (data.deposits.length > 0) { // $('#deposit_destiny').prop('disabled', false); //$('#city_destiny').empty(); // $('#city_destiny').prop('disabled', true); for (let i = 0; i < data.deposits.length; i++) { $('#deposit_destiny').append('<option value="' + data.deposits[i].NM + '">' + data.deposits[i].NM + '</option>'); } } else { // $('#deposit_destiny').prop('disabled', true); // $('#city_destiny').prop('disabled', false); }   $('#city_destiny').trigger('change'); } }); });   $('#deposit_destiny').on('change', function () { let depositDestinyId = $(this).val(); localStorage.setItem('selected_deposit_destiny_id', depositDestinyId); });   }); </code>
×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.