antifaz
83f0c79564
In the JS Gui, the workflow stops at the Save Button, but data area rightly managed.
108 lines
3.5 KiB
HTML
108 lines
3.5 KiB
HTML
<!DOCTYPE html>
|
|
|
|
<html>
|
|
<head>
|
|
|
|
<title> TechREC </title>
|
|
|
|
<link rel="stylesheet" type="text/css" href="css/style.css">
|
|
|
|
<script src="js/jquery-1.9.1.min.js"></script>
|
|
<script type="text/javascript" src="js/reclibrary.js"></script>
|
|
|
|
<script>
|
|
/*
|
|
TODO:
|
|
prendere lo stato !!!
|
|
*/
|
|
$(document).ready(function(){
|
|
|
|
$("#searchform").submit(
|
|
function (event) {
|
|
event.preventDefault();
|
|
dataString = $(this).serialize();
|
|
var request = RecAjax("search", dataString);
|
|
|
|
$("#searchresult").html(" ");
|
|
request.done( function(data) {
|
|
|
|
$.each(data, function(key, val) {
|
|
console.log("Extract " + key );
|
|
|
|
var divstring = "<div class=\"searchresult\" id=\""+ rs_trxarea(key) +"\"> </div>";
|
|
|
|
$("#searchresult").append( divstring );
|
|
// var str = newformstr( key ); // new form
|
|
|
|
var str = "";
|
|
str += "<div class=\"namevalues\">"+val.name+" - <a href=\"\">Scarica</a> <a href=\"\" id=\"delete-"+val.id+"\">Cancella</a></div>";
|
|
str += "<div class=\"namevalues\">RECID: "+val.recid+" ID: "+ val.id + " Active " + val.active + "</div>";
|
|
str += "<div class=\"timevalues\">["+val.starttime+" >>> "+val.endtime+"]</div>"
|
|
|
|
$("#"+rs_trxarea(key)).html(str);
|
|
$("#delete-"+val.id).click(function(evt) {
|
|
evt.preventDefault();
|
|
console.log("Delete request for ID "+ val.id);
|
|
var dataString = "id="+val.id
|
|
var req_del = RecAjax("delete", dataString);
|
|
|
|
req_del.done (function(data) {
|
|
$.each(data, function(del_key, del_val) {
|
|
console.log("K:V " + del_key +":"+del_val );
|
|
|
|
if (del_key == "message") {
|
|
$("#"+rs_trxarea(key)).fadeOut( 500, function() { $(this).remove(); });
|
|
console.log("delete area "+rs_trxarea(key));
|
|
|
|
}
|
|
|
|
if (del_key == "error") {
|
|
alert("Impossibile cancellare elemento");
|
|
}
|
|
|
|
});
|
|
});
|
|
}
|
|
); // End of delete link handler
|
|
|
|
});
|
|
});
|
|
});
|
|
$("#searchform").submit();
|
|
});
|
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<div id="pagecontainer">
|
|
|
|
<h1> techr*c </h1>
|
|
|
|
<h2> <a href="index.html"> Nuova registrazione</a> </h2>
|
|
|
|
<div id="buttonscontainer">
|
|
<form action="#" method="POST" id="searchform">
|
|
<input type="text" id="recid" name="recid" placeholder="Codice Registrazione" /> <br />
|
|
<input type="text" id="name" name="name" placeholder="name" /> <br />
|
|
<input type="text" id="starttime" name="starttime" placeholder="Start: 2012/11/24 22:37:361" />(timepicker http://puna.net.nz/timepicker.htm#) <br />
|
|
<input type="text" id="endtime" name="endtime" placeholder="End: 2012/11/24 22:37:36" /> <br />
|
|
<input type="submit" value="Cerca" />
|
|
</form>
|
|
</div>
|
|
|
|
<div id="searchresult">
|
|
|
|
</div>
|
|
|
|
|
|
</div>
|
|
|
|
<div id="footer">
|
|
techbl*c
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|