<?php
include("head.php");
?>
<body>
<?php
$link = 'https://www.sgu.ru/schedule/'.$_GET["name"];
$text = file_get_contents($link);
preg_match ("#<table[^>]*>.*</table[^>]*>#isU", $text, $regs);
//echo $regs[0];
?>
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript" src="js/html2canvas.js"></script>
<script type="text/javascript" src="js/jquery.plugin.html2canvas.js"></script>
<table>
<tr>
</tr>
<tr>
<td>
<div id="target">
<?php
echo $regs[0];
$fname = str_replace("/","",$_GET["name"]);
?>
</div>
</td>
</tr>
</table>
<br />
<div id="previewImage" style="display: none;">
<script>
$(document).ready(function () {
var element = $("#target"); // global variable
var getCanvas; // global variable
html2canvas(element, {
onrendered: function (canvas) {
// $("#previewImage").append(canvas);
getCanvas = canvas;
var imgageData = getCanvas.toDataURL("image/png");
var fname = '<?php echo $fname;?>';
$.post('/priem.php',{imgBase64: imgageData, imgName: fname});
var newData = imgageData.replace(/^data:image\/png/, "data:application/octet-stream");
$("#btn-Convert-Html2Image").attr("src", newData);
}
});
$("#btn-Convert-Html2Image").on('click', function () {
});
});
</script>
<style type="text/css">
#target {
border: 1px solid #CCC;
padding: 5px;
margin: 5px;
}
h2, h3 {
color: #003d5d;
}
p {
color:#AA00BB;
}
#more {
font-family: Verdana;
color: purple;
background-color: #d8da3d;
}
</style>
</body>
</html>