Friday, 9 October 2015

DB


Java

logo


Camera

<!DOCTYPE html>
<html>
  <head>
    <title>Capture Photo</title>

    <script type="text/javascript" charset="utf-8" src="cordova.js"></script>
    <script type="text/javascript" charset="utf-8">

    var pictureSource;   // picture source
    var destinationType; // sets the format of returned value

    // Wait for device API libraries to load
    //
    document.addEventListener("deviceready",onDeviceReady,false);

    // device APIs are available
    //
    function onDeviceReady() {
        pictureSource=navigator.camera.PictureSourceType;
        destinationType=navigator.camera.DestinationType;
    }

    // Called when a photo is successfully retrieved
    //
    function onPhotoDataSuccess(imageData) {
      // Uncomment to view the base64-encoded image data
      //console.log(imageData);

      // Get image handle
      //
      var smallImage = document.getElementById('smallImage');

      // Unhide image elements
      //
      smallImage.style.display = 'block';

      // Show the captured photo
      // The inline CSS rules are used to resize the image
      //
      smallImage.src = "data:image/jpeg;base64," + imageData;
    }

    // Called when a photo is successfully retrieved
    //
    function onPhotoURISuccess(imageURI) {
      // Uncomment to view the image file URI
      // console.log(imageURI);

      // Get image handle
      //
      var largeImage = document.getElementById('largeImage');

      // Unhide image elements
      //
      largeImage.style.display = 'block';

      // Show the captured photo
      // The inline CSS rules are used to resize the image
      //
      largeImage.src = imageURI;
    }

    // A button will call this function
    //
    function capturePhoto() {
      // Take picture using device camera and retrieve image as base64-encoded string
      navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 50,
        destinationType: destinationType.DATA_URL });
    }

    // A button will call this function
    //
    function capturePhotoEdit() {
      // Take picture using device camera, allow edit, and retrieve image as base64-encoded string
      navigator.camera.getPicture(onPhotoDataSuccess, onFail, { quality: 20, allowEdit: true,
        destinationType: destinationType.DATA_URL });
    }

    // A button will call this function
    //
    function getPhoto(source) {
      // Retrieve image file location from specified source
      navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 50,
        destinationType: destinationType.FILE_URI,
        sourceType: source });
    }

    // Called if something bad happens.
    //
    function onFail(message) {
      alert('Failed because: ' + message);
    }

    </script>
  </head>
  <body>
    <button onclick="capturePhoto();">Capture Photo</button> <br>
    <button onclick="capturePhotoEdit();">Capture Editable Photo</button> <br>
    <button onclick="getPhoto(pictureSource.PHOTOLIBRARY);">From Photo Library</button><br>
    <button onclick="getPhoto(pictureSource.SAVEDPHOTOALBUM);">From Photo Album</button><br>
    <img style="display:none;width:60px;height:60px;" id="smallImage" src="" />
    <img style="display:none;" id="largeImage" src="" />
  </body>
</html>

Complaint

<!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(){
    $("#flip").click(function(){
        $("#panel").slideToggle("slow");
    });
});
</script>

<script>
$(document).ready(function(){
    $("#flip2").click(function(){
        $("#panel2").slideToggle("slow");
    });
});
</script>


<style>

</style>

<!--<script type="text/javascript" charset="utf-8" src="cordova.js"></script>-->
<script type="text/javascript" charset="utf-8">
   /* var pictureSource=navigator.camera.PictureSourceType;
    var destinationType=navigator.camera.DestinationType;   */
   



        //Function to capture Photo from Phone camera and store it to Phone SavedPhotoAlbum
        function capturePhoto() {
        navigator.camera.getPicture(uploadPhoto, onFail, { quality: 75, saveToPhotoAlbum: true, allowEdit: false,
            destinationType: Camera.DestinationType.FILE_URI });
        }

        function onSuccess(imageURI) {
            var image = document.getElementById('myImage');
            image.src = imageURI;
        }

        function onFail(message) {
            alert('Failed because: ' + message);
        }

   
        //Function to get photo from Phone SavedPhotoAlbum
       /* function getPhoto() {
         
          navigator.camera.getPicture(onPhotoURISuccess, onFail, { quality: 75,
            destinationType: destinationType.FILE_URI,
            sourceType: destinationType.SAVEDPHOTOALBUM });
        }

        // Called when a photo is successfully retrieved
        //
        function onPhotoURISuccess(imageURI) {
          // Uncomment to view the image file URI
           console.log(imageURI);
           console.log("Image taken.");

          // Get image handle
          //
          var largeImage = document.getElementById('largeImage');

          // Unhide image elements
          //
          largeImage.style.display = 'block';

          // Show the captured photo
          // The inline CSS rules are used to resize the image
          //
          largeImage.src = imageURI;
        }
    */


        //Function to upload image to remote server
        function uploadPhoto(imageURI) {
            var options = new FileUploadOptions();
            options.fileKey="image";
            options.fileName=imageURI.substr(imageURI.lastIndexOf('/')+1);
            options.mimeType="image/jpeg";

            var params = new Object();
            params.value1 = "test";
            params.value2 = "param";

            options.params = params;
            options.chunkedMode = false;

            var ft = new FileTransfer();
            ft.upload(imageURI,  encodeURI("http://192.168.102.84:8080/punebook/Images/"), win, fail, options);
        }

        function win(r) {
            console.log("Code = " + r.responseCode);
            console.log("Response = " + r.response);
            console.log("Sent = " + r.bytesSent);
            alert(r.response);
        }

        function fail(error) {
            alert("An error has occurred: Code = " = error.code);
        }



























    </script>


</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 id="flip2">Your complaint</div>
<div id="panel2">


    <div class="card">
               
                <p>Please fill out the details regarding your complaint</p>
                <center><input type="text" id="subject"  placeholder="Subject" style="width:275px;"></center><br><br>
                <center><input type="text" id="content" placeholder="Complaint" style="height:200px;width:275px;"/></center><br><br>
                <center><input type="button"   name="image" onclick=capturePhoto() value="Take a Snap"/></center><br><br>
                <center><input type="submit" id="submit" placeholder="Submit"></center><br><br>


    </div>

</div>          
         
             <div class="content">
            <div class="card">
                <h1>Complaint Satus!</h1>
                <p><span style="color:#8bc34a">Resolved!</span> Nagar road near Hyatt Hotel fixed 2 days ago.</p>
            </div></div>

 

</body>
</html>

Latlang

<!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>

MSEDCL

<!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>