Skip to content

Instantly share code, notes, and snippets.

@noiano
Created October 18, 2023 08:18
Show Gist options
  • Save noiano/eef8e53c21c6561dd20d425e8c998b12 to your computer and use it in GitHub Desktop.
Save noiano/eef8e53c21c6561dd20d425e8c998b12 to your computer and use it in GitHub Desktop.
mytonic
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="img/favicon.ico">
<title>MyTonic</title>
<!-- Bootstrap core CSS -->
<link href="dist/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="dist/offcanvas.css" rel="stylesheet">
<!-- Just for debugging purposes. Don't actually copy this line! -->
<!--[if lt IE 9]><script src="../docs-assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
<script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
</head>
<script src="https://code.jquery.com/jquery-1.10.1.min.js"></script>
<script>
jQuery(function($) {
$(document).ready(function () {
$("#login").submit(function() {
if($( "#user" ).val() == "" || $( "#pass" ).val() == ""){
$( "#warn_message" ).fadeIn();
$( "#warn_message" ).html("<b>I campi nome utente e password non possono essere vuoti!</b>");
return false;
}
if($.trim($( "#user" ).val()).length < 5 || $.trim($( "#pass" ).val()).length < 5){
$( "#warn_message" ).fadeIn();
$( "#warn_message" ).html("<b>I campi devono essere minimo 5 caratteri!</b>");
return false;
}
$("#submit").attr("disabled", true);
$("#loading").show();
login($( "#user" ).val(), $( "#pass" ).val());
return false;
});
$("input").click(function(){
$( "#warn_message" ).fadeOut();
$( "#err_message" ).fadeOut();
});
});
function login(user, pass)
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
var url = "login.php";
var params = "user="+user+"&pass="+pass;
xmlhttp.open("POST", url, true);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var response = xmlhttp.responseText;
//alert (response);
jQuery(function($) {
if(response == "ok"){
//window.location.href="home.php";
window.location.href="nhome.php";
}else
if(response == "repass"){
window.location.href="repass.php";
}else
if(response == "home"){
//window.location.href="home.php";
window.location.href="nhome.php";
}else{
$( "#err_message" ).fadeIn();
$( "#err_message" ).html("<b>"+response+"!</b>");
//$( "#err_message" ).html(response);
$("#submit").attr("disabled", false);
$("#loading").hide();
}
});
}
}
//Send the proper header information along with the request
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(params);
}
});
</script>
<body>
<link href="css/style.css" rel="stylesheet">
<link id="page_favicon" href="img/favicon.ico" rel="icon" type="image/x-icon" />
<script>
function openPdf(){
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
var url = "utils/build_pdf.php";
var params = "";
xmlhttp.open("POST", url, true);
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
var response = xmlhttp.responseText;
jQuery(function($) {
$('#pdfmodal').html(response);
});
}
}
//Send the proper header information along with the request
xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp.setRequestHeader("Content-length", params.length);
xmlhttp.setRequestHeader("Connection", "close");
xmlhttp.send(params);
}
</script>
<div class="navbar navbar-fixed-top navbar-inverse" role="navigation">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<img src="img/LOGO-MY-TONIC-web.png" id="logo" class="img-responsive" alt="Responsive image"/>
<a class="navbar-brand" style="float: left" href="#">MyTonic</a><!--href="index.php"-->
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav">
<li><button type="button" class="btn btn-lg navbaricons" data-toggle="modal" data-target="#ModalInfo"><img id="infoIcon" src="img/info.png" class="navbariconsimg" />Informazioni</button></li>
</ul>
</div><!-- /.nav-collapse -->
</div><!-- /.container -->
</div><!-- /.navbar -->
<!-- Modal Scarica Documenti-->
<div class="modal fade" id="ModalInfo" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h4 class="modal-title" id="myModalLabel">MyTonic</h4>
</div>
<div class="modal-body">
<h1>MyTonic</h1>
<img id="logobig" src="img/logo_big.png" style="float:left;margin-top:20px" />
<div style="float:left;margin:10px">
<h3>Telefono: <a href="tel:199 319 600">199 319 600</a></h3>
<h3>Sito Web: <a href="http://www.tonicnet.it">http://www.tonicnet.it</a></h3>
<h3>E-mail : <a href="mailto:mytonic@tonicnet.it">mytonic@tonicnet.it</a></h3>
</div>
<div class="clearfix"></div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-primary" data-dismiss="modal">Chiudi</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<div class="container">
<div class="container">
<div class="row row-offcanvas row-offcanvas-right">
<div class="col-xs-12 col-sm-12">
<div class="jumbotron" style="background-color:#fac196; text-align:center;">
<h1>MyTonic Test</h1>
<h2>Login</h2>
<form name="login" id="login"> <!--action="index.php"-->
<div class="input-group" style="position:relative; left:50%; margin-left:-94px; width:188px">
<input type="text" class="form-control" placeholder="Username" name="user" id="user">
</div>
<div class="input-group" style="position:relative; left:50%; margin-left:-94px; width:188px">
<input type="password" class="form-control" placeholder="Password" name="pass" id="pass">
</div>
<button type="submit" data-loading-text="Caricamento..." class="btn btn-primary" id="submit">
Accedi
</button></br>
<div style="font-size:14px;">* Se è la prima volta che accedi usa le credenziali fornite da Tonic</div>
</br>
<img src="img/loading.gif" class="img-responsive" alt="Responsive image" id="loading" style="margin-top:15px;display: none;position: relative;left:50%;margin-left: -16px">
<div class="alert alert-danger" id="err_message" style="margin-top:15px">
Effettua il login prima di andare avanti! </div>
<div class="alert alert-warning" id="warn_message" style="display:none; margin-top:15px"></div>
</form>
<span style="font-size:18px;">Hai dimenticato la password? </span> <button onclick="location.href='recuperopsw.php';" style="color:#F58139;" class="btn btn-default" >Recupera</button>
</div>
</div><!--/span-->
</div><!--/row-->
<hr>
<footer>
<p>&copy; Fitnet srl - P.IVA 07249610960</p>
</footer>
</div><!--/.container-->
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="https://code.jquery.com/jquery-1.10.2.min.js"></script>
<script src="dist/js/bootstrap.min.js"></script>
<script src="dist/offcanvas.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment