<?php

 

       

     include("./bd/conexao.php");

    

     

?>

<!DOCTYPE html>

<html lang="en">



<head>

    <meta charset="utf-8">

    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">

    <title>    Cadastro - Carteira de Graham

</title>

    <link rel="stylesheet" href="/painel/admin-assets/vendors/ti-icons/css/themify-icons.css">

    <link rel="stylesheet" href="/painel/admin-assets/vendors/css/vendor.bundle.base.css">

    <link rel="stylesheet" href="/painel/admin-assets/css/horizontal-layout-light/style.css">

    <link rel="shortcut icon" href="/painel/admin-assets/images/favicon.png" />

</head>



<body>

    <div class="container-scroller">

        <div class="container-fluid page-body-wrapper full-page-wrapper">

            <div class="main-panel">

                <div class="content-wrapper d-flex align-items-center auth px-0">

                    <div class="row w-100 mx-0">

                        <div class="col-lg-4 mx-auto">

                            <div class="auth-form-light text-left py-5 px-4 px-sm-5">

                                <div class="brand-logo" align="text-center">

                                    <img src="./admin-assets/images/login.png" alt="logo" align="text-center">

                                </div>

                                <h4>    Novo por aqui?

</h4>

                                <h6 class="font-weight-light">    Faça seu cadastro, é rápido e fácil.

</h6>



<?php



    if(isset($_POST['acao']) && $_POST['acao'] == 'registrar'){


    
    $nome         = $_POST["nome"];

    $email   = $_POST['email'];

    $password  = $_POST['password'];





        if($nome == "" || $email == "" || $password == ""){

            echo "<script>alert('Os Campos Não Podem Ficar Vazios!');</script>";

        }else{

            $editaProduto = $link->query("INSERT INTO usuarios(nome,email,password) VALUES('$nome','$email','$password')");

        if($editaProduto){

              echo '<div class="content-wrapper">

                                            <div class="alert alert-success" role="alert">

                            Pagina sobre atualizada com sucesso.

                        </div>';

        }else{

            echo '<div class="content-wrapper">

                                            <div class="alert alert-warning" role="alert">

                            Ouve um erro ao Atualizar.

                        </div>';

        }

        }

    }

   ?>

                                    
<form class="pt-3" action="" method="POST" enctype="multipart/form-data">

        <input type="hidden" name="_token" value="sXHEX2anuSHDg2PYz3XcHkw7BntL72wVFmmR5jwI">

        <div class="form-group">

            <input type="text" class="form-control form-control-lg " placeholder="Nome" name="nome" required autocomplete="name" autofocus>

                    </div>



        <div class="form-group">

            <input type="text" class="form-control form-control-lg " placeholder="Email" name="email" required autocomplete="email">

                    </div>

        

        <div class="form-group">

            <input type="password" class="form-control form-control-lg " placeholder="Senha" name="password" required autocomplete="new-password">

                    </div>

        

        <div class="mb-4">

            <div class="form-check">

                <label class="form-check-label text-muted">

                    <input type="checkbox" class="form-check-input">

                    I agree to all Terms & Conditions

                </label>

            </div>

        </div>



        <div class="mt-3">
<input  type="submit" "class="btn btn-block btn-primary btn-lg font-weight-medium auth-form-btn" value="Cadastrar">


            <input  type="hidden" name="acao" value="registrar"class="btn btn-block btn-primary btn-lg font-weight-medium auth-form-btn" >

        </div>

        

        <div class="text-center mt-4 font-weight-light">

            Já tem uma conta? <a href="index.php" class="text-primary">Acessar</a>

        </div>

    </form>

                            </div>

                        </div>

                    </div>

                </div>

            </div>

        </div>

    </div>

    <script src="/painel/admin-assets/vendors/js/vendor.bundle.base.js"></script>

    <script src="/painel/admin-assets/vendors/chart.js/Chart.min.js"></script>

    <script src="/painel/admin-assets/js/off-canvas.js"></script>

    <script src="/painel/admin-assets/js/hoverable-collapse.js"></script>

    <script src="/painel/admin-assets/js/template.js"></script>

    <script src="/painel/admin-assets/js/settings.js"></script>

    <script src="/painel/admin-assets/js/todolist.js"></script>

    <script src="/painel/admin-assets/js/dashboard.js"></script>

    <script src="/painel/admin-assets/js/todolist.js"></script>

</body>



</html>

