1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<?php
function erreur($msg) {
echo "<response>";
echo " <error>$msg</error>";
echo "</response>";
exit();
}
?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.6/themes/cupertino/jquery-ui.css" rel="Stylesheet" />
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.8/jquery-ui.min.js"></script>
<script type="text/javascript">
$(function(){
$(document).bind("contextmenu",function(e){ return false; });
$( "#dialogmessage" ).dialog({
autoOpen: false,
closeOnEscape: false,
resizable: false,
draggable: false,
show: 'puff',
modal: true,
open: function(event, ui) {
//cache le bouton "close".
$(this).parent().children().children('.ui-dialog-titlebar-close').hide();
},
buttons: {
Ok: function() { $( this ).dialog( "close" ); }
}
});
$( "submit", "#formulaire" ).button();
$( "#formulaire" ).submit( function (e) {
e.preventDefault(); // on empeche l'envoi du formulaire par le navigateur
var datas = $(this).serialize();
$.ajax({
type: "GET",
url: "verif_figure.php",
data: datas,
success: function(retour){
// il y a un problème, j'affiche le message d'erreur retourné.
if($(retour).find("error").length > 0){
var msg =$(retour).find("error").text();
$("#dialogmessage").find("p").html(msg);
$("#dialogmessage").dialog("open");
return;
}
// sinon pas de soucis
if($(retour).find("success").length > 0){
var msg =$(retour).find("success").text();
$("#dialogmessage").find("p").html(msg);
$("#dialogmessage").dialog("option","buttons",{ "Ok": function() { document.location='createur.php?fig=<?php echo $fichier; ?>' } });
$("#dialogmessage").dialog("open");
$( "#dialogmessage" ).dialog( "option", "stack", false );
return;
}
}
});
});
});
</script>
</head>
<body>
<div id="dialogmessage" title="Message">
<p></p>
</div>
<form id="formulaire" method="POST" action="">
<input type="submit" class="resoudre" value="RESOUDRE" style="height:70px;width:144px;"/>
</form>
</body>
</html> |
Partager