Usamos cookies para medir audiência e melhorar sua experiência. Você pode aceitar ou recusar a qualquer momento. Veja sobre o iMasters.
cadastro.php
<?php session_start(). include_once 'includes/header.inc.php'. include_once 'includes/menu.inc.php'.?> <!-- Formulário de Cadastro Cliente --> <div class="row container"> <form action="banco_de_dados/create.php" method="post" class="col s12"> <fieldset class="formulario" style="padding: 1px. "> <legend><!--<img src="imagens/CadCli.png" alt="[imagem]" style="width:40x. height:40px">--></legend> <br> <?php if(isset($_SESSION['msg'])): echo $_SESSION['msg']. session_unset(). endif.?> <!-- Campo Nome --> <div class="input-field col s12"> <i class="material-icons prefix">account_circle</i> <input type="text" name="nome" id="nome" maxlength="40" required autofocus> <label for="nome">Nome</label> </div> <!-- Campo Instituição --> <div class="input-field col s12"> <i class="material-icons prefix">account_balance</i> <input type="text" name="inst" id="inst" maxlength="40" required autofocus> <label for="inst">Instituição</label> </div> <!-- Campo Telefone --> <div class="input-field col s12"> <i class="material-icons prefix">phone</i> <input type="text" name="telefone" id="telefone" maxlength="13" required> <label for="telefone">Telefone</label> </div> <!-- Campo Chave --> <div class="input-field col s12"> <i class="material-icons prefix">vpn_key</i> <input type="text" name="chave" id="chave" maxlength="4" required> <label for="chave">Chave</label> </div> <!-- Botões --> <div class="input-field col s12"> <input type="submit"style="width:120px. height:37px" value="cadastrar" class="btn blue"> <input type="reset" style="width:120px. height:37px" value="limpar" class="btn red"> </div> </fieldset> </form> </div> <?php include_once 'includes/script.inc.php'.?> ------------------------- create.php <?php
session_start(). include_once 'conexao.php'. $id = $_POST [ 'id' ]. $nome = $_POST [ 'nome' ]. $inst = $_POST [ 'inst' ]. $data = date('y-m-d'). $telefone = $_POST [ 'telefone' ]. $chave = $_POST [ 'chave' ]. $queryInsert = $link->query("insert into tb_cadastro VALUES ('".$id."', '".$nome."','".$inst."','".$data."','".$telefone."','".$chave."')"). $affected_rows = mysqli_affected_rows($link). if($affected_rows > 0): $_SESSION['msg'] = "<p class='center green-text'>".'Cadastrado com Sucesso!'."<br>". header("Location:../cadastro.php"). endif. --------------- relatorio.php <?php session_start(). include_once 'includes/header.inc.php'. include_once 'includes/menu.inc.php'.?> <!-- Formulário de Cadastro Cliente --> <div class="row container"> <p> . </p> <form action="banco_de_dados/consulta_rel.php" method="post" class="col s12"> <fieldset class="formulario" style="padding: 3px"> <legend><img src="imagens/relatorio.png" alt="[imagem]" style="width:55px. height:45px"></legend> <br> <?php if(isset($_SESSION['msg'])): echo $_SESSION['msg']. session_unset(). endif.?> <!-- Campo Data --> <div class="input-field col s12"> <i class="material-icons prefix">event_available</i> <input type="date" name="datainicial" id="data" maxlength="10" required> <label for="data">Data Inicial</label> </div> <div class="input-field col s12"> <i class="material-icons prefix">event_busy</i> <input type="date" name="datafinal" id="data" maxlength="10" required> <label for="data">Data Final</label> </div> <!-- Botões --> <div class="input-field col s12"> <input type="submit"style="width:120px. height:37px" value="Gerar" class="btn blue"> <input type="reset" style="width:120px. height:37px" value="limpar" class="btn red"> </div> </fieldset> </form> </div> <?php include_once 'includes/footer.inc.php'.?>
<?php include_once 'includes/script.inc.php'. ----------------- arquivo_rel.php?> <!-- Formulário de Cadastro Cliente --><div class="row container">
<p> . </p> <fieldset class="formulario" style="padding: 5px"> <legend><img src="imagens/relatorio.png" alt="[imagem]" style="width:55px. height:45px"></legend> <br> <?php if(isset($_SESSION['msg'])): echo $_SESSION['msg']. session_unset(). endif.?> <table class="highlight" > <thead> <tr> <th>Nome</th> <th>Instituição</th> <th>Data</th> </tr> </thead> </table> </fieldset>
</div> <?php include_once 'includes/footer.inc.php'.?>
<?php include_once 'includes/script.inc.php'. --------------- consulta_rel.php <?php session_start(). include_once 'conexao.php'. $datainicial = $_POST [ 'datainicial' ]. $datafinal = $_POST [ 'datafinal' ]. $sql= "select * from tb_cadastro where data between '$datainicial' and '$datainicial'". $consulta_rel = mysqli_query($link, $sql). echo "sql". if($consulta_rel) {
////// $_SESSION['msg'] = "<p class='center green-text'>".'Devolução efetuada com Sucesso!'."<br>". header("Location:../arquivo_rel.php"). exit(). } Alguma dica de como eu posso, mostrar os dados do cadastro, quando abro a pagina relatório e coloco as datas para consultaCarregando comentários...