Your IP : 216.73.216.48
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Качване на снимка на ученик</title>
<link rel="shortcut icon" type="image/png" href="/sn/enter.png" />
<link rel="shortcut icon" type="image/png" href="https://enter.vlevski.eu/sn/enter.png" />
<script src="jquery.min.js"></script>
<script src="bootstrap.min.js"></script>
<script src="croppie.js"></script>
<link rel="stylesheet" href="bootstrap.min.css" />
<link rel="stylesheet" href="croppie.css" />
</head>
<body>
<div class="container">
<br />
<h3 align="center">Снимка за пропуск</h3>
<br />
<br />
<div class="panel panel-default">
<div class="panel-heading">Качете Вашата снимка<br />* по предложение на Десислава Маринова и Мария Данчева</div>
<div class="panel-body" align="center">
<label for="upload_image" style="cursor: pointer;">
<input type="file" name="upload_image" id="upload_image" style="display: none;" accept="image/*" />
<br />
<div id="uploaded_image"><img src="b.png" class="img-thumbnail" /></div>
</label>
</div>
</div>
</div>
<div id="uploadimageModal" class="modal" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">×</button>
<h4 class="modal-title">Качване и изрязване на снимка</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-8 text-center">
<div id="image_demo" style="width:350px; margin-top:30px"></div>
</div>
<div class="col-md-4" style="padding-top:30px;">
<br />
<br />
<br/>
<button class="btn btn-success crop_image">Изрежи и качи</button>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Затвори</button>
</div>
</div>
</div>
</div>
<script>
thename="super";
$(document).ready(function(){
$image_crop = $('#image_demo').croppie({
enableExif: true,
viewport: {
width:300,
height:400,
type:'square' // circle square
},
boundary:{
width:300,
height:400
}
});
$('#upload_image').on('change', function(){
var reader = new FileReader();
reader.onload = function (event) {
$image_crop.croppie('bind', {
url: event.target.result
}).then(function(){
console.log('jQuery bind complete');
});
}
reader.readAsDataURL(this.files[0]);
$('#uploadimageModal').modal('show');
});
$('.crop_image').click(function(event){
$image_crop.croppie('result', {
type: 'canvas',
size: 'viewport'
}).then(function(response){
$.ajax({
url:"upload.php",
type: "POST",
data:{"image": response, "imgname": thename},
success:function(data)
{
$('#uploadimageModal').modal('hide');
$('#uploaded_image').html(data);
}
});
})
});
});
</script>
</body>
</html>