<!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>
<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>
No comments:
Post a Comment