tupali/librerias/modal.php

52 lines
1.9 KiB
PHP
Raw Permalink Normal View History

2017-11-03 19:22:40 +00:00
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="stylesheet" href="firma/signature-pad.css">
<link rel="stylesheet" href="bootstrap/css/bootstrap.min.css?'.time().'" >
<script src="jquery/jquery-2.1.4.min.js" ></script>
<script src="bootstrap/js/bootstrap.min.js" ></script>
</head>
<body >
<div id='signature-pad' class='m-signature-pad'>
<div class='m-signature-pad--body'>
<canvas onmouseout=" if (signaturePad.isEmpty()) { alert('Por favor firme primero.'); } else { saveViaAJAX(); }" id='canvas_firma' ></canvas>
</div>
<div class='m-signature-pad--footer'>
<div class='description'>Firme arriba</div>
<div class='left'>
<button type='button' id='clear' class='button clear btn-warning' data-action="clear" onclick="document.getElementById('<?php echo $_REQUEST[campo]?>[<?php echo $_REQUEST[item]?>]').value=''; ">Limpiar</button>
</div>
<div class='right'>
<button type='button' class='button save btn-success' data-action='save-data'>Confirmar firma</button>
</div>
</div>
</div>
<script type="text/javascript">
function saveViaAJAX()
{
var testCanvas = document.getElementById('canvas_firma');
var canvasData = testCanvas.toDataURL('image/svg+xml');
var postData = 'canvasData='+canvasData;
//mapa = window.parent.document.getElementById('<?php echo $_REQUEST[id]?>');
var debugConsole= window.parent.document.getElementById('<?php echo $_REQUEST[campo]?>[<?php echo $_REQUEST[item]?>]' );
debugConsole.value=canvasData;
}
</script>
<script src="firma/signature_pad.js"></script>
<script src="firma/app.js"></script>
</body>
</html>