Jump to content
Sign in to follow this  
lucasbicalleto

While e Webservice

Recommended Posts

Olá Pessoal ,boa tarde.

Tenho um WS aqui que faz uma consulta, e teria que me retornar as ultimas compras feita , porem me retorna apenas o Ultimo ,não todos.

index.html

<!DOCTYPE html>
<html lang="pt">
<head>
  <meta charset="utf8" />
  <title>Ciclum Tecnologia</title>
  <meta name="description" content="">
  <meta name="author" content="Padmanaban, Mine Web Design">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  
  <link href='http://fonts.googleapis.com/css?family=Raleway:400,300,600' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/normalize.css">
  <link rel="stylesheet" href="css/style.css">

</head>
<body>
<div class="row">
	<div class="container">
		<form action="include/mostra.php" method="post" class="form-signin">
			<h4 class="section-heading"><span>Acesso Usuario | Ciclum </span></h4>
			<div class="row">
				<div class="column">
					<label><span id="ast">*</span>Acesso permitido so ao titular</label>
					<input id="username" name="cartao" class="full-width" type="number" placeholder="Numero do Cartao" />
				</div>
			</div>
			<br/>
			<input class="button-submit" type="submit" value="ACESSAR" />
			
			<div class="row">
				<a href="www.ciclum.com.br" class="forgot">Ciclum Tecnologia</a>
			</div>
		</form>
	</div>
</div>
</body>
</html>

mostra.php

<?php
	@session_start(); 	
	$nucartao = $_SESSION['cartao'];
?>
<?php
		
		require_once 'vale-consulta.php';
		
	
	try {

		$dados = array(
			'cd_grupo'        => '38',
			'de_login_usu'    => 'vale.consulta',
			'de_senha_usu'    => 'v3r5b6',
			'nu_cartao'       => "$nucartao",
			'fl_apenas_saldo' => 'N'
		);

		$vale = new ValeConsulta();
		$resposta = $vale->consultar( $dados );

    if ( $vale->tem_erro() ) {}
	else {
        $nome  =  $resposta->nome. 	 "<br>";
        $saldo =  $resposta->vl_saldo. "<br>";
		$lact  =  $resposta->lancamentos->lancto->dt_lancto. "<br>";
		$lact2 =  $resposta->lancamentos->lancto->descricao. "<br>";
		$lact3 =  $resposta->lancamentos->lancto->valor.     "<br>";
		$lcts  =  $lact2."<br>".$lact."<br>".$lact3."<br> -------------- <br>";
		
    }

	} catch( SoapFault $fault ) {
		echo "Erro: " . $fault->faultcode . " - " . $fault->faultstring;
	}
?>

/user/index.php

<?php
	@session_start(); 	
	
	$seguranca2 = $_SESSION['seguranca'];
	
	if(($seguranca2) < 1)
	{
		echo "<script>document.location.href='../index.html';</script>";
		session_destroy();
		exit;
	}
	
	$nucartao = $_SESSION['cartao'];
	include("../include/mostra.php");
	$i = 1;
	
?>
<html>
	<head>
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<title>Cpainel</title>
		<link rel="stylesheet" href="../include/style.css" />
	</head>

	
	<body>
    <div class="container">
      <input type='checkbox' id='new' style='display:none;' />
      <h1><a id="saldo"><?php echo $nome; ?></a></h1>
      <nav>
        <ul>
		  <li><a id="saldo"><?php echo $saldo; ?></a></li>
          <li><a href='#'>Inicio</a></li>
          <li><a href='#'>Rede Credenciada</a></li>
          <li><a href='sair.php'>Sair</a></li>
        </ul>
      </nav>
	  
    <main>
        <label class='toggleMenu' for='new'> <span class='bar'></span> <span class='bar'></span> <span class='bar'></span> </label>
			<h1>Ciclum Tecnologia</h1>
				<div align="center">
					<?php
						while($i <= 5){
							echo $lcts;
							 $i ++;
						}
					?>
				</div>
	</main>
	  
    </div><script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-46156385-1', 'cssscript.com');
  ga('send', 'pageview');

</script>
</body>
</html>

Alguem da uma luz ?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

Ao usar o fórum, você concorda com nossos Terms of Use.