Friday, June 9, 2017

6.2) Updates to 3.1, 3.2 and 3.3

Hello all !

My app
My app is powered by hasura

                                                 SIGN-UP PAGE  CODE 07-07-2017
=========================================================================
<!DOCTYPE html>
<html lang="en">
<head>

<title>State of the Art</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.4/angular.min.js"></script>
<link href="/main.css" rel="stylesheet" />
<!--<link rel="icon" href="/logo.gif">-->
</head>

<body class=scroll>
<nav class="navbar navbar-default container">
  <div class="container-fluid">
    <div class="navbar-header">
      <a class="navbar-brand" href="#">State-of-the-Art</a>
    </div>
    <ul class="nav navbar-nav">
      <li class="active"><a href="/">Home</a></li>
      <li><a href="/subjects.html">QUESTIONS</a></li>
     <li><a href="/">SIGNIN/SIGNUP</a></li>
     <!--<li><a href="/logout.html">SIGNOUT</a></li>-->
     <li ><a id=date href="#"></a></li>
      <li ><a href="https://hasura.io/" target=_blank>powered by : Hasura</a></li>
    </ul>
  </div>
</nav>

<div class="jumbotron text-center container">
 
    <div id=header>
    <h2>Sign Up </h2>
    </div>
   
    <div id=content>
    <pre id = pre class=bold>
<label for="username"></label>
<input class="form-control" type=text id=username placeholder="*Choose a username">
<label for="password"></label>
<input class="form-control" type=password id=password placeholder="*Password:minimum 8 chars">
<label for="email"></label>
<input class="form-control"  id=email placeholder="Enter a valid e-mail">
<label for="mobile"></label>
<input class="form-control"  id=mobile placeholder="Enter your 10 digit mobile number">
 <br>
 Fields marked as * are compulsory

<span id=error_msg></span>
<input type=button value="Sign up" class="btn btn-success" id=signup_btn>
    </pre>
    </div>
 
    <div id=footer>
    <span class=white>Site Owner & developer: Ashutosh Singh, U.P., India<br>
    Contact information:</span> <a href="mailto:webwithjs@gmail.com" class=hyperlinks>Send me a letter</a>
    </div>
<script>

    var signup_btn = document.getElementById("signup_btn");
   
    signup_btn.onclick= function(){
   var request= new XMLHttpRequest();
   
    request.onreadystatechange= function(){
   
      if(request.readyState===XMLHttpRequest.DONE){
        
         if(request.status===200)
          { 
                document.getElementById("pre").innerHTML= "<h3>"+" Welcome  "+"<span style=color:blue>" + username + "</span>" + "  sign-up success ! sign in using your credentials... " + "</h3>";
                setTimeout(NavigateToHome, 3000);
            }  
          else
          {
            document.getElementById("error_msg").innerHTML= "<span style=color:red>"+"Error : "+"</span>"+JSON.parse(this.responseText).message+"<br>";
            document.getElementById("signup_btn").value= "Sign up";
          }
     }               
   
}     
    var username1= document.getElementById("username").value;
    var username=username1.trim();
    var password= document.getElementById("password").value;
    var email= document.getElementById("email").value;
    var mobile= document.getElementById("mobile").value;
    var signup=document.getElementById("signup_btn");
    request.open('POST', " https://auth.veejay84.hasura-app.io/signup", true);
    request.setRequestHeader('Content-type','application/json');
    request.send(JSON.stringify({username:username,password:password,email:email,mobile:mobile}));
    signup_btn.value="Signing-up...";
   


}; 
       

       
</script>
<script>
var d =new Date();
    var date_time= d.toDateString();
    document.getElementById("date").innerHTML=date_time;
   
function NavigateToHome() {
           location.href = "/";
       }
</script>

    <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
      <script src = "https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
     
      <!-- Include all compiled plugins (below), or include individual files as needed -->
      <script src = "//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>
      <!--script src=/main.js></script>-->
</body>

No comments:

Post a Comment

How can I run a C++ program directly from Windows?

How-can-I-run-a-C-program-directly-from-Windows