<!DOCTYPE html>
<html>
<head>
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$.support.cors = true;
/* navigator.globalization.dateToString(
new Date(),
function (date) { alert('date: ' + date.value + '\n'); },
function () { alert('Error getting dateString\n'); },
{ formatLength: 'short', selector: 'date and time' }
);*/
var s_uid = localStorage.getItem('s_uid');
$.ajax({
type: 'POST',
url: 'http://10.11.18.88:8080/punebook/Mseb ',
data:"{'s_uid':" + s_uid + "}",
success: function(data){
var arr = JSON.parse(data);
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();/* Returns the month (from 0-11) */
var curr_month_plus= curr_month+1; /* because if the month is 4 it will show output 3 so we have to add +1 with month*/
var curr_year = d.getFullYear();
function dstrToUTC(ds) {
var dsarr = ds.split("-");
var mm = parseInt(dsarr[1],10);
var dd = parseInt(dsarr[2],10);
var yy = parseInt(dsarr[0],10);
return Date.UTC(yy,mm-1,dd,0,0,0); }
function datediff(ds1,ds2) {
var d1 = dstrToUTC(ds1);
var d2 = dstrToUTC(ds2);
var oneday = 86400000;
return (d2-d1) / oneday; }
var a =curr_year+ '-' + curr_month_plus + '-' + curr_date;
var b;
b = arr.DueDate;
// document.write(+datediff(a,b)+" day(s)<br>");
$("#billdue").html("<p>You bill is due in " + datediff(a,b)+" days."+" <br>Due Date: " +arr.DueDate+ ". Please pay up!</p><p><h5><a href='https://wss.mahadiscom.in/wss/wss?uiActionName=getViewPayBill' target='_blank'>Pay now</a></h5></p>");
},
error: function(err){
$("#billdue").html("Failed to retreive your bill information");
alert("error");
}
});
$("#flip").click(function(){
$("#panel").slideToggle("slow");
});
});
</script>
<style>
</style>
</head>
<body>
<div id="flip">PuneBook</div>
<div id="panel">
<ul>
<a href="police.html"><li>Police</li></a><hr>
<a href="msedcl.html"><li>MSEDCL</li></a><hr>
<a href="pmpml.html"><li>PMPML</li></a><hr>
<a href="complaint.html"><li>Complaint Box</li></a><hr>
<a href="newsfeed.html"><li>Home</li></a>
</ul>
</div>
</div>
<div class="content">
<div class="card" id="billdue">
</div>
</div>
</body>
</html>
<html>
<head>
<meta name="format-detection" content="telephone=no">
<meta name="msapplication-tap-highlight" content="no">
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width">
<link rel="stylesheet" type="text/css" href="css/index.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script>
$(document).ready(function(){
$.support.cors = true;
/* navigator.globalization.dateToString(
new Date(),
function (date) { alert('date: ' + date.value + '\n'); },
function () { alert('Error getting dateString\n'); },
{ formatLength: 'short', selector: 'date and time' }
);*/
var s_uid = localStorage.getItem('s_uid');
$.ajax({
type: 'POST',
url: 'http://10.11.18.88:8080/punebook/Mseb ',
data:"{'s_uid':" + s_uid + "}",
success: function(data){
var arr = JSON.parse(data);
var d = new Date();
var curr_date = d.getDate();
var curr_month = d.getMonth();/* Returns the month (from 0-11) */
var curr_month_plus= curr_month+1; /* because if the month is 4 it will show output 3 so we have to add +1 with month*/
var curr_year = d.getFullYear();
function dstrToUTC(ds) {
var dsarr = ds.split("-");
var mm = parseInt(dsarr[1],10);
var dd = parseInt(dsarr[2],10);
var yy = parseInt(dsarr[0],10);
return Date.UTC(yy,mm-1,dd,0,0,0); }
function datediff(ds1,ds2) {
var d1 = dstrToUTC(ds1);
var d2 = dstrToUTC(ds2);
var oneday = 86400000;
return (d2-d1) / oneday; }
var a =curr_year+ '-' + curr_month_plus + '-' + curr_date;
var b;
b = arr.DueDate;
// document.write(+datediff(a,b)+" day(s)<br>");
$("#billdue").html("<p>You bill is due in " + datediff(a,b)+" days."+" <br>Due Date: " +arr.DueDate+ ". Please pay up!</p><p><h5><a href='https://wss.mahadiscom.in/wss/wss?uiActionName=getViewPayBill' target='_blank'>Pay now</a></h5></p>");
},
error: function(err){
$("#billdue").html("Failed to retreive your bill information");
alert("error");
}
});
$("#flip").click(function(){
$("#panel").slideToggle("slow");
});
});
</script>
<style>
</style>
</head>
<body>
<div id="flip">PuneBook</div>
<div id="panel">
<ul>
<a href="police.html"><li>Police</li></a><hr>
<a href="msedcl.html"><li>MSEDCL</li></a><hr>
<a href="pmpml.html"><li>PMPML</li></a><hr>
<a href="complaint.html"><li>Complaint Box</li></a><hr>
<a href="newsfeed.html"><li>Home</li></a>
</ul>
</div>
</div>
<div class="content">
<div class="card" id="billdue">
</div>
</div>
</body>
</html>
No comments:
Post a Comment